Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
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. –  Zack 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
add comment

migrated from stackoverflow.com Jan 11 '12 at 9:59

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.