I'm running a Debian 7 server and have the following Scenario (example names)


  • paul:paul
  • john:paul

Directory: /home/paul/Directory

  • File W (Owner paul, Group paul, Rights: 0770)
  • File X (Owner paul, Group paul, Rights: 0700)
  • File Y (Owner paul, Group paul, Rights: 0700)
  • File Z (Owner john, Group paul, Rights: 0770)

The user john should be able to delete "File Z" but not "File X" or "File Y" He should also have permission to edit and delete "File W".

Short: He should only be able to delete his own files but edit all with the permission for it.

Im searching a solution to use the deletion bit of the directory on specified files. The option "chattr" is no option because nothing should be done with root rights.

Does anybody has an idea?


In the POSIX security model, to delete a file you only need write access to its parent directory. So if the "john" account has +w rights to /home/john/Directory, it will always be able to delete files inside.

But one exception is the "sticky" / "restricted deletion" mode. When you set +t on a directory, file deletion is restricted only to the file's owner or to the directory's owner. (For example, /tmp works this way.) So if you chmod +t and chown root the directory, you should get the expected result.

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.