UFW (Uncomplicated Firewall) is a network firewall tool for Linux-based operating systems that focuses on simplifying firewall configuration. UFW provides an easy-to-use user interface for managing firewall rules, allowing system administrators to easily configure and control network access to their systems. In summary, UFW is a useful tool for protecting Linux systems against potential network attacks.
Open a terminal: Press Ctrl+Alt+T
to open a terminal on your system.
Verify that UFW is not installed: Before starting the installation of UFW, it is important to verify that it is not installed on your system. To do this, run the following command in the terminal:
sudo ufw status
If UFW is not installed, you will see an error message indicating that the ufw
command is not found. Otherwise, be sure to disable UFW before continuing with the installation.
sudo apt-get update
sudo apt-get install ufw
ufw version
This command should display the current version of UFW installed on your system.
sudo ufw enable
sudo ufw allow ssh
sudo ufw deny http
You can consult the complete list of services and their associated ports, using the ufw app list
command.
sudo ufw status
This command will display the rules you have configured in UFW, as well as the current firewall status.
success Done! With these steps, you have installed and configured UFW on your Debian 11 or Ubuntu 22.04 system. Now, you can manage and modify UFW rules according to your network security needs.