git - ssh git kex_exchange_identification:读取:连接由对等方重置
问题描述
几天前一切正常。现在给我同样的ssh -T git@gitlab.com
输出。ssh -T git@github.com
kex_exchange_identification: read: Connection reset by peer
我在互联网上尝试了一些建议,但没有成功。我正在使用 Ubuntu 20.04 和 git 版本 2.25.1
ssh -Tv git@gitlab.com
给出这个输出
OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to gitlab.com [172.65.251.78] port 22.
debug1: Connection established.
debug1: identity file /home/fazar/.ssh/id_rsa type 0
debug1: identity file /home/fazar/.ssh/id_rsa-cert type -1
debug1: identity file /home/fazar/.ssh/id_dsa type -1
debug1: identity file /home/fazar/.ssh/id_dsa-cert type -1
debug1: identity file /home/fazar/.ssh/id_ecdsa type -1
debug1: identity file /home/fazar/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/fazar/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/fazar/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/fazar/.ssh/id_ed25519 type -1
debug1: identity file /home/fazar/.ssh/id_ed25519-cert type -1
debug1: identity file /home/fazar/.ssh/id_ed25519_sk type -1
debug1: identity file /home/fazar/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/fazar/.ssh/id_xmss type -1
debug1: identity file /home/fazar/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
kex_exchange_identification: read: Connection reset by peer
解决方案
检查您的 ssh 配置,如gitlab-org/gitlab
issue 121570
我发现我的 /etc/ssh/ssh_config 文件中的端口被意外更改了。
一旦我将端口改/etc/ssh/ssh_config
回 22,我就可以连接到 Gitlab。
尝试ssh -Tv git@gitlab.com
看到更多。
推荐阅读
- spring-cloud - 使用 Spring Cloud Gateway 的简单网关 - ProxyExchange
- python - 如何多次重命名文件(Python)
- mysql - SQL 查询查找未售出的 Woocommerce 产品
- c# - 列表中的数据绑定列表,uwp + xaml
- angular - 意外的令牌导入茉莉花
- javascript - 按特定 div 内的类隐藏引导元素
- matlab - 在每次迭代中更改打印输出编号的文本命令
- https - mysite https:// 我得到一个不安全的连接失败
- ios - 使用声音捕捉 Swift 放大/缩小 UIImage
- ffmpeg - FFMPEG MP4 转换需要很长时间,它不实用