Skip to content
Commitpedia
Log in Join & edit

Lynis: a security audit of a Linux or Unix host with hardening suggestions

Lynis is a shell script that inspects a Linux, BSD or macOS system you administer, tests hundreds of settings and services, and prints warnings and concrete hardening suggestions with a score.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of Lynis: a security audit of a Linux or Unix host with hardening suggestions: 1 recorded edit
Edit history · 1 edit
Type
Repo
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Source
CISOfy/lynis

CISOfy/lynis

Stars
16.5k
Forks
1.6k
Language
Shell
Licence
GPL-3.0
Last push
16 Sep 2026

On GitHub: Lynis - Security auditing tool for Linux, macOS, and UNIX-based systems. Assists with compliance testing (HIPAA/ISO27001/PCI DSS) and system hardening. Agentless, and installation optional.

Open on GitHub

Lynis (about 16,000 stars on GitHub) is a host security auditing tool that has been in development since 2007. Its author, Michael Boelen, maintains it through his company CISOfy, and contributors add tests and distribution support. Unlike scanners that look at a system from the network, Lynis runs on the host itself with the privileges of the administrator, which lets it read configuration files, kernel parameters, installed packages, running services and file permissions, and compare them with hardening guidance.

What an audit covers

A run works through a few hundred tests grouped by area: boot and kernel settings, authentication and password policies, file systems and mounts, storage encryption, installed packages and pending updates, name resolution, firewall and network settings, SSH daemon options, database and web server configurations, logging, cryptographic libraries, and malware scanners. Each test records a status; failures become warnings (a problem to fix) or suggestions (an improvement to consider), each with an identifier that links to a page on the project’s site with more context. At the end Lynis prints a hardening index between 0 and 100, meant as a rough indication of progress rather than a certification.

Who it is for

  • Administrators who have just installed a server and want a checklist of what to tighten before it goes into service.
  • Operators who run the audit periodically and compare reports to see whether a system has drifted.
  • People preparing for a compliance review who want to find the obvious gaps first.
  • Learners, because the suggestion texts and linked pages explain why each setting matters.

How to install and try it

Lynis is a portable shell script with no dependencies beyond the standard Unix tools, so it runs on most Linux distributions, the BSDs, macOS, Solaris and AIX. Many distributions package it, CISOfy publishes its own repository with current versions, and cloning the repository and running the script in place also works.

Check before you run this

  • Runs with administrator rights. Make sure you understand every line.
git clone --depth 1 https://github.com/CISOfy/lynis.git
cd lynis
sudo ./lynis audit system

The full report is written to /var/log/lynis-report.dat and the screen output ends with the warnings and suggestions. Running without sudo is possible but skips the tests that need root. The project site documents the options, including profiles that disable tests which do not apply to a given host.

Credit

Lynis is created and maintained by Michael Boelen and CISOfy, with community contributions. It is published under the GNU GPL version 3. CISOfy also sells an enterprise version with central reporting; the open source script is complete on its own.

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

  • 0099 Proxmox VE repositories and updates: enterprise vs no-subscription A fresh Proxmox VE install uses the enterprise repository, which needs a subscription. Learn how to switch to the no-subscription repository and… Beginner · Step by step · Linux Article Installation & first steps · Packages & updates 15 Oct 2026
  • 0102 Proxmox VE storage types: local, LVM-thin, ZFS, NFS and Ceph Proxmox VE stores disks, ISOs, templates and backups in storage pools defined in /etc/pve/storage.cfg. Learn the main storage types, what local and… Intermediate · Explains an idea · Linux Article Disks, LVM & filesystems · Storage 15 Oct 2026
  • 0103 Proxmox VE networking: Linux bridges (vmbr0) and VLANs Guests reach the network through Linux bridges such as vmbr0, defined in /etc/network/interfaces. Learn the default setup, VLAN-aware bridges, VLAN tags for… Intermediate · Step by step · Linux Article Installation & first steps · Networking & firewalls 15 Oct 2026
  • 0164 systemd services: systemctl and journalctl basics systemd starts and supervises services on most Linux servers. systemctl starts, stops and enables them; journalctl shows their logs. Beginner · Explains an idea · Linux Article Services & systemd 15 Oct 2026
  • 0165 Write a systemd service unit for your own app Turn any long-running program into a proper service: create a unit file, run it as an unprivileged user, restart it on failure… Intermediate · Step by step · Linux Article Services & systemd 15 Oct 2026
  • 0166 Replace a cron job with a systemd timer A systemd timer runs a service on a schedule like cron, but logs every run to the journal, can catch up missed… Intermediate · Step by step · Linux Article Services & systemd 15 Oct 2026

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +2,674 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?