Setup vsftpd user default dir (CentOS)

Hi,

Today, I’m sharing how to simply setup the default directory of your vsftpd user on CentOS.

1. Edit vsftpd.conf

vi /etc/vsftpd/vsftpd.conf

2. Add the line

user_config_dir=/etc/vsftpd/vsftpd_user_conf

3. Create a dir, and change directory to the created dir

mkdir /etc/vsftpd/vsftpd_user_conf; cd /etc/vsftpd/vsftpd_user_conf/

4. Create a file with the username as filename of the vsftpd user

vi username

5. Add the line

local_root=/var/www/html

You’re done! Once the user logs in, the file you’ve just created will be used to read as config parameter. I believe it should also work with other flavour of Linux, only the vsftpd installation are different.

(for more info just man vsftpd.conf)

Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *