Do I need a firewall for my fedora 38?

Harry_Houdini@lemmy.dbzer0.com to Linux@lemmy.ml – 39 points –

Do I need a firewall for my fedora 38?

I'm new to Linux, previously been on Windows where I used defender + Windows firewall. Now I'm on fedora which also have its firewall called firewalld. Are those sufficient, or do I need any other solutions for my security?

18

You are viewing a single comment

Uncomplicated Firewall is easy to setup and understand. It blocks traffic and allows it. Install UFW

sudo apt install ufw

My recommended(Chris Titus)

`sudo ufw limit 22/tcp

sudo ufw allow 80/tcp

sudo ufw allow 443/tcp

sudo ufw default deny incoming

sudo ufw default allow outgoing

sudo ufw enable`

Is this enough?

This is fedora, I would stick with firewalld.

sudo dnf install firewalld

sudo systemctl enable --now firewalld

sudo firewalld-cmd --add-service --permanent ssh

sudo firewalld-cmd --add-service --permanent https

sudo firewalld-cmd --add-service --permanent http

sudo systemctl restart firewalld

Yes, it is enough. Generally, the default handling of connections on Linux is enough but having ufw can't hurt. Certain developer or server software may not work unless you add UFW exceptions for them. They don't know how to do this on their own.

By default, without a firewall, any program can communicate through any port it wants as long as it can bind that port. Ports that are special or low-numbered (e.g. TCP port 21 is reserved for FTP) require root to be bound. Otherwise, a program can bind any port that isn't already in use by something else. All incoming connections to a port that isn't bound will be refused and the information discarded.

Edit: Your router also usually has a firewall that is strong enough for most everyday purposes.