I have set up a FTP server using vsftpd and enabled anonymous upload and download. The problem I have is that when I upload a directory it will be uploaded successfully (I can see it in server), but the next time I want to check that directory, FTP client shows an empty directory!!

There is no error logged in /var/log/vsftpd.log. The pub folder (home folder for anonymous ftp user) has also write permission. I tested various config options but none helped!

The latest config options I set are like below:


I even turned off firewall once for testing it, but it didn't change anything!

  • Stumbled upon this myself. Many pages have the same question, but often not the (full) answer. It's the PASV ports that need to be reachable in PASV mode. This may need the firewall/IPtables to be adjusted: serverfault.com/questions/421161/…
    – user102760
    Feb 11, 2015 at 15:21
  • Did you ever solve this problem? I have the same problem now. None of the suggestions mentioned here helps. I also noticed that you never marked any of the answers as the solution. Dec 11, 2015 at 18:27
  • @SarahWeinberger Sorry for the very late reply. No, I couldn't find a solution.
    – saeedn
    Jun 20, 2016 at 3:29
  • 1
    seccomp_enable=YES (the default) on Gentoo caused this behavior; changing this setting to NO fixed it. Interestingly on Debian vsftpd reportedly exhibited the same seccomp warnings, but did not cause vsftpd to fail when listing a directory.
    – Winny
    May 14, 2019 at 16:02

10 Answers 10


Two suggestions:

  1. Does whatever user ID that will run FTP have "write" permissions on the "root" directory that vsftpd will use as its current working directory? vsftpd doesn't want a writable working directory.

  2. The vsftpd.conf file can have a hide_file directive. Depending on the regular expression specified by that directive, anonymous users might not be allowed to see any files.

I've had this problem with vsftpd in the past, and I recall having a vsftpd.conf setting that caused it, so read that config file closely, understand all the params and their values.

  • Thanks for suggestions. Yes that directory has write permission. When I restrict write permission to owner, I get permission denied while uploading, so I made it world writable. And I checked hide_file, it is not set in config file, which according to unix man page of vsftd.conf should be set to (none).
    – saeedn
    Feb 2, 2012 at 6:49

Thanks to user81029 for pointing out

sudo setsebool -P allow_ftpd_full_access 1

solves the issue with empty ftp directory after mount --bind a folder into /var/ftp/ on SELinux

  • That was the problem for me on Centos 7.5-1804. Thanks! Jan 24, 2019 at 18:27

If your config is correct and it's not a firewall issue it could well be SELinux, in my case it was and the answer was:

setsebool -P allow_ftpd_full_access 1

From the man page:

If you want to allow ftp servers to login to local users and read/write all files on the system, governed by DAC, you must turn on the allow_ftpd_full_access boolean


I just forced my VSFTPD to run only in active mode and that seemed to have worked for me. To do that put the following line in your config file:


What I ended up doing, though, was enabling the passive mode as for some applications it appeared to have been a requirement. It looks like VSFTPD does not play with defaults nicely so it is best to specify your preference explicitly:


It is also important to get up the correct iptables settings if you are running a firewall. Here are mine, extracted from my /etc/sysconfig/iptables file:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1024:65535 -j ACCEPT

In /etc/vsftpd.conf set seccomp_sandbox=NO

Fixed this for me, reported as https://bugzilla.opensuse.org/show_bug.cgi?id=1173275


Have you considered adding hide_file=NO?

  • Yes, I tried it, but it didn't help
    – saeedn
    Feb 4, 2012 at 9:19

A possible solution for anybody on a private LAN

I also had VSFTPD establishing an SSL passive connection but as soon as Filezilla sent the LIST command for the directory listing, it would time out. VSFTPD logs showed this error:

[userftp] DEBUG: Client "x.x.x.x", "Control connection terminated without SSL shutdown."

My problem was that I was on the same private LAN as my FTP server. This meant both my client machine and the server had the same public IP. Presumably my router was trying to redirect FTP responses from the server, back to the server because of my port forwards. My router doesn't allow for incoming/outgoing config, just PORT>IP. My solution was simple; turn on the VPN on my client machine. The same VPN I had turned off specifically to save it causing me trouble while configuring VSFTPD [facepalm]. This gave my client machine a different public IP therefore allowing my router to differentiate between the client and server machines and route server responses accordingly.

Of course another solution would be to use local IP addresses, but I wanted to tighten up a passive config that would work from anywhere.


if SELinux is enabled, have you tried setenforce 0 command? Note, it temporarily enters into permissive mode.


I know you 've tried to disabled your firewall and this solution is not applicable to you but this could help someone else

In my case I had to allow BOTH port 20 and 21

ufw allow ftp


ufw allow 20/tcp

If you have tried to list directories by using commands like ls, dir that will not help.

If you use any GUI FTP client, for example filezilla, all directories will be shown.

You must log in to answer this question.

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