I was wondering about the following behavior:
I have three users A
, B
and C
. A
creates a folder and changes the group ownership to C
's group.
mkdir fold
chgrp C fold
chmod g+rw fold
Now I add B
to the C
user group by
usermod -a -G C B
and id B
gives me uid=1002(B) gid=1002(B) groups=1002(B),1003(C)
. Trying to change the content of fold
(mkdir fold/fold2
or touch fold/test
) as user B
, however, gives me a permission denied and only A
and C
can change the contents of that folder. What is the reason? If I change the gid
of B
to C
by usermod -g C B
, but this can't be the proper way right?