From this tutorial you would learn how to execute a local script on remote server by ssh command.
- Linux/Mac OS
we write a script in current directory,which just prints the version info of the OS.
Execute it on remote server
The key command is ssh [email protected] ‘bash -s’ < ./a.sh
You can find detail documents about the linux and ssh here: