- 本地生成ssh 公私钥
ssh-keygen -t rsa
- 将本地公钥导入到authorized_keys中
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- 将公钥上传到远程服务器上
scp ~/.ssh/id_rsa.pub root@192.168.7.178:/root
- 将公钥添加到远程服务器上的authorized_keys里
cat /root/id_rsa.pub >> ~/.ssh/authorized_keys
好了
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/id_rsa.pub root@192.168.7.178:/root
cat /root/id_rsa.pub >> ~/.ssh/authorized_keys
本文标题:免密登录
本文链接:https://www.haomeiwen.com/subject/mimyxktx.html
网友评论