虚拟机A
1.完成ssh无密码的验证,采用公钥、私钥
ssh-keygen //一路回车,产生公钥、私钥
ls /root/.ssh/ //查看公钥、私钥
ssh-copy-id root@192.168.4.207 //传递给207公钥
虚拟机B
2查看公钥
[root@pc207 ~]# ls /root/.ssh/
authorized_keys known_hosts
虚拟机A
3.验证无密码登陆
[root@svr7 ~]# ssh -X root@192.168.4.207
Last login: Thu Aug 23 15:35:52 2018 from 192.168.4.254
[root@pc207 ~]#