1、vi /etc/ssh/sshd_config在每个节点上执行
追加
RSAAuthentication yes
PubkeyAuthentication yes
之后重启服务
service sshd restart
2、ssh-keygen -t rsa
执行一直回车,会创建公钥和私钥文件
(在/root/.ssh目录下)
3、cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
在master中
4、 chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
5、 把所有远程的服务器秘钥全部追加到当前主机的公钥author文件中
ssh root@192.168.48.24 cat ~/.ssh/id_rsa.pub>> ~/.ssh/authorized_keys
ssh root@192.168.48.23 cat ~/.ssh/id_rsa.pub>> ~/.ssh/authorized_keys
把制造好的整体的密码本,拷贝到远程服务器上
scp ~/.ssh/authorized_keys root@slave1:/root/.ssh/
scp ~/.ssh/authorized_keys root@slave2:/root/.ssh/