2行命令
代码语言:javascript复制ssh-keygen #生成本地秘钥
ssh-copy-id -i ~/.ssh/id_rsa.pub root@ip地址
输入密码,即可将公钥追加到新的服务器中
代码语言:javascript复制[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.
本文为仙士可原创文章,转载无需和我联系,但请注明来自仙士可博客www.php20.cn
- 上一篇: easyswoole 更新代码shell
- 下一篇: jenkins通过supervisor配置守护进程