0

I have created a folder with user 'afayes' called tempfolder in directory '/Users/afayes' and have set permissions to be able to read, write and execute for all users:

drwx---rwx    2 afayes  staff          64  6 Mar 15:16 tempfolder

I am trying to access the tempfolder with user called 'testuser'. From the directory '/Users/afayes' I am executing:

cd tempfolder/

I get the error

-bash: cd: tempfolder: Permission denied

When I try to access the same folder with another user called 'jenkins' I can access it. I don't understand why 'testuser' cannot access it.

1

The problem you are having is because it has no group permissions.

Execute chmod -R g+rwx /Users/afayes/tempfolder in the shell. At that point the permissions will be drwxrwxrwx and all will be well.

  • To clarify why this is necessary: The owner of the item gets the owner permissions. Members of the group assigned to the item ("staff" which is actually all normal users) other than the owner get the group permissions. The "everyone" permissions don't actually apply to everyone; they apply to everyone else (i.e. everyone who is neither the owner nor a member of the group). If the group is assigned less permissions than everyone else (as in this case), then the group gets less permissions than everyone else. – Gordon Davisson Mar 8 '18 at 8:07
  • @GordonDavisson Thank you for the clarification. The key bit of understanding which I was missing was 'The "everyone" permissions don't actually apply to everyone; they apply to everyone else (i.e. everyone who is neither the owner nor a member of the group)' – Abul Fayes Mar 11 '18 at 15:40
  • I would accept the answer if it explained why group permissions were necessary as clarified by @GordonDavission in his comment – Abul Fayes Mar 11 '18 at 15:42

You must log in to answer this question.

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