Home Blog CV Projects Patterns Notes Book Colophon Search

UFW Firewall on the Pi

24 Apr, 2021

I also install a firewall when I'm setting up a Raspberry Pi.

sudo apt install -y ufw
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https

WARNING: If you haven't rebooted yet, you'll need to now, otherwise you'll be using an old version of IP tables that was upgraded the first time you ran apt upgrade and the ufw command won't work.

After the reboot:

sudo ufw enable

Now you can see the firewall:

sudo ufw status

Gives:

Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
443/tcp                    ALLOW       Anywhere
22/tcp (v6)                ALLOW       Anywhere (v6)
80/tcp (v6)                ALLOW       Anywhere (v6)
443/tcp (v6)               ALLOW       Anywhere (v6)

Comments

Be the first to comment.

Add Comment





Copyright James Gardner 1996-2020 All Rights Reserved. Admin.