Thymolblue
V2EX  ›  问与答

SSH 如何通过代理?

  •  
  •   Thymolblue · Aug 2, 2022 · 5775 views
    This topic created in 1379 days ago, the information mentioned may be changed or developed.

    今天学习 git 的时候发现下面的测试命令一直报错,git clone 无法克隆 ssh 地址

    $ ssh -T [email protected]
    kex_exchange_identification: Connection closed by remote host
    Connection closed by 198.18.0.3 port 22
    
    $ ssh -T -o ProxyCommand="connect.exe -S 198.18.0.3:21547 %h %p" [email protected]
    FATAL: Connection closed by peer.
    kex_exchange_identification: Connection closed by remote host
    Connection closed by UNKNOWN port 65535
    

    198.18.0.1 是 clash tun mode 虚拟网卡的地址

    如果关闭 clash ,ssh 就立即回复正常了

    环境是 windows 11

    git 和 windows 自带的 ssh 均是上面的结果

    9 replies    2023-08-16 12:11:41 +08:00
    EyebrowsWhite
        1
    EyebrowsWhite  
       Aug 2, 2022 via iPhone
    我也遇到过这个问题,我的解决是设置 22 端口不走代理,就可以了
    erguotou521
        2
    erguotou521  
       Aug 2, 2022 via Android
    用 443 端口
    Mystery0
        3
    Mystery0  
       Aug 2, 2022 via Android   ❤️ 1
    前两天刚遇到这个问题,加 22 端口的规则都不好使,换 443 才是好使的 https://docs.github.com/cn/authentication/troubleshooting-ssh/using-ssh-over-the-https-port
    waleslau
        4
    waleslau  
       Aug 2, 2022
    unsized
        5
    unsized  
       Aug 2, 2022 via iPhone
    Thymolblue
        6
    Thymolblue  
    OP
       Aug 2, 2022
    @tyx1703
    @waleslau
    @Mystery0
    @erguotou521
    @EyebrowsWhite
    感谢,改用 443 端口就解决了
    Thymolblue
        7
    Thymolblue  
    OP
       Aug 2, 2022
    遇到了新问题。问了一下机场客服,说是可能会阻断 22 端口,并不是本地软件的问题。
    yongSir
        8
    yongSir  
       Aug 3, 2022
    改端口,让我回忆起当年内网屏蔽 22 端口,我们挂 4G 改端口的日子了😭
    husldlq
        9
    husldlq  
       Aug 16, 2023
    @EyebrowsWhite openwrt passwall 如何设置 22 端口不走代理
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   999 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 22:17 · PVG 06:17 · LAX 15:17 · JFK 18:17
    ♥ Do have faith in what you're doing.