Hacker News new | ask | show | jobs
by ruttiger 4655 days ago
I made the mistake of accidentally setting the firewall too strict on a remote server, killing my ability to SSH. A neat little trick I found was to setup a scheduled task to kill the firewall in 5 minutes, and then restart it. If it's too restrictive and locks you out, wait 5 minutes. If you did it right, then kill the scheduled task.
3 comments

You can just use iptables-apply. It achieves the same thing and is built-in. If you don't confirm the changes after they are applied, because you locked yourself out, they will be rolled back.
This is in the article FWIW.
APF, which is basically just a simplified way of setting up IPTables rules, does this.

http://www.rfxn.com/projects/advanced-policy-firewall/

or

apt-get install apf-firewall

Install dome9 to remotely configure the iptables. Never be locked out of your server again