OpenVZ Forum


Home » General » Support » iptables on VE0 to prevent SSH Attacks?  () 1 Vote
Re: iptables on VE0 to prevent SSH Attacks? [message #1644 is a reply to message #1122] Fri, 17 February 2006 18:07 Go to previous messageGo to previous message
almahdi is currently offline  almahdi
Messages: 2
Registered: February 2006
Junior Member
You may want to limit the number of times each IP connects per second to SSH..

Most of those Attacks are script based, there is an easy way to block them, we've been using it for a while on our servers.

----
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
----
This will limit incoming connections to port 22 to no more than 3 attemps in a minute. Any more will be dropped.

You can adjust the numbers yourself to limit connections further.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: application templates?
Next Topic: Config files
Goto Forum:
  


Current Time: Sat Jul 20 22:17:05 GMT 2024

Total time taken to generate the page: 0.02472 seconds