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!
someuser
matches the group is that account has only execute permissions. World permissions are not looked at. More sane permissions may be0750
on the directory. – doneal24 Jun 07 '22 at 15:36