Linux secure by default? No. Comprehensive 2026 guide: 13 checks with commands, SELinux, SSH, firewall, LUKS, Lynis. Objectively compare two Linux OSes.
Table of Contents
Linux Security Audit 2026: Comprehensive Guide with Commands
Context: Linux is known to be secure — but a default installation is far from a hardened system. In 2025, 5,530 kernel CVEs were recorded, and 79% of Linux attacks used no malware: they exploited misconfigurations and poorly protected credentials.
This guide covers comprehensively what a user must check:
How to use this guide
Each tile in the navigation below corresponds to a security area. Click an item in the menu to display the associated commands, expected results, and explanations. Commands are directly copyable.
I. The 13 essential checks
Navigate between categories using the left menu. Each panel displays the commands to run and the expected result.
II. Secure application comparison
Recommended applications by category, compared according to current security and privacy criteria in 2026.
Web browser
| Browser | Telemetry | Verdict |
|---|---|---|
| LibreWolf | None | ✓ Recommended |
| Hardened Firefox | Disableable | ✓ Good |
| Ungoogled Chromium | None | ✓ Acceptable |
| Brave | Partial | ~ Mitigated |
| Chrome / Edge | Maximal | ✗ Discouraged |
Password manager
| Application | Storage | Verdict |
|---|---|---|
| KeePassXC | Local, encrypted | ✓ Recommended |
| Bitwarden | Self‑hostable | ✓ Very good |
| 1Password | Proprietary cloud | ~ Acceptable |
| LastPass | Cloud (breached 2022) | ✗ Avoid |
| Browser built‑in | Cloud sync | ✗ Insufficient |
Instant messaging
| Application | Encryption | Verdict |
|---|---|---|
| Signal | E2E (Signal protocol) | ✓ Recommended |
| Element / Matrix | E2E optional | ✓ Good |
| Telegram | E2E optional only | ~ Insufficient |
| E2E (but Meta) | ✗ Discouraged | |
| Discord | No E2E | ✗ Avoid |
VPN — protocols & reliability
| Solution | Protocol | Verdict |
|---|---|---|
| WireGuard | WireGuard | ✓ Self‑hosted |
| Mullvad | WireGuard | ✓ Verified no‑log |
| ProtonVPN | WireGuard | ✓ Good |
| NordVPN / ExpressVPN | WireGuard | ~ Mitigated |
| Browser VPN | Simple proxy | ✗ Marketing |
Audit and detection tools (2026)
| Tool | Type | Usage | 2026 Verdict |
|---|---|---|---|
| Lynis | Full audit | Hardening score, recommendations | ✓ Must‑have reference |
| CrowdSec | Collaborative banning | Modern Fail2ban replacement, behavioural analysis, 60x faster | ✓ 2026 standard |
| rkhunter | Rootkit scanner | On‑demand audit, daily cron | ✓ Essential |
| chkrootkit | Rootkit scanner | Complement to rkhunter | ✓ Good complement |
| ClamAV | Antivirus | File scanning, mail server | ✓ Useful (mail server) |
| Fail2ban | IP banning | Brute‑force SSH, services | ~ Obsolete (prefer CrowdSec) |
| Wazuh | SIEM / IDS | Continuous monitoring, correlation | ~ Advanced / enterprise |
| Falco | Runtime security | Behavioural detection (containers, kernel) – CNCF graduated project | ✓ Container standard |
| OpenSCAP | Compliance | CIS Benchmark / DISA STIG audit | ✓ Regulatory compliance |
III. Lynis score — the automated audit reference
Lynis is the reference tool to obtain a numeric hardening score. It covers in 5 to 10 minutes all the areas of this article and provides prioritised recommendations.
# ── 1. Install Lynis ────────────────────────────────────── sudo apt install lynis -y # Debian / Ubuntu / Mint sudo dnf install lynis -y # Fedora / RHEL / AlmaLinux sudo zypper install lynis # openSUSE sudo pacman -S lynis # Arch / Manjaro # ── 2. Run the full audit (5-10 min) ─────────────────── sudo lynis audit system # ── 3. Read the hardening index ───────────────────────── sudo lynis audit system | grep 'Hardening index' # ── 4. See priority warnings ──────────────────────────── sudo grep Warning /var/log/lynis.log sudo grep suggestion /var/log/lynis-report.dat | head -20 # ── 5. Schedule a weekly audit ────────────────────────── echo "0 3 * * 0 root /usr/bin/lynis audit system > /var/log/lynis-weekly.log 2>&1" \ | sudo tee /etc/cron.d/lynis-weekly
Interpreting the score and practical limitations
Reaching a score > 90 is theoretically possible, but exposes you to documented functional risks.
| Parameter | Risk | Recommendation |
|---|---|---|
kernel.modules_disabled=1 | Disables kernel modules → USB devices, some external drives become inoperable | Avoid on workstations |
PAM modifications (pam_faillock, pam_tally2) | Incorrect configuration → sudo lockout and admin lockout | Use libpam-pwquality and test before reboot |
Source: user feedback, February 2026
# CIS Benchmark audit via OpenSCAP sudo apt install openscap-scanner scap-security-guide -y # Run CIS level 1 audit (Ubuntu 24.04) sudo oscap xccdf eval \ --profile xccdf_org.ssgproject.content_profile_cis_level1_server \ --results /tmp/cis-results.xml \ --report /tmp/cis-report.html \ /usr/share/xml/scap/ssg/content/ssg-ubuntu2404-ds.xml # Open the HTML report xdg-open /tmp/cis-report.html
IV. 2026 standards: automation, runtime and collective intelligence
Security practices have evolved in 2026. Here are the three pillars that complement classic auditing.
1. CrowdSec: the modern successor to Fail2ban
CrowdSec has become the reference solution for protecting against brute‑force and malicious scans. Written in Go, it is up to 60 times faster than Fail2ban and incorporates collaborative intelligence: when an attacker is detected on one server in the CrowdSec network, the IP is automatically blocked on all other servers in real time.
| Criterion | CrowdSec (2026) | Fail2ban (legacy) |
|---|---|---|
| Performance | Go, up to 60× faster | Python, single‑threaded |
| Collaboration | Global threat intelligence network | None |
| IPv6 | Native | Partial support |
| Integrated WAF | Yes (HTTP bouncers) | No |
| Machine learning | Behavioural analysis | Static rules |
curl -s https://packagecloud.io/install/repositories/crowdsec/crowdsec/script.deb.sh | sudo bash sudo apt install crowdsecSource: CrowdSec vs Fail2ban benchmark, January 2026
2. Falco – runtime security (CNCF graduated)
In 2026, Falco is the reference runtime security project in the cloud‑native ecosystem. It interfaces directly with the Linux kernel to detect anomalous behaviour in real time: unauthorised process execution, suspicious volume mounts, unexpected network connections, etc.
- rule: Shell in container desc: A shell was launched inside a production container condition: container and proc.name in (shell_binaries) output: "Shell launched in container (user=%user.name %container.info)"
3. Automating hardening with Ansible (devsec.hardening)
The devsec.hardening collection (formerly ansible-hardening) has become the community reference for applying hardening compliant with CIS and STIG benchmarks. It is actively maintained and supports recent versions.
| Role | Function | Status |
|---|---|---|
os_hardening | sysctl, file permissions, removal of dangerous packages | Active |
ssh_hardening | Ed25519 keys, password disabling, root restriction | Active |
nginx_hardening | Secure default configuration | Active |
mysql_hardening | Permissions, passwords, TLS | Active |
# Installation and usage ansible-galaxy collection install devsec.hardening # playbook.yml - hosts: all become: true collections: - devsec.hardening roles: - devsec.hardening.os_hardening - devsec.hardening.ssh_hardening
4. CIS Benchmarks: the compliance standard
CIS Benchmarks have become the essential reference to objectively measure an OS’s security in 2026. More than 171 open source projects on GitHub allow you to audit these benchmarks automatically.
| Tool | Type | Recommended use |
|---|---|---|
| OpenSCAP | HTML/XCCDF audit | Regulatory compliance (PCI‑DSS, HIPAA) |
| Prowler | Multi‑cloud environment | AWS/Azure/GCP + Linux audit |
| Ansible CIS roles | Automation | Continuous application and verification |
- CrowdSec vs Fail2ban – 2026 benchmark (January 2026)
- Falco – CNCF graduated (March 2026)
- devsec.hardening – latest updates (March 2026)
- CIS Benchmark tools – 171 GitHub projects (January 2026)
Conclusion
devsec.hardening."Linux provides excellent security primitives — and then hands you the controls. What you do with them is entirely up to you."
Find our technical analyses on safeitexperts.com.
Share your experience
Your Lynis score before/after applying these checks? Share it in the comments or on social media with #SafeITExperts.