Assume I have groups
G2, and user
U is a member of both groups, but
G1 is it's primary group.
In my file system there is a folder
F which is accessible by
G2. Now if
U wants to access
F the only way for it is to do
newgrp G2, and then access, which is not what I want my users do all the time.
What should I do?
ajalali@ws47lx:/projects/gchrupala$ stat . File: `.' Size: 17 Blocks: 0 IO Block: 1048576 directory Device: 15h/21d Inode: 150 Links: 3 Access: (0775/drwxrwxr-x) Uid: ( 6052/gchrupala) Gid: ( 6000/nis_users) Access: 2015-03-05 15:34:46.260662858 +0100 Modify: 2013-03-05 16:35:16.000000000 +0100 Change: 2013-06-10 20:40:25.418034444 +0200 Birth: - ajalali@ws47lx:/projects/gchrupala$ id uid=1004(ajalali) gid=1001(ajalali) groups=1001(ajalali),6000(nis_users),6060(admin),6061(sudo),1625200000(admins),1625200001(lsv_local),1625200035(compute_server_users),1625200036(contact_server_users) ajalali@ws47lx:/projects/gchrupala$ mkdir tmp mkdir: cannot create directory `tmp': Permission denied
The user (ajalali) is a member of the group that owns the current folder (6000), but can not make anything there, cause it's primary group (1001) is not the group that owns current folder.
It will only work if the user does
newgrp nis_users first, and then try to make a folder there.