No rights to view file as member of root group

I am in the group root who owns a file and all the directories above. Why do I have no access to this file? CentOS 7

$ ls /etc/systemd/system | grep parts.service  ls: cannot access /etc/systemd/system/parts.service: Permission denied -????????? ? ? ? ?            ? parts.service 

With SUDO:

$ sudo ls /etc/systemd/system | grep parts.service  -rw-rw-rw-  1 root root  563 Feb 13 09:59 parts.service 

Checking for an ACL:

$ sudo getfacl /etc/systemd/system/parts.service getfacl: Removing leading '/' from absolute path names # file: etc/systemd/system/parts.service # owner: root # group: root user::rw- group::rw- other::rw- 

My groups:

$ groups root wheel docker poweruser 

Parent directories

drwxr-xr-x  155 root root 12288 Jul 17 09:04 etc/ drwxr-xr-x    4 root root      151 Nov 11  2019 systemd/ drw-rw-r--   19 root root  4096 Jun 19 18:14 system/ 
Add Comment
1 Answer(s)

sudo is used to verify that you are the user with which you are logged. you can access root files with your user, but you have to tell your PC that you want to acces files from the root group

Answered on August 1, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.