Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] modifying iptables: how can I prevent locking me out?
Date: Mon, 24 Jan 2011 22:33:30
Message-Id: 201101250031.06990.alan.mckinnon@gmail.com
In Reply to: Re: [gentoo-user] modifying iptables: how can I prevent locking me out? by "J. Roeleveld"
1 Apparently, though unproven, at 23:40 on Monday 24 January 2011, J. Roeleveld
2 did opine thusly:
3
4 > On Monday 24 January 2011 19:47:43 Jarry wrote:
5 > > Hi,
6 > >
7 > > I have to change rather complex iptables rules on server
8 > > and I do not want to lock me out as this server is about
9 > > 50 miles away. So how should I do it?
10 > >
11 > > I can back up the old rules by running:
12 > > /etc/init.d/iptables save
13 > > and it will be saved to /var/lib/iptables/rules-save
14 > > (some strange format starting with number like [536:119208])
15 > >
16 > > I prepared a script with new (modified) iptables-rules,
17 > > which I will run in bash. But in case I screw something,
18 > > how could I force netfilter to load old saved rules,
19 > > if I for whatever reason do not connect to server (ssh)?
20 > >
21 > > Or can I load new iptables-rules for certain time, and
22 > > then force netfilter to load back the old rules again?
23 > >
24 > > Jarry
25 >
26 > You could add the necessary rule(s) to ensure existing connections stay
27 > active.
28 > That way you can enable the new rules and test by openening a new SSH-
29 > connection to the server.
30 > If that works, you're ok.
31 > If not, you can use the existing SSH-connection to go back to the old
32 > rules.
33
34 It's no help to the OP now, but around here we have a rule:
35
36 Remote servers without a DRAC do not get installed. Period.
37
38
39 --
40 alan dot mckinnon at gmail dot com