ssh 用过密钥登录 显示 Permission denied (password).
spooking 归属分类: 运维 评论数: 0 个

先说说我的问题

我是通过 ssh-keygen -t rsa 创建的密钥。
但是登录远程服务器的时候提示:
Permission denied (password).

密码登录没问题,因此估计是配置的问题,查了资料,解决方案如下:

  1. 在远程服务器 /etc/ssh/sshd_config 中的以下设置

    PubkeyAuthentication yes
    RSAAuthentication yes  # RSA密钥 必须加
  2. 重启服务器

    systemctl restart sshd
问题解决!