git克隆代码失败Cloning into 'demo'... Unable to negotiate with x.x.x.x: no matching host key type found...

git克隆代码失败Cloning into 'demo'... Unable to negotiate with x.x.x.x: no matching host key type found. Their offer: xxx
编辑ssh配置,.ssh/config,如果config文件不存在,则新建一个,加入以下内容

Host *
KexAlgorithms +diffie-hellman-group1-sha1
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

原因如下:

失败问题1

Cloning into 'demo'...
Unable to negotiate with x.x.x.x: no matching host key type found. Their offer: diffie-hellman-group1-sha1
解决办法

KexAlgorithms +diffie-hellman-group1-sha1

失败问题2

Cloning into 'demo'...
Unable to negotiate with x.x.x.x: no matching host key type found. Their offer: ssh-rsa
解决办法

HostkeyAlgorithms +ssh-rsa

失败问题2

Cloning into 'demo'...
x.x.x.x: Permission denied (publickey)
解决办法

HostkeyAlgorithms +ssh-rsa
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容