no matching host key type found. Their offer: ssh-rsa,ssh-dss问题解决

最近在克隆git项目时,遇到如下问题:

    ~/project  git clone git@xxx.com:xxx/xxx.git                                                                                                                                                         ✔ 
正克隆到 'xxx'...
Unable to negotiate with xxx.xxx.xxx.xxx port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。

解决方法如下:

~/.ssh目录下,创建config文件,文件内容为:

注意将xxx.com改为实际的地址

Host xxx.com
        HostKeyAlgorithms ssh-rsa
        PubkeyAcceptedKeyTypes ssh-rsa
欢迎转载,转载请注明出处。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注