SSH password-free setup Failure reason summary

Source: Internet
Author: User

Let's review the steps to set up an SSH password-free operation:

Go to home directory

Cd

Generate Public key

ssh-keygen-t rsa-p ' (Note: The last is two single quotes, which means no password is set)

Then distribute the public key to the target machine

ssh-copy-id-i ~/.ssh/id_rsa.pub Each other machine IP (Be careful not to forget the parameter-I.)

Note: Ssh-copy-id-i is the easiest way to score two steps if you don't use this one:

A) First SCP copies the id_rsa.pub of the machine to the other machine's. SSH directory

b) Perform cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys Import Public key on the other machine

The above operation is completed, you can use the SSH machine IP to test, smooth, should not be prompted to enter the password.

If it fails, the following may be the cause:

1. Permissions issues

. SSH directory, and/home/the current user needs 700 permissions, refer to the following actions to adjust

sudo chmod ~/.ssh

sudo chmod 700/home/Current user

The Authorized_keys file in the. SSH directory requires 600 or 644 permissions, and the following actions are adjusted

sudo chmod ~/.ssh/authorized_keys

2, Strictmodes problem

Edit

sudo vi/etc/ssh/sshd_config

Found it

#StrictModes Yes

Change into

Strictmodes No

If not, you can use ssh-vvv target machine IP to view the details, according to the specific problem of the output content analysis

SSH password-free setup Failure reason summary

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.