UFW Firewalls are EASY! Setup and manage your UFW in Ubuntu 22.04

preview_player
Показать описание
Setting up and managing your firewall in Ubuntu is simple. Here is a guide showing you everything you need to know to manage your firewall effectively!

BE SURE TO ALLOW YOURSELF ON SSH BEFORE ENABLING FIREWALL!

Enable UFW
sudo ufw enable

Disable UFW
sudo ufw disable

Allow a service
sudo ufw allow ssh

Allow a service from a specific ip range
sudo ufw allow from 192.168.0.0/24 to any port 22 proto tcp

Check status of UFW
sudo ufw status

Get numbered rules for UFW
sudo ufw status numbered

Delete a rule by number
sudo ufw delete [number of rule]

Reload UFW
sudo ufw reload

Deny by default all incoming
sudo ufw default deny incoming

Allow outgoing by default
sudo ufw default allow outgoing

Allow specific port
sudo ufw allow 443/tcp

Allow range of ports
sudo ufw allow 443:449/tcp

Block specific ip
sudo ufw deny from 123.123.123.123

Block specific ip on specific port
sudo ufw deny from 123.123.123.123 to any port 22

Check what an application rule allows
sudo ufw app info apache

That is it, deny all incoming connections by default, and figure out what needs to be allowed, common ports:
80 - http, 443 - https, 22 - ssh
Рекомендации по теме
Комментарии
Автор

Thank you very much and also the helpful tips in the details, i enjoyed your methodical and well paced video, refreshing this knowledge using it on my WSL system for Windows has been useful as i see myself using it soon. -- I love Uncomplicated.. 😅

BeNetCoders