Works out of the box to prevent brute force attacks against ssh, and can also be configured for other services, like web authentication, POP, IMAP, etc.
Just a friendly tip: Try to verify whether Fail2ban actually works and keep monitoring your log files (Logwatch). I once found some dumb ass trying to brute force his way into my Postfix server, unfortunately Fail2ban didn't catch it and I only noticed when Logwatch showed me the authentication failures (several hours and thousands of attempts later).
apt-get install fail2ban
Works out of the box to prevent brute force attacks against ssh, and can also be configured for other services, like web authentication, POP, IMAP, etc.