V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
siwadiya
V2EX  ›  GitHub

ssh github 突然报 Connection closed?

  •  
  •   siwadiya · 2021-10-13 21:32:05 +08:00 · 5376 次点击
    这是一个创建于 897 天前的主题,其中的信息可能已经有所发展或是发生改变。

    今天 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 条回复    2022-01-17 14:20:23 +08:00
    Kobayashi
        1
    Kobayashi  
       2021-10-13 22:05:43 +08:00 via Android
    export GIT_SSH_COMMAND="ssh -vvv"
    AoEiuV020
        2
    AoEiuV020  
       2021-10-14 09:28:11 +08:00
    可能单纯是你梯子那个服务器本身连接 github 不通畅?
    我在用的机场最近就大部分节点连不上 github.com 的 ssh 端口,网页都正常,莫名,
    lixu111
        3
    lixu111  
       2021-10-20 00:41:33 +08:00   ❤️ 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  
       2022-01-17 14:20:23 +08:00
    @lixu111 谢谢你的答案,找了半天,改成 443 可行
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1335 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:44 · PVG 01:44 · LAX 10:44 · JFK 13:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.