Change the default directory for local and anonymous users on vsftp on CentOS 6 & 7

3 January 2020

To change the default login directory for anonymous user(s):

[root@phantom ~]# vim /etc/vsftpd/vsftpd.conf

anon_root=/Path to directory

To change the default login directory for local user(s):

[root@phantom ~]# vim /etc/vsftpd/vsftpd.conf

local_root=/Path to directory

NOTE: Don’t forget to set the SELinux context in case of enabled.

[root@phantom ~]# setsebool -P allow_ftpd_anon_write on 
[root@phantom ~]# setsebool -P ftp_home_dir on

You might need to restart the service for the changes to take effe

[root@phantom ~]# systemctl restart vsftpd

Leave a Reply