Bash Run a Local Script & Command on Remote Server using SSH


Use ssh to run a local bash script on a remote computer.

Use the following syntax:

ssh user@host sh < ssh user@host bash <

If using bash, include "#!/bin/bash" at the top of and be sure to call `bash' instead of `sh' or you may get commands not found.