Windows 下检出代码的时候报错:
1 2 3 4 5 6 7 |
$ 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)
1 2 3 |
Host xxx.com HostkeyAlgorithms +ssh-rsa PubkeyAcceptedAlgorithms +ssh-rsa |
参考链接
windows git ssh 方式提示 no matching host key type found. Their offer: ssh-rsa,ssh-dss