How to restrict users on deleting files? The user should have read and write rights, but the delete rights should be denied. In windows the same task can be done easily, i dont find the way to do this in ubuntu. Can anyone help me with a clear solution pls. Thanks in advance..
From the article:
An access control list (ACL), with respect to a computer file system, is a list of permissions attached to an object. An ACL specifies which users or system processes are granted access to objects, as well as what operations are allowed on given objects. Each entry in a typical ACL specifies a subject and an operation. For instance, if a file has an ACL that contains (Alice, delete), this would give Alice permission to delete the file.
There are 2 packages in Ubuntu to maintain the rules for ACL:
The problem you will run into with chmod is that delete and write are considered the same: if you can write to a file you can empty it (and thus you can delete the contents).
Btw: the 1st package can also manage your samba settings ;)
This can be accomplished by giving user write permission on files only but not on directory. User will not be able to delete a file from directory if he doesnt have 'write' permissions on the directory its self.
Note that this will also apply on file creation. So without write permission on directory, user will be able to read/write files already existing in the directory but will not be able to create or delete any file.
UPDATE: The following screenshot shows what I am trying to say:
|show 2 more comments|
set read and write permissions to a group, so all members of that group can read and write.
make owner some other user, because the folder is owned by that user
set this other user's permission of the folder to sticky, only the owner can delete files in the folder