vsftpd restrict local users to home and group directories

i’ve got vsftpd install on an ubuntu server 9.10

i can use chroot to restrict users to their own home directories but i also want to give them access to a group shared folder

for example, users foo1 and foo2 are local users in the group foos
i want foo1 to have access to /home/foo1 and /svr/foos and foo2 to have access to /home/foo2 and /svr/foos

other notes:
using pam and enforce local user ssl
already tried mount –bind but it does weird permissions when you try to mount bind multiple users to the same

Answer

Well, obviously symlinks aren’t going to work and to the best of my knowledge you can’t have two completely seperate chroot environments available at the same time. So… if you want to chroot them to their home folders plus the foos group folder then just have all users dropped (chrooted) into /home.

Then mount /srv/foos to /home/foos instead. Make sure each users own homedir has proper permissions so that only that user has access to it. In this setup each user will be able to access the foos group folder and their own home folder. They could see that other users home dirs exist, but will be unable to access them.

Perhaps someone else has a better idea?

Attribution
Source : Link , Question Author : wag2639 , Answer Author : CarpeNoctem

Leave a Comment