Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    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
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    This MAY be possible by filtering/piping the contents of the file into the ssh command, as in:
    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. $spacer_open
  5. #4
    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

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