How to set the default ftp root folder for an Ubuntu user connecting to VSFTPD

ftprootuser-default

How do I set/change the default ftp root folder for a specific user? I want to be able to create a developer account that homes to different sites on a development box depending on what is currently being worked on.

EDIT: The server is running Ubuntu and vsftpd.

Best Answer

If you specify the user_config_dir in vsftpd.conf, you can set any config option on a per-user basis.

From man vsftpd.conf:

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.

So, setting local_root in this way to the desired directory changes the FTP root for just that user.

Related Question