Through the certificate signing to the Linux host SSH no password access, using Ssh-keygen and Ssh-copy-id to achieve rapid certificate generation and public key issued, where Ssh-keygen generate a pair of keys, using Ssh-copy-id to distribute the generated public key. Here's how:
To create a key in Host a (192.168.0.100), execute:
SSH-KEYGEN-T RSA
, there is a query directly press ENTER, you will generate a pair of keys under/root/.ssh/, where Id_rsz is the private key, Id_rsa.pub is the public key (need to be issued to the B host user. SSH directory, also requires the same name as Authorized_keys file). (b Host: 192.168.0.101) You can also specify the certificate generation location by using the-f parameter.
Ssh-keygen-t rsa-f/root/.ssh/id_rsa #指证书的生成位置
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8B/C9/wKioL1hZAArDjcKwAAEjt-VoUeY525.png "title=" Wkiom1g3o3ua3kgbaaa8csq1en4232.png-wh_500x0-wm_3-wmp_4-s_3099150748.png "alt=" Wkiol1hzaardjckwaaejt-vouey525.png "/>
Next sync public key file id_rsa.pub to target host, we recommend using Ssh-copy-i Public key Copy tool (also can use SCP copy), command format:/usr/bin/ssh-copy-id [-I [Identity_file]] [[Email Protected]] machine.
#ssh-copy-id-i/root/.ssh/id_rsa.pub [email protected]
Verify that SSH password is not configured successfully, run SSH [email protected], if you go directly to the root account prompt, the configuration is successful.
Configuring a Linux host for SSH without password access