Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 (Lynis 3.1)
Lynis is a free security auditing tool. It checks hundreds of settings (SSH, firewall, updates, file permissions, services) and gives a hardening score with concrete suggestions. The current version is 3.1.7; it works on Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9.
Install
dnf install epel-release && dnf install lynis # AlmaLinux / Rocky apt install lynis # Ubuntu / Debian (may be an older version)
For the newest version on any system, run it straight from its Git repository (no installation needed):
git clone https://github.com/CISOfy/lynis /opt/lynis cd /opt/lynis && ./lynis audit system
Run an audit
lynis audit system
Read the results
- Warnings: fix these first.
- Suggestions: hardening ideas. Not all fit every server; decide one by one.
- Hardening index: a score out of 100. Use it to track progress, not as a goal in itself.
- Details for one test:
lynis show details SSH-7408(use the test ID from the output). The full report is in/var/log/lynis-report.datand the log in/var/log/lynis.log.
Typical quick wins
- Disable SSH password login once key login works (
PasswordAuthentication no). - Enable automatic security updates (
dnf-automaticorunattended-upgrades). - Remove services and packages you do not use.
Tip: Run Lynis again after changes, and monthly after that, to catch configuration drift.