0

I was trying to get the user nagios to have access a sub directory in another users home directory /home/alert/NagiosAlerts/.

I was going crazy setting permissions that should have been to high to get this work work (777 type stuff for testing) but was still getting permission denied doing simple touch tests. Started writing up a question here to ask and got linked to this dupe target which had the following in its answer:

The directory needs to be searchable to allow users to enter it or its subdirectory "project"

So that is what fixed my issue me as well. I change the group of the folder /home/alert and set the group permissions to --x and I am now able create files in /home/alert/NagiosAlerts/.

Why did I have to assign those rights in the parent directory /home/alert? I would have figured the rights in /home/alert/NagiosAlerts would have been fine?

If I touch /home/alert/NagiosAlert/file should it only matter about the permissions on NagiosAlert? Why would alert matter?

1 Answer 1

4

You need to have permission to transit /home/alert in order to access /home/alert/NagiosAlerts. The executable bit gives that permission for a directory.

5
  • Can you expand on that for me possibility? Is this just something fundamental with RedHat / CentOS? I'm more of a Windows guy and in NTFS I can just assign rights to a subfolder while blocking the parent directory. Sure the user cannot traverse the tree but if they explicitly access the desired directory they get in.
    – Matt
    Dec 21, 2017 at 16:31
  • This is a fundamental way that *NIX filesystems and *NIX filesystem permissions work, not specific to Red Hat / CentOS. The (very large) caveat to that is that once you bring in ACLs, everything changes.
    – John
    Dec 21, 2017 at 16:32
  • So its not just the parent directory then. The user needs to traverse the whole directory tree from /home onwards?
    – Matt
    Dec 21, 2017 at 16:34
  • @Matt the whole directory tree from / onwards, actually. So you need +x on /, /home, /home/alert, and /home/alert/NagiosAlerts
    – derobert
    Dec 21, 2017 at 16:36
  • 1
    As a Windows guy, think of this as the situation that exists on Windows for accounts that do not have the "bypass traverse checking" privilege. This is, in fact, the same as on the operating system that you are familiar with, except that on that operating system users have as a matter of course a privilege that users on Linux operating systems and Unices do not have.
    – JdeBP
    Dec 21, 2017 at 17:18

You must log in to answer this question.

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