服务器ssh免密登录

1、登录任意节点home目录,创建公私有密钥

执行:ssh-keygen

           cd ~/.ssh

           ls 

           

2、上传公钥到需要免密登录的节点

       

              比如:172.16.154.10    172.16.154.13   等等,root用户

ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

3、测试免密登录

ssh [email protected]

ssh [email protected]

成功登录,说明ok了,一般是不会出问题的。

猜你喜欢

转载自www.cnblogs.com/happyniqiu/p/12532177.html