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).
Well, I think there may be two causes:
You log in to the FTP server as
anonymous
, but the uploaded directories arechown
'ed to another user, and they have permissions0600
, so they become unavailable toftp
(or another user set byftp_username
) to which anonymous users are mapped by thevsftpd
daemon.Try to set the following in your
vsftpd.conf
:Note that you may want to change
ftp
to something else if you already changedftp_username
orguest_username
.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 like011
or033
that causes theexecute
bit to be disabled, and therefore you cannot list directories.Try to fix that by setting
umask
values to022
in thevsftpd.conf
: