Ubuntu – iptables rules stored on Digital Ocean Ubuntu 14.04

firewalliptablesUbuntu

I have a basic standard Ubuntu 14.04 droplet on digital ocean. I used ufw to set some firewall rules but forgot to open port 22 for SSH. I rebooted my server and could no longer log in so DO support booted me into recovery mode so I can fix this up.

Unfortunately I have no idea where the iptables or ufw config files are saved. I've googled for ages and tried all these locations and none exist:

  • /etc/iptables
  • /etc/ufw
  • /etc/sysconfig
  • /lib/ufw
  • /var/lib/iptables

Where could they possibly be?

Best Answer

Ah found them at /lib/ufw/user.rules. But it's actually mounted as /mnt/lib/ufw/user.rules in recovery mode.