If ufw reports “Status: inactive” on Ubuntu 20.04, the firewall is installed but filtering nothing. Here is how to enable it without locking yourself out of SSH.
How to activate an inactive UFW on Ubuntu 20.04 step-by-step instructions
- First, check your current UFW status:
$ sudo ufw status Status: inactive - Activate UFW:
$ sudo ufw enable Firewall is active and enabled on system startup - (optional) Check UFW status:
$ sudo ufw status Status: activeOnce the UFW is enabled, these settings should persist after the system reboots.
