1

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?

1 Answer 1

1

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.

5
  • Is there a way to get the sticky bit to inherit automatically to sub-folders that are created? Aug 8, 2011 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: vanemery.com/Linux/ACL/linux-acl.html Aug 10, 2011 at 13:59
  • I have been trying to accomplish this using ACLs and am still not getting what I need. Any more pointers? Thanks. Aug 14, 2011 at 19:18
  • nothing that I have tried personally. Try to understand how ACL inheritance works Aug 15, 2011 at 21:12
  • POSIX ACLs cannot fully replicate the sticky bit's functionality.
    – user1686
    May 24, 2016 at 11:39

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.