Target:
- heach ftp user ca access a specified directory (chroot)
- each ftp user can access a subtree eventually overlapping another user subtree
- use virtual users - ftp users won't have access to the hosting machine and would be simply defined in a file (eventually allowing a simpler automation)
I use docker here to demonstrate the proposed setup; you can deploy the docker image if you wish or just follow the steps and reproduce it elsewhere.
What's in it:
docker-compose.yml- following Yannick Pereira-Reis's suggestions compose is my preferred build tool for Dockeretc/init.dis a modified copy of the init script in order to avoid the "vsftpd failed - probably invalid config." message as suggesterd here/etc/pam.d/vsftpd- pam configuration to instruct ftp daemon to look for users in/etc/vsftpd/ftpd.passwd(virtual users)/etc/vsftpd_user_confcontains an ad-hoc configuration file per each ftp virtual user/etc/vsftp.confbasic vsftpd configuration to enable virtual users and per-user-configurationDockerfileis the magic glue for all this stuff
See