Git(ssh_exchange_identification)连接被对等方重置(Windows,GitLab)

5

我正在尝试使用Windows PuTTY上的ssh连接到一个gitlab服务器(我没有授权),我尝试过的git客户端包括简单的git、git-extensions、sourcetree和git bash/gui。它们都告诉我:

Cloning into 'repo'...
debug2: ssh_connect: needpriv 0
debug1: Connecting to git.server [x.y.z.w] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/c/Users/user/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /c/Users/user/.ssh/id_rsa type 1
debug1: identity file /c/Users/user/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/user/.ssh/id_dsa type -1
debug1: identity file /c/Users/user/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/user/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/user/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/user/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.

我已更改repo/server/ip/user的名称,但除此之外,每次尝试连接时我都会得到这个错误信息。debug3消息实际上不应该引起任何兴趣(?),我查看了这里和其他与ssh和Gitlab相关的帖子,但大部分是涉及服务器端问题和安装问题。包括重新生成密钥在内的所有建议选项都没有任何效果。我尝试连接的Gitlab版本是GitLab 7.7.2 bd98290。
我使用putty-gen转换私钥以便能够加载(我尝试了3种可能的类型)。我可以在bitbucket和其他git服务器上使用ssh,所以我很困惑为什么每次都无法连接。有没有客户端的东西可以用来验证/调试连接?
Windows
我确实安装了cygwin,但已经有一段时间没用过了。它还链接回ssh的标准windows配置文件(当我第一次查看它们时为空的),我尝试过一些关于密码和LDAP以及各种git内存包/解包设置的添加,但这些都没有真正帮助解决问题。
我关闭了Windows防火墙,以查看它是否对通信产生影响,但迄今为止没有运气。
可重现性
其他人可以通过他们的SSH密钥连接到存储库,在相同的子网中。我也可以使用http版本,但每次在约88%的位置中断克隆过程,可能是因为repo太大了。我想使用reflog将其缩小,但首先必须能够在本地进行克隆,对吗?
提前感谢。

ssh_exchange_identification: read: Connection reset by peer。这与git或SSH密钥无关。远程SSH服务器在连接建立后立即断开连接。一个可能的解释是远程SSH服务器崩溃了。您需要在服务器端而不是客户端上进行故障排除。 - Kenster
看起来其他人可以很好地连接(使用OpenSSH和Linux客户端),所以我怀疑远程SSH并没有“崩溃”。这似乎更像是连接失败,可能与Windows有关。 - StarShine
你是否在与这些其他用户不同的网络上?有时防火墙会配置为发送连接尝试的重置,而不是仅仅将它们丢弃。 - Kenster
这是个奇怪的问题。正如我在帖子中提到的,我和服务器在同一个子网内。如果路由器以某种方式不同对待Windows连接,那么仍然可能是网络问题,但也许一些网络专家可以介入并解决问题。 - StarShine
1个回答

1
这是最终解决我的问题的方法。
1)我注意到在同一子网中无法使用http连接,但我成功地从另一个子网连接了http。
2)我使用git-ext删除了所有大文件。这真的是一种非常棒的工具。唯一的缺点是,即使它们已经被推送(强制)到所有分支上进行删除,它仍然会列出这些大文件。
3)由于某种原因,http和ssh现在都能正确地连接,即使在同一子网中。
也许一些网络gitlab专家知道是什么原因导致了这个问题?我遇到了某种门槛?网络故障?Gitlab失误?电线上的外星人?

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接