SSH logon without a password-a magic Error

Source: Internet
Author: User

I made the configuration according to the official website and various netizens.

Ssh-keygen

If you are prompted to enter the file name or password, simply press Enter. After completion, ". SSH "directory," ls. after SSH, we will find two files, one is id_rsa and the other is id_rsa.pub. The former is the private key and the latter is the public key.

Enter

Cat ~ /. Ssh/id_rsa.pub> ~ /. Ssh/authorized_keys

Modify the File Permission chmod 777-r/root/. SSH(This is the problem. 777 is not acceptable. It must be 600)

I restarted SSH several times and found that the ssh_agent botnet process was running. I am puzzled. I still cannot find a method after searching the Internet for a long time. Together with Ubuntu installed on another computer, the same approach is the same.

    1. I didn't have the authorized_keys file. I thought it was a problem. Later I found that no, cat ~ /. Ssh/id_rsa.pub> ~ The/. Ssh/authorized_keys statement is automatically created.
    2. /Etc/ssh/sshd_config: It's been around for a long time. Rely on me!

      Authorizedkeysfile % H/. Ssh/authorized_keys pubkeyauthentication Yes

    3. Finally, I suddenly found that the permission can only be 600. Modified. Really good.

This is a real zombie. 777 of permissions are not enough and 600 of permissions are required. Root/. Ssh this folder and the following files require this permission.

Alas, a lot of time is wasted. The brains are all big.

Return to node1 and copy authorized_keys to node2 and node3.

[Hadoop @ hadoop. Ssh] $ SCP authorized_keys node2:/home/hadoop/. Ssh/

[Hadoop @ hadoop. Ssh] $ SCP authorized_keys node3:/home/hadoop/. Ssh/

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.