报错

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

$ 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.

解决

$ vim ~/.ssh/config
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

参考资料:linuxquestions

文章目录