SSH adds mutual trust mechanism
Suppose three hosts establish mutual trust mechanism: master, slave1, slave2
1. Generate key: execute the following command on the three hosts to generate the key
Ssh-keygen-t rsa (rsa is the key encryption algorithm. After executing the command, click enter three times in a row)
two。 Create text under the path where the key is generated (~ / .ssh /)
Touch authorized_keys
3. Modify the permissions of the file
Chmod 600 authorized_keys
4. Append the public key to the text file: all three public keys are added to the file
Cat id_rsa.pub > > authorized_keys
5. Copy the file to another
6. The three log in to each other without a password.