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

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

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

 ssh -vvv -N remotemachine -L 5223:localhost:8118 

一切都很好,如果我不使用超过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冻结

/etc/ssh/sshd_config MaxSessions 30参数完全没有帮助。

我能做些什么来消除这10个连接限制?

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

仅供参考,我有一个非常类似的问题,并将MaxSessions撞到100固定它。 我是唯一一个在这台服务器上使用SSH,所以高限不是我的问题。

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

 ssh -vvv -N remotemachine -L 5223:remotemachine:8188 

在服务器上,查看sshd_config中的MaxStartups。

从手册页:

 MaxStartups Specifies the maximum number of concurrent unauthenticated con- nections to the sshd daemon. Additional connections will be dropped until authentication succeeds or the LoginGraceTime expires for a connection. The default is 10. Alternatively, random early drop can be enabled by specifying the three colon separated values ``start:rate:full'' (eg, "10:30:60"). sshd will refuse connection attempts with a proba- bility of ``rate/100'' (30%) if there are currently ``start'' (10) unauthenticated connections. The probability increases lin- early and all connection attempts are refused if the number of unauthenticated connections reaches ``full'' (60). 

我会认为这是某种服务器configuration。 如果你build立了两个隧道并且打开(比如说)8个连接,那么会发生什么?冻结( – >整个服务器限制)还是不是( – >每个连接的限制)?