In recent releases of slackware I have noticed that dmesg is disabled by default for non-privileged users. I can imagine why this is done server installations, but it is somewhat of a nuisance on single user machines. Nonetheless, this can be quickly remedied.
grepping for 'dmesg' in the run start scripts (/etc/rc.d/rc.*) you will find the following ->
/etc/rc.d/rc.M:/bin/dmesg -s 65536 > /var/log/dmesg
/etc/rc.d/rc.M.new:# Set the permissions on /var/log/dmesg according to whether the kernel
/etc/rc.d/rc.M.new:# permits non-root users to access kernel dmesg information:
/etc/rc.d/rc.M.new:if [ -r /proc/sys/kernel/dmesg_restrict ]; then
/etc/rc.d/rc.M.new: if [ $(cat /proc/sys/kernel/dmesg_restrict) = 1 ]; then
The interesting string is -> if [ $(cat /proc/sys/kernel/dmesg_restrict) = 1
It is logical to suspect that the setting is indeed '1' for restrictive access to dmesg kernel messages. Simply doing the following as root resolves the problem
echo "0" > /proc/sys/kernel/dmesg_restrict and of course to confirm that the previous command worked as desired.
The following command should result in "0"
cat /proc/sys/kernel/dmesg_restrict and indeed it does on my system.
Now you can exit root shell and retry dmesg as non-privileged user.