Assume I have groups G1, and G2, and user U.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?Concrete example: ajalali@ws47lx:/projects/gchrupala$ stat .  File: `.'  Size: 17          Blocks: 0          IO Block: 1048576 directoryDevice: 15h/21d Inode: 150         Links: 3Access: (0775/drwxrwxr-x)  Uid: ( 6052/gchrupala)   Gid: ( 6000/nis_users)Access: 2015-03-05 15:34:46.260662858 +0100Modify: 2013-03-05 16:35:16.000000000 +0100Change: 2013-06-10 20:40:25.418034444 +0200 Birth: -ajalali@ws47lx:/projects/gchrupala$ iduid=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 tmpmkdir: cannot create directory `tmp': Permission deniedThe 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.
Linux user groups and file system permissions
linux;permissions;nfs;group
This looks like an NFS issue. Is NFS involved?NFS servers running on Debian-based systems, and possibly others, are configured to ignore supplementary groups unless told specifically otherwise. Ensure that --manage-gids has been supplied to the rpc.mountd program. On Debian systems that is done by editing /etc/default/nfs-kernel-server and ensuring that RPCMOUNTDOPTS=--manage-gids is present.