IPv6, ssh, and tcp-wrappers question
gentoo linux
kernel-2.6.12.3
I'm trying to implement denyhosts to monitor my linode to thwart ssh brute-force attacks. This program monitors your syslogs and creates entries in /etc/hosts.deny for offending hosts.
The IPv6 support in the kernel is seeming to cause problems. In my syslog, all of the IP addresses are being logged in their IPv6 form. Whenever I try and enter one of those addresses (either in their v4 or v6 forms) in my hosts.deny file, it doesn't actually block the host. I'm not really sure where the problem lies.
Any ideas?
6 Replies
What does your /etc/hosts.deny entry look like? Can you give an example?
It could look something like this:
sshd: [2001:499:23f::5e]
or
sshd: [2001:499:23f::5e]/120
First form is for a single IP (aka /128 in IPv6)
Second form is for a subnet (in this case, a /120 subnet, aka 256 hosts)
Make sure you do not have 'sshd: ALL' in your /etc/hosts.allow file or it will not check /etc/hosts.deny for sshd at all.
(See the man page for hosts.allow to see how it processes both file. It has some subtle behavior you need to be aware of.)
Also, what is the name of this program? It sounds interesting.
DenyHosts
A masked ebuild has recently become available in portage for it. I unmasked it and have been using it on several servers for about a week now, and it's working perfectly.
@anderiv:
Sorry for the delay in my response…the program is called
. DenyHostsA masked ebuild has recently become available in portage for it. I unmasked it and have been using it on several servers for about a week now, and it's working perfectly.
Thanks!!!! I'm now sufficiently annoyed with all the silly ssh probes, and had been looking at my ssh log when I saw your post.
@anderiv:
Sorry for the delay in my response…the program is called
. DenyHosts
On seeing this post maybe a week ago, I decided to give it a try. It turned out to be amazingly easy to setup, cleans up after itself, and has been doing a great job.
I'm assuming you got your IPv6 issue worked out? If so, what turned out to be the issue?