How To Install lynis on CentOS 7

In this tutorial we learn how to install lynis on CentOS 7. lynis is Security and system auditing tool

Introduction

In this tutorial we learn how to install lynis on CentOS 7.

What is lynis

Lynis is an auditing and hardening tool for Unix/Linux and you might even call it a compliance tool. It scans the system and installed software. Then it performs many individual security control checks. It determines the hardening state of the machine, detects security issues and provides suggestions to improve the security defense of the system.

We can use yum or dnf to install lynis on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install lynis.

Install lynis on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install lynis using yum by running the following command:

sudo yum -y install lynis

Install lynis on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install lynis using dnf by running the following command:

sudo dnf -y install lynis

How To Uninstall lynis on CentOS 7

To uninstall only the lynis package we can use the following command:

sudo dnf remove lynis

References

Summary

In this tutorial we learn how to install lynis on CentOS 7 using yum and dnf.