linux 免密钥登陆

版权声明:QQ:1009002494 https://blog.csdn.net/Doudou_Mylove/article/details/83150773

免密钥登陆(推荐第二种):

ssh-keygen    一路回车


第一种:
scp -r /root/.ssh/id_rsa.pub [email protected]:root/.ssh/authorized_keys    
这里的ip是目的ip,输入密码之后这两台服务器之后的传输就再不用输密码

第二种方法用ssh自带的一个命令更简便:
ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected]    按提示输入密码
这种方法ip后面什么都不用加直接就OK


直接登录:ssh 192.168.20.129

猜你喜欢

转载自blog.csdn.net/Doudou_Mylove/article/details/83150773