{"id":13563,"date":"2022-01-06T12:59:53","date_gmt":"2022-01-06T12:59:53","guid":{"rendered":"https:\/\/linuxways.net\/?p=13563"},"modified":"2022-01-06T13:00:00","modified_gmt":"2022-01-06T13:00:00","slug":"how-to-install-lynis-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-lynis-on-ubuntu-20-04\/","title":{"rendered":"How to Install Lynis on Ubuntu 20.04"},"content":{"rendered":"<p>Lynis is a security-auditing tool, used for UNIX, Linux, and macOS systems. This tool is an open-source tool designed for various purposes such as configuration errors detection, security auditing, compliance testing, penetration testing, weak user account passwords, and vulnerability detection. Lynis is useful for system administrators and auditors to measure the security checks on the Linux systems.<\/p>\n<p>This article will provide a complete guide about how to install the lynis on Ubuntu 20.04 system and its derivatives using the command line.<\/p>\n<h2><strong>Installation of lynis on Ubuntu 20.04<\/strong><\/h2>\n<p>The following installation steps will help you to install the Lynis tool on Ubuntu 20.04:<\/p>\n<h3><strong>Step 1: Update apt packages repository<\/strong><\/h3>\n<p>First, make sure that the system package repository is up to date and all packages are upgraded to the latest version. Therefore, use the following command to perform this task:<\/p>\n<pre>$ sudo apt update<\/pre>\n<pre>$ sudo apt upgrade<\/pre>\n<p>After performing the above actions, your system is ready to install the Lynis tool.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"255\" class=\"wp-image-13564\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-55.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-55.png 728w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-55-300x105.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/p>\n<h3><strong>Step 2: Add lynis repository\u00a0<\/strong><\/h3>\n<p>The lynis tool is not available in the default Ubuntu 20.04 system base repository. However, you can add the lynis repository to your Ubuntu system and install the lynis from there. Add the lynis repository to Ubuntu 20.04 by executing the following command:<\/p>\n<pre>$ echo \"deb https:\/\/packages.cisofy.com\/community\/lynis\/deb\/ stable main\" | sudo tee \/etc\/apt\/sources.list.d\/cisofy-lynis.list<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"74\" class=\"wp-image-13565\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-56.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-56.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-56-300x30.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p>Once\u00a0 the repository is included in your system, download the public signing key by using the following command:<\/p>\n<pre>$ wget -O - https:\/\/packages.cisofy.com\/keys\/cisofy-software-public.key | sudo apt-key add -<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"331\" class=\"wp-image-13566\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-57.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-57.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-57-300x137.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<h3><strong>Step 3: Installing Lynis on Ubuntu 20.04<\/strong><\/h3>\n<p>Refresh the system repository for the above changes that take effect on your system. After that start the lynis installation on Ubuntu 20.04.<\/p>\n<pre>$ sudo apt update<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"367\" class=\"wp-image-13567\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-58.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-58.png 741w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-58-300x149.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/p>\n<pre>$ sudo apt install Lynis<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"358\" class=\"wp-image-13568\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-59.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-59.png 724w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-59-300x148.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/p>\n<h3><strong>Step 4: Check lynis version<\/strong><\/h3>\n<p>Once the lynis installation is completed, verify the lynis installation by displaying the installed version as follows:<\/p>\n<pre>$ lynis show version<\/pre>\n<p>The following output should receive on the terminal:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"722\" height=\"61\" class=\"wp-image-13569\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-60.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-60.png 722w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-60-300x25.png 300w\" sizes=\"auto, (max-width: 722px) 100vw, 722px\" \/><\/p>\n<h3><strong>Step 5: Auditing Linux system using lynis<\/strong><\/h3>\n<p>Lynis performs the security checks on the various key areas in which boot loader files, configurations files, software packages, logging, and auditing directories. Perform the security audit for your Linux system by running the following command:<\/p>\n<pre>$ sudo lynis audit system<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"816\" class=\"wp-image-13570\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-61.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-61.png 718w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-61-264x300.png 264w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/p>\n<p>When you run the above command for auditing a Linux system using lynis, the auditing results with different keywords such as OK, Found, Suggestion, Warning, etc. show on the screen.<\/p>\n<p>A number of commands are available that you can execute using the lynis. To view these useful commands, run the following command:<\/p>\n<pre>$ lynis show commands<\/pre>\n<p>The following commands should display on the terminal:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"716\" height=\"205\" class=\"wp-image-13571\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-62.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-62.png 716w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-62-300x86.png 300w\" sizes=\"auto, (max-width: 716px) 100vw, 716px\" \/><\/p>\n<h3><strong>Uninstall or Purge Lynis from Ubuntu 20.04<\/strong><\/h3>\n<p>After finishing the auditing of your Linux system, you can remove this application from the Ubuntu system by using the following command:<\/p>\n<pre>$ sudo apt purge --remove lynis<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"719\" height=\"297\" class=\"wp-image-13572\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-63.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-63.png 719w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-63-300x124.png 300w\" sizes=\"auto, (max-width: 719px) 100vw, 719px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>We have installed the lynis auditing tool on Ubuntu 20.04 system. We have seen how you can audit a Linux system using lynis. For more information about the lynis tool, visit the man pages of lynis. Thanks!<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Lynis is a security-auditing tool, used for UNIX, Linux, and macOS systems. This tool is an open-source tool designed for various purposes such as configuration errors detection, security&hellip;<\/p>","protected":false},"author":1,"featured_media":13694,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[683,100],"class_list":["post-13563","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-lynis","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=13563"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13563\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/13694"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=13563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=13563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=13563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}