Find the answer to your Linux question:
Results 1 to 5 of 5
i'm looking for the best way to run commands on a remote machine. what i want to do is run some command locally that will send another command to a ...
  1. #1
    Just Joined! kramerP's Avatar
    Join Date
    Dec 2005
    Posts
    19

    remote machine command execution

    i'm looking for the best way to run commands on a remote machine. what i want to do is run some command locally that will send another command to a remote computer and then once that command runs on the remote machine the output will be displayed on the local machine in standard output. i was trying to use netcat, but didn't seem to working quite right.

    is there a better utility to use or maybe if netcat is good i just need some help with using it.

  2. #2
    Just Joined! DusteD's Avatar
    Join Date
    May 2006
    Location
    Denmark
    Posts
    35

    how bout

    If what you want is to use programs/files on the remote machine
    and simply want to be able to run commands on it, you should be fine with ssh.

    If you want to execute a process on your local machine, and then use the processing
    power of the remote machine, you should look at openmosix.

  3. #3
    Just Joined! kramerP's Avatar
    Join Date
    Dec 2005
    Posts
    19
    yeah i know i can use ssh to connect and then run commands i was just trying to see if there was a way i could send the commands without making an active connection (or a tcp connection that would remain active only until the commands were run and output returned). what i was trying on with netcat was something like this....

    Code:
    nc -l -p port_to_listen_on -c command_to_run -n ip_address port
    but truthfully i'm not a netcat guru so this could be all wrong....

  4. #4
    Linux Enthusiast
    Join Date
    Aug 2005
    Location
    Hell
    Posts
    514
    Why can't you do this with SSH?
    Code:
    ssh user@host "command_to_run"

  5. #5
    Just Joined! kramerP's Avatar
    Join Date
    Dec 2005
    Posts
    19
    did not even realize you could pass a command through ssh like that, but that works..... i guess i was just making it harder than it needed to be..... anyways, thanks for your help

Posting Permissions

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