# Touch/root/. Ssh/authorized_keys (if this file already exists, skip this one)
# Cat/root/. Ssh/id_rsa.pub>/root/. Ssh/authorized_keys (append the id_rsa.pub content to authorized_keys)
Return to machine:
# SSH root@192.168.60.110 (password not required, login successful)
2. Control n machines for Automatic Logon As described above
Then we need n pairs of keys (key and public key). The Ssh-keygen command can change the name of the key pair at will, for example:
# Ssh-keygen-T RSA
Generating public/private RSA key pair.
Enter file in which to save the key (/root/. Ssh/id_rsa):/root/. Ssh/id_rsa_192.168.60.110
In this way, the private key and public key are named id_rsa_192.168.60.110 and id_rsa_192.168.60.110.pub respectively. Then, the content of the id_rsa_192.168.60.110.pub file is appended to the content of the sever ~ In the/. Ssh/authorized_keys file, specify the local key using the-I parameter of the local SSH command, and log on:
For example, if my machine is a, the intermediate server is B, and the target server is C <br>
From A to B, from B to C, but a cannot directly SSH to C <br>
Now we will use SSH channel technology to directly transfer files from A to C <br>
1. Ssh-l1234: C: 22 userid @ B <br>
Input B's password <br>
(Port 1234 is the idle port of host a. This Command requires the root user permission on host a. In fact, a channel is established on port 1234 of the host.) <br>
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.