Linux configuration ssh No password login does not work solution __linux

Source: Internet
Author: User

1, install SSH

Direct sudo apt-get install Openssh-server

2. View SSH running status

Ps-e | grep ssh

If sshd and ssh-agent are found, the SSH service is basically functioning

3. Generate public and private keys

Ssh-keygen-t rsa-p ""

4. Append the public key to the file

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

5, Test ssh localhost

If you find that you can log in without entering a password, the SSH password-free mechanism is successful.

6, one of the reasons for failure:. SSH and its subordinate file permissions issues:

Preferred. SSH directory permissions are 700, two DSA and RSA's private key permissions are 600, and the remaining file permissions are 644.

The following lists the. SSH directory and the permissions table for the child files:

DRWX------2 Hadoop hadoop 4096 2014-06-02 15:32.
Drwxr-xr-x Hadoop hadoop 4096 2014-06-02 15:06.
-rw-r--r--1 Hadoop hadoop 2252 2014-06-02 15:32 Authorized_keys
-RW-------1 Hadoop hadoop 668 2014-06-02 15:11 ID_DSA
-rw-r--r--1 Hadoop hadoop 615 2014-06-02 15:11 id_dsa.pub
-RW-------1 Hadoop hadoop 1675 2014-06-02 15:32 Id_rsa
-rw-r--r--1 Hadoop Hadoop 407 2014-06-02 15:32 id_rsa.pub
-rw-r--r--1 Hadoop hadoop 442 2014-06-02 15:08 known_hosts

7. Permissions issues for the parent directory of SSH (my question appears here):

The parent directory file permissions for SSH should be 755, which is the user file (a user file for the/home subordinate) of the owning user.

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.