ssh_dispatch_run_fatal: incorrect signature (gerrit 在windows 克隆代码报错)

场景:

本地执行 ssh-keygen -t rsa -C “邮箱”后将~/.ssh/id_rsa.pub的内容放到gerrit上,windows系统上打开git bash使用ssh的防止执行git clone  ssh://xx@gerritip:29418/pro_test的方式下载代码。

这个问题真的是头大了很久的一个问题。不知道从哪天开始,后面新来的同事使用windows从gerrit下载代码一直报错,但是之前的用windows的同事是可以正常下代码的。

分析:

(1)刚开始怀疑是git  bash版本的问题,给了我的正常的git bash版本给新同事,还是不能下代码,

(2)然后怀疑是生成的ssh key有问题,可是新同事放到自己的github上也可以正常下代码,

(3)我用linux进行代码下载也是没问题的,最后都不知道该怀疑哪里了。

曙光:

百度上搜了好几天,看到的回答没有一个可以解决我的问题,结果翻了个墙,google到的第一个回答就解决了我的问题!!!

报错如下:

$ git clone ssh://az@192.168.8.10:29418/test
Cloning into 'test'...
ssh_dispatch_run_fatal: Connection to 192.168.8.10 port 29418: incorrect signature
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

解决方案:

vim /etc/ssh/ssh_config  

添加一行:HostKeyAlgorithms ssh-rsa

在执行git clone ssh:即可,你要是还不确定,最好重新再生成一个ssh key放到gerrit上之后再执行git clone ssh

原文地址:https://www.cnblogs.com/zndxall/p/14764338.html