this post was submitted on 06 Oct 2023
97 points (95.3% liked)

Linux

48061 readers
726 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Hi. I wanted to know if it's needed to install a firewall on a linux desktop/laptop. Why yes or why no?

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 64 points 1 year ago (1 children)

If your computer is connected to a network, I don't see any downside of enabling a firewall. It's a good security layer to have and costs basically no resources to keep running.

[–] [email protected] 7 points 1 year ago (1 children)

I guess a downside is having to fiddle with it, allowing stuff you want to get through. Sometimes it blocks stuff you don't want blocked

[–] [email protected] 4 points 1 year ago (1 children)

I'd rather have to open up stuff my self then have an uninvited visitor doing it without me knowing about it.

load more comments (1 replies)
[–] [email protected] 25 points 1 year ago

There is no reason not having a firewall

[–] [email protected] 23 points 1 year ago (1 children)

Yes, and hopefully you will have one preinstalled, blocking all incoming connections.

An outbound firewall like Opensnitch or Portmaster is also nice. But here I would say often you dont need one. Balena Etcher was the only App loading Ads, at all. Firefox and Thunderbird can be hardened. The rest is okay and doesnt phone home, Flatpak permissions ard also great.

[–] [email protected] 6 points 1 year ago (1 children)

Balena Etcher shouldn't be loading ads. Where did you install it from?

[–] [email protected] 3 points 1 year ago

Official website. They just advertise their own products which I consider Adware

[–] [email protected] 19 points 1 year ago* (last edited 1 year ago) (2 children)

Linux comes with a default firewall it's called IPtables/NFtables, Just make sure that it's on. Example I Ubuntu Sudo ufw enable.

[–] [email protected] 8 points 1 year ago

Actually it's Netfilter. IPTables is just a frontend.

load more comments (1 replies)
[–] [email protected] 17 points 1 year ago (8 children)

Why not? It's comically easy to set up one.

load more comments (7 replies)
[–] [email protected] 16 points 1 year ago

Ironically enough if you do not know what a firewall actually does (and saying it "protects" against "stuff is NOT enough) IMHO you do need one. That being said unless you know what you are doing, better leave it to the default one with default settings.

[–] [email protected] 15 points 1 year ago (11 children)

On a laptop absolutely. My firewall on my laptop doesn't let me discriminate between networks so I'm always worried someone will try to attack me on public WiFi for the few ports I want open

On a desktop on a network you trust less important but still no firewall means if another device on your network gets compromised you're screwed

load more comments (11 replies)
[–] [email protected] 14 points 1 year ago (1 children)

Do you need a lock on the door of your place?

No, but it’s a damn good idea to protect whatever is in it.

[–] [email protected] 7 points 1 year ago* (last edited 1 year ago) (5 children)

That's a bad comparison. Without a lock you can just open the door from the outside.

load more comments (5 replies)
[–] [email protected] 13 points 1 year ago (3 children)

Yes, because while I trust my device, I do not trust the Chromecast or the WAP to not be an asshole and fuck with things.

load more comments (3 replies)
[–] [email protected] 12 points 1 year ago

I'd say if you plan on using it any public places, or if you don't have full control over all the computers/technology in your home network, it's a good idea to run one. It's a nice last resort should someone on the same lan have a piece of malicious software.

[–] [email protected] 10 points 1 year ago* (last edited 1 year ago) (2 children)

No, you don't. But it's also not necessarily a bad idea if it's not going to create issues for you.

Normally, a software package that wants to talk over IP and only wants to let local software communicate with it can listen only on loopback addresses (like 127.0.0.1). But I have definitely seen software packages that have defaulted to listening to the world (gpsd used to do this by default, for example, which would let anyone in the world who could talk to your machine see precisely where you were). Having a firewall makes the default to be secure -- you know that the default is not to be reachable, regardless of what some software author thinks is a good idea.

Most home systems these days are generally behind a NATting router, which effectively firewalls them against the outside world (though maybe IPv6 will change this), so they can't be directly reached from the outside anyway, unless a user has set up port forwarding on the router, the systems are effectively firewalled anyway, unless an attacker can get inside the network somehow.

It's one more thing that you're going to have to remember to deal with if you're installing software and troubleshooting network problems. You install software package X and it isn't reachable, you're going to have to figure out how to diagnose problems. As long as this isn't a problem for you...shrugs

I don't personally run firewalls on my desktops. But I have also, over the years, occasionally checked netstat -ntap and discovered that a service that I thought only listened locally was listening to the world, gpsd probably being the most-flagrant example.

If I were not behind a router, or if I were forwarding all ports to my system, I would be firewalling my desktop systems.

On a dedicated server, I'd be less worried, because I'm not normally installing tons of random software on the thing. If you aren't going to firewall it, though, be sure that you've checked to see what is listening on the server.

[–] [email protected] 5 points 1 year ago (1 children)

There is no reason to not leverage a firewall. Plenty of browser based malware can breach your home router and call back out to allow an attacker to explore your network. Windows has included a firewall for over a decade and it's fine. You can with a single command enable Linux's built in firewall and be glad you did the bare minimum of cyber security.

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 10 points 1 year ago (1 children)

Its always a good idea. I have a firewall on my laptop since I travel and connect to many different networks.

I don't run any services that would be broadcasting open ports but its always better to be safe

[–] [email protected] 7 points 1 year ago

Hell, even if you don't travel. You never know when something nasty is going to get loose on your network. Especially since most folks have some IoT things, and don't bother to properly isolate them.

[–] [email protected] 8 points 1 year ago (1 children)

You most likely already have one installed, but not enabled. It doesn't harm anything (maybe you need to allow traffic to ssh or other configuration, but after that you're all set) and it's a layer of protection, specially if you need to move between networks (public wifi etc).

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

On Mint the firewall is enabled by default. Setting up firewall rules is pretty easy though, so it's worth taking five minutes to read up on it.

[–] [email protected] 8 points 1 year ago (1 children)

No - If you are aware which programs open incoming ports. E.g. check with netstat -tulpe

Yes - If you want to make sure e.g. TCP port 22 or a webserver on 443 etc is only available from IP/Adapter xy. Or if you want to mess with filtering outgoing connections.

load more comments (1 replies)
[–] [email protected] 7 points 1 year ago (2 children)

Yes, because you can forget what services are running and maybe they can be explited.

An example can be Syncthing which setting are done via web browser at port 8384. If you do not have a firewall, everyone on the same network would be able to change Syncthing settings and then sync your directories to their devices.

[–] [email protected] 8 points 1 year ago (1 children)

Is syncthing listening on all addresses, or only loopback? A firewall would block it, sure, but that would also be bad design.

[–] [email protected] 3 points 1 year ago

Syncthing only listens on loopback by default unless you modify the config.

[–] [email protected] 3 points 1 year ago

Good point, but syncthing only listens on localhost as others have said too.
However it still is a network service that can have vulnerabilities, besides many others like KDE Connect (which may be a target as one of its purposes is remote control and monitoring) or a bittorrent client

[–] [email protected] 5 points 1 year ago

A sane firewall configuration should have no/minimal impact on a desktop focused OS.

On the other hand, sometimes programs are really badly made and expect stupid things like there being no firewall.

You should have one yes, but to each their own.

I manage a bunch of windows computers and regularly make adding firewall rules part of install scripts, good example: Dreamweaver.

[–] [email protected] 4 points 1 year ago

Very few people do, you probably don't need to worry about it

[–] [email protected] 3 points 1 year ago (1 children)

If you are only at home you don't need it because the router already has a firewall. But if you're is using public WiFi definitely use it.

[–] [email protected] 12 points 1 year ago (8 children)

It depends on how much do you trust your router.

Some home routers have poor security: unfrequent updates, http (not https) web consoles, single factor authentication (password only, without username for instance).

Enabling your firewall is the bare minimum, costs nothing and it's a good security practice.

[–] [email protected] 5 points 1 year ago

It depends on how much do you trust your router

Your router and every single device connected to your local network.

load more comments (7 replies)
[–] [email protected] 3 points 1 year ago (2 children)

I still don't know what a firewall actually does lol. I just install nftables and ufw and hope it somehow improves my security. I just don't know how.

[–] [email protected] 7 points 1 year ago

Every computer has a bunch of ports (1-65535 if I recall correctly), each of which is a unique entity to which a single service can bind. In layman's terms, a port is a door that one service is able to answer when someone knocks. By convention, some ports have a specific associated service (80 = HTTP, 443 = HTTPS, 22 = SSH), but there are a lot that you can just use as you deem appropriate.

If you want a service (e.g. a web server) to be accessible, you have to run a service that binds to a known port (e.g. 80), and a client has to reach out to your server on that same port. A firewall sits between your service(s) and any potential clients, much like those steel security screen doors. If that's closed, nobody gets through on that port, even if a service is bound to that port and is listening for a connection.

As a general rule of thumb, you want your firewall to block as much traffic as possible without breaking something (I.e. blocking one of your public-facing services). If you don't run any services on your computer (web services, media servers, etc.), you can probably get away with blocking all inbound traffic. without any discernable impact.

[–] [email protected] 4 points 1 year ago* (last edited 1 year ago)

Programs that want to receive or send data across the network do so using a port. A firewall (in the sense of a firewall on your computer) is basically a program that sits between the rest of your programs and your network connection and determines what programs should be allowed out to the network and what incoming connections should be allowed to talk to your programs.

This is "increasing security" by making sure you don't let incoming connections talk to whatever happens to be running on your computer that might be listening for network traffic.

I can provide a more ELI5 explanation if you would like it.

load more comments
view more: next ›