Saturday, 7 April 2018

linux - Read/write permission on a nested folder


I have a nested directory structure like this:


foo
foobar
foofoobar

In case I want to give a user read/write access to directory foofoobar, do I have to assign read/write access on foo and foobar as well?


The answer seems obvious (i.e. no), since such a requirement would present an obvious and laughable security hole


I think the only requirement is that the user has eXecute permission on foo and foobar, so they can cd into foofoobar?



Answer



The requirement is that the user has "execute" permission on all the parent directories. When you modify the contents of /foo/foobar/foofoobar, it does not cause any changes in any of its parents directories, so read/write is not necessary.



  • +x /foo

  • +x /foo/foobar

  • +rwx /foo/foobar/foofoobar.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...