Often to deploy multiple servers above the application, if a machine's login too cumbersome.
All just think about writing a script to deploy different servers
Prerequisites:
Configuring SSH Login Free
If not, please join me in another article http://blog.csdn.net/chenpy/article/details/30281515
(1) The command line executes the login and executes the command on the target server [Java] view plain copy ssh user@remotenode "cd/home;" LS "Basically can complete the commonly used for remote node management, a few attention points:
Double quotes that must be there. Without double quotes, the second LS command performs a semicolon locally, separated by a semicolon between two commands
(2) The way the script
This is officially the way I want to execute the batch command on the target server. [Java] view plain copy #!/bin/bash ssh root@192.168.0.23 << remotessh killall-9 java Cd/data/apa Che-tomcat-7.0.53/webapps/exit Remotessh
Remote execution of content between "<< remotessh" to "remotessh", the operation on the remote machine is located in it, attention to the point:<< remotessh,ssh until the end of the content of the REMOTESSH, Remotessh can be arbitrarily modified into other forms. Before ending, add exit to exit the remote node
If you do not want the log file to appear on this computer, you can modify the configuration
[HTML] view plain copy ssh root@192.168.0.23 >/dev/null 2>&1 << remotessh
OK, that's it.
Reference Document: Http://www.cnblogs.com/ilfmonday/p/ShellRemote.html