ssh实现秘钥登陆
温馨提示:
本文最后更新于 2021年06月02日,已超过 1,225 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我。
2行命令
ssh-keygen #生成本地秘钥
ssh-copy-id -i ~/.ssh/id_rsa.pub root@ip地址
输入密码,即可将公钥追加到新的服务器中
[root@MiWiFi-RA69-srv ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@47.106.110.119
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@47.106.110.119's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'root@47.106.110.119'"
and check to make sure that only the key(s) you wanted were added.
正文到此结束
- 本文标签: 服务架构
- 本文链接: https://www.php20.cn/article/292
- 版权声明: 本文由仙士可原创发布,转载请遵循《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权