Linuxers posted a tutorial about running commands on a remote machine using ssh
We 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).How to run commands on a remote machine using ssh(no interactive shell)