For automated blocking of attackers try denyhosts. DenyHosts is a script intended to be run by Linux system administrators to help thwart SSH server attacks (also known as dictionary based attacks and brute force attacks).
http://www.cyberciti.biz/faq/block-ssh-attacks-with-denyhosts/