We are using Linux development process, often need to jump between different servers, through SSH, each need to enter the password, more cumbersome, today from the Internet to find the relevant methods, but the experimental process found that there are some problems, special will be some details of the following:
For example, I have the machine 192.168.1.100 and 192.168.1.200 two servers, I want to log in from 100 to 200 to use SSH not to enter the password, so I need to do the following steps
1, first in IP for the machine to execute the Ssh-keygen command, all the way to return, so that, in the current user directory under the. SSH folder generated two files Id_rsa and id_rsa.pub files
2. Transfer the ID_RSA.PUB to 200 machines using the SCP command, such as SCP id_rsa.pub root@192.168.1.200:/root/.ssh/100.put
If you have authorized_keys this file in the 200/root/.ssh/directory, add the 100.put file content to Authorized_keys directly using the Cat command
Commands are as follows: Cat 100.pub >> Authorized_keys
Note that you cannot make use of manual copies, or it will cause failure, only cat >> (which I have tried many times)
3, the right to modify the Authorized_keys 600, as follows: chmod Authorized_keys
Then delete 100.pub on it, done, hurriedly to 100 of the machine try SSH root@192.168.1.200, look directly into the bar, no longer enter the password.