1

I am configuring vsftpd so that when user login it will redirect to a specified directory with read and write permissions in that directory. I have configured the following:

Content of vsftpd.conf

anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
userlist_enable=YES
userlist_file=/etc/vsftpd/userlist
userlist_deny=NO
user_config_dir=/etc/vsftpd/user_config_dir/
allow_writeable_chroot=YE

Content of userlist

ale
sunny

Content of /etc/vsftpd/userlist/ale

local_root=/var/www/ftp/ale
write_enable=YES
dirlist_enable=YES
download_enable=YES

Output ls -al /var/www/ftp/ale enter image description here

When I login with user ale, I am redirected to / instead of /var/www/ftp/ale as expected.

10
  • Please edit your question and include the output of ls -al /var/www/ftp/alex
    – Panki
    Mar 27, 2022 at 13:00
  • When you login via ftp check if this / is not actually /var/www/ftp/alex Mar 27, 2022 at 13:22
  • 1
    have you restarted the vsftpd after changes? Mar 27, 2022 at 13:23
  • I have restarted vsftp @αғsнιη
    – aphabeta
    Mar 27, 2022 at 13:30
  • when i logged in it came / @Ro
    – aphabeta
    Mar 27, 2022 at 13:31

1 Answer 1

1

So the answer is: work as design.

The reason is first you have set the root directory for this user:

local_root=/var/www/ftp/ale

then you define to chroot local users;

chroot_local_user=YES

so when the user login (via ftp) it is directed to directory /var/www/ftp/ale which is mapped from ftp daemon as root (/). And you can't see upper directories

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .