git 报错Unable to negotiate with **** port 22: no matching host key type found. Their offer: ssh-rsa

Published on with 4,857 views

新安装的git,生成公钥,并添加到阿里云中,但是clone时报错

Unable to negotiate with **** port 22: no matching host key type found. Their offer: ssh-rsa
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.在.ssh目录下创建config文件,并添加如下内容

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

image.png

image.png



标题:git 报错Unable to negotiate with **** port 22: no matching host key type found. Their offer: ssh-rsa
作者:yanjing
地址:https://yanjingtp.cn/articles/2022/06/13/1655109803428.html