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.