On 26/04/13 17:34, mick wrote:
One way to avoid locking yourself out when playing with iptables on a remote machine would be to add an entry to root's cron to flush the tables every N minutes or at time X (choose N or X to suit your circumstances). This will ensure that if the worst happens, then the tables will be deleted and you can get back in. But of course that will leave the box exposed for the period in which the tables are empty. Caveat emptor.
Given I do everything in screen now, what I tend to just do is something like
sleep 600;iptables-restore < /etc/iptables.rules (or wherever you saved the previous set of working rules)
In another screen window