IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    No more authentication methods to try,Permission denied (publickey)

    the5fire发表于 2023-11-21 01:08:37
    love 0

    简言之就是ssh client更新了,不支持rsa的私钥,导致无法登陆。

    ssh登陆服务器,出现类似下面的提示:

    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Offering public key: /home/user/.ssh/id_rsa RSA ... agent
    debug1: send_pubkey_test: no mutual signature algorithm <-- ssh-rsa is not enabled 
    debug1: No more authentication methods to try.
    user@hostname: Permission denied (publickey).
    

    本来以为是key弄错了,或者服务器被hei了。加上 -v 参数才发现问题。

    解决方案也很简单,就是在 ~/.ssh/config 中增加:

    Host *
        ServerAliveInterval 30
        PubkeyAcceptedKeyTypes +ssh-rsa
    

    具体原因: https://www.openssh.com/txt/release-8.2

    阅读原文
    Django视频教程


沪ICP备19023445号-2号
友情链接