Skip to content

VPS Security Audits Using Lynis

Updated 2 min read

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.dat and 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-automatic or unattended-upgrades).
  • Remove services and packages you do not use.

Tip: Run Lynis again after changes, and monthly after that, to catch configuration drift.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket