linux ssh 免密码登录的配置过程

  1. # ssh-keygen -t rsa -C "自定义描述" -f ~/.ssh/自定义生成的rsa文件
  2. # cd ./.ssh
  3. # touch config
  4. # 粘贴 
    Host 远程服务器地址
    IdentityFile ~/.ssh/自定义生成rsa文件
    User root 登录远程服务器的用户
  5. # 保存
  6. #
     ssh-copy-id -i ~/.ssh/自定义生成rsa文件.pub root@远程服务器地址
     如果上述 步骤完成未生效 清检查  服务器  /etc/ssh/sshd_config 文件
    RSAAuthentication yes
    PubkeyAuthentication yes
    AuthorizedKeysFile .ssh/authorized_keys

    检查上面配置是否被 # 注释. 如果被注释  则取消注释 重启 

    // ubuntu系统
    service ssh restart
    // debian系统
    /etc/init.d/ssh restart
原文地址:https://www.cnblogs.com/lizhanzhou/p/7544385.html