setting up SSH login without password can improve the security of our host. SSH login with no password to use the public and private keys. Linux can generate a public/private key pair with Ssh-keygen, followed by CentOS for example.
Example diagram: Experimental host A no key access host B
Actual Combat part:
Host Cent65 (192.168.1.65)
Host Cent67 (192.168.1.67)
Now want to 65 through SSH password-free login to 67. First, take the root account login as an example.
1. Generate a public/private key pair under the a machine.
[[email protected] ~]# ssh-keygen-t rsa-p '
P followed by a space and two single quotes
P represents a password, - P ' indicates a blank password, or it can be used without - P parameters, this will take three times to enter, with - P just one return. The command will generate a pair of keys Id_rsa and id_rsa.pubunder the /root/.ssh directory .
2. Copy the/root/.ssh/id_rsa.pub under the 65 host to the /root/.ssh/authorized_keys file of the 67 host, and create the/ROOT/.SSH on the 67 machine first. This directory, with SCP replication.
3. [Email protected] ~]# scp/root/.ssh/id_rsa.pub [email Protected]:/root/.ssh/authorized_keys
Since there is no password-free login, enter the root password of the 67 host once.
4, attention!!! The Authorized_keys must be !!!
It is now possible to implement a no-key login.
SSH-free login for Linux