Results 1 to 5 of 5
I want to run a file in a remote machine using SSH, without transferring the file to the remote machine.This file contains parameters to get input during execution in remote ...
- 01-28-2012 #1Just Joined!
- Join Date
- Jan 2012
- Posts
- 5
SSH remote file execution
I want to run a file in a remote machine using SSH, without transferring the file to the remote machine.This file contains parameters to get input during execution in remote machine.
- 01-28-2012 #2Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Can you be more specific? I'm inclined to say "That's impossible", but maybe I just don't understand what you're trying to do.
- 01-28-2012 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
This MAY be possible by filtering/piping the contents of the file into the ssh command, as in:
In any case, this is just a SWAG, since I haven't tried it myself...Code:ssh [usual login stuff] <local-file-name
IE, it may not work at all. Do some experimenting to see. What's the worst thing that can happen? If you aren't logging in as root to the remote system, the worst is to nuke your own files there. Lesson? Backup early. Backup often. On both systems!
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 02-02-2012 #4Just Joined!
- Join Date
- Feb 2011
- Posts
- 19
Best way will be to upload your public ssh key to the remote machine. On the remote host, create a script that does whatever you want it to.
On your machine, create a cron job that automatically ssh's into the remote host, and executes the script
- 02-06-2012 #5
I once had a similar problem and ended up setting up all my machines so they could automount a scripts dir. Then its just a matter of triggering the script through ssh.
If I was to do something like this again I might have a look at puppet.


Reply With Quote