Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This 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.


  Search this Thread
Old 09-16-2005, 07:21 AM   #1
LQ Newbie
Registered: Oct 2004
Location: Germany
Distribution: Mandriva LE2005, Ubuntu Hoary Hedgehog
Posts: 26

Rep: Reputation: 15
share files on local machine

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.

Thank you.


Last edited by bulldogzerofive; 09-16-2005 at 07:22 AM.
Old 09-16-2005, 08:46 AM   #2
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
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."

chmod g+s /home/resources


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setup local machine to allow lan machines to retrieve its local user mail. Brian1 Linux - Networking 3 03-30-2006 05:04 AM
trying to copy files from another machine to the local machine using telnet, shrike_912 Programming 6 03-14-2006 04:45 PM
how to open a dilog on local machine when i do ssh to remote machine fahad26 Programming 3 05-03-2005 07:39 PM
Trying to share files on my Windows machine. jbraum Linux - Networking 6 01-07-2004 01:15 PM
client can't copy files to local machine through vsftpd server on RH9 tree_buddy Linux - Networking 7 09-15-2003 10:54 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:18 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration