kernel.log stays empty: “rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.”

I think the VPS is not a VM, but a container. Unpriviledged cotainers do not have access to kernel log for security reasons.


If you don't need or have insufficient system access to read the kernel log, you can remove the imklog module (which is what attempts to read it)

-module(load="imklog")   # provides kernel logging support
+# module(load="imklog")   # provides kernel logging support

This Answer for the same issue under Docker suggests the following command, which can be incorporated into scripts

sed -i '/imklog/s/^/#/' /etc/rsyslog.conf