Installing DenyHosts on CentOS
1. Download & install the RPM.
2. Modify /etc/denyhosts.conf to your requirements.
3. Start service.
This is it you’re done however its not always that easy, some time you can get an error like this:
starting DenyHosts: /usr/bin/python /usr/bin/denyhosts.py –daemon –config=/etc/denyhosts.conf
Traceback (most recent call last):
File “/usr/bin/denyhosts.py”, line 5, in ?
import DenyHosts.python_version
ImportError: No module named DenyHosts.python_version
The first thing you want to check are the site packages.
libpython2.4.so.1.0
Is there only one file like shown above? Then are all the files still stored in python2.3. Which causes the problem. What we are going to do is copy all of the files from python2.3 to python2.4.
Now you have copied all the files to the python2.4 folder, try to start the service.
starting DenyHosts: /usr/bin/python2.4 /usr/bin/denyhosts.py –daemon –config=/etc/denyhosts.conf
It worked for me, so I hope it works for you too. If not.. Then you might have another problem. The only problem I can think of is that you have to change the /usr/bin/denyhosts to #!/usr/bin/env python2.4. You can read more about the bug HERE.
