Lynis

An auditing tool for Linux and other Unix-like servers. It checks the system's configuration and lists warnings and suggestions for hardening. It runs on the server you are checking.

cat lynis/meta.ymlChecked on 2026-10-27

Safety

Impact Local onlyStays on your machine and sends nothing out
Admin rights
Required
Test lab
Not required

Usage

Purpose
Audit
Difficulty
Intermediate
Type
Command line
Platforms
Linux / macOS

Trust

Repository
CISOfy/lynis
License
CopyleftGPL-3.0
GitHub
stars16,7022026-11-17
Maintenance
Actively updatedLast update 2026-09-16
Contents
  1. Introduction
  2. What Lynis does
  3. Network traffic
  4. Try it safely on one server
  5. Common uses
  6. How it differs from Vuls
  7. Cautions
  8. Read next
  9. Sources

Lynis is an auditing tool for Linux and other Unix-like servers. It checks the configuration and gives you warnings and suggestions for hardening. You run it directly on the server you want to check. According to the official site, it is open source and has been around since 2007. Many of its tests are written in shell script.

This review is for people who manage their own Linux servers. After reading it, you can do the following:

  • Run Lynis on your own server and read its warnings and suggestions
  • Know what traffic it sends outside and how to turn it off
  • Skip tests you don’t need and run the same audit again on a schedule

What Lynis does

Lynis runs hundreds of tests against the system’s configuration. According to the official description, its main goal is to test your defenses and suggest ways to harden the system. It also collects general system information and looks for vulnerable packages and configuration problems.

Tests are grouped into categories. The official list includes SSH, authentication, firewall, kernel, logging, file systems, containers, malware, web services, and databases. Each test has an ID such as KRNL-6000.

Lynis scans “opportunistically”. It tests only the tools and settings it finds, so you don’t need to install other tools. If it finds Apache, for example, it adds Apache tests. Each server gets a different audit.

Results go to three places.

Output Contents
Screen The result of each test. Warnings and suggestions are grouped at the end
Log (default /var/log/lynis.log) What each test did, why a test failed or was skipped, and hints for fixing it. Overwritten on every scan
Report (default /var/log/lynis-report.dat) A record of what Lynis found, as option=value lines
What it doesn’t doLynis reports its findings as suggestions. You decide whether to change a setting. The official documentation also says that having no warnings does not make a system secure if it still has many suggestions.

Network traffic

  • Update check: During a scan, Lynis checks whether a newer version exists. In the source code, it queries the DNS TXT record of lynis-latest-version.cisofy.com with dig, host, or drill. If none of the three is installed, the check is skipped. This code sends only a DNS query.
  • Turning the check off: Put skip-upgrade-test=yes in your profile.
  • Data upload: Off by default (upload=no in default.prf). It runs only if you pass --upload or set upload=yes in a profile. Without a license key and an upload server, Lynis stops with an error. It uses curl over HTTPS. This feature is for Lynis Enterprise, the commercial edition from CISOfy. You don’t need it to audit your own servers.
  • I did not verify whether any test makes other connections. If it matters, run Lynis once in an environment with restricted traffic and watch.

Try it safely on one server

Start with one Linux machine you manage, or a virtual machine you built yourself.

  1. Install Lynis. The official README recommends packages. CISOfy provides DEB and RPM packages in its own repository. Some distributions also ship Lynis, but their version may be old.

  2. If you don’t use a package, you can clone the repository and run it in place. The project says no compilation or installation is needed.

    git clone https://github.com/CISOfy/lynis
    cd lynis
  3. If you run it as root, change the owner of the files to root. If a regular user still owns them, Lynis warns about file permissions.

    sudo chown -R 0:0 .
  4. Start the audit. Use lynis if you installed a package, or ./lynis from the cloned directory.

    sudo ./lynis audit system

    By default, Lynis pauses after the first section. Press Enter to continue and Ctrl+C to stop. Add --quick to run to the end without pausing.

  5. Read the warnings and suggestions grouped at the end. The ID in brackets on each line, such as [SSH-7408], is the test ID.

  6. To see why a test reported something, look it up by ID. The log has the same ID with the reason.

    sudo lynis show details SSH-7408
  7. Fix suggestions one at a time, then run the audit again and compare.

Common uses

Goal How
Run to the end without pausing lynis audit system --quick
Fix hard-to-read colors --no-colors or --reverse-colors
Don’t write a log file --no-log
Switch settings --profile <file>
See details of one test lynis show details <test ID>
Audit a Dockerfile lynis audit dockerfile <file>
Show version and update information lynis show version, lynis update info

You turn off tests you don’t need in a profile. The official documentation recommends copying default.prf and editing your copy.

skip-test=SSH-7408
skip-test=SSH-7408:permitrootlogin

The first line skips the whole test. The second skips one item inside the test. If you make a separate profile for each server role, such as mail server or web server, you can audit the same way every time.

If you run Lynis without root, it switches to “non-privileged mode”. Tests that need root are skipped, and some results may differ. Run server audits as root (sudo).

How it differs from Vuls

Lynis runs on the server it checks. The official site says this lets it analyze more deeply than network-based scanners such as Nessus and OpenVAS. Vuls also looks inside the server at its packages, but it looks at different things.

Lynis Vuls
Main goal Check configuration and suggest hardening List known vulnerabilities (CVEs) in packages
Result Warnings, suggestions, a hardening index CVE numbers and CVSS scores
Where it runs On the server being checked On the target itself, or on another server over SSH

Lynis also checks for vulnerable packages, but a CVE list is not its main output. To cover package vulnerabilities thoroughly, use Vuls. To find weak configuration, use Lynis. Running both is a realistic setup.

Cautions

  • Audit only servers you manage or have written permission to test. --pentest is a mode that runs without root and shows points of interest for penetration testing. Don’t use it on machines you have no permission for.
  • The log and report include installed packages and configuration details. They reveal how your server is built, so don’t paste them in public or leave them in shared folders.
  • The log is overwritten on every scan. To keep a previous result, copy it before the next run or set up log rotation.
  • If you run a cloned copy as root, check where you got it and make root the owner. The script runs with root privileges.
  • Some suggestions can affect your services if applied as they are. On production servers, test them in a separate environment first.
  • According to the official README, the version a distribution ships may be old. Run lynis update info for update information.

Sources

  1. Official repository READMEgithub.com/CISOfy/lynis
  2. License (GPL-3.0)github.com/CISOfy/lynis/blob/master/LICENSE
  3. Official site: Lynis introduction (supported OS, how it works, comparison)cisofy.com/lynis/
  4. Docs: Get Started (installation, first run, report and logging)cisofy.com/documentation/lynis/get-started/
  5. Docs: Suggestions and warnings, profilescisofy.com/documentation/lynis/
  6. Official site: Lynis security controlscisofy.com/lynis/controls/
  7. Source: lynis main script (privilege check, options, update check, upload conditions)github.com/CISOfy/lynis/blob/master/lynis
  8. Source: update check function (include/functions)github.com/CISOfy/lynis/blob/master/include/functions
  9. Source: profile options (include/profiles)github.com/CISOfy/lynis/blob/master/include/profiles
  10. Source: default profile (default.prf)github.com/CISOfy/lynis/blob/master/default.prf
  11. Source: data upload (include/data_upload)github.com/CISOfy/lynis/blob/master/include/data_upload

Checked on 2026-10-27

Similar tools

osquery

Impact Local only
osquery/osquery

A tool that lets you query the state of an operating system, such as running processes, listening ports, users, and startup items, with SQL.

Purpose
Defense
Type
Command line
Difficulty
Intermediate
License
Check termsApache-2.0 OR GPL-2.0-only
Category
Defense and hardening / Incident response
Actively updatedstars23,776Last update 2026-11-12
Read the osquery review

Vuls

Impact Reaches others
future-architect/vuls

An agentless vulnerability scanner that checks the packages installed on a server and lists the ones affected by known CVEs.

Purpose
Defense
Type
Command line
Difficulty
Intermediate
License
CopyleftGPL-3.0
Category
Vulnerability scanning
Actively updatedstars12,347Last update 2026-11-17
Read the Vuls review

Wazuh

Impact Local only
wazuh/wazuh

A free security platform (SIEM/XDR) that collects logs, configuration, and vulnerability data from agents on your endpoints and shows it all in one dashboard.

Purpose
Defense
Type
Self-hosted server
Difficulty
Advanced
License
CopyleftGPL-2.0(一部の構成要素は Apache-2.0)
Category
Vulnerability scanning / Forensics
Actively updatedstars17,780Last update 2026-11-17
Read the Wazuh review