Ssh password-free login-Establish a trust relationship with the server
Assume that the master machine A, B, and C needs to be established as the master machine A. You can directly access the master machine B and C through ssh without A password. The procedure is as follows:
Assume that you only use the user yimr to establish trust, use the yimr user to log on to host A and perform the following operations:
Generate public and private keys
Ssh-keygen-t rsa
Then, the id_rsa and id_rsa.pub files are generated under the/home/user/. ssh directory.
Copy the public key to the BC Node
Scp. ssh/id_rsa.pub B:/home/username/. ssh/A. pub
Go to the BC node and put the public key in the authorized_keys file.
Cat. ssh/A. pub>. ssh/authorized_keys
Permissions of machines A, B, and C must be modified.
Chmod 755. sshchmod 600. ssh/authorized_keys
A, B, and C each machine must modify the sshd configuration file vim/etc/ssh/sshd_config
RSAAuthentication yesPubkeyAuthentication yesAuthorizedKeysFile. ssh/authorized_keysGSSAPIAuthentication noUseDNS no Restart SSHD service
Service sshd restartDone