UPDATE: the project seems to be heavilly outdated: https://sourceforge.net/projects/denyhosts/files/denyhosts/
One can use Fail2ban instead.

How do you install and configure Denyhosts on CentOS?

Here is what worked for me: yum install denyhosts

add my IP (www.myip.ms) to the /etc/hosts.allow to whitelist myself. The line should look like this for example:
all: 1.2.3.4

configuration file (not required to modify it): /etc/denyhosts.conf

start the service: service denyhosts start

make the service to run at server start: chkconfig denyhosts on