Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question

migrated from Jan 11 '12 at 9:59

This question came from our site for professional and enthusiast programmers.

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 '12 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. – Corey Henderson Jan 11 '12 at 0:13
Corey can you point me to a site has this sort of SELinux information? – user1141993 Jan 11 '12 at 13:23

You must log in to answer this question.

Browse other questions tagged .