I am trying to read the Machine Specific Registers (MSRs) by reading the sysfs files /dev/cpu/0/msr
. It usually has read-write permissions for only the root. I update those permissions to 666 (of course using the sudo rights) and then try to read the file as a normal user. It doesn't allow me to do that. However, if I try to open the file with sudo
it allows me to open the file and read.
I also tried to change the ownership of the file using chown
command. Currently the status of the file is the following:
[my-user@machine-name]$ ls -l /dev/cpu/0/msr
crw-rw-rw-. 1 my-user root 202, 0 Oct 25 16:23 /dev/cpu/0/msr
Ehat do I need to do to access the file as a normal user?
As you can find in MSR man page:
Here is similar question and you can find instructions how to grant permission to access these files there.