So I wish to install denyhosts, installed and enabled the epel repository, but yum install denyhosts still can't find it. I have to notice that I managed to do it on CentOS 6.4 the same easy way, but on version 7 this doesn't work.

repo id                       repo name                           status
base/7/x86_64                 CentOS-7 - Base                     enabled: 8,465
base-debuginfo/x86_64         CentOS-7 - Debuginfo                disabled
base-source/7                 CentOS-7 - Base Sources             disabled
centosplus/7/x86_64           CentOS-7 - Plus                     disabled
centosplus-source/7           CentOS-7 - Plus Sources             disabled
epel/x86_64                   Extra Packages for Enterprise Linux enabled: 5,923
epel-debuginfo/x86_64         Extra Packages for Enterprise Linux disabled
epel-source/x86_64            Extra Packages for Enterprise Linux disabled
epel-testing/x86_64           Extra Packages for Enterprise Linux disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux disabled
epel-testing-source/x86_64    Extra Packages for Enterprise Linux disabled
extras/7/x86_64               CentOS-7 - Extras                   enabled:    44
extras-source/7               CentOS-7 - Extras Sources           disabled
fasttrack/7/x86_64            CentOS-7 - fasttrack                disabled
updates/7/x86_64              CentOS-7 - Updates                  enabled:   944
updates-source/7              CentOS-7 - Updates Sources          disabled
repolist: 15,376

No package denyhosts available.
Error: Nothing to do

UPDATE I believe the issue is related to the EPEL 7 library, the /beta/ has been taken out from the official URL. I'm not completely sure where it is at http://dl.fedoraproject.org/pub/epel/7/x86_64/

2 Answers 2


Counter to what Chris says, DenyHost does not use iptables or any other firewalling system, it uses /etc/hosts.allow and /etc/hosts.deny which are used by tcpd and sshd among others.

Not clear why they are missing from CentOS 7 EPEL, but the firewall change is unlikely to be the cause ... FreeBSD doesn't have iptables and it has denyhosts, for example. I just grepped through the denyhost script (it's in python). 'iptables' appears nowhere.

While I am loathe to install things outside of the package management system it appears the code for denyhosts has not changed since 2008 (at least in sourceforge) so it's probably OK to download and install it directly: http://denyhosts.sourceforge.net/

At least it works, but does require reading README.TXT to install. The instructions are quite complete and include getting it into chkdconfig/service control.

I have just verified this works fine under CentOS 7 here.


In CentOS 7 the default firewall is firewalld, not iptables. The denyhosts tool currently works with iptables. If you absolutely must have denyhosts, you may want to try manually disabling firewalld, installing and activating iptables, and then dong a force install of the el6 version of denyhosts.

How to revert to iptables: http://www.tejasbarot.com/2014/08/02/rhel-7-centos-7-disable-firewalld-and-use-iptables/

Alternatively, you could try installing fail2ban-hostsdeny Its in EPEL, and since it integrates into fail2ban it is probably a more robust solution. That's the route I'm exploring right now.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.