UFW Firewall CLI

 10 Apr 2021  Snippets

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 Thu, 21 Oct 2021 17:49:44 -0400

1MB Club Badge

Paramdeo Singh Guyana

Riding the wave of consciousness in this treacherous mortal sea.

Technology Design Strategy Literature Personal Blogs