ssh-keygen -t rsa -P ‘‘
The id_rsa.pub of all the machines is pooled into the authorized_keys of one server, and the Authorized_keys is distributed to other machines.
1 a public/private key pair is generated under a machine.
ssh-keygen -t rsa -P ‘‘
Tap the ENTER key to
It generates the. SSH directory under/home/hadoop, with Id_rsa and id_rsa.pub under SSH.
2. Copy the id_rsa.pub under the a machine into the. ssh/authorized_keys file under the B machine.
[[email protected] ~]$ scp .ssh/id_rsa.pub [email protected]:/home/hadoop/id_rsa.pub.hadoop_wang[email protected]‘s password: |
Since there is no password-free login, enter the password.
The 3.B machine adds the Id_rsa.pub.hadoop_wang copied from a machine to the. ssh/authorzied_keys file.
[[email protected] ~]$ cat id_rsa.pub.hadoop_wang >> .ssh/authorized_keys[[email protected] ~]$ chmod 600 .ssh/authorized_keys |
Authorized_keys's permission if 600.
4.A Machine login B machine.
[[email protected] ~]$ ssh 192.168.10.107 |
The first time you log in is when you want to enter Yes.
Now a machine can be no password login B machine.
Summary: Log on the machine can have a private key, the machine to be logged on to have the public key of the machine. This public/private key pair is typically generated on the private key host. Above is the RSA algorithm's public/private key pair, of course, you can also use DSA (the corresponding file is id_dsa,id_dsa.pub)
Want to let A, B machine without password mutual login, that machine is configured in the same manner as above, the B's public key copy has been added to the end of the Authorized_keys line. This is over.
SSH Password-free login