Multi-VM mutual trust in Centos 7
Assume that the network connectivity between the three VMS is guaranteed, for example, A (10.139.8.82), B (10.139.8.83), and C (10.139.8.84.
Procedure:
1. Configure on server
① Log On As the root user and change the ssh configuration file/etc/ssh/sshd_config
RSAAuthentication yes # enable rsa Authentication
PubkeyAuthentication yes # enable public key/private key pair Authentication
AuthorizedKeysFile. ssh/authorized_keys # public key file path
[Root @ localhost/] # systemctl restart sshd // restart the ssh service
② Generate a public key/private key pair
[Root @ localhost/] # ssh-keygen-t rsa
The system generates id_rsa and id_rsa.pub under/root/. ssh.
③ Send id_rsa.pub under server A to server B and server C.
[Root @ localhost/] # ssh-copy-id-I/root/. ssh/id_rsa.pub 10.139.8.83
[Root @ localhost/] # ssh-copy-id-I/root/. ssh/id_rsa.pub 10.139.8.84
2. Machine B and machine C adopt the same method in step 1. Remember to change the IP address
Iii. achieve mutual trust between multiple ssh hosts
Take host A as an Example
[Root @ localhost/] # ssh 10.139.8.83 // log on to B
[Root @ localhost/] # ifconfig // check whether logon is successful
[Root @ localhost/] # exit // log out of ssh and return to the Local Machine