Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I would like to set up a shared folder (lets call it /home/resources) and allow all the local users in a certain group (lets call that group "community") to share files in that folder. I would like all files written to that folder to belong to "nobody" and the group "community" and have the permissions set to 060. I do not want to just change the user's (let's call him "bob") umask settings because obviously bob does not want everybody else in "community" to be able to read /home/bob.
The end result i want is that if "bob" saves a file to /home/resources, it will belong to "nobody" and the group "community" with permission set to 060 and another user in "community" (let's call him john) can then read and write this file. However, if bob writes something to /home/bob, i want it to belong to "bob" in the group "bob" with permissions set to 600 (which is currently how umask is set up) so that john cannot touch it.
Right now the only way i can do that is to periodically run (as root) chown and chmod recursively on on /home/resources, but as I have a few local users belonging to "community" and I frequently travel while they continue to use the machine, i would prefer if this went automatically. Besides, it would eliminate an annoying task that i have to do periodically.
I prefer not to use cron to do this, and i prefer not to use samba, but i suppose that would work as a last resort.
What i would really like to do (can anyone confirm or deny this is possible?) is write the umask (or mask) configuration to do this as each file is created. Of course, anything that acheives the same end result (a local machine shared folder with files shared read/write automatically) would help me.
If anyone knows how to do this or where i can read how to do this i would be very appreciative.
Last edited by bulldogzerofive; 09-16-2005 at 07:22 AM.
Maybe the sticky flag for directories can help you. From info coreutils:
"set the process's effective group ID to that of the file upon execution (called the "setgid bit"). For directories on some systems, put files created in the directory into the same group as the directory, no matter what group the user who creates them is in."