1 |
On Sunday 01 April 2007 14:03, Daniel Iliev wrote: |
2 |
> Hi, guys |
3 |
> |
4 |
> Recently I was looking through my logs when I got pissed off (again) by |
5 |
> the big number of lines showing something like 'sshd: auth. error: |
6 |
> unknown user "XXX" from "some IP address"'. I wrote a script which |
7 |
> automatically sets all connections from those IP addresses to be |
8 |
> dropped. Next I decided to change "-j DROP" with "-j TARPIT" and I |
9 |
> realized that gentoo-sources doesn't provide the netfilter target "TARPIT". |
10 |
> |
11 |
> My question: what is the best way get this iptables module working w/o |
12 |
> diverting too much from the official Gentoo installation. I mean the |
13 |
> normal way is to use patch-o-matic to patch iptables source and vanilla |
14 |
> kernel source, then build and install. I have the feeling that it is not |
15 |
> exactly the right thing to with Gentoo. |
16 |
> |
17 |
> Any advices would be much appreciated. |
18 |
|
19 |
Given that others have already replied how patch the kernel, here's a somewhat |
20 |
indirect answer which may resolve the route cause: Are you using passwd |
21 |
authentication? I wonder if the logs would still be filling up by such |
22 |
botnets if you had allowed only 'PubkeyAuthentication yes'. The other thing |
23 |
to consider is changing the default ssh port 22 to some other random port |
24 |
which is not hit as frequently by botnets, only by more comprehensive port |
25 |
scans. Then remove your iptables LOG rule for port 22 (if you have one) and |
26 |
you should get rid of almost all related messages. |
27 |
|
28 |
HTH. |
29 |
-- |
30 |
Regards, |
31 |
Mick |