hosts.allow
and hosts.deny
are deprecated. They are used by TCP Wrappers, host-based access control, http://en.wikipedia.org/wiki/TCP_Wrapper
If you want to block access to a service, you need to find whether that service has been compiled with TCP Wrappers. I highly doubt that Ubuntu services still use TCP Wrappers.
The TCP Wrappers library is found in /lib/libwrap.so.0
If you want to check whether lighttpd
(Web server) supports TCP Wrappers, run
> ldd /usr/sbin/lighttpd
linux-vdso.so.1 => (0x00007fff2a5ff000)
libpcre.so.3 => /lib/libpcre.so.3 (0x00007f69af837000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f69af633000)
libattr.so.1 => /lib/libattr.so.1 (0x00007f69af42d000)
libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00007f69af1db000)
libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00007f69aee4b000)
libfam.so.0 => /usr/lib/libfam.so.0 (0x00007f69aec42000)
libc.so.6 => /lib/libc.so.6 (0x00007f69ae8bf000)
/lib64/ld-linux-x86-64.so.2 (0x00007f69afa90000)
libz.so.1 => /lib/libz.so.1 (0x00007f69ae6a8000)
> _
It does not mention libwrap
, so at least this service does not support TCP Wrappers, and will ignore /etc/hosts.{allow, deny}
.