1

I recently set up an FTP site using VSFTPD on Debian, and am running into an issue with uploaded directories not being able to be accessed. Files are okay but when I try to upload a directory or change into a freshly uploaded empty directory, I get the following error:

Failed to change directory.

If I go in through the shell as and chmod the correct permissions, I can access the directory with no issues. If I go in through the shell and make a new directory, there is also no issue with it, this issue only seems to be on directories uploaded via an FTP client.

Any help on this is greatly appreciated. I am running Debian 7.5 (Wheezy) and the client I am using to connect is WinSCP from a Windows 7 system. I am using a chroot jail, where the the user is jailed to their home directory (which is not writeable).

1 Answer 1

2

Well, I think there may be two causes:

  1. You log in to the FTP server as anonymous, but the uploaded directories are chown'ed to another user, and they have permissions 0600, so they become unavailable to ftp (or another user set by ftp_username) to which anonymous users are mapped by the vsftpd daemon.

    Try to set the following in your vsftpd.conf:

    chown_uploads=YES
    chown_upload_mode=0644
    chown_username=ftp
    

    Note that you may want to change ftp to something else if you already changed ftp_username or guest_username.

  2. You said that uploaded files are OK, but directories are broken. That makes me think that there is something wrong with umask, perhaps it is set to something like 011 or 033 that causes the execute bit to be disabled, and therefore you cannot list directories.

    Try to fix that by setting umask values to 022 in the vsftpd.conf:

    anon_umask=022
    local_umask=022
    
1
  • I solved the problem earlier today. I had accidentally set local_umask twice in vsftpd.conf, and the second instance was set to 011, which did cause my issue.
    – codewario
    Commented Jul 22, 2014 at 20:26

You must log in to answer this question.

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