在使用ncat让git的ssh协议走上代理,遇到如下错误
ssh_exchange_identification: Connection closed by remote host

我的~/.ssh/config
Host github.com
Hostname github.com
User git
IdentityFile ~/.ssh/id_ed25519
ProxyCommand E:/Applications/nmap-7.91/ncat.exe --proxy 127.0.0.1:8889 --proxy-type socks5 %h %p
不知道是什么问题,经过多方搜索,终于找到了答案,是ncat本身的问题
https://github.com/nmap/nmap/issues/2149
这issue是最近才提出的,我好几个月前就遇到了这个问题,没想到居然是ncat的问题,哼哼哼
经过测试7.91和7.90版本都存在问题,7.80版本可以正常使用

只需要安装7.80版本的nmap,修改~/.ssh/config即可
Host github.com
Hostname github.com
User git
IdentityFile ~/.ssh/id_ed25519
ProxyCommand E:/Applications/nmap-7.80/ncat.exe --proxy 127.0.0.1:8889 --proxy-type socks5 %h %p

本文解决了使用ncat为git的SSH协议配置代理时遇到的连接被远程主机关闭的问题。发现问题是ncat版本导致,通过回退到7.80版本解决。
472

被折叠的 条评论
为什么被折叠?



