Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just 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.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    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.

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,574
    This MAY be possible by filtering/piping the contents of the file into the ssh command, as in:
    Code:
    ssh [usual login stuff] <local-file-name
    In any case, this is just a SWAG, since I haven't tried it myself... 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!

  4. #4
    Just Joined!
    Join Date
    Feb 2011
    Posts
    21
    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

  5. #5
    Just Joined! nelop's Avatar
    Join Date
    Feb 2012
    Location
    Bakewell Derbyshire
    Posts
    8
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •