command-line commands customization fedora fixes ftp GUI Internet linux network OS quick reference redhat selinux server software tech tips

VSFTPD: Transfer Done (but failed to open directory)

If you like the following article and it has helped you out, please leave a comment and let other readers know of you success and thank you for reading my blog.

In most cases, the supplied sample configuration file for VSFTPD located in /etc/vsftpd will work for most simple setups. However, you might find that after connecting to your FTP server using you favourite FTP client, you find you recieve the following error in you client log:

Error: Transfer Done (but failed to open directory)

The main reason that the client can’t read or “open” the directory is permission issues on the folder denying the client access. When running a Red Hat based (Red Hat, Fedora etc.) server, SELinux is installed and live be default. SELinux controls a second set of folder/file access permissions on top of the standard linux folder permissions system. And because in most cases SELinux is not setup properly, users and administrators are unaware that SELinux is working on this layer.

Because of many issues with configuration SELinux, if you don’t properly set this up, SELinux will deny FTP access to the folders and also see the access as a possible security threat.

In my configuration, the standard linux permission system is fine. Therefore, disabling SELinux resolves this issue.

To disable SELinux (Note: this needs to be done as root or sudo):

  1. Using a command-line, goto /etc/selinux/
  2. Open the file config using your prefered text editor (e.g. vim, nano)
  3. Find the option SELINUX= and set it to the following:
    SELINUX=disabled
  4. Save the file and reboot you machine.

Once this has been done, you FTP clients should now be able to access your folders.