1.虚拟机A 生成公钥 私钥
[root@svr7 ~]# ssh-keygen #一路回车
[root@svr7 ~]# ls /root/.ssh/ #查看公钥 私钥
2.虚拟机A 传递公钥 到对方服务器
[root@svr7 ~]# ssh-copy-id root@192.168.4.207
3.虚拟机A 验证
[root@svr7 ~]# ssh root@192.168.4.207
•配置SSH 信仸关系(namenode)
–注意:不能出现要求输入yes 的情况,每台机器都要能登录成功,包括本机!!!
–ssh_config
StrictHostKeyChecking no
–ssh-keygen -b 2048 -t rsa-N '' -f key
–ssh-copy-id -i ./key.pub root@ip.xx.xx.xx
操作:
eg:
[root@nn01 ~]# vim /etc/ssh/ssh_config
58 Host *
59 GSSAPIAuthentication yes
60 StrictHostKeyChecking no #追加项
[root@nn01 ~]# ssh-keygen -b 2048 -t rsa -N '' -f key
[root@nn01 ~]# cd .ssh/
[root@nn01 .ssh]# ssh-copy-id -i id_rsa.pub nn01
[root@nn01 .ssh]# ssh-copy-id -i id_rsa.pub node1(注node1-node3)
原文链接:https://www.cnblogs.com/momo6656/p/14848387.html