November 2013 Archives

klogctl: Operation not permitted

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.

Monthly Archives

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.25

About this Archive

This page is an archive of entries from November 2013 listed from newest to oldest.

August 2013 is the previous archive.

December 2013 is the next archive.

Find recent content on the main index or look in the archives to find all content.