1. First check if SSH is installed
Rpm-qa | grep ssh
If yum install SSH is not installed
2. Perform on each machine
ssh-keygen-t RSA generates two files in root/.ssh/. (The root account is used at this time, and the different accounts are not generated in the same location.) Never tried! Copy one of the files generated on each machine.
CP ~/.ssh/id_rsa.pub ~/.SSH/ID_RSA.PUB.100
Send them all on a machine
Scp-r ~/.ssh/id_rsa.pub.101 [Email protected]:/root/hadoop/.ssh
Now it's all on the 100 machine.
3. Put all the machine's public key into a file
Cat ~/.ssh/id_rsa.pub.100 >> ~/.ssh/authorized_keys
Cat ~/.ssh/id_rsa.pub.101 >> ~/.ssh/authorized_keys
Cat ~/.ssh/id_rsa.pub.102 >> ~/.ssh/authorized_keys
4. The authority of the document is amended to
chmod 644 Authorized_keys
5. Copy the generated Authorized_keys files to another machine
Scp-r ~/.ssh/authorized_keys [Email protected]:/root/hadoop/.ssh
Repeat step 4. Now all the machines are free to sign in with each other!
Login-free SSH configuration for Linux multiple hosts