dmesg with / without sudo on Debian / Mint
This is controlled by the dmesg_restrict
sysctl
entry, documented in the kernel documentation. Its default value is determined by the CONFIG_SECURITY_DMESG_RESTRICT
kernel configuration value, which is typically enabled in modern distributions.
You can see the current value by running
/sbin/sysctl kernel.dmesg_restrict
and change its value using (as root
)
sysctl -w kernel.dmesg_restrict=1
(to enable the restriction) or
sysctl -w kernel.dmesg_restrict=0
(to disable it and restore the old behaviour).