美文网首页
ssh 免密登陆

ssh 免密登陆

作者: 九歌丶 | 来源:发表于2019-10-10 19:24 被阅读0次
# 生成密钥,如 ~/.ssh/id_rsa 已存在,输入y覆盖,然后不要密码,直接回车。
$ ssh-keygen -t rsa      
# 输入密码将公钥复制到服务器上
$ ssh-copy-id root@YOUR_IP         
# 观察是否成功
$ ssh root@remoteHost       
服务器端转发配置:
# 关于ssh的配置项修改
$ vi /etc/ssh/sshd_config 

    AllowTcpForwarding yes

# 重启ssh服务
$ systemctl restart sshd

相关文章

网友评论

      本文标题:ssh 免密登陆

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