完成ssh无密码的验证,采用公钥、私钥

虚拟机A
1.完成ssh无密码的验证,采用公钥、私钥

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

猜你喜欢

转载自blog.csdn.net/gydtep/article/details/82052764