[K12OSN] Shared Folders

Pete pvdw at criticalcontrol.com
Mon Nov 15 20:42:45 UTC 2004


> 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

You need Novell's NDS man :-)

I don't see a 100% good solution for this within one directory.
(Can't you make an examdir in every students /home?)
However for the immutable status you gonna need a cronjob...

Lets give it a try (Thinking and typing e-mail at the same time):
As root
Lets make a directory /examdata
The group of the directory is 'teachers'
chgrp teachers /examdata
The owner of the dir /examdata is root
Setting the rwx stuff.
chmod 773 /examdata
Now set the bits
chmod g+s /test
This ensures the 'teachers' as being the group owner of a given file.
chmod o+t /test
(This ensures that the file cannot be delete by anybody but the original 
creator + root)

As a student I can now cd into /examdata but a ls -l etc is forbidden
however I am in that dir and I can do a
touch file1
So I can write a file into it.

Now you gonna need a cronjob (unless somebody knows a better way)
to make the file under /examdata immutable
so every minute run:
chattr -R +i /examdata/*

See man chattr (Change attributes)
This only works on a ext2 or ext3 filesystem!

Clear as mud?

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