10 Apr 2021  Meta Code

UFW Firewall CLI

Install ufw:

sudo apt install ufw -y

Set default rules:

ufw default allow outgoing
ufw default deny incoming

Enable SSH (otherwise will result in a lockout ufw is enabled and the session ends):

ufw allow ssh

Enable example rules:

# human-readable syntax

ufw allow http
ufw allow https
...

# protocol/port syntax

ufw allow 51820/udp
ufw allow 8081/tcp
...

Enable ufw:

ufw enable

Disable ufw:

ufw disable

View firewall status:

ufw status
Webmentions & Comments

Copyright © Paramdeo Singh. Built with Jekyll and in Guyana. All Rights Reserved.

Last Site Build on Sun, 09 May 2021 20:55:38 -0400

1MB Club Badge