在使用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
Logo

一站式 AI 云服务平台

更多推荐