Troubleshooting guide for Lynis

Troubleshooting Lynis

This document helps with solving most common issues experienced when running Lynis.

Errors

No hostid and/or hostid2 found

Some systems do not have the OpenSSH server package installed. In this case, the hostid2 value may be missing. During the upload it may result in an error.

Error: No hostid and/or hostid2 found. Can not upload report file.

To see what Lynis discovered, use the show command.

lynis show hostids

If the hostid2 is missing, we can tell Lynis to use one that is generated and unique for that system.

openssl rand 1024 | sha256sum | awk '{ print "hostid2="$1 }'

Append the output of this command (hostid2=xxxxxx) to your custom.prf. Then run the show command again. If the value is properly filled, it should allow you to do the upload.

Warning: if you deploy Lynis with a configuration management tool, make sure that each system has a unique identifier. Systems may otherwise overwrite data from other systems when uploading it to the central system.

Error: Unknown protocol, please specify (http, https) in profile (update_server_protocol)

This error may show up when using the lynis update release command. This is a depecrated command. Use a new version from the software repository.

Automate security audits with Lynis and Lynis Enterprise
Lynis Enterprise screenshot to help with system hardening

This blog post is part of our Linux security series to get Linux (and Unix-based) systems more secure.

Daily security checks

Want to go to the next level of security scanning and system hardening? Start with automated security scans for Linux: Lynis and Lynis Enterprise.


Automate Scanning »

Leave a Reply

Your email address will not be published. Required fields are marked *