In plain words
An antivirus is the guard at the entrance: it recognises known troublemakers and turns them away. Useful, but not enough on its own: you also need solid locks (updates, passwords, firewall) and, now and then, an inspector who walks round the building to report badly closed windows. On Windows and macOS, the guard comes with the system. On Linux, you mainly add inspectors: audit and integrity-checking tools.
1. What you need depending on the system
| Windows | macOS | Linux (desktop or server) | |
|---|---|---|---|
| Built-in antivirus | Microsoft Defender, on by default | XProtect, invisible and automatic | None |
| Should you add one? | No, in the vast majority of cases | No, unless you have a particular need | Only in some cases (see section 5) |
| Useful complementary tool | A second-opinion scanner, occasionally | Objective-See's open source tools | Lynis for auditing, AIDE for integrity |
| Firewall | Windows Defender Firewall, on | Application firewall, off by default | ufw, firewalld or nftables, to configure |
| The most important thing | Updates, a standard account day to day | Updates, signed applications | Automatic updates, hardened SSH, minimal services |
One antivirus at a time
Two antivirus programs running at the same time get in each other's way: slowdowns, conflicts, blocked files. On Windows, Defender steps aside by itself when another antivirus is installed, and takes over again if it's uninstalled.
2. Windows: Microsoft Defender is enough
Microsoft Defender Antivirus is built into Windows 10 and 11. It scans files in real time, queries Microsoft's cloud for recent threats and updates through Windows Update. For home users and small organisations alike, it offers solid protection, with no ads and no excessive resource use.
The settings to check
Open Windows Security (Start menu), then:
| Section | Setting | Recommended value |
|---|---|---|
| Virus & threat protection | Real-time protection, cloud-delivered protection, automatic sample submission | On |
| Virus & threat protection | Tamper Protection | On: stops malware from turning Defender off |
| Virus & threat protection > Ransomware protection | Controlled folder access | On if possible: only allowed applications can change Documents, Pictures, etc. Some legitimate software will need to be allowed by hand |
| App & browser control | Reputation-based protection (SmartScreen), potentially unwanted app blocking | On |
| Device security > Core isolation | Memory integrity | On if no incompatible driver is reported |
| Firewall & network protection | Firewall for all three profiles (domain, private, public) | On |
In PowerShell
These commands run in an administrator terminal.
Protection status:
Get-MpComputerStatus | Select-Object AMRunningMode, RealTimeProtectionEnabled, IsTamperProtected, AntivirusSignatureLastUpdated
AMRunningMode : Normal
RealTimeProtectionEnabled : True
IsTamperProtected : True
AntivirusSignatureLastUpdated : 20/10/2026 07:12:44
AMRunningMode is Normal when Defender is the active antivirus, Passive Mode when another antivirus has taken over.
Update the signatures, then run a scan:
Update-MpSignature
Start-MpScan -ScanType QuickScan
Start-MpScan -ScanType FullScan
List the threats detected:
Get-MpThreatDetection
Offline scan
Some malware hides while Windows is running. The Microsoft Defender Offline scan restarts the machine in a minimal environment to find it (Windows Security > Virus & threat protection > Scan options). Or in an administrator PowerShell:
Start-MpWDOScan
The PC restarts immediately
Start-MpWDOScan restarts the machine without further warning. Save your work first. The scan takes about fifteen minutes; the result then appears in the protection history.
A second opinion
If you have doubts about a machine, an on-demand scanner, which doesn't stay installed, can confirm or complement Defender:
| Tool | What it is |
|---|---|
| Microsoft Safety Scanner | Microsoft's standalone scanner, valid for 10 days after download |
| Malwarebytes | Free version usable as an on-demand scanner; effective against adware and unwanted software |
| ESET Online Scanner | One-off scanner, uninstalls itself after use |
For a machine you suspect is really compromised, an antivirus is no longer enough: disconnect it from the network, back up the important data and consider reinstalling (see resetting Windows 11).
3. Well-rated third-party antivirus
A third-party antivirus isn't essential on Windows, but it can be justified: several devices to protect with a single tool (Windows, Mac, phones), parental controls, stronger web protection, or, in a business, a centralised management console to monitor every computer's status. The vendors below regularly get good results in independent tests.
| Vendor | Country | Windows | macOS | Linux | Strengths |
|---|---|---|---|---|---|
| Bitdefender | Romania | ✓ | ✓ | Business | Regularly top of detection tests, low performance impact; free edition for Windows |
| ESET | Slovakia | ✓ | ✓ | Business | Very light, fine-grained settings appreciated by administrators, management console for fleets |
| G DATA | Germany | ✓ | ✓ | Business | Own engine combined with Bitdefender's, vendor under European law, "no backdoor" commitment |
| F-Secure | Finland | ✓ | ✓ | — | Easy to use, good browsing and payment protection; the business offer has become WithSecure |
| Trend Micro | Japan | ✓ | ✓ | Business | Effective web and anti-phishing protection |
| Emsisoft | New Zealand | ✓ | — | — | Light; vendor known for its free decryption tools after ransomware |
| Sophos Home | United Kingdom | ✓ | ✓ | Business | Manage several computers from a web console, even for a family |
"Business": Linux protection available only in offers for servers and professional fleets.
Where to check the results
Rankings change from year to year: check the latest reports from independent labs before choosing.
| Lab | What it publishes |
|---|---|
| AV-TEST (Germany) | Protection, performance and usability scores, every two months, for Windows, macOS and Android |
| AV-Comparatives (Austria) | Real-world protection, false-positive and performance-impact tests, annual summary |
| SE Labs (United Kingdom) | Tests based on real attacks, for home users and businesses |
Why some well-known vendors aren't listed
Kaspersky gets good technical results, but Germany's federal office for information security (BSI) recommended replacing it in 2022, and its sale has been banned in the United States since 2024. Avast, which owns AVG, was sanctioned in the United States in 2024 for selling its users' browsing data.
Good practice with a third-party antivirus
- Only one active antivirus: uninstall the old one before installing the new one, preferably with the vendor's removal tool, which also removes the drivers.
- Download it from the vendor's official website, never from a download site or an ad.
- Install only the antivirus: decline the system "optimisation" or "cleaning" modules, which are useless and sometimes intrusive.
- If the antivirus inspects encrypted connections (HTTPS) by sitting in between, be aware it can cause certificate errors in some software; the option can usually be turned off in its settings.
- In a business, prefer a solution with a centralised console and alerts: an antivirus whose alerts nobody reads only half protects you.
4. macOS: the built-in protections
macOS stacks several protections, active with no setup:
| Protection | Role |
|---|---|
| XProtect | Signature-based antivirus, updated automatically by Apple in the background |
| XProtect Remediator | Regular system scans and removal of known malware |
| Gatekeeper and notarisation | By default only allow applications from the App Store or signed by an identified developer and checked by Apple |
| SIP (System Integrity Protection) | Prevents any change to system files, even by the administrator |
| FileVault | Disk encryption: protects the data if the Mac is lost or stolen |
| Firewall | Filters incoming connections; off by default |
Check them in Terminal
spctl --status
csrutil status
fdesetup status
/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
assessments enabled
System Integrity Protection status: enabled.
FileVault is On.
Firewall is disabled. (State = 0)
Turn the firewall on in System Settings > Network > Firewall, and FileVault in System Settings > Privacy & Security if it's off. In System Settings > General > Software Update > Automatic Updates, leave on the setting that installs Security Responses and system files: that's how XProtect receives its updates.
Objective-See's open source add-ons
Objective-See publishes free, open source security tools for macOS, highly regarded:
| Tool | Role |
|---|---|
| LuLu | Outbound firewall: asks permission when an application tries to connect to the internet |
| KnockKnock | Lists everything that starts automatically at boot, where malware hides |
| BlockBlock | Alerts as soon as software installs itself to start automatically |
| OverSight | Alerts when the microphone or camera turns on |
For a one-off scan, Malwarebytes for Mac also exists as a free on-demand scanner.
5. Linux: no antivirus by default, and why
Viruses targeting Linux desktops are rare, for several reasons: software comes from the distribution's signed repositories, the user doesn't work as administrator, and the diversity of distributions makes mass attacks less profitable. Linux servers, on the other hand, are heavily attacked: guessed SSH passwords, exposed and outdated services, vulnerable web applications. Against these attacks, an antivirus is useless; what protects you is hardening.
| Need | Tool | Type |
|---|---|---|
| Find known malicious files | ClamAV | Signature-based antivirus |
| Spot configuration weaknesses | Lynis | Security audit |
| Detect changes to system files | AIDE | Integrity check |
| Look for traces of a rootkit | rkhunter, chkrootkit | Rootkit detectors |
| Block repeated login attempts | fail2ban | Automatic banning |
| Apply security fixes | unattended-upgrades (Debian, Ubuntu), dnf-automatic (Fedora, RHEL, Rocky, Alma) | Automatic updates |
When should you install ClamAV?
| Situation | Is ClamAV useful? |
|---|---|
| File server (Samba, Nextcloud) used by Windows computers | Yes: it avoids storing and redistributing infected files |
| Mail server, email gateway | Yes: scanning attachments |
| Website receiving files uploaded by visitors | Yes: scanning before processing |
| One-off scan of a suspicious disk or USB stick | Yes, on demand |
| Personal Linux desktop | Rarely useful |
| Web or database server with no file uploads | No: hardening matters far more |
6. ClamAV in practice
ClamAV is the reference open source antivirus, maintained by Cisco Talos. It's made up of several programs:
| Program | Role |
|---|---|
freshclam |
Downloads and updates the signature database |
clamscan |
Standalone on-demand scan (loads the signatures at every start: slow to start) |
clamd |
Service that keeps the signatures in memory, for fast, repeated scans |
clamdscan |
Sends a scan to the clamd service |
clamonacc |
On-access scanning: checks files when they're opened (relies on clamd) |
Install and update
Debian, Ubuntu:
sudo apt install clamav clamav-daemon
Fedora, RHEL, Rocky, Alma (EPEL repository needed on RHEL and derivatives):
sudo dnf install clamav clamav-update clamd
On Debian and Ubuntu, the clamav-freshclam service updates the database automatically, several times a day. Check that it's running:
systemctl status clamav-freshclam
To force a manual update, stop the service first, otherwise freshclam reports that the database is locked:
sudo systemctl stop clamav-freshclam
sudo freshclam
sudo systemctl start clamav-freshclam
Scan
Scan a folder recursively, showing only infected files:
clamscan -r -i /home/spo
/home/spo/Downloads/invoice.pdf.exe: Win.Trojan.Agent-1234567 FOUND
----------- SCAN SUMMARY -----------
Known viruses: 8712345
Engine version: 1.4.3
Scanned directories: 412
Scanned files: 5873
Infected files: 1
Data scanned: 2.31 GB
Time: 96.204 sec (1 m 36 s)
The figures vary with the version and your system. Useful options:
| Option | Effect |
|---|---|
-r |
Recursive: scans subfolders |
-i |
Only shows infected files |
--move=/var/quarantine |
Moves infected files to a quarantine folder (create it first) |
--remove |
Deletes infected files: avoid it, a false positive erases a healthy file |
--exclude-dir="^/proc" |
Excludes a folder (regular expression) |
-l /var/log/clamscan.log |
Writes the result to a log |
With the clamd service running, scanning is much faster:
sudo systemctl enable --now clamav-daemon
clamdscan --fdpass -m /srv/share
--fdpass lets clamd read files its account can't access; -m spreads the scan over several threads.
ClamAV and memory
clamd keeps the whole signature database in memory: more than a gigabyte. When reloading the database after an update, it temporarily loads a second copy (the ConcurrentDatabaseReload option, on by default). On a small machine or a 2 GB VM, prefer a scheduled clamscan, or turn this option off in /etc/clamav/clamd.conf, at the cost of a short pause in scanning during the reload.
Schedule a daily scan
Create the file /etc/cron.d/clamscan:
30 3 * * * root clamscan -r -i --move=/var/quarantine -l /var/log/clamscan.log /srv/share
The scan runs every night at 3:30 a.m. on the share. Check /var/log/clamscan.log, or better, feed detections into your monitoring.
7. Lynis: the security audit
Lynis puts a Linux (or macOS) system through its paces: several hundred tests on boot, accounts, SSH, firewall, permissions, logs, kernel, services. It changes nothing: it produces a score and a list of suggestions, which you decide whether to apply.
Run an audit
From the distribution's repositories:
sudo apt install lynis
sudo lynis audit system
The repository version is sometimes old. For the latest version, without installing anything:
git clone https://github.com/CISOfy/lynis
cd lynis
sudo ./lynis audit system
Read the result
At the end of the audit, Lynis shows:
Lynis security scan details:
Hardening index : 64 [############ ]
Tests performed : 268
Plugins enabled : 0
-[ Lynis 3.x.x Results ]-
Warnings (1):
----------------------------
! Found one or more vulnerable packages. [PKGS-7392]
Suggestions (34):
----------------------------
* Consider hardening SSH configuration [SSH-7408]
- Details : MaxAuthTries (6 --> 3)
| Element | Meaning |
|---|---|
| Hardening index | Hardening score out of 100. It isn't an absolute security rating: it's for measuring your progress from one audit to the next |
| Warnings | Problems to deal with first (here: some packages have known vulnerabilities, you need to update) |
| Suggestions | Possible improvements, each with a test identifier in square brackets |
To understand a suggestion:
sudo lynis show details SSH-7408
The full report is saved in /var/log/lynis.log (detailed run) and /var/log/lynis-report.dat (raw results, usable by a script).
Don't aim for 100
Some suggestions don't apply to your use (a test server doesn't need a full audit system, for example). Deal with the warnings, apply the suggestions that make sense, and run the audit again after each set of changes. For SSH, see securing SSH.
8. Other Linux tools worth knowing
rkhunter and chkrootkit: rootkit detectors
A rootkit is malware that hides at the heart of the system, by replacing commands or kernel modules. rkhunter and chkrootkit look for its known traces.
sudo apt install rkhunter chkrootkit
sudo rkhunter --propupd
sudo rkhunter --check --sk
sudo chkrootkit
--propupd records the current state of the system files as the reference: run it right after installation, on a healthy system, then after every system update. --sk avoids having to confirm each step.
Old tools, frequent false positives
rkhunter hasn't had a new release since 2018, and both tools often raise harmless alerts (legitimate hidden files, scripts in place of binaries). An alert is a starting point for an investigation, not proof of infection. They're still useful as a complement, never as the only protection.
AIDE: integrity checking
AIDE takes a snapshot of the state of important files (hashes, permissions, dates), then reports anything that has changed since. It's the most reliable way to detect that an attacker has modified the system.
Debian, Ubuntu:
sudo apt install aide
sudo aideinit
sudo aide --config /etc/aide/aide.conf --check
Fedora, RHEL, Rocky, Alma:
sudo dnf install aide
sudo aide --init
sudo mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
sudo aide --check
Initialisation takes several minutes. After a legitimate system update, update the database (aide --update), otherwise every check will list the updated files. For real protection, keep a copy of the database off the machine: an attacker with root rights can also modify the local database.
The foundations not to forget
These measures protect a Linux server more than any antivirus:
| Measure | Command or starting file |
|---|---|
| Automatic security updates (Debian, Ubuntu) | sudo apt install unattended-upgrades then sudo dpkg-reconfigure unattended-upgrades |
| Automatic updates (Fedora, RHEL) | sudo dnf install dnf-automatic then sudo systemctl enable --now dnf-automatic.timer |
| Firewall | sudo ufw default deny incoming, sudo ufw allow ssh, sudo ufw enable (or firewalld) |
| Key-based SSH, with no password or root login | See securing SSH |
| Banning repeated attacks | sudo apt install fail2ban |
| Confining services | Check that AppArmor (sudo aa-status) or SELinux (getenforce → Enforcing) is active |
| Unneeded services stopped | systemctl list-units --type=service --state=running then sudo systemctl disable --now service |
| Known listening ports | sudo ss -tulpn |
9. Good habits, whatever the system
- Update the system, the browser and your software: most attacks exploit vulnerabilities that have already been fixed.
- Work with a standard account, and only use the administrator account for tasks that require it.
- Install software from official sources (see the open source software catalogue).
- Use a password manager and two-factor authentication (see the dedicated guide).
- Back up: against ransomware, an offline backup is the only real defence (see the 3-2-1 rule).
Key points
- Windows: Microsoft Defender is enough in most cases; a well-rated third-party antivirus (Bitdefender, ESET, G DATA…) is justified for several devices or centralised management. Check Tamper Protection, Controlled folder access and Memory integrity.
- macOS: XProtect, Gatekeeper and SIP already protect you; turn on the firewall and FileVault, add LuLu if you want to control outbound connections.
- Linux: an antivirus is only useful in specific cases (files shared with Windows, email, file uploads); ClamAV does the job then.
- Lynis audits the configuration, AIDE detects changes, rkhunter and chkrootkit look for rootkits.
- Nothing replaces updates, least privilege and backups.