Setting up the UFW firewall on Ubuntu 22.04 is a simple and effective way to protect your system from unwanted incoming traffic. Here is a step-by-step guide to help you set up the UFW firewall on your Ubuntu 22.04 system in just a few minutes:
sudo ufw statusSource:www.lautturi.com
If UFW is not installed, you can install it by running the following command:
sudo apt update sudo apt install ufw
sudo ufw enable
This will enable the firewall and block all incoming traffic.
sudo ufw allow ssh
To allow incoming traffic for other services, you can use the ufw allow
command followed by the name of the service. For example, to allow incoming traffic for the HTTP and HTTPS services, you can run the following commands:
sudo ufw allow http sudo ufw allow https
ufw allow
command followed by the port number.