本机环境
3台机器执行命令ssh-keygen
选取第一台,生成authorized_keys文件
hadoop002 hadoop003传输id_rsa.pub文件到hadoop001
hadoop001机器 合并id_rsa.pub2、id_rsa.pub3到authorized_keys
设置每台机器的权限
1 | chmod 700 -R ~/.ssh |
将authorized_keys分发到hadoop002、hadoop003机器
验证(每台机器上执行下面的命令,只输入yes,不输入密码,说明配置成功)
1 | [root@hadoop001 ~]# ssh root@hadoop002 date |