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

  1.  First, check your current UFW status:
    $ sudo ufw status
    Status: inactive
  2. Activate UFW:
    $ sudo ufw enable
    Firewall is active and enabled on system startup
    
  3. (optional) Check UFW status:
    $ sudo ufw status
    Status: active
    

    Once the UFW is enabled, these settings should persist after the system reboots.

Was this answer helpful? 3 Users Found This Useful (6 Votes)