Troubleshooting guide for Lynis

Troubleshooting Lynis

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

Common 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.

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.

Relevant commands in this article

Like to learn more about the commands that were used in this article? Have a look, for some there is a cheat sheet available:

Feedback

Small picture of Michael Boelen

This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution.

Mastodon icon