01 Feb 2022 - David Baker
Tags: digitalocean linux
If you’re like me you might’ve locked yourself out of your DigitalOcean linux droplet by enabling your firewall using sudo ufw enable
without allowing SSH first. This means that after you exit the terminal you will no longer be able to SSH into the droplet from either your own terminal or the DigitalOcean console.
You have 2 options now, but first you have to use the DigitalOcean recovery console to turn off the firewall first. The recovery console works with VNC instead of SSH which is why we can use it while the firewall blocks ssh.
And run:
sudo ufw disable
Now, your 2 options are:
sudo ufw allow ssh
sudo ufw enable
Hopefully this helps someone. Obviously this doesn’t apply to me since I would never, ever, make this mistake, multiple times.