The vsftpd manual describe how to deal with multiple users on the FTP server via an environment variable called user_config_dir :-
user_config_dir
This powerful option allows the override of any config option specified in the manual page, on a per-user basis. Usage is simple,
and is best illustrated with an example. If you set user_config_dir to
be /etc/vsftpd_user_conf and then log on as the user "chris", then
vsftpd will apply the settings in the file /etc/vsftpd_user_conf/chris
for the duration of the session. The format of this file is as
detailed in this manual page! PLEASE NOTE that not all settings are
effective on a per-user basis. For example, many settings only prior
to the user's session being started. Examples of settings which will
not affect any behviour on a per-user basis include listen_address,
banner_file, max_per_ip, max_clients, xferlog_file, etc.
Default: (none)
This seems logical enough. You create a directory in /etc and assign its name to the user_config_dir in the vsftpd.conf file. Then you create sub-folders within this folder with the name of each user. Into each of these you put the special configurations for that user.
Only trouble is that it doesn't work !
Whenever I have a vsftpd.conf file with a statement like
user_config_dir=/etc/vsftpd_user_conf
and sub-folders for say two users, user1 and user2, I get an error after restarting vsftpd service. It stops in the vsftpd.conf file, I think error -2.
There is no guidance or worked example for using this configuration separation method anywhere I looked. Indeed I am surprised that vsftpd coders haven't produced better documentation by now.
This is not a critical problem as yet for me: I can use the same SSL certificate for all vsftpd accounts to date. But it would be useful to be able to apply different configs to other accounts in the future.
Can anyone suggest a reason for the error that has occurred ?
For the record I am using an Ubuntu 22.04 server from OVH.
I connect to it for sys admin using SSH from my work PC.
For FTP I connect to my server using FileZilla 3.58 on my work PC - this works fine for both insecure and secure FTP transfers without using any user_config_dir setting.