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