Welcome to the Linux Foundation Forum!

Read / Write access to `/sys/kernel/` files not permitted?

Posts: 1

Hi There!

First time poster, newbie linux enthusiast here. I'll cut right to the chase:

On a fresh install of Ubuntu 18.04.04: why don't I (as the root user) have read /
write access to the files in /sys/kernel/? Any pointers in the right directions
would be greatly appreciated.

I didn't see any guidelines for posting etiquette so I'll do my best to follow Eric S. Raymond and Rick Moen's "How to ask smart questions essay".

Observations:

I was curious about the devices that were mounted on my computer so I ran the following:

  1. $ mount > filesystems.txt

and came across securityfs:

  1. ..other file systems..
  2.  
  3. securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
  4.  
  5. ..other file systems..

I wanted to see the contents of this directory so I ran the following:

  1. $ sudo less /sys/kernel/security/integrity/ima/policy

and got this message:

  1. /sys/kernel/security/integrity/ima/policy: Permission denied

I tried openning another file in the /sys/kernel/ directory and got the same
Permission denied message. I didn't find any results on the web so, as a
final attempt, booted a fresh install of Ubuntu from a flash drive, tried
openning another file in /sys/kernel/, and got the same error.

Any ideas on why Ubuntu limits access to this directory? Thanks again for being
a part of this community - any pointers in the right direction would be
apprecaited.

Comments

  • Posts: 1

    A similar problem is caused by CONFIG_IMA_READ_POLICY of /boot/config-*, but I can access to other file of /sys/kernel/ directory.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training