SSH no password login under Linux setup

Source: Internet
Author: User

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 make sure that all hosts ' firewalls are turned off.

On host A, perform the following:

1. $CD ~/.ssh

2. $ssh-keygen-t RSA--------------------and then press ENTER, the generated key is saved in the. ssh/id_rsa file according to the default options.

3. $CP Id_rsa.pub Authorized_keys

After this step is complete, you can normally log on to the machine without a password, that is, ssh localhost, without entering a password.

4. $SCP Authorized_keys [Email protected]:/home/summer/.ssh------Copy the Authorized_keys file that was just generated to host B.

5. $chmod Authorized_keys

Enter the. SSH directory of Host B to change the license permissions for the Authorized_keys file.

(4 and 5 can be synthesized one step, execute: $ssh-copy-id-i [email protected])

Under normal circumstances, after the completion of the above steps, from host a machine to host A, Host B is the machine to initiate an SSH connection, only the first time you need to enter the password, then do not need.

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 login with the password, but it is not possible to login without password, on the connected host (such as a to B to initiate an SSH connection, on B) perform the following steps:

$chmod o-w ~/

    $chmod 700 ~/.ssh

       $chmod 600 ~/.ssh/authorized_keys

3.如果执行了第2步,还是不能无密码登录,再试试下面几个

$ps-af | grep agent

Check whether the SSH proxy is turned on, if it is on, kill the agent, and then execute the following, reopen an SSH proxy, if not open, directly execute the following:

$ssh-agent

Or not, do the following, restart the SSH service

$sudo Service sshd Restart

4. "Could not open a connection to your AUTHENTICATIONH agent" fails when executing Ssh-add

Execution: Ssh-agent bash

This article turns from http://www.cnblogs.com/jdksummer/articles/2521550.html!

SSH no password login under Linux setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.