What are the best tools to prevent Brute force attacks against ssh and FTP on Linux servers ?
|
|
It's not to everyone's tastes but I really like DenyHosts for broad-brush blocking of automated probes to sshd : http://denyhosts.sourceforge.net/ I use it in a very paranoid mode, if you trip it - you get an entry in hosts.deny with an ALL: prefix, not just an SSH: one. You can allow denyhosts to purge the deny list on a periodic basis if you so wish. |
|||
|
|
|
Check out fail2ban. http://www.fail2ban.org/wiki/index.php/Main_Page it's very handy to prevent bruteforce attacks on http, ftp, stmp servers etc. |
||||
|
|
|
On SSH, tips: That for password authentication. I would avoid the brute force attack using RSAAuthentication with public keys with a good passphrase only available for the users I want. Also change the default port used for SSH and use another one distinct to 22 in the free available range and set iptables to filter the in traffic. |
|||
|
|
|
You can also use iptables to do rate limiting for any port you want. It's very flexible. |
|||
|
|
|
First, check if the module is there or not To protect the User from Brute force attack:
Then, edit Add at the last line:
Open another terminial and check using user name and wrong password. To lock a Particular User: edit
Open another terminial and check using user name and wrong password. Notes: |
||||
|
|
|
use Netfilter's 'recent' module and nip it in the bud at the kernel level. Also this solution is not application specific (i.e. does not rely on application configuration) |
|||
|
|
|
You could also consider protecting your domain from the DNS level. Something like CloudFlare Or Incapsula. They both offer free plans, but ultimately they are paid for services. I use the free service for my website. It does not block all attacks, but it is all about the layers of security. |
|||
|
|
|
"You could also consider protecting your domain from the DNS level. Something like CloudFlare " We actually can't proxy traffic on these ports (SSH, ftp) because we work only on web traffic (ports like 80 and 443). You might want to look at something like Dome9. |
|||
|
|
|
Try reading through Linux Security HOWTO from TLDP and then possibly refine your question if it does not provide the answer already. EDIT (after question update): In addition to all of the above (most classifiable as intrusion detection) there is also port knocking. It does not prevent brute force attacks, but it hardens the system in several ways
I found this reply to critique of the system quite informative. |
||||
|
|