1. How to avoid password-free mutual trust between ssh-Principle: Private Key Encryption and Public Key decryption
Establish an SSH trust relationship between experiment web1 (192.168.204.7) and web2 (192.168.204.9)
The command ssh-keygen is used to generate the public key and private key.
Operate on web1
1. automated commands
Ssh-keygen-t rsa-p'-f ~ /. Ssh/id_rsa
-T indicates the type
-P specifies the password
-F specifies the file
Result:
Save the private key to id_rsa and save it to id_rsa.pub.
[[Email protected] ~] # Ls. Ssh/
Id_rsa id_rsa.pub
2. Install the public key on the remote host.
Ssh-copy-ID [-I [identity_file] [[email protected] Machine
Ssh-copy-ID-I. Ssh/id_rsa.pub [email protected]
Result: authentication information is recorded on web2.
[[Email protected] ~] # Cat. Ssh/authorized_keys
Ssh-RSA Secure + wmk3/secure + qgqnchkmutfeixguvcm + K + ilhapqrf6mun + gjxybqablh403iod0fyp57vsu6wfg + 1 W = [email protected]
[[Email protected] ~] # Ls-L. Ssh/authorized_keys
Mutual trust can be achieved by performing the same operation on web2
Mutual trust between SSH hosts-password-free