ssh user@host -i rsa_private_key 'bash -s arg01 arg02' < some_script.sh See also: https://stackoverflow.com/questions/305035/how-to-use-ssh-to-run-a-shell-script-on-a-remote-machine