Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#38084 closed defect (fixed)

denyhosts @2.6.4 exits (2) in MacOS X 10.8 (Mountain Lion)

Reported by: catkfr@… Owned by: nerdling (Jeremy Lavergne)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cooljeanius (Eric Gallager)
Port: denyhosts


This should be an add-on to ticket #35477 but have not found how to do that.

On a fresh install on denyhosts, denyhosts would exit with error 2 in system.log.

I have followed the README.txt and launched by hand daemon-control:

denyhosts$ sudo ./daemon-control start
starting DenyHosts:    /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/ --daemon --config=/opt/local/share/denyhosts/denyhosts.cfg
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/", line 164, in <module>
    first_time, noemail, daemon)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DenyHosts/", line 78, in __init__
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DenyHosts/", line 272, in get_denied_hosts
    for line in open(self.__prefs.get('HOSTS_DENY'), "r"):
IOError: [Errno 2] No such file or directory: '/etc/hosts.deny'

Turns out: creating the file /etc/hosts.deny fixes the problem.

I did a "sudo touch /etc/hosts.deny" and could then launch the daemon without any issues.

As a summary, this is what I did installing denyhosts on Mountain Lion requires:

  • creating denyhosts.cfg and daemon-control in /opt/local/share/denyhosts
  • changing
  • doing
    sudo touch /etc/hosts.deny
  • finally launching
    sudo port load denyhosts

Hope this helps.

Change History (6)

comment:1 Changed 8 years ago by ryandesign (Ryan Schmidt)

Owner: changed from macports-tickets@… to snc@…
Port: denyhosts added

comment:2 Changed 8 years ago by catkfr@…

The above got denyhosts "working" in the sense that it fills properly the /etc/hosts.deny file. Beware that on Mac OS X 10.8 ML, this does not do anything since TCP Wrappers have been removed from the system.

Alternative solution that is recommended is sshguard available in macports

comment:3 in reply to:  2 Changed 8 years ago by nerdling (Jeremy Lavergne)

Resolution: fixed
Status: newclosed
Version: 2.1.3

Blocked installation on Snow Leopard (and newer). r103268

comment:4 Changed 8 years ago by jmroot (Joshua Root)

Shouldn't it just depend on tcp_wrappers?

comment:5 in reply to:  4 Changed 8 years ago by nerdling (Jeremy Lavergne)

Patches welcome. I still run on Snow Leopard.

comment:6 Changed 8 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.