V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
siwadiya
V2EX  ›  GitHub

ssh github 突然报 Connection closed?

  •  
  •   siwadiya · Oct 13, 2021 · 7017 views
    This topic created in 1666 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
        1
    Kobayashi  
       Oct 13, 2021 via Android
    export GIT_SSH_COMMAND="ssh -vvv"
    AoEiuV020
        2
    AoEiuV020  
       Oct 14, 2021
    可能单纯是你梯子那个服务器本身连接 github 不通畅?
    我在用的机场最近就大部分节点连不上 github.com 的 ssh 端口,网页都正常,莫名,
    lixu111
        3
    lixu111  
       Oct 20, 2021   ❤️ 7
    我最近也遇到了,可能是梯子的服务器做了什么修改禁止了 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
        4
    kil  
       Jan 17, 2022
    @lixu111 谢谢你的答案,找了半天,改成 443 可行
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2772 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 15:45 · PVG 23:45 · LAX 08:45 · JFK 11:45
    ♥ Do have faith in what you're doing.