您的位置:首页 > 编程语言

git clone代码时提示:no matching key exchange method found

2016-08-25 11:23 726 查看
最近接受一个新项目在使用git clone克隆代码时,遇到了如下错误:

Unable to negotiate with xxx.xxx.xxx.xxx: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

fatal: Could not read from remote repository.

从提示来看,这个应该是server的key exchange方法无法匹配导致的。而server支持的算法是:
diffie-hellman-group1-sha1
。所以此处应该将client端的算法强制使用
diffie-hellman-group1-sha1


所以此处需要在~/.ssh/config当中添加如下配置:

host xxx.xxx.xxx.xxx #服务器ip地址
KexAlgorithms diffie-hellman-group1-sha1
identityfile ~/.ssh/xxx.pub #如果不是默认的公钥,此处需要指定一下


之后再次执行git clone命令就可以正常执行了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git-clone exchange
相关文章推荐