I've installed vsftpd following this tutorial: https://help.ubuntu.com/6.06/ubuntu/serverguide/C/ftp-server.html

The setup went well and I'm able to connect using my local users credentials as expected. However I have a problem with directory listing and permissions ..

If I do not restrict local users to their home directory with chroot_local_user, they are able to browse the whole file system down to the deepest /dev folder.

On the other hand when I try to enable the chroot_local_user directive, the users are indeed restricted to their home directory, but the initial remote directory is the root partition. Listing any directory raise an authorization error except for the user's home directory.

I've checked vsftpd's configs and nothing seems to do what I want ..

Another thing I don't understand is why on earth the package installation is creating a /home/ftp directory if it doesn't use it.

Edit: I've noticed vsftpd is running as root.. is that the expected behavior ??

  • What is the behavior that you are expecting? – Matt Simmons Oct 21 '09 at 20:06
  • First of all I don't expect the FTP to allow every user full access to the file system. I expected it to use /home/ftp as root folder or the home directory of the users if chroot_local_user is enabled. – h3. Oct 21 '09 at 21:21

Make sure that local_root isn't set:

    This option represents a directory which vsftpd will try to change into after
    a local (i.e. non-anonymous) login. Failure is silently ignored.

    Default: (none) 

Also, this option may be of service:

    If enabled, along with chroot_local_user , then a chroot() jail location may 
    be specified on a per-user basis. Each user's jail is derived from their home
    directory string in /etc/passwd. The occurrence of /./ in the home directory
    string denotes that the jail is at that particular location in the path.

    Default: NO

Then you can add /home/user/./ to the /etc/passwd file.

Lastly, the ftp user is created for anonymous logins:

    This is the name of the user we use for handling anonymous FTP. The home
    directory of this user is the root of the anonymous FTP area.

    Default: ftp 

All from http://vsftpd.beasts.org/vsftpd_conf.html

  • This didn't help in my case. chroot_local_user enabled, local_root not set, passwd_chroot_enable=Yes – ibo.ezhe Aug 11 '12 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.