Git安装问题"no matching key exchange method found"

在本地ssh-keygen之后,把C:\User.ssh\目录下的id_rsa.pub中的秘钥复制到服务器配置中

1、遇到问题

Cloning into 'ADAS'...
Unable to negotiate with 10.4.0.169 port 29418: no matching key exchange method f
ound. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
fatal: Could not read from remote repository.

这是git的ssh支持算法没配置,那么先在C:\User.ssh\下新建文件config,写进如下代码:

Host *

KexAlgorithms +diffie-hellman-group1-sha1

2、结果又报错

Cloning into 'ADAS'...
Unable to negotiate with 10.4.0.169 port 29418: no matching host key type found.
Their offer: ssh-rsa
fatal: Could not read from remote repository.

在刚才的文件中继续修改至如下内容:

Host *

KexAlgorithms +diffie-hellman-group1-sha1
HostkeyAlgorithms +ssh-dss,ssh-rsa
PubkeyAcceptedKeyTypes +ssh-dss,ssh-rsa
posted @ 2022-11-25 16:50  月的光景  阅读(1370)  评论(0编辑  收藏  举报