Ok. I'm slow enough writing that others have started to answer also...
Vikas N Kumar wrote:
Working with hosts.deny is not a pf feature, but it might be glued
together.
Curt Micol wrote:
As Curt just answered, PF tables are an option. See also
http://www.openbsd.org/cgi-bin/man.cgi?query=pf.conf
I am getting good mileage out of "The Book of PF", and tables are
covered there pp 67-71 and pp 31-32. Maybe using PF's tables is enough
for you.
There are at least four pieces that might be useful if you really want a
script to add to hosts.deny.
1) pf.conf
2) pfctl
3) sshd_config
4) /var/log/authlog
Henri Salo wrote:
Basically, you can have the blocked addresses exported from the PF
table. From there they can be imported via a script into hosts.deny or
anywhere else you might want. The tool for that is pfctl with the "-t"
and "-T show" options:
http://www.openbsd.org/cgi-bin/man.cgi?query=pfctl
However, PF only logs the connections attempts. The sshd_config keyword
"MaxAuthTries" will specifically log failed attempts to log in, per
connection, if they exceed 1/2 the maximum number of tries for that
connection.
http://www.openbsd.org/cgi-bin/man.cgi?query=sshd_config
However, if each attempt is on a new connection, then that's not
necessarily a help for you.
The failed attempts will also show up in /var/log/authlog, regardless.
e.g. Apr 16 17:13:27 +gateway sshd[12708]: Failed password
for root from 218.106.52.91 port 58224 ssh2
And that can be parsed for addresses.
Regards,
-Lars
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
| Linus Torvalds | Re: 2.6.25-rc2 System no longer powers off after suspend-to-disk. Screen becomes g... |
git: | |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Ray Lee | Re: [BUG] New Kernel Bugs |
