I see the following error running dmesg in my Linux running on a embedded board.
/ # dmesg
dmesg: klogctl: Operation not permitted
As you see, I'm running as root. I am also aware of the question here. But when I issue the solution given there I get the following error:
/ # echo 0 > /proc/sys/kernel/dmesg_restrict
sh: write error: Operation not permitted
Any idea how should I get around with it?
klogctl(3)/syslog(2)
documents the error. Maybe you are root with some privileges removed?. You can check withgrep ^Cap /proc/$$/status
. If you don't get 3 lines (out of 5) that have a lot of ffff at the end, then you should add the results in the question. – A.B Jul 02 '21 at 20:23