[SLL] DenyHosts installation on Fedora Legacy

Paul Franz paul at eucleides.com
Fri Feb 27 00:00:20 PST 2009


I'm having difficulty getting DenyHosts working on Fedora Legacy.

Synopsis

Downloaded DenyHosts 2.6 source rpm, built and successfully installed the rpm.
Followed the configuration instructions. Starting was unsuccessful as it announced it
needed Python 2.3 or newer and suggested installing the most recent version of Python.
There is no more current rpm available for Fedora Core (Legacy) so I downloaded the
source tarball for Python 3.1 following the instructions for doing the build when
another version exists. I created daemon-control as instructed in the readme noting
the one changed line:

[root at Beaker denyhosts]# diff daemon-control daemon-control-dist
1c1
< #!/usr/local/bin/python3.0
---
> #!/usr/bin/env python
18c18
< PYTHON_BIN      = "/usr/local/bin/python3.0"
---
> PYTHON_BIN      = "/usr/bin/env python"

As instructed in the /usr/share/denyhosts/README.txt, I ran the first step:

[root at Beaker denyhosts]# python setup.py install
running install
running build
running build_py
error: package directory 'DenyHosts' does not exist

Possible problems.

I got the source rpm here:

<http://sourceforge.net/project/showfiles.php?group_id=131204&package_id=143910&release_id=469508>

I noted the presence of:
DenyHosts-2.6-1.src.rpm                Platform-Independent
DenyHosts-2.6-python2.3.noarch.rpm     Platform-Independent
DenyHosts-2.6-python2.4.noarch.rpm     Platform-Independent
DenyHosts-2.6-python2.5.rpm            None

As previously stated, I selected the src rpm, built and installed the result. But
maybe something specific for Python versions must be done? Here's the info and file
list from the installed rpm:

[root at Beaker denyhosts]# rpm -qil DenyHosts-2.6-1
Name        : DenyHosts                    Relocations: /usr
Version     : 2.6                               Vendor: Phil Schwartz <phil_schw      
                           artz at users.sourceforge.net>
Release     : 1                             Build Date: Sun 20 Jul 2008 03:58:55      
                            PM PDT
Install Date: Sun 20 Jul 2008 04:02:16 PM PDT      Build Host: Beaker.eucleides.      
                           com
Group       : Development/Libraries         Source RPM: DenyHosts-2.6-1.src.rpm
Size        : 260500                           License: GPL v2
Signature   : (none)
URL         : http://denyhosts.sourceforge.net
Summary     : DenyHosts is a utility to help sys admins thwart ssh hackers
Description :

DenyHosts is a python program that automatically blocks ssh attacks by adding en      
                           tries to
/etc/hosts.deny. DenyHosts will also inform Linux administrators about offending      
                            hosts, attacked
users and suspicious logins.
/usr/bin/denyhosts.py
/usr/lib/python2.2/site-packages/DenyHosts/__init__.py
/usr/lib/python2.2/site-packages/DenyHosts/__init__.pyc
/usr/lib/python2.2/site-packages/DenyHosts/allowedhosts.py
/usr/lib/python2.2/site-packages/DenyHosts/allowedhosts.pyc
/usr/lib/python2.2/site-packages/DenyHosts/constants.py
/usr/lib/python2.2/site-packages/DenyHosts/constants.pyc
/usr/lib/python2.2/site-packages/DenyHosts/counter.py
/usr/lib/python2.2/site-packages/DenyHosts/counter.pyc
/usr/lib/python2.2/site-packages/DenyHosts/daemon.py
/usr/lib/python2.2/site-packages/DenyHosts/daemon.pyc
/usr/lib/python2.2/site-packages/DenyHosts/deny_hosts.py
/usr/lib/python2.2/site-packages/DenyHosts/deny_hosts.pyc
/usr/lib/python2.2/site-packages/DenyHosts/denyfileutil.py
/usr/lib/python2.2/site-packages/DenyHosts/denyfileutil.pyc
/usr/lib/python2.2/site-packages/DenyHosts/filetracker.py
/usr/lib/python2.2/site-packages/DenyHosts/filetracker.pyc
/usr/lib/python2.2/site-packages/DenyHosts/lockfile.py
/usr/lib/python2.2/site-packages/DenyHosts/lockfile.pyc
/usr/lib/python2.2/site-packages/DenyHosts/loginattempt.py
/usr/lib/python2.2/site-packages/DenyHosts/loginattempt.pyc
/usr/lib/python2.2/site-packages/DenyHosts/old-daemon.py
/usr/lib/python2.2/site-packages/DenyHosts/old-daemon.pyc
/usr/lib/python2.2/site-packages/DenyHosts/plugin.py
/usr/lib/python2.2/site-packages/DenyHosts/plugin.pyc
/usr/lib/python2.2/site-packages/DenyHosts/prefs.py
/usr/lib/python2.2/site-packages/DenyHosts/prefs.pyc
/usr/lib/python2.2/site-packages/DenyHosts/purgecounter.py
/usr/lib/python2.2/site-packages/DenyHosts/purgecounter.pyc
/usr/lib/python2.2/site-packages/DenyHosts/python_version.py
/usr/lib/python2.2/site-packages/DenyHosts/python_version.pyc
/usr/lib/python2.2/site-packages/DenyHosts/regex.py
/usr/lib/python2.2/site-packages/DenyHosts/regex.pyc
/usr/lib/python2.2/site-packages/DenyHosts/report.py
/usr/lib/python2.2/site-packages/DenyHosts/report.pyc
/usr/lib/python2.2/site-packages/DenyHosts/restricted.py
/usr/lib/python2.2/site-packages/DenyHosts/restricted.pyc
/usr/lib/python2.2/site-packages/DenyHosts/sync.py
/usr/lib/python2.2/site-packages/DenyHosts/sync.pyc
/usr/lib/python2.2/site-packages/DenyHosts/util.py
/usr/lib/python2.2/site-packages/DenyHosts/util.pyc
/usr/lib/python2.2/site-packages/DenyHosts/version.py
/usr/lib/python2.2/site-packages/DenyHosts/version.pyc
/usr/share/denyhosts/CHANGELOG.txt
/usr/share/denyhosts/LICENSE.txt
/usr/share/denyhosts/README.txt
/usr/share/denyhosts/daemon-control-dist
/usr/share/denyhosts/denyhosts.cfg-dist
/usr/share/denyhosts/plugins/README.contrib
/usr/share/denyhosts/plugins/shorewall_allow.sh
/usr/share/denyhosts/plugins/shorewall_deny.sh
/usr/share/denyhosts/plugins/test_deny.py
/usr/share/denyhosts/scripts/restricted_from_invalid.py
/usr/share/denyhosts/scripts/restricted_from_passwd.py
/usr/share/denyhosts/setup.py

Noting that the DenyHosts directory and contents. I created that in the python3.0
structure by just copying the files:

[root at Beaker denyhosts]# locate python3 | grep package | grep Deny
/usr/local/lib/python3.0/site-packages/DenyHosts
/usr/local/lib/python3.0/site-packages/DenyHosts/__init__.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/__init__.py
/usr/local/lib/python3.0/site-packages/DenyHosts/allowedhosts.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/allowedhosts.py
/usr/local/lib/python3.0/site-packages/DenyHosts/denyfileutil.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/constants.py
/usr/local/lib/python3.0/site-packages/DenyHosts/constants.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/counter.py
/usr/local/lib/python3.0/site-packages/DenyHosts/counter.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/daemon.py
/usr/local/lib/python3.0/site-packages/DenyHosts/daemon.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/deny_hosts.py
/usr/local/lib/python3.0/site-packages/DenyHosts/deny_hosts.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/denyfileutil.py
/usr/local/lib/python3.0/site-packages/DenyHosts/loginattempt.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/filetracker.py
/usr/local/lib/python3.0/site-packages/DenyHosts/filetracker.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/lockfile.py
/usr/local/lib/python3.0/site-packages/DenyHosts/lockfile.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/loginattempt.py
/usr/local/lib/python3.0/site-packages/DenyHosts/purgecounter.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/old-daemon.py
/usr/local/lib/python3.0/site-packages/DenyHosts/old-daemon.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/plugin.py
/usr/local/lib/python3.0/site-packages/DenyHosts/plugin.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/prefs.py
/usr/local/lib/python3.0/site-packages/DenyHosts/prefs.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/purgecounter.py
/usr/local/lib/python3.0/site-packages/DenyHosts/python_version.py
/usr/local/lib/python3.0/site-packages/DenyHosts/python_version.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/regex.py
/usr/local/lib/python3.0/site-packages/DenyHosts/regex.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/report.py
/usr/local/lib/python3.0/site-packages/DenyHosts/report.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/restricted.py
/usr/local/lib/python3.0/site-packages/DenyHosts/restricted.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/sync.py
/usr/local/lib/python3.0/site-packages/DenyHosts/sync.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/util.py
/usr/local/lib/python3.0/site-packages/DenyHosts/util.pyc
/usr/local/lib/python3.0/site-packages/DenyHosts/version.py
/usr/local/lib/python3.0/site-packages/DenyHosts/version.pyc

Checking the rights on the two locations for the site packages:
[root at Beaker denyhosts]# ls -l /usr/local/lib/python3.0/site-packages/ | grep Deny
drwxr-xr-x  2 root root   4096 Feb 23 05:25 DenyHosts
[root at Beaker denyhosts]# ls -l /usr/lib/python2.2/site-packages/ | grep Deny
drwxr-xr-x  2 root root   4096 Jul 20  2008 DenyHosts

Any suggestions?

-- 
Paul Franz
425.440.9505 (O)
425.241.1618 (C)


More information about the linux-list mailing list