To install Denyhost using yum, ensure that the EPEL repository is installed and enabled (refer to old post[3] albeit an older version).
Installation and configuration
- vi /etc/hosts.allow # whitelist any trusted hosts and/or networks
- yum install denyhosts # install the denyhosts package
- vi /etc/denyhosts.conf # change to suit, the file is well documented
- chkconfig denyhosts --level 2345 on # set runlevels to start daemon on
- service denyhosts start # manually start the daemon
- tail /var/log/denyhosts # confirm daemon started successfully
References:
- http://denyhosts.sourceforge.net/
- http://www.aczoom.com/blockhosts/
- http://nkush.blogspot.com.au/2011/10/installing-snort-2912-on-centos-57.html
I wrote a small (single use) script to generate a set of iptables rules from the tcpwrapper hosts.deny file to drop traffic from denied hosts.
for A in `egrep -v '^#' /etc/hosts.deny | tr -d '\t' | tr -d 'ALL:' | grep '[0-9]'`
do
echo "/sbin/iptables -I -s $A -j DROP"
done
No comments:
Post a Comment