troubleshooting Question

Default group ownership of new files

Avatar of speedworks
speedworks asked on
Linux
2 Comments1 Solution452 ViewsLast Modified:
Hi

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.

Any ideas?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros