1、在Master节点上执行 ssh-keygen-trsa
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): /*回车,设置默认路径*/
Enter passphrase (empty for no passphrase): /*回车,设置空密码*/
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
2、把Master上的id_rsa.pub文件追加到Slave的authorized_keys内
cat /home/id_rsa.pub >> /root/.ssh/authorized_keys
注意:配置完毕,如果Master仍然不能访问Slave,可以修改Slave的 authorized_keys文件的权限。