Password-free SSH Logon
My virtual machine:
192.168.91.130 test1
192.168.91.131 test2
192.168.91.132 test3
1. First generate a key pair on test1
The. shh/file will be generated later, enter. shh/, and copy id_rsa.pub
Id_rsa is the private key and id_rsa.pub is the public key.
2. Put the Public Key authorized_keys (id_rsa.pub) in/root/. ssh/authorized_keys of test2 and test3.
3. At this time, the authorized_keys file will be available on test2 and test3. Note that (the directory. shh/needs to be created on test2 and test3 /)
In this case, you need to set the permissions to go to test2 and test3 respectively:
Chmod 700. shh/
Chmod 600. shh/authorized_keys
Note: After the permission settings are completed, Restart sshd.
/Etc/init. d/sshd restart
4. Now it's over. You can connect test2 and test3 through test1.
Note the following points:
1. Restart sshd after setting permissions.
2. enter a password for the first connection. Don't worry,
3. If the VM is reconnected without restarting, you may need to enter a password. In this case, restart the VM to reconnect.
You may also like the following SSH-related articles. For details, refer:
Complete SSH service configuration and troubleshooting in Ubuntu
How to install Samba and SSH server in Ubuntu 14.04
SSH service remote access to Linux Server login is slow
How to Improve the SSH login authentication speed of Ubuntu
Enable the SSH service to allow Android phones to remotely access Ubuntu 14.04
How to add dual authentication for SSH in Linux
Configure the SFTP environment for non-SSH users in Linux
Configure and manage the SSH service on Linux
This article permanently updates the link address: