Gentoo Archives: gentoo-security

From: "Lasse B. Jensen" <gymer@××××××××××××××××××.dk>
To: Andrew Gaffney <agaffney@×××××××××××.com>
Cc: gentoo-security@l.g.o
Subject: Re: [gentoo-security] blocking SSH probes
Date: Mon, 09 Aug 2004 06:23:17
Message-Id: Pine.LNX.4.60.0408090819170.29218@sutsko.kollegie.dk
In Reply to: [gentoo-security] blocking SSH probes by Andrew Gaffney
1 You cannot just add the sleep function. I will only give 1 minute sleep
2 when you initialing your firewall.
3
4 The best thing you can do i to only allow certaion ips to connect to your
5 server, fx:
6
7 iptables -A INPUT -p tcp --dport 22 -s 192.168.0.2 -j ACCEPT
8 iptables -A INPUT -p tcp --dport 22 -j DROPA
9
10 Which will drop alle connections to port 22 (ssh) expect connections from
11 192.168.0.2 (more can easily be added)
12
13 --
14 Kind regards
15 Lasse B. Jensen
16
17 On Sun, 8 Aug 2004, Andrew Gaffney wrote:
18
19 > I'm getting really annoyed with these SSH probes. While I don't have any weak
20 > accounts, I still want to cover myself. I want to add an iptables DROP rule
21 > for 1 minute for any IP that has a failed login through SSH. I already have
22 > metalog set to run a script which emails me whenever there is a failed login
23 > attempt (I've had this for a while). Can I just add:
24 >
25 > iptables -A INPUT -s $IP_OF_PROBE -j DROP # to make their scans slower
26 > sleep 60s
27 > iptables -D INPUT -s $IP_OF_PROBE -j DROP
28 >
29 > to the end of my script? I want it at one minute in case I'm logging in via
30 > SSH from a computer where I don't have keys setup and I accidentally type the
31 > wrong password ;) Is there a problem with this idea?
32 >
33 > --
34 > Andrew Gaffney
35 > Network Administrator
36 > Skyline Aeronautics, LLC.
37 > 636-357-1548
38 >
39 >
40 > --
41 > gentoo-security@g.o mailing list
42 >
43 >
44 >
45
46 --
47 gentoo-security@g.o mailing list

Replies

Subject Author
Re: [gentoo-security] blocking SSH probes Andrew Gaffney <agaffney@×××××××××××.com>
Re: [gentoo-security] blocking SSH probes cummings@××××××××.net