How to control remote hosts and execute commands remotely through ssh
Source: Internet
Author: User
It is very simple and practical to teach you how to control the remote host through ssh and how to remotely execute commands on the remote host through ssh. Step 1: Set ssh authentication-free. authentication-free means that you can directly log on without password authentication, which is particularly useful when writing script server control. Every two steps teach you how to control the remote host through ssh, and how to remotely execute commands through ssh to control remote host remote command execution in two steps, which is very simple and practical. Step 1: Set ssh authentication-free. authentication-free means that you can directly log on without password authentication, which is particularly useful when writing script server control. Every two steps is to execute commands on the remote server. suppose there are two servers, one is SA and the other is SB. Now I want to control SB on SA. Format: ssh SB _ username @ SB_IP "command" for example: ssh tuxedo@172.16.18.54 "echo aaa> hzs_test.txt" ssh tuxedo@172.16.18.54 'echo-e "haha \ n hoho"> hzs_test.txt'
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service