Skip to content

Instantly share code, notes, and snippets.

@cmackenzie1
Created October 28, 2024 03:23
Show Gist options
  • Save cmackenzie1/bb04acafe2fa6f3caab5b87204208a6a to your computer and use it in GitHub Desktop.
Save cmackenzie1/bb04acafe2fa6f3caab5b87204208a6a to your computer and use it in GitHub Desktop.

Settings for locking down a server with UFW

# delete all existing rules
sudo ufw reset

# enable ufw
sudo ufw enable

# defult deny everything incoming
sudo ufw default deny incoming
sudo ufw default allow outgoing

# allow everything using tailscale
sudo ufw allow in on tailscale0

# HTTP and HTTPS
sudo ufw allow http
sudo ufw allow https
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment