[问与答] SSH 如何通过代理?

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

$ ssh -T git@github.com
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" git@github.com
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 均是上面的结果

发表评论

您的电子邮箱地址不会被公开。