Hadoop learning problems encountered (linux ssh-free non-root user password)

ssh-keygen –t rsa

Then press the Enter key all the way, and finally wrote the id_rsa.pub authorized_keys, the command is as follows:

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

In hadoop user, you need to give permission to 600 authorized_keys, otherwise invalid password-free login. Other nodes only need to use  ssh-keygen -t rsa  command to produce a corresponding public key, and then appended to id_rsa.pub authorized_keys nna nodes in each node. Finally, the authorized_keys file under nna node via scp command, distributed to each node  ~ / .ssh /  directory. Contents are as follows:

# This is an example of the node to NNS scp ~ / .ssh / authorized_keys hadoop @ nns: ~ / .ssh /

  Then use the ssh command to log in to each other, to see whether to implement a password-free login, the login command is as follows:

# In this example node nns nns SSH

  If the login process wood prompted to enter the password, it means that the password configured successfully.

Note: / home / hadoop permissions to 700
     permissions .ssh folder also 700
authorized_keys file permissions to 600 
otherwise, can not be achieved free login password.

 

rm  ~/.ssh/authorized_keys
ls .ssh

 cp authorized_keys  ~/.ssh/
chmod 600    ~/.ssh/authorized_keys

 

Guess you like

Origin blog.csdn.net/madongyu1259892936/article/details/89135088