STS Host and Tech Knowledge base
Close this search box.

Solve FTP Connection fails passive mode on Pure FTP config server

Error Case: Failed to retrieve directory listing

Solve FTP failed connection: for example you want to connect your website using filezilla
software after you configure your domain name with cPanel and add your FTP
username and password correctly , then you get the following error:

					Command: PWD
Response: 257 “/” is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode
Command: MLSD
Error:        The data connection could not be established: ETIMEDOUT – Connection attempt timed out
Error:        Connection timed out after 60 seconds of inactivity
Error:        Failed to retrieve directory listing

Solve FTP Failed to retrieve directory listing from CSF ConfigServer Security & Firewall

When you see ftp error massage that is because your server is blocking the Passive port range 30000 35000, so we have to allow those port range from configserver by allowing TCP_IN , follow one of these two ways:

  • From your WHM Home »Plugins »ConfigServer Security & Firewall , Allow incoming TCP ports on TCP_IN = then add the following port range 30000:35000 and press Change Button, and CSF will ask for restart the configserver to take effect , Click Restart Csf+ldf button, then you will be able to connect to your FTP site without any issue.
  • Or you can do the following step:
    1. Login to the server via SSH as root.
    2. Edit /etc/csf/csf.conf and look for the line that begins with: TCP_IN
    3. add 30000:35000 to TCP_IN section.
    4. Run csf -r to reload the config in the live firewall.

Solve FTP Failed to retrieve directory listing Over SSL

When you face this case just connect via FTP on plain text (none secure connection ), but unable to use FTP over TLS, you are getting the Error:Failed to retrieve directory listing. Follow the same steps as above after replacing the port range on those steps with 60000:60100.

Share Article

Related Articles