SSH configuration host a:10.0.5.199 host b:10.0.5.198 need to configure host a without password logon host A, Host B first ensure that all the host's firewall is turned off. Perform the following on host a: 1. $CD ~/.ssh 2. $SSH-keygen-t RSA--------------------and then press ENTER, the generated key is saved in the. ssh/id_rsa file as the default option. 3. $CP id_rsa.pub Authorized_keys This step, under normal circumstances can be no password login to the machine, that is, ssh localhost, no need to enter a password. 4. $SCP Authorized_keys [email protected]:/home/summer/.ssh------to copy a copy of the Authorized_keys file that was just generated to host B. 5. $chmod Authorized_keys enter the. SSH directory of Host B and change the permissions of the Authorized_keys file. (4 and 5 can be synthesized one step, the execution: $ssh-copy-id-i [email protected]) Normally, after the completion of a few steps above, from host a machine to host A, Host B is located on the machine to initiate an SSH connection, only the first time you need to enter a password to login, You don't need it later. Problems you may encounter: 1. When SSH is logged in, it appears: "Agent admitted failure to sign using the key". Execution: $ssh-add forcibly add the private key in. 2. If there is no error prompt, you can enter the password to log in, but you cannot login without password, on the connected host (such as a to B to initiate an SSH connection, then on B) perform the following steps: $chmod o-w ~/$chmod ~/.ssh $chmod ~/.ssh/au Thorized_keys3. If you do a 2nd step, you cannot log in without a password, try the following $ps-af | The grep agent checks whether the SSH proxy is on, if it is on, kill the agent, then execute the following, reopen an SSH proxy, if it is not, execute the following directly: $ssh-agent or not, perform the following, restart the SSH service $sudo ServicE sshd restart4. "Could not open a connection to your AUTHENTICATIONH agent" fails to execute when Ssh-add is executed: ssh-agent bash
SSH no password login under Linux setup