FTP hanging at "150 Here comes the directory listing."

I have a CentOS server running VSFTPD so I can upload files to my site.

When I connect to the FTP, it lists the folders in the root directory, and I can open all of the folders apart from a folder called 'public' which just causes FileZilla to hang on "150 Here comes the directory listing."

A friend can connect to the server and access the folder just fine.

Also when I access some of the other folders I mentioned, when I try to download the files in there, it just hangs on transferring.

I have set up passive mode in vsftpd.conf and opened the ports like following:

pasv_enable=Yes
pasv_max_port=12100
pasv_min_port=12000
pasv_address=<IP ADDRESS>

IPtables:

-I INPUT -p tcp --destination-port 12000:12100 -j ACCEPT

I can connect to other FTP servers and transfer files just fine, but my own server seems to have something wrong. I have also tested it over multiple FTP accounts.


Make sure that you also have the "ip_conntrack_ftp" kernel module loaded, that will track related connections needed for actual data transfer. As root (or using sudo), run this:

modprobe ip_conntrack_ftp

Also make sure that SELinux (if enabled) isn't blocking your requests, make sure to use public contexts, e.g. user_home_dir_t (the default context of your homedir) will by default NOT work with an FTP server, unless you do:

setsebool -P ftp_home_dir 1

There are some other ftp related SELinux flags as well, that may be interfering in some situations. Run getsebool -a|grep ftp to see them all and look them up in the documentation for extensive descriptions.