解决git 报错 Their offer: ssh-rsa,ssh-dss

415 阅读1分钟

报错信息

Unable to negotiate with 192.168.8.2 port 29418: 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.
​

原因

新的ssh客户端不支持ssh-rsa算法,要修改本地配置重新使用ssh-rsa算法

解决方法

1.本地C盘找到.ssh文件

Snipaste_2022-12-14_11-32-09.png

2.找到config配置文件,没有就新建一个

3.加上ssh-rsa

Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa