解决geriit 报错no matching host key type found. Their offer: ssh-rsa

2023-10-20 14:44:59 浏览数 (2)

报错

配置好公私钥之后,仍然无法直接用 git ssh的方式,下载代码。

代码语言:javascript复制
$ git clone "ssh://lianst@gerrit.lianst.com:29418/cs/devops-tool/python-test" && scp -p -P 29418 lianst@gerrit.lianst.com:hooks/commit-msg "python-test/.git/hooks/"
Cloning into 'python-test'...
Unable to negotiate with 192.168.3.160 port 29418: 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.

解决

代码语言:javascript复制
$ vim ~/.ssh/config
Host *
HostkeyAlgorithms  ssh-rsa
PubkeyAcceptedKeyTypes  ssh-rsa

参考资料:linuxquestions

0 人点赞