← Back to Blog

Linux UFW Quickstart

#linux #blue-team • Updated:
Linux UFW firewall configuration example

Introduction

UFW (Uncomplicated Firewall) is a user-friendly interface for iptables. It simplifies managing firewall rules on Linux and comes preinstalled on most Debian and Ubuntu systems.

Essential Commands

sudo ufw status
sudo ufw enable
sudo ufw allow 22/tcp     # SSH
sudo ufw allow 80/tcp     # HTTP
sudo ufw allow 443/tcp    # HTTPS
sudo ufw deny 23/tcp      # Telnet
sudo ufw logging on
sudo ufw reload

Best Practices

Check Logs

sudo tail -f /var/log/ufw.log