Take the 2-minute tour ×

I would like to be able to use ssh, but I end up getting an timeout intermittently.

Here is how I can reproduce the error on the server in question:

$ ssh <user>@<server> ls # returns contents as expected
$ ssh <user>@<server> ls # " " " " 
$ ssh <user>@<server> ls # times out
ssh: connect to host <server> port 22: Connection timed out

if I wait about 10 minutes or so, it will work again for the first three times. The system administrators have not been able to identify the issue.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

It is probably a connection rate limit, imposed by the platform's equivalent of iptables. Three connections per minute is the most common setting, which looks suspiciously like what you're seeing.

share|improve this answer
thanks, are you referring to the iptables --limit rate settings? I am finding man iptables pretty dense, e.g. 'limit : This module matches at a limited rate using a token bucket filter' –  Abe Oct 31 '11 at 22:14
No, that limits the traffic rate. I'm talking about limits to the connection rate from distinct source IP addresses. Check the manpage under recent and look at hitcount and seconds. (The link in my answer has examples.) –  David Schwartz Oct 31 '11 at 22:16
When asked, the sysadmins say 'I can almost guarantee you that is the case.' and 'I totally forgot about the ssh firewall rule'. Thanks for helping us identify the issue. –  Abe Nov 1 '11 at 14:50

Your Answer


