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

migrated from stackoverflow.com Jan 11 at 9:59

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

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.