Atlantic.Net Blog

How to Install DenyHost on CentOS 6.7

Jose Velazquez
by Atlantic.Net (71posts) under VPS Hosting
Verified and Tested 08/11/15


In this How-To, we will walk you through the install and configuration of DenyHost on a CentOS 6.7 Server. DenyHosts is used by many System Administrators to protect their servers/networks from Brute force attacks and hackers. It is simple and effective in getting the job done with little experience. Due to the simplicity of DenyHost and the ability to manually configure your rules it is widely used as an alternative to Fail2ban which is a bit more complicated to use and configure. We will now work on getting it installed on your server.


You need a CentOS 6.7 server that is configured with a static IP address. If you do not have a server already, fire up a cheap and reliable virtual private server from Atlantic.Net.

Server Preparation

First, we need to make sure that your server is fully up-to-date by running the following command:

yum update

With the server up-to-date, we can continue and install DenyHost on CentOS 6.7.

Install DenyHost on CentOS 6.7

Download the EPEL repository with the following command:

sudo rpm -Uvh

Install the Deny Hosts package with the following:

sudo yum install denyhosts

We must make sure to allow your IP address to prevent yourself from being denied access. We do this editing the following:

nano /etc/hosts.allow

Add the following line all the way to the bottom of the description with your IP. In most cases, you can use this link to find your IP address.


Next we need to block everything by editing the following file:

nano /etc/hosts.deny

Add the following line all the way to the bottom of the description:

 sshd: ALL   **

Save your work and restart DenyHosts with the following command:

/etc/init.d/denyhosts restart

You can further configure any settings in the DenyHosts.conf file by going to the following and updating according to your preference.

nano /etc/denyhosts.conf

Congratulations! You have just installed DenyHosts on your CentOS 6.7 Server. Thank you for following along in this How-To! Check back with us for any new updates, and browse our full lineup of our VPS hosting.

Get A Free To Use Cloud VPS

Free Tier Includes:
G2.1GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G2.1GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4


London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom