当前位置:   article > 正文

Unable to negotiate with xx.xx port xx: no matching host key type found. Their offer: ssh-rsa...._unable to negotiate with 10.11.81.103 port 8235: n

unable to negotiate with 10.11.81.103 port 8235: no matching host key type f
  • 背景
    • 下载安装了官网最新的Git;

    • 安装没问题,配置了name和email;

    • 同时也配置了ssh秘钥到代码仓库;

    • 使用git bash命令或者从idea中clone代码,报错如下:

      Unable to negotiate with 118.31.165.50 port 22: no matching host key type found. Their offer: ssh-rsa
      fatal: Could not read from remote repository.
      
      Please make sure you have the correct access rights 
      and the repository exists.
      
      • 1
      • 2
      • 3
      • 4
      • 5
    • 上面的报错信息说的是没有匹配到类型为ssh-rsa的主机秘钥;也有一些报错的类型是Their offer: ssh-dss

  • 解决(以下两种方法本人都已成功验证)
    • 1、卸载高版本,使用低版本git(最简单);
    • 2、在.ssh目录中新建config配置文件,在文件中添加如下代码:如果是dss则将rsa更换为dss即可
      Host *
      HostkeyAlgorithms +ssh-rsa
      PubkeyAcceptedKeyTypes +ssh-rsa
      
      • 1
      • 2
      • 3
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/秋刀鱼在做梦/article/detail/789901
推荐阅读
相关标签
  

闽ICP备14008679号