Windows git ssh报错“no matching host key type found. Their offer: ssh-rsa,ssh-dss”

Windows 下检出代码的时候报错:

$ git clone root@10.10.10.10:/nfs/MyCloud/.Git/xxxx
Cloning into 'xxxx'...
Unable to negotiate with 10.10.10.10 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
解决:

前提: 在排除没有配置公钥的情况下。

  • Git的安装目录下 Git > etc > ssh 文件夹下找到 ssh_config 文件
  • 在文件末尾添加一下代码(注意,这里的 xxx.com 就是远程仓库地址或者ip,格式如:baidu.com)
Host xxx.com
    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedAlgorithms +ssh-rsa

参考链接


windows git ssh 方式提示 no matching host key type found. Their offer: ssh-rsa,ssh-dss

发布者

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注