美文网首页
linux ssh免密登录

linux ssh免密登录

作者: evoxy | 来源:发表于2018-05-04 14:48 被阅读0次

linux 免密登录

// 通过scp 命令将本机公钥 追加到登录机器的authorized_keys中
$ scp -p ~/.ssh/id_rsa.pub root@<remote_ip>:/root/.ssh/authorized_keys
// 或者
$ scp ~/.ssh/id_rsa.pub root@<remote_ip>:pub_key //将文件拷贝至远程服务器
$ cat ~/pub_key >>~/.ssh/authorized_keys //将内容追加到authorized_keys文件中, 不过要登录远程服务器来执行这条命令

相关文章

网友评论

      本文标题:linux ssh免密登录

      本文链接:https://www.haomeiwen.com/subject/ykmdrftx.html