Blockhosts is an application that provides a way to automatically block abusive IP hosts. Here are the steps required to get blockhosts installed.
- Download blockhosts
- Read over the install doc that is contained in the download.
- Install the Software. You can either choose to install it locally or use the remote rpm command (see install doc)
- Read the install doc for configuration of the software. You have to configure it before you run it the first time.
# python setup.py install --force
# python setup.py --dry-run install --force
- edit the /etc/hosts.allow file and insert the required elements (see install doc)
- Test your install.
# /usr/bin/blockhosts.py --verbose
- Examine /etc/hosts.allow and you will probably have new information stored between "#---- BlockHosts Additions"
- Now edit /etc/blockhosts.cfg and uncomment the line COUNT_THRESHOLD = 7 so that the system will block connections after 7 failed attempts. Note: I normally run this at like 5 or less.
- You can also uncomment the line AGE_THRESHOLD to increase how long something is blocked.
- For further testing, have someone you know try to ssh into your system more than the level you have set and see if they appear in the blockhost file.
An overview of installing Blockhost