4

How to run commands on a remote machine using ssh(no interactive shell)

view full story
linux-howto

http://linuxers.org – TweetWe all use ssh to access machines remotely, but not many know that instead of using a shell we can use ssh to simply run a command on the remote system. Just add the command, you want to be executed, after the user@host part and instead of throwing an interactive shell, ssh will run the command on the remote machine and show you the output(if any). Here is a simple illustration: [shredder12]$ ssh [email protected] lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 10.04 LTS Release: 10.04 Codename: lucid If you want to run multiple commands, separate t (General)