security.frabs.net
All Guides

Open Services · about 5 minutes

Turn On a Firewall

What This Means

Nothing filters incoming traffic, so every service that listens is open to the internet.

Why It Matters

A firewall that allows only the ports you mean to offer stops a forgotten or misconfigured service from being exposed.

Before you start

Always allow SSH before turning the firewall on, or you'll lock yourself out.

  1. 1

    Check the firewall's status

    Ubuntu and Debian come with ufw, which is off until you turn it on.

    ufw status
    Terminal: Check the firewall's status, on Ubuntu 24.04
  2. 2

    Allow SSH first

    ufw allow OpenSSH
    Terminal: Allow SSH first, on Ubuntu 24.04
  3. 3

    Allow the other services you offer

    For a web server, for example:

    ufw allow 80/tcp && ufw allow 443/tcp
    Terminal: Allow the other services you offer, on Ubuntu 24.04
  4. 4

    Turn it on

    --force skips the yes/no question; you've already allowed SSH.

    ufw --force enable
    Terminal: Turn it on, on Ubuntu 24.04
  5. 5

    Confirm what's allowed

    Everything not listed here is now blocked.

    ufw status verbose
    Terminal: Confirm what's allowed, on Ubuntu 24.04

Check It’s Fixed

Run the security report again. This check should now pass.

More Open Services Guides

Close Databases and Admin Services to the InternetLock Down the Docker Socket