[K12OSN] Shared Folders

Pete pvdw at criticalcontrol.com
Mon Nov 15 20:09:18 UTC 2004


Shawn Powers wrote:

> Does anyone offer shared folders to staff/students?  If so, how do you 
> manage permissions so that everyone can read/write to the files?  Is 
> there a way to make a UMASK for a specific folder?  For a shared 
> folder to work right, it would have to have a UMASK of 0666, correct?  
> I am not sure how to handle that with sticky bits, etc...
>
> My current kludge is to have a cron job on my nfs server that runs 
> "chmod -R 666 /share" every minute.  Not pretty, and not immediate.
>
> Thanks again for any insight,
> -Shawn

The trick is to have one group that everybody is member of.
Example group "users"
Some have "users" as there primary group some don't but that doesn't matter.
The trick is to make that common group (users) as the owner of the 
shared directory (/data)

chgrp users /data
I assume drwxr-xr-x is the current permission set.

make the directory rw for everybody in group users

chmod g+w

Now without setting the SGID bit. User that have 'users' as their 
default group can read and write to the /data dir without problems
However users that belong to the users group but have another primary 
group will mess up things
there files will be owned by them and their default group...

So you want the default group directory...
chmod g+s /data

Now to ensure that only the people that created a certain file can 
delete that file you need the sticky bit on the /data directory
(same as /tmp)
chmod +t /data

And you can delete your cron job :-)

Peter



-- 

Any technology distinguishable from
foodoo-magic is insufficiently advanced.


Peter Van den Wildenbergh
Linux System Administrator (& advocate)

CriticalControl Solutions Inc.
Bow Valley Square II
Suite 2400
205 - 5th avenue SW
Calgary, AB T2P 2V7

T 403.705.7500
F 403.705.7555





More information about the K12OSN mailing list