DenyHosts
From Consultancy.EdVoncken.NET
I strongly recommend installing DenyHosts or comparable software on every Internet-facing host that exposes an SSH server.
DenyHosts works by scanning the log files for suspicious behavior. If an attack is detected, the offending host is (temporarily) placed in /etc/hosts.deny, the TCP Wrapper configuration file.
You can configure if offenders are only blocked from SSH, or from any network service on your host.