SSH no password hand set
As a result of many online configuration without password login is very bad use, I simply write a put up a total of the reference, I have prepared 3 test machines, the demand is that these three machines can not use the password to access each other.
Steps as follows: Www.pcjsh.com
Java code
192.168.100.67 Master
192.168.100.68 slave1
192.168.100.69 Slave2
Enter master (Hadoop user)
Perform:
SSH-KEYGEN-T RSA
Enter ~/.ssh Directory
The generated Id_rsa id_rsa.pub
CP Id_rsa.pub Authorized_keys
And then confirm that Authorized_keys's permission is 600 if it's not chmod id_rsa the rest is 644.
Then SSH master Date test
Enter slave1 (Hadoop user)
Enter ~/.ssh Directory
ssh-keygen-t RSA on Master
Put it in the directory
chmod Id_rsa
Then SSH slave1 Date test
and master and slave1 test each other.
Slave2 and Slave1
In fact, CP Id_rsa.pub Authorized_keys does not matter, it is best to use cat command, I This is a map of the trouble, and I am too lazy to skillfully SCP so troublesome point, in fact this is very easy to understand that 3 machines use the same private key, so the public key to generate a set of enough
Of course, the permissions of the three-machine ~/.ssh directory and the following files must be identical, if not different.
I generally for the sake of convenience, three machines are running the ssh-keygen-t RSA command, and then a machine generated key pairs cover the rear two machines, and chmod into the same permissions, that is Id_rsa id_rsa.pub 644 Authorized_keys 644.
Because of the same key, so you can connect yourself can be successfully connected to other machines, if not connected to see if the/etc/hosts file is not configured.
Note : More wonderful tutorials Please pay attention to the triple computer tutorial section, triple Computer group: 189034526 welcome you to join