ssh 端口转发在 10 个同时连接后冻结

Mar*_*vac 6 ssh proxy port-forwarding ssh-tunnel

我正在使用端口转发来利用远程机器上的代理服务器。

远程机器主机名是remotemachine. 代理正在侦听 8118 端口。我正在将此端口转换为本地端口 5223。

ssh -vvv -N remotemachine -L 5223:localhost:8118
Run Code Online (Sandbox Code Playgroud)

如果我不使用超过 10 个同时连接,当 ssh 冻结时,一切都很好。它不再通过端口转发发送数据。

ab -c 10 -t 5 -X 'localhost:5223' 'http://www.google.ru/'工作,但ab -c 20 -t 5 -X 'localhost:5223' 'http://www.google.ru/'导致 ssh 冻结

MaxSessions 30参数 in/etc/ssh/sshd_config根本没有帮助。

我该怎么做才能消除这 10 个连接限制?

-vvv输出中没有什么有趣的=(

小智 1

您确定本地转发设置正确吗?您的端口转发的目的地应该是remotemachine而不是localhost

ssh -vvv -N remotemachine -L 5223:remotemachine:8188
Run Code Online (Sandbox Code Playgroud)