1

I want to create a folder, so the owner can create and read files but not be able to delete them. I tried with ACL, but the owner can still delete the files.

$ setfacl --set u::rwx,g::-,o::- control
$ setfacl -d --set u::r-x,g::-,o::- control
$ touch 1.txt
$ ls -al 1.txt
-r--------. 1 user group 1.txt
$ rm 1.txt 
rm: remove write-protected regular empty file `1.txt'? y
3
  • 1
    I don't believe this is possible. You can have read but not create or delete, but you can't have one of create or delete without the other. Also, this is pointless, as the owner can always reset the permissions to whatever they want.
    – zwol
    Jan 11, 2012 at 0:09
  • It can be done with SELinux, but that's fairly complicated. It also can be done by setting the "append only" attribute on the directory, but that comes with its own set of trickery when dealing with putting files in there. Jan 11, 2012 at 0:13
  • Corey can you point me to a site has this sort of SELinux information? Jan 11, 2012 at 13:23

0

You must log in to answer this question.

Browse other questions tagged .