码迷,mamicode.com
首页 > 系统相关 > 详细

Linux远程ssh免密码,秘钥登录

时间:2018-07-21 18:51:41      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:rsa   keygen   免密码   主机   yum   linux   linux系统   使用   code   

Linux系统做免密,秘钥登录要注意一下几点:

  • /root/.ssh目录权限为700
  • SELinux要关闭
  • /root/.ssh/authorized_keys文件名要写对
  • 文件内容要粘贴对
检查是否按照ssh
ssh -V

如果没有安装ssh,使用如下命令安装:
yum install -y openssh-clients

    主机A:
    ssh-keygen
    cat /root/.ssh/id_rsa.pub
    scp /root/.ssh/id_rsa.pub root@主机B:/root/.ssh/authorized_keys
    在主机B上:
    chmod 600 /root/.ssh/authorized_keys
    
    主机A:
    ssh 主机B IP

 

Linux远程ssh免密码,秘钥登录

标签:rsa   keygen   免密码   主机   yum   linux   linux系统   使用   code   

原文地址:https://www.cnblogs.com/hujianli/p/9347558.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!