大佬教程收集整理的这篇文章主要介绍了CentOS SSH免密登陆,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
内容:
RSAAuthentication yes # 启用 RSA 认证
PubkeyAuthentication yes # 启用公钥私钥配对认证方式
AuthorizedKeysFile .ssh/authorized_keys # 公钥文件路径(和下面生成的文件同)
ssh-keygen -t rsa -P ''
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
service sshd restart
scp ~/.ssh/id_rsa.pub root@slave1.hadoop:~/.ssh
scp ~/.ssh/id_rsa.pub root@slave2.hadoop:~/.ssh
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
rm -r ~/.ssh/id_rsa.pub
ssh slave1.hadoop
exit
ssh slave2.hadoop
exit
以上是大佬教程为你收集整理的CentOS SSH免密登陆全部内容,希望文章能够帮你解决CentOS SSH免密登陆所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。