MOX
Products
Learn about our additional services
Resources & Elements
Return

MOXNicolás Aravena
15-02-2021

UFW Firewall for Debian and Ubuntu VPS

UFW, an acronym for Uncomplicated Firewall, is a service that functions as a firewall and can be installed 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 form of computer security to consider for allowing inbound and outbound packet transfers. It is very important due to the multiple threats and new generations of hackers attempting to breach ports and access.

This tool may or may not be enabled by default depending on the version of the Debian and Ubuntu distribution. It was developed specifically to simplify the administration of iptables firewalls. 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 this work.
1. You need root (sudo) permissions to install and manage the package.
2. UFW is disabled by default.
3. Before enabling it, you must allow SSH access so you don't get locked out of 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

Other articles that might interest you

Servicios

Fast, secure web hosting designed to grow with you.

Your sites load faster, are always available, and have expert support 24/7. SSL certificates, automatic backups, and an intuitive dashboard are included. Ideal for shops, blogs, or businesses that can't stop.

Get to know Hosting

Browse without limits with a fast, private VPN.

Protect your identity with military-grade encryption, bypass geoblocks, and access all the world's content. No logs, optional dedicated IP, and stable connections across all your devices.

More about Chilean VPN

Total power and control with dedicated VPS servers.

Get root access, high performance with NVMe drives, and complete isolation. Easily scale your resources to host applications, systems, or web projects with constant traffic. Advanced security and dedicated support whenever you need it.

Get to know Cloud VPS