[K12OSN] Shared Folders

Petre Scheie petre at maltzen.net
Mon Nov 15 21:11:35 UTC 2004



Huck wrote:
> Pete wrote:
> 
>> 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
> 
> 
> 
> Peter,
> 
> This allows for rw permissions for everyone of 'users'...and only the 
> creator can delete their creations, how to restrict it so that no one 
> BUT the creator(and a teacher) can view/edit their creation?
> so in /data  when Jimmy saves his final exam, Jane can not open it 
> read-only or overwrite it with a file of the same name?
> 
> --Huck
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
> 
Set the umask to 006, which will strip all rights for others; and then put the 
teacher's ID into each student's default group, which is the same name as the 
student's ID.  When Jimmy creates a file in /data, only the user jimmy and 
anyone in the jimmy group will be able to read/write the file, and since the 
teacher has been placed in the jimmy group, the teacher can read/write the file.

Petre




More information about the K12OSN mailing list