state —state NEW -m recent \
—set
iptables -I INPUT -p tcp —dport 22 -i eth0 -m state —state NEW -m recent \
—update —seconds 600 —hitcount 2 -j DROP
This iptable command will drop incoming connections which make more than 2 connection attempts upon port 22 within ten minutes/
Now how do i apply this to all ports ?
You're gonna block yourself by accident, often.
I'd just disable password authentication
Обсуждают сегодня