Scanning with Lynis

Lynis commands work the same, regardless of which operating system that you want to scan. The only difference is that if you're running it from the archive file that you downloaded from the website, you would cd into the lynis directory and precede the lynis commands with a ./. (That's because, for security reasons, your own home directory isn't in the path setting that allows the shell to automatically find executable files.)

To scan your system that has Lynis installed, execute the following command:

sudo lynis audit system

To scan a system that you just downloaded the archive file on, execute the following command:

cd lynissudo ./lynis audit system

Running Lynis from the shell script in your home directory presents ...

Get Mastering Linux Security and Hardening - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.