Assuming three virtual machines a (10.139.8.82), B (10.139.8.83), C (10.139.8.84), you need to ensure the connectivity of the network between the three virtual machines.
Operation Steps:
First, the configuration on a machine
① log in as root to change the SSH configuration file/etc/ssh/sshd_config
Rsaauthentication Yes #启用rsa认证
Pubkeyauthentication Yes #启用公钥私钥配对认证方式
Authorizedkeysfile. Ssh/authorized_keys #公钥文件路径
[[email protected]/] #systemctl restart sshd//restart SSH service
② generating a public key private key pair
[[email protected]/] #ssh-keygen-t RSA
The system generates ID_RSA, id_rsa.pub under/root/.ssh
③ send the Id_rsa.pub under the A machine to B, C machine
[[email protected]/] #ssh-copy-id-i/root/.ssh/id_rsa.pub 10.139.8.83
[[email protected]/] #ssh-copy-id-i/root/.ssh/id_rsa.pub 10.139.8.84
Second, B, C machine using the same method in step one, remember to change the IP address
Third, realize SSH multi-machine mutual trust
Take a machine as an example
[[email protected]/] #ssh 10.139.8.83//login B Machine
[[email protected]/] #ifconfig//Check if login is successful
[[email protected]/] #exit//exit SSH login, return to this machine
This article is from the "11877272" blog, please be sure to keep this source http://11887272.blog.51cto.com/11877272/1828587
Multi-virtual Machine trust under Centos 7