Using iptables, you can ban for like 5 minutes an IP that has failed X times.
It goes something like this :
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 300 --hitcount 10 -j DROP
That example bans for 300 seconds after 10 unsuccessful tries.