0

Say I login as root and create a directory

> mkdir /mydir

Now I create a group mygroup

> groupadd mygroup

Then I add a user someuser to the group mygroup

> usermod -a -G mygroup someuser

Next I assign the directory /mydir to the group mygroup

> chgrp mygroup /mydir

Finally I update the permissions of /mydir to 014:

> chmod 014 /mydir

What I'm wondering is when I log in as someuser and attempt to ls /mydir why do I get a permission error on wsl2 ubuntu. My limited understanding is that group should have execute (traverse) permissions for the directory and the world (aka other) should have read permissions. Since someuser is a part of both the world and the group mygroup wouldn't someuser have both read and execute permissions for /mydir?

If not, why? Do permissions short circuit from most specific scope to least?

Thanks!

  • You have the short circuit correct. someuser matches the group is that account has only execute permissions. World permissions are not looked at. More sane permissions may be 0750 on the directory. – doneal24 Jun 07 '22 at 15:36
  • 1
    Short summary - "Other" does not equate to "World". Other means "not the user and not in the group". – NotTheDr01ds Jun 07 '22 at 16:01
  • thanks folks, @NotTheDr01ds explanation of the other bits really helps me understand the short circuit behavior. Much appreciated. – Matthew Madson Jun 08 '22 at 10:05

0 Answers0