UFW, short for Uncomplicated Firewall, is a service that functions as a firewall for installation on Linux distributions: Ubuntu and Debian. This is due to the difficulty of using iptables conventionally to manage the opening and closing of ports on your private servers. A firewall is the most appropriate cybersecurity measure to consider for allowing inbound (in) and outbound (outbound) packet transfer. It is very important due to the numerous threats and new generations of hacking techniques that attempt to compromise ports and access points. This tool may (or may not) be the default depending on the version of the Debian and Ubuntu distribution. It was specifically developed to simplify the administration of the iptables firewall. Below you will discover the simple methods for creating basic rules.

Installing UFW

Installing UFW is easy.
 
apt update 
apt install ufw 

Basic Usage

Enable firewall: ufw enable Disable firewall: ufw disable Display status: ufw status Display numbered rule list: ufw status numbered Block all incoming traffic: ufw default deny incoming Allow all incoming traffic: ufw default allow incoming Block port 22: ufw deny 22 Allow port 22: ufw allow 22 Block port 22 only for a specific user: ufw deny from 123.52.12.55 to any port 22

UFW Considerations

Below are some important considerations for working with UFW. 1. You need root (sudo) privileges to install and manage the package. 2. UFW is disabled by default. 3. Before enabling it, you must allow SSH access to avoid being excluded from your own server: (ufw allow 22) or (ufw allow SSH) 4. The ports required for a web application are port 80 for the HTTP protocol and 443 for the HTTPS protocol. You can also enable both using ufw allow \"WWW Full\" https://www.youtube.com/watch?v=el0ATPPMwnE&feature=youtu.be&ab_channel=MoxNetworks More information on Wikipedia