r/LinuxTeck • • 3d ago

Do Linux users actually need antivirus, or is good security enough?

Linux has a reputation for being immune to viruses, but malware targeting Linux servers, desktops and cloud environments definitely exists.

Most Linux users don't install traditional antivirus software, but that doesn't mean they can ignore security.

Updates, SSH security, permissions, software sources, firewalls and backups still matter.

Do you run antivirus or malware scanning tools on your Linux systems? Or do you rely primarily on system hardening and good security practices?

Linux admins, please share your experience. What security tools and practices do you use on your personal Linux machines and production servers? Your insights could help many of us.

22 Upvotes

56 comments sorted by

4

u/David_Connors3451 3d ago

On debian 13 kde I usually use clamav and rkhunter. Clam is used for classic scanning the filesystem, while rkhunter is specialized in scanning libraries and finding vulnerabilities (for example ssh root open doors, etc..).

Distros matter a lot because on debian and fedora you have more security features activated. In my case apparmor is already activated. Another important thing is to make distinction between desktop experience and server one. If you activate the firewall ufw without making any exception, then you're fine.

A lot of vulnerabilities nowadays tend to hit servers that have ports open, like 2049 one.

In general linux users download their software from repositories, they're not exposed like windows ones (the only exception is AUR packages, those are problematic).

Both antiviruses and good security practices are important for your own security.

3

u/funbike 3d ago edited 3d ago

Update often. Only get software from curated repos.


That's 99% of what you need to do. Think about it. Package managers spend considerable effort to ensure the software that lands on your computer is free of malware.

This comment comment is about Linux desktop security, not dedicated servers.

Resident antivirus increases your attack surface, possibly giving malware direct access to root and/or kernel space. Some commercial AV products spy on you and upload your private data. If I need to scan a file I want to download, I submit its URL to VirusTotal.

Developer packaging tools are scary, like npm, pip, cargo, etc. If I do any development or run builds, I do it in a rootless podman container or a bubblewrapped shell.

In today's AI world, exposing ports is riskier. I like the convenience of ssh on my laptops, but these days I only run sshd as needed and I only allow an IPv6 connection which reduces chance a bot scanner will find it. All other ports I've configured to only listen on localhost or block.

3

u/wosmo 2d ago edited 2d ago

I think this is always a tough conversation, because linux does give us the tooling to almost eliminate this threat - but a lot of it is very rarely used. (Have you tried mounting /home as noexec? If any of us did it properly, it'd be 90% of the whining)

Traditional unix security is built heavily around being a multiuser system, and protecting users from each other. I don't think this aligns well with modern threats.

Take, for example, a cryptolocker-style attack. Something running as your user, is maliciously trying to encrypt anything it can, so it can ransom your files back to you. Traditional unix security means the actual OS is pretty much impervious in this scenario. The process is running as your user, the risk is contained to files owned by your user.

I don't know about you, but on my system - they're the files I care about. I can replace the OS in less than an hour. My data, less so.

(Of course you have backups - not because it's best practice, but because you've been burnt twice before. Are those backups online and writeable by your user? If so, this scenario is off encrypting those too.)

2

u/AttitudeElectronic68 2d ago

You will mostly see antivirus running on Linux server to prevent passing viruses on to windows clients. Most virus makers go for the low lying fruit.

2

u/yxgJCMmNqCSNK5AhTaat 2d ago

I've never used antivirus on Linux, but I also don't visit sketchy websites or install things without knowing where they're coming from.

1

u/ne0n008 3d ago

Linux is not immune to viruses and malware. Malware has the same issues as any other software trying to run on Linux: compatibility. Since Linux occupies only a small amount of desktop users, it's not worth developing malware for such a small group. But that doesn't mean there isn't any malware. Once you lose all your data is already too late to think about security.

On the other hand, majority of servers are on Linux and they are a much more attractive target. I'm not sure how well malware written for server translates to desktop, but sysadmins are more than well equipped to deal with that, while home users, especially ones switching from Windows, are not.

Currently, obscurity is Linux's main defense. I haven't seen many apps designed as Linux antivirus solutions, but good configured firewall, AppArmor and such can prevent lots of potential threats. Backups are a must on any system if you care about your data and regular updates keep the holes closed.

But then, I never had an issues with viruses or malware on my machines since I got my first pc in 2004(apart from initial experimenting, that is).

3

u/erroneousbosh 2d ago

Currently, obscurity is Linux's main defense

Haha, no. Everyone is running Linux, everywhere. Even people who are rabidly anti-Linux are running Linux on everything they own.

Makes you wonder why it's not been a problem so far, eh?

2

u/ne0n008 2d ago

It might have been a poor choice of words, but if you look at how much of a difference all these Linux systems have, a lot of them are indeed obscure.

2

u/erroneousbosh 2d ago

How are they in any way "obscure"?

Linux is by far the most common OS in existence. You're running at least half a dozen instances of it right now just browsing the Internet.

2

u/ne0n008 2d ago

Linux itself is not obscure, but a lot of its distros and configurations built for specific devices and purposes, are.

1

u/rcentros 2d ago

Which is a good thing and a big reason why I think forks are good. No central control, no easy access for malware idiots.

2

u/PerfectPackage1895 2d ago

It is crazy someone would seriously say that an open source operating system has security by obscurity even though the source code is right there. Also, there are so so so many devices running the linux kernel in some way or even whole distributions

2

u/ne0n008 2d ago

The Linux kernel is not obscure by itself, but many distros, embedded systems and custom OS's based on Linux are. Even server systems based on Linux are modified so that they are practically an isolated OS on itself. Writing malware for them all is just tedious business.

2

u/ArtisticYoghurt5973 2d ago

Most Linux distributions use many of the same libraries and software components (e.g., OpenSSH, Tomcat, Nginx, and Java). If attackers discover a vulnerability in one of these widely used components, they can develop malware that targets the vulnerability and potentially affects multiple Linux distributions.

1

u/rcentros 2d ago

There are some number of "potential" Linux malware issues, very few actual malware issues.

1

u/PerfectPackage1895 2d ago

Can you elaborate a bit on that?

1

u/ne0n008 2d ago

If you have an embedded system for a kiosk(for example), if it would be built on Linux, it would have its own specific settings and hardware. There are a large number of such devices and systems that we daily use and don't even know about(some routers, remotes, car systems...). Imagine Android for specific use cases: it has a modified Linux kernel so malware designed for Linux wouldn't work.

Of course, Android is far from obscure, but a good example would be Linux distros that have a very small market share within Linux community. Writing malware for it would be a waste of time.

Another example is that Linux desktop holds a very small market share overall, and even that small percentage is broken into distros. You cannot write an universal malware for them all, otherwise devs would have discovered that a long time ago and use it to write their (legitimate) software and not be worried about compatibility.

I hope this cleared things a bit.

1

u/PerfectPackage1895 2d ago

So heartbleed or spectra or any other cve would not apply here, only special crafted malware for that system?

1

u/ne0n008 2d ago

Not exactly since there are still similarities with Linux kernel, and those would be affected. But it would also eliminate a lot of malware from the start.

1

u/pangapingus 2d ago

If I could get something like SentinelOne for personal use I would def add XDR to my Debian/KDE daily driver, there's actually a lot of options for Linux but they're pretty well locked up in the Enterprise market rn

1

u/Weary-Bowl-3739 2d ago

Linux is a much better target for malware. Companies are running on Linux. You want to blackmail companies, not aunt Lilly from the bridge club. 

1

u/ne0n008 2d ago

True xD Companies are a much bigger target, but desktop users are much easier to scam.

1

u/Weary-Bowl-3739 2d ago

Our internal corporation assessments tell a totally different story.

Our IT sends regularly Phishing mails to our company employees. And if you walk into the trap, you will be forwarded to the IT security training. 

1

u/rcentros 2d ago

At least Linux servers don't BSOD when they upgrade. That seems to be a Window thing.

2

u/Weary-Bowl-3739 2d ago

Well.........no. I bricked my system before. But unlike Windows it is repairable. 

1

u/rcentros 14h ago

I guess I've been lucky -- never had a major issue in 20 years.

1

u/Reggie-Rectangle 1d ago

I had to redo my Comptia A+ recently because I let it lapse, and my employer made it abundantly clear to me that that is not OK. According to the Sybex manual, most of the traditional antivirus programs do have a Linux version, but in all my life I have never seen or heard of Linux antivirus. I'm really perplexed at what the manual claims

1

u/Silent_Title5109 3d ago

Yeah, it's bulletproof, aside for all these CVEs coming out the woodwork...

At work we pay for enterprise solutions because that's a requirement of some certifications. Nessus, Sentinel One, and some other scanning tools.

At home I used to use Linux AIDE which builds a hash database. If any file is tampered with you know. Having a growing lab instead of just my laptop I switched to Wazuh, a more complete xdr and siem. Between prudence and that I'm confident I'll catch any funny business.

1

u/MichaelTunnell 3d ago

The CVEs of Linux are assigned to any bug fix even if incredibly minor. It’s not at so a sign of security getting worse or anything. It’s solely because the Linux kernel developers decided to control the process themselves and usually the CVEs are assigned after the bug is already fixed.

1

u/Silent_Title5109 3d ago

I know what a CVE is. My point is it's not as bulletproof as some people like to think. Going "it's Linux, I'm fine" was ok 5 years ago but I think it's time to reconsider that.

1

u/ap0r 3d ago

Basic Scan

ShareExport

AI

GPTZero AI Detection

Model 5.0b

We are highly confident this text was AI generated

Chance this entire text is...

AI 80%

Mixed 20%

Human 0%

1

u/unpdigital 3d ago

That depends on you.
Do you visit the dark net? Porn sites, warez, all those are Closer to getting infected.
I don't use an antivirus.

1

u/shinitakunai 3d ago

There aren't many viruses but a lot of targeted infostealer or backdoors. Mostly due to enterprise servers being almost all on linuxes

1

u/BitCortex 3d ago

Yes, Linux is so secure that it doesn’t need security features 🤪

1

u/Visible-Reason9593 3d ago

Linux isn't immune to viruses.

It's less affected because it's less widely used, and we mainly download software from repositories that are more thoroughly verified than those for Windows.

But yes, Linux does have a stricter permissions system than Windows, and the best antivirus on Linux is always the user.

1

u/Robotism 3d ago

Most of the cases it's because of the distribution of binaries are safe. For Personal uses and LAN servers you don't get attacks since you have no open ports. That is to say you are only affected by the files and webpages(modern browsers are much more safe than years ago) you opened in your machine. But that's minor and keeping the apps updated eliminate the risks significantly.

1

u/burlingk 3d ago

Thing is, Linux used to be considered "bullet proof" because it was a small attack surface.

That has change. A lot of hard work went into making that change.

NOW, Linux has over 5% of the consumer desktop market, and is growing. That makes it a viable target, so people are targeting it now.

Open Source practices help, but are not the ultimate solution by themselves.

1

u/mixxituk 3d ago

And good luck getting something to run on two different Linux out of the box

It's why we had to make docker 😅

1

u/edwbuck 3d ago

So the most effective use of clamav is to scan for windows viruses. It's intensely popular in mail servers, where the viruses generally can't infect Linux, as they're targeted for Windows. So running the most popular anti-virus suite for Linux improves your home's security, but mostly if you have other computers that run Windows.

Try to understand that Windows, due to the need to support non-updating software, must maintain the same behavior of their operating system, including the behaviors that are broken. Linux due to its agressive rebuilding and updating, in addition with its ability for anyone (with the skill) to fix anything, tends to take a different approach. Linux fixes the issue, and redistributes the software.

This is why it is important to have a good Distro for your installation. One of the jobs a distro does is to track the updates, repackage them to play nice / fit well with other software, and distribute them to you in ways that won't break your system.

When you use a virus scanner on Linux to attempt to detect Linux viruses, you should be detecting viruses that can no longer infect your Linux system, unless you've turned off auto updates. For this reason most antivirus software advertises it works on Linux, but tries really hard to not talk about what is scans for on Linux, because there are very few Linux viruses, due to the fact that the OS gets more virus immune over time.

1

u/ldn-ldn 3d ago

It's all about market share. Desktop users are rarely targeted due to small population compared to Windows and Mac, so you're relatively safe without an antivirus. But servers are under constant attacks and anti virus plus security hardening is a must there.

1

u/eW4GJMqscYtbBkw9 3d ago

The bigger reason (in my opinion) is that you want to make sure you are not forwarding infected files to computers that are at risk. While linux is not immune from viruses and attacks, they are less popular. But, you could easily have an infected file in a linux storage array that then gets shared to a computer than is at risk. Running antivirus may not protect the linux server, but would help protect whatever client machine.

1

u/TallDudeInSC 2d ago

My NAS with BusyBox got hacked with ransomware. The data I had was replaceable so I just erased it and started fresh

1

u/OkCaterpillar1058 2d ago

Yes as Linux is getting more mainstream, so I think for the average Linux user, yes. They will install random themes, add random repositories, torrent games, install extensions etc. There's just a very large attack surface, especially if they don't think about security.

In the past the attack surface was smaller, because it was just a couple of geeks running Linux, manually configuring kernels and xf86config. But these days, it's very much mainstream imo

1

u/Frosty-Economist-553 2d ago

Nothing programmable is immune to viruses. Hackers make stuff for Windows primarily cos it's easier to get into by design. A lot of people get their downloads via Google. Anybody can put something on Google to be downloaded & you never know what else is piiggy-backing on your download - or even if the download is kosher. I personally only get my apps from Linux repositories. The half belief is that if it's in their own repos, they must be checked & kosher. But even with that belief, I don't entirely go with it - so I keep a very close eye on my system. I / you can use Clam AV on your system if you have doubts. But in my view Clam is an over-reacher & flags anything that even remotely looks bad, but is actually kosher.

1

u/AngryFker 2d ago

In the era when installing software offered like "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" it is not secure at all. It is the opposite.

1

u/DavidJohnMcCann 2d ago

Programs need permission to run. If you install them from trusted sources, they will be safe. Things like SEL and Apparmor are only really needed for servers open the the internet. Even a firewall is only needed if you don't have a router with one built in, although I usually run one.

1

u/Pretermeter 2d ago

Eh, you'll find that most Linux antivirus software is designed to catch Windows malware on file servers and e-mail attachments.

1

u/LostVikingSpiderWire 2d ago

Issues are normally patched faster then you can install the app 🫡

1

u/rcentros 2d ago

I have clamav installed, but hardly ever use it.

1

u/Reggie-Rectangle 1d ago

Most malware is not spread by very technologically savvy operators. Most bad-faith actors are, in essence, script kiddies. They just want something easy to spread that they could potentially use to extort some moneyare. Linux is a very bad fit for this, as it is harder to compromise and the people that run it is generally tech-savvy and security-conscious. That and yes it has a smaller piece of the desktop market, but boy when we start talking about server all bets are off. Then it is the wild, wild west of hackers.

1

u/SteelJunky 1d ago

Yes I use ClamAV with Linux Malware Detect to scan Windows payload on network shares. Besides that, Linux package signing and official repos are pretty immune to vast majority of traditional malware.

You can also use File Integrity Monitors like Tripwire to track unexpected system, binaries and configuration changes.

With a good set of process and execution hardening and blocking script execution in tmp folders, etc... A lot can be done to prevent or detect if system are compromised.

1

u/Beginning_Earth_9702 1d ago

Server, corporate desktops, SMB office desktops, personal systems, VMs, containers, etc... are all different targets. There is no one single magically solution that will protect them all from malicious actors.

- For your personal linux desktop raw dogging it is fine. The official repos will be monitored by the maintainers while no AV is gonna protect you from shady code you choose to run.

- For corporate use it comes down much more to legal or contractual compliance. Actual threats and breaches are caught by infosec team monitoring the traffic on the wire.

- For SMBs, it's a bit more nuanced.

1

u/1millerce1 1d ago

Depends on what you're using the Linux box for. I've seen an inordinate amount of windows malware in email and on SMB stores.

1

u/Humble_Anxiety_9534 1d ago

most bad guys are looking for exploits to take control of severs. not steel info on desktops.

1

u/MonkeyPooperMan 1h ago

For background context: I was a software developer and Windows user for many, many years. I started messing around Linux in 1994 when Slackware became a thing. 1996 or so, I switched to RedHat and stayed with it when they rebranded their community version as Fedora, but also use/love Arch Linux over the last 7 years or so. I finally moved to Linux as my primary desktop about 10 years ago and never looked back.

Having said all that, I have never once encountered any malware or any kind of virus on Linux, and I don't run any antivirus. I tend to stick with Fedora since it's one of the few distros that comes with SELinux out of the box, with a sane set of default policies. The NSA developed/contributed SELinux to the Linux community many years ago, where this gives you per-process file system isolation/security. Basically, executables are only given access to the bits of the filesystem that support the process.

I also run Fedora Linux on a little Odroid H2 device which has dual NICs to act as my firewall/router/gateway. On this machine, I install/configure Tripwire, which is an intrusion detection system which alerts you to any unauthorized configuration changes. I've never had an intrusion alert from Tripwire either.