Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a configuration for this without installing 3rd party software?

share|improve this question

2 Answers 2

You can do rate-limiting easily with iptables, and this can be done without giving the machine a full firewall.

The code is

# rate-limit connections to sshd
iptables -A INPUT -p tcp --syn --dport 22 -m recent --name sshattack --set
iptables -A INPUT -p tcp --dport 22 --syn -m recent --name sshattack --rcheck --seconds 60 --hitcount 3 -j LOG --log-prefix 'SSH REJECT: '
iptables -A INPUT -p tcp --dport 22 --syn -m recent --name sshattack --rcheck --seconds 60 --hitcount 3 -j REJECT --reject-with tcp-reset

which will only allow two connections from any given IP address, in a rolling 60-second window. You will need to be careful to put these rules in the right place in your INPUT chain.

See my writeup for more information, if you're interested.

share|improve this answer

No, not that I know of. There is no such thing with openssh.

What you have is

MaxStartups
    Specifies the maximum number of concurrent unauthenticated connections 
    to the SSH daemon.  Additional connections will be dropped until authentication 
    succeeds or the LoginGraceTime expires for a connection. The default is 10.

But I don't think this is what you were looking for.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.