I have a few users who belong to multiple groups, for example:
$ id user1
uid=1001(user1) gid=1001(user1) groups=1001(user1),1003(pubfiles)
$ id user2
uid=1002(user2) gid=1002(user2) groups=1002(user2),1003(pubfiles)
Then I have a directory in /usr called pubfiles, which is owned by root:pubfiles where the group pubfiles have write permissions.
However, when user1 puts a file there, it belongs to user1:user1, not user1:pubfiles. This makes it impossible for user2 to modify that file.
Is it possible to make default group ownership to "pubfiles" for all new files created/copied into /usr/pubfiles?
Right now I have a script that runs a chgrp on all files every 15 minutes, which is a pretty lame solution IMHO.