Server1 and Server2 in the same virtual network, Server1 hostname connection Server1 is used in Server2, and no password authentication is required.
Server1, hostname:hlmvmeast652 Internal ip:192.168.0.5
Server2, hostname:hlmvmeast653 Internal ip:192.168.0.6
1. Generate a key pair in Server1
2. Create the/ROOT/.SSH in Server2
3. Copy the public key id_rsa.pub from the Server1 to Server2,server2 place the file under/root/.ssh and rename it to Authorized_keys.
Operation Command Scp/root/.ssh/id_rsa.pub 192.168.0.6:/root/.ssh/authorized_keys
4. Server1 connection Server2, found also need password
5. Set SELinux in Server2 to permissive status
6. Connect the Server2 again in the Server1 and find that it can be successfully connected without a password
7. You can also connect using host name
Implementing key logins between Linux virtual machines