I'm trying to set up a FTP server, and I've been following guides. They all only show how to set up one user, I need to have multiple users be able to access the same folder and pull files out of it. Am I able to set up one folder and jail multiple users to that folder?
I am using vsftpd. The users will be independent and need the ability to download files out of the folder without being able to write anything to that folder or leave it.
I have been following these guides:
https://documentation.ubuntu.com/server/how-to/networking/ftp/index.html
From
man vsftpd.conf
:Following this guide
https://documentation.ubuntu.com/server/how-to/networking/ftp/index.html
I setup vsftpd and got it working with one user (user_a). But I had to set the owner of user_a's home directory to root and set the permissions of the directory to 755. This is because I wanted to be able to update the files in the directory, but I don't want any ftp users to be able to make any changes, they will only be able to see files and download them. Also, in the vsftpd.conf uncomment chroot_local_user=YES. This makes it to where the ftp users are locked in user_a's home directory and can not access the root directory.
Then once that's done I did a reboot of the server. If you're unable to reboot your server restarting the vsftpd service should do the trick as well. Then I followed this guide on setting up virtual users.
https://github.com/dagwieers/vsftpd/blob/master/EXAMPLE/VIRTUAL_USERS/README
However I did not use berkeleydb. Berkeleydb has a lot of functions but the only relevant one is creating and managing .db files. If you already have berkeleydb or need it for other reasons following the guide is fine, but for me setting up berkeleydb was a lot of extra effort, so I used SQLite3 for .db creation using this guide.
I had to run this to get db functionality
and I used these here in the vsftpd.pam file because I didn't use berkeleydb for my .db files.
Thank you to Bodo in the comments of this post for showing me the guide on github for virtual user creation.