I want to create a shared folder on my Debian server so that users can create and edit files, but not be able to delete each other's files in that directory.


Users that can read and write files in the map are in a group: work

I tried few permission commands like these, but still not succeeding:

setfacl -dm u::rwx,g::rwx,o::r /shared/directory

How can I achieve what I want?

  • Try giving full permissions using the command chmod 777 filename.txt – manjesh23 Apr 26 '16 at 9:49
  • Are you aware which access right and where is responisble for allowing or denying the deletion of a file? – Run CMD Apr 26 '16 at 9:52

Classical solution for shared folders is sticky bit, that prevents deleting files of other users. The best example is /tmp dir.

Therefore, set the following ownership:

chown root:work /shared/directory

and permissions:

chmod 3775 /shared/directory

I'd recommend the following POSIX ACL:

setfacl -dm u::rwX,g::rwX,o::rX /shared/directory

Only users of group work can edit newly created files and dirs but can not delete the files of each other.


chmod 1776 /home/sharedfolder from root user


  • 4
    Can you expand and explain why this answer works for the OP? It makes it a more valuable answer to keep around – Canadian Luke Apr 26 '16 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.