siwadiya
V2EX  ›  GitHub

ssh github 突然报 Connection closed?

  •  
  •   siwadiya · Oct 13, 2021 · 7612 views
    This topic created in 1849 days ago, the information mentioned may be changed or developed.

    今天 ssh github 突然报错连不上了。

    Connection to github.com port 22 [tcp/ssh] succeeded!
    kex_exchange_identification: Connection closed by remote host
    

    查了一下说是 ProxyCommand 的问题。

    于是我把 config 文件里的ProxyCommand nc -v -x 127.0.0.1:7890 %h %p 给注释了,然后访问成功了。

    但是之前一直是可以的,有大佬帮解释下这是什么原因吗?

    4 replies  •  2022-01-17 14:20:23 +08:00
    Kobayashi
    Kobayashi
    Oct 13, 2021 via Android
    1
    export GIT_SSH_COMMAND="ssh -vvv"
    AoEiuV020
    AoEiuV020
    Oct 14, 2021
    2
    可能单纯是你梯子那个服务器本身连接 github 不通畅?
    我在用的机场最近就大部分节点连不上 github.com 的 ssh 端口,网页都正常,莫名,
    lixu111
    lixu111
    Oct 20, 2021❤️7
    3
    我最近也遇到了,可能是梯子的服务器做了什么修改禁止了 22 端口。根据 https://docs.github.com/cn/authentication/troubleshooting-ssh/using-ssh-over-the-https-port 的配置改成 443 端口就可以了。
    我的配置:
    Host github.com
    hostName ssh.github.com
    User git
    Port 443
    ProxyCommand nc -v -x 127.0.0.1:7890 %h %p
    kil
    kil
    Jan 17, 2022
    4
    @lixu111 谢谢你的答案,找了半天,改成 443 可行
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2278 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:41 · PVG 19:41 · LAX 03:41 · JFK 06:41
    ♥ Do have faith in what you're doing.