SSH password-free login configuration in CentOS

Source: Internet
Author: User

SSH password-free login configuration in CentOS

When we installed Hadoop in CentOS, we had to configure SSH password-free login configuration. Many methods have been collected on the Internet, which cannot be solved. I started to log on with a common user and the configuration failed multiple times. Later I changed my identity as root, just a moment! In the past, the configuration in Ubuntu was successful for common users. Why can't it work after Centos?

Later, a friend reminded me that it was probably a permission issue. Centos6.0 has enabled SElinux and has strict permission requirements on network services. I tried to disable SElinux and reconfigure it to solve the problem. The configuration method is as follows.

First switch to the root identity and disable SElinux:

[Root @ bogon ~] # Vi/etc/selinux/config

Set SELINUX = disabled

Then restart.

Log on as a common user and enter the following command:

Ssh-keygen-t dsa

Press enter, and then:

Cd ~ /. Ssh

Cat id_dsa.pub> authorized_keys

Test: ssh localhost

###

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.