I am busy setting up a file server in our church office (using samba on a debian machine).

I would like to impliment a dropbox-like folder for each user, where othere users may deposit files. Ideally it should work like this: The "owner" (does not necesarily have to be the unix owner) "A" should be able to read and delete files from his own dropbox only (not paste or create new files) All other users should be able to only paste or create files in the "A" directory, no deletion or overwrites. Ideally they should not even be able to list the folder contents.

Currently, all regular users belong to a "Users" group, and I have set the directory owners to be their respective users (ie "a" is the owner of the "a" directory inside the "dropboxes/" directory) I tried setting the permissions to 533 and 522 for all these user folders, but I keep on getting the wrong result. I also tried using ACLs, but that, also, did not suceed. The "dropbox" directory lists as follow:

drwxrwxr-x 5 root users 4096 Apr 7 01:01 dropboxes

Any tips?

  • Deleting from a directory requires write access to it. – peterph Apr 8 '13 at 12:56
  • Unless you set the sticky bit for the directory, in which case only the owner can delete the file? Or am I wrong – aguywithsocks Apr 9 '13 at 16:10
  • You are wrong. :) Sticky makes sure one can't delete a file to which he has permissions unless he also owns it. Write access to the directory is required always, because removing the file consists of two steps: 1) removing the data and freeing inode 2) updating the directory contents. For the second step write permission on the containing directory is needed. – peterph Apr 9 '13 at 22:38

Your Answer

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

Browse other questions tagged or ask your own question.