Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One IP address was accessing my site too frequently to be a real user, it was accessing so much that it caused site to slow down. Is there any application that can automatically block IP, if it is accessing too frequently to my site? My server is Linux Debian.

share|improve this question

You can use fail2ban to do this. You will probably have to write a custom jail for it, to read your server log and determine how many attempts is too many. Be careful that you don't ban legitimate users.

share|improve this answer

You can use iptables for this.

iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set

iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP

These two rules will limit incoming connections to port 22 to 3 attemps in a minute, any more than that will be dropped.

See source.

share|improve this answer

I can see, that Snort can do it too and a lot more.

share|improve this answer

Your Answer


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.