| I have a friend who has an ubuntu server at a remote datacenter (not cloud based unfortunately), the other day he set up the ufw firewall and even though he assures me he added his IP address to the rules, he was locked out when he enabled the firewall sudo ufw allow from his-ip-address
sudo ufw allow
ssh sudo ufw enable It ended up costing him over £200 to pay for out-of-hours support for an engineer to drive to the data centre and restart the server. He still needs to enable the firewall, but is very worried about getting locked out again. How can he do this without locking himself out? My initial ideas are : 1. have a crontab that runs every 10 minutes to disable the firewall. Then enable the firewall, test he can still gain access. If not, worst case he is locked out for 10 minutes 2. run a shell script that enables the firewall, sleeps for a few minutes, and then disables it This would need to run in something like tmux so that when the session is killed by the firewall the script will continue running Is there a better way? I have already suggested he take a look at moving to AWS - but that may take some time. Thanks |