I want to give users the ability to create write and read files in other user directory, but not to have option to delete the file after created ( sticky bit not going to work here … )
for example :
I have user manager
with directory repository
I have user worker1
that need to write files to /manager/repository
but can't delete the files
I have user worker2
that need to write files to /manager/repository
but can't delete the files
I have user worker3
that need to write files to /manager/repository
but can't delete the files
but worker 1-2-3
can't delete the files after created only manager
and root
can delete the files worker 1-2-3
created.
I tried few chown
and chmod
tricks with applying the sticky bit without success.
Best Answer
Unlike Windows there is no distinct delete permission under Unix/Linux. The right to delete (or create or rename) a file is bound to the containing directory. Remove the write permission for the workers on
/manager/repository/
in order to deny the workers to create, delete, and rename files.Note that it is not possible to permit creation of files but to deny their deletion.