SSH login with no password to use the public and private keys. Linux can be used to generate a public/private key pair with Ssh-keygen, below I take CentOS as an example.
There is machine A (192.168.0.188), B (192.168.0.189). Now want to a through SSH password-free login to B.
1. Generate a public/private key pair under the a machine.
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/79/39/wKiom1aL0KvghGHcAAAqJkquVqc603.png "title=" aa.png "alt=" Wkiom1al0kvghghcaaaqjkquvqc603.png "/>
-P for the password,-p ' means the empty password, you can not use the-p parameter, so that three cars to enter, with-P on a return.
It generates the. SSH directory under/HOME/CHENLB, with Id_rsa and id_rsa.pub under SSH.
2. Copy the id_rsa.pub under the A machine to B machine, in the. ssh/authorized_keys file of B machine, I use SCP to copy.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/79/39/wKiom1aL0MOBAj4nAAAW5VyUdPI330.png "title=" bb.png "alt=" Wkiom1al0mobaj4naaaw5vyudpi330.png "/>
Since there is no password-free login, enter the password.
The 3.B machine adds the id_rsa.pub copied from a machine to the. ssh/authorzied_keys file.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/79/39/wKiom1aL0nuzsg95AABprUa5PJk222.png "title=" 111. PNG "alt=" Wkiom1al0nuzsg95aabprua5pjk222.png "/>
Authorized_keys's permission if 600.
4.A Machine login B machine.
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/79/39/wKiom1aL0xmi3HXhAAAQhc0hvtU448.png "title=" login. png "alt=" Wkiom1al0xmi3hxhaaaqhc0hvtu448.png "/>
The first time you log in is when you want to enter Yes.
Now a machine can be no password login B machine.
Want to let A, B machine without password mutual login, that machine is configured in the same manner as above.
A machine login b machine password-free