配置ssh互信操作步骤:
1.生成公钥
[root@hadoop000 ~]# rm -rf ~/.ssh [root@hadoop000 ~]# ssh-keygen [root@hadoop001 ~]# rm -rf ~/.ssh [root@hadoop001 ~]# ssh-keygen
2.选择第一台作为先完善的机器
[root@hadoop000 .ssh]# cat id_rsa.pub >> authorized_keys 将本机公钥输出到authorized_keys中
3.其他机器将id_rsa.pub发送给第一台
[root@hadoop001 .ssh]# scp id_rsa.pub 192.168.137.251:/root/.ssh/id_rsa.pub.hadoop001
4.将其他机器的id_rsa.pub追加到authorized_keys
[root@hadoop000 .ssh]# cat id_rsa.pub.hadoop001 >> authorized_keys
5.然后将该authorized_keys分发
[root@hadoop000 .ssh]# scp authorized_keys 192.168.137.141:/root/.ssh/
每台机器第一次ssh跳转其他机器都需输入yes 目的 --> known_hosts
之后再登录其他机器就无需密码了。