Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to setup 2 individual FTP users. They should both have access to the same directory. They both need to be able to read/write into the directory. But, I want them not to be able to write to each others files (e.g. delete, remove, rename, etc.).

So let's say the shared directory is: /home/ftp/shared/

UserA needs read/write access to /home/ftp/shared/. UserA should only have write access to his own files. UserB also needs read/write access to /home/ftp/shared/. UserB should only have write access to his own files.

It would be a unix box of sorts, but that is the only restriction. I could use whatever software. I am currently thinking pure-ftpd or vsftp but I am open to all ideas.

Any ideas how I can accomplish this?

share|improve this question
up vote 1 down vote accepted

You can achieve this using only the unix permissions.

  1. You should create a group (e.g. mysharegroup). Both of your users must be in this group.
  2. Make the shared folder sticky and owned by a third user (the administrator of the ftp) and the group mysharegroup.
  3. Make the folder readable and writable by the owner and the group.

It's done. Every user can write into the shared directory because they're part of the sharedgroup but they can't delete the file owned by someone else because of the sticky bit.

share|improve this answer
Is there a way to get the sticky bit to inherit automatically to sub-folders that are created? – Jonathan Hult Aug 8 '11 at 5:38
I'm not sure if you can accomplish this by using the standard unix permissions, what I'm sure is that you can do that by using ACLs. A brief tutorial on how to set up ACLs is here: – David Costa Aug 10 '11 at 13:59
I have been trying to accomplish this using ACLs and am still not getting what I need. Any more pointers? Thanks. – Jonathan Hult Aug 14 '11 at 19:18
nothing that I have tried personally. Try to understand how ACL inheritance works – David Costa Aug 15 '11 at 21:12
POSIX ACLs cannot fully replicate the sticky bit's functionality. – grawity May 24 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .