How can I restrict user from 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, but I don't know the way to do this in Ubuntu.
permissions
How can I restrict user from 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, but I don't know the way to do this in Ubuntu.
Best Answer
You need an access control list to do this. Package is called acl
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:
sadms
eiciel
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 ;)