Lazo Lab Sign up

Linux & the Command Line / Servers and scripts

Lesson 26 of 30

The firewall with ufw

ufw is Ubuntu's simple firewall. Deny everything incoming by default and only allow the ports you need.

Key points

  • sudo ufw allow OpenSSH before enabling
  • sudo ufw enable
  • sudo ufw status verbose
sudo ufw default deny incoming
sudo ufw allow OpenSSH
sudo ufw enable
Watch a video on thisOpens YouTube search results for “The firewall with ufw” in a new tab

Quiz · +10 XP

What should you allow before enabling ufw on a remote server?

Log in to save progress and earn XP.