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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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."