6

I have a group of files that I cannot access via cat or vim although I have read access.

The parent directory has permissions set as follows:

drwxrws--- 2 test test_grp 94424 May 10 20:01 my_test_grp

Then the file that I would like to access has permissions set as follows:

-rwxrwx--- 1 test test_grp 3398 May 10 19:40 my_test_file.txt

When I execute id -gn, it returns the following: test_grp

When I try to execute cat, I receive the following:

cat: my_test_file.txt: Permission denied

I've tried logging out and logging back in to the terminal, to no avail. Are there any other recommended steps to remediate this issue?

Also, I do not have sudo access.

Update After doing a df -h I can see that the directory is in a location whose filesystem is a mounted NFS. Could that be a factor as well?

13
  • 3
    94424 is a weird size for a directory.
    – user147505
    Commented May 11, 2017 at 15:25
  • @ilkkachu SELinux is disabled, ls -Z on the file lists as follows: -rwxrwx--- test test_grp ? my_test_file.txt
    – Glenak1911
    Commented May 11, 2017 at 15:29
  • Do you belong to the test_grp?
    – Secko
    Commented May 11, 2017 at 15:58
  • try newgrp test_grp and then try to acess the file Commented May 11, 2017 at 16:39
  • @Secko Yes, I'm a part of test_grp
    – Glenak1911
    Commented May 11, 2017 at 17:19

1 Answer 1

3

A possible explanation is that there are permissions on the server which NFS is unable to express. The permissions transmitted over the network are not what determines whether an access is authorized: the server gets to decide. Normally the permissions and the access control decision are based on the same information, and therefore they're consistent. However, if something along the way loses some information about permissions, then the two may be inconsistent.

Some examples of permissions that NFS is unable to express are access control lists (you're using NFSv3 which doesn't always support ACL; and NFSv4 has ACL but they aren't exactly the same as Linux's), and Linux security frameworks such as SELinux and AppArmor.

If this is the problem, then diagnosing it without access to the server would require a lot of guesswork. Without help from the server administrator, you're unlikely to resolve this problem.

4
  • Thanks for the explanation. I do believe this was the case, as it was reported to the administrator who manages the environment, and they were able to resolve the issue. I wasn't able to get details at the moment, but I believe this is the most correct answer in this situation.
    – Glenak1911
    Commented May 12, 2017 at 13:38
  • @Glenak1911, Any idea of how they resolve? I am trying to access an usb drive attached in the router from RaspberryPi. Facing the same issue. I can read write from windows machines but not even read from mounted RPi location. permissions says -rwxrwxrwx Commented Sep 3, 2020 at 11:53
  • @JoyGeorgeKunjikkuru This thread was about NFS (and other network filesystems). It won't help you with a problem with a USB drive. Chances are that the problem is the way you're mounting it, but this can't be diagnosed in a comment. Ask a question where you explain your setup in detail. Commented Sep 3, 2020 at 12:15
  • Thanks @Gilles'SO-stopbeingevil' for quick response. I got it fixed. It was my mistake. When I checked permission it was showing proper so I did't check the case of path. But actually it was not 'media' intead 'Media'. cp failed but ls worked. One more lesson with linux casing. pi@raspberrypi:~ $ ls -lp /media/router/media/2020/2020-08-26-Giant-stairs/DJI_0159.MP4 -rwxrwxrwx 1 pi root 556408823 Aug 26 14:35 /media/router/media/2020/2020-08-26-Giant-stairs/DJI_0159.MP4 pi@raspberrypi:~ $ sudo cp /media/router/media/2020/2020-08-26-Giant-stairs/DJI_0159.MP4 /media/usbadata64gb/share Commented Sep 3, 2020 at 14:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .