cPanelResources

FAQ: Why do I see "Failed to retrieve directory listing" errors during FTP authentication attempts?

Jerald Feller

Member
Feb 14, 2017
13
3
3
Philippines
cPanel Access Level
Root Administrator
[Moderator Addition]
cPanelResources submitted a new resource:

FAQ: Why do I see "Failed to retrieve directory listing" errors during FTP authentication attempts? - Learn why "Failed to retrieve directory listing" errors occur during FTP connection attempts.

Question:
Why do I see "Failed to retrieve directory listing" errors during FTP authentication attempts?

Answer:
FTP uses a data port and a command port to transfer information between a client and a server. During an active mode session, the command port uses port 21 and the data port uses port 20. During a passive mode session, however, the data port does not always use port 20. Instead, a data port range of 49152 through 65534 is utilized by default...
Read more about this resource...
[End Of Moderator Addition]

Hi, why I cant connect to FTP or it gives me error: Failed to retrieve directy listing?
I'm new to the server stuff and besides I didnt do any anything to the FTP configuration or settings. I create ftp accounts trough cpanel.

This is the logs when I access ftp.

Status: Connecting to 104.*******...
Status: Connection established, waiting for welcome message...
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Status: Logged in
Status: Retrieving directory listing...
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 (208,167,229,23,178,72)
Command: MLSD
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing


Please advise, Thanks
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463

Jerald Feller

Member
Feb 14, 2017
13
3
3
Philippines
cPanel Access Level
Root Administrator
Hello,

You can check to ensure your server is properly configured for passive mode FTP by reviewing the following document:

How to Enable FTP Passive Mode - cPanel Knowledge Base - cPanel Documentation

Additionally, if you are using CSF, there's a thread on this topic at:

SOLVED - passive mode on pure-ftp + configserver

Thank you.
Thank you for your response.

Yes I did look on that but I didnt change anything on the cofiguration file since that passive mode is enabled already or I'm getting it wrong.

Here is the cofiguration for /etc/pur-ftpd.conf
# Port range for passive connections replies. - for firewalling.
PassivePortRange 30000 50000

and there is no CSF in my server so I guess its on IPTABLES
-A INPUT -p tcp -m tcp --dport 30000:50000 -j ACCEPT
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello,

Could you open a support ticket using the link in my signature so we can take a closer look?

Thank you.
 

Jerald Feller

Member
Feb 14, 2017
13
3
3
Philippines
cPanel Access Level
Root Administrator
Hello,

Could you open a support ticket using the link in my signature so we can take a closer look?

Thank you.

Hi,

Thank you for the response.
I just figured it out and fixed the issue.

This is no solve.

Its weird though in the pure-ftpd.conf
ForcePassiveMode public-ip-address is somehow changed and I dont know why.. havent touch that file ever since..

But btw its solve..
Thank you very much
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463

Michael Legg

Well-Known Member
Mar 2, 2015
90
6
58
New Farm, Queensland, Australi
cPanel Access Level
Website Owner
I'm having the same issue. I can connect via FTP but can't get a directory listing.
I've tried everything mentioned in these forums including disabling CSF, but I still can't get FTP to work (Passive or active)
Running cPanel 66.0.25 release
 

Jerald Feller

Member
Feb 14, 2017
13
3
3
Philippines
cPanel Access Level
Root Administrator
I'm having the same issue. I can connect via FTP but can't get a directory listing.
I've tried everything mentioned in these forums including disabling CSF, but I still can't get FTP to work (Passive or active)
Running cPanel 66.0.25 release

Hi, try open your pure-ftpd.conf and disable ForcePassiveMode just comment it and try loggin in again in FTP.

This solved my issue.
 

Michael Legg

Well-Known Member
Mar 2, 2015
90
6
58
New Farm, Queensland, Australi
cPanel Access Level
Website Owner
Hi, try open your pure-ftpd.conf and disable ForcePassiveMode just comment it and try loggin in again in FTP.

This solved my issue.
Thanks Jerard

I have ...

1. Disabled passive mode completely.

2. Run these commands ->
openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048
/scripts/restartsrv_pureftpd

3. Enabled Broken Clients Compatibility.

I can now connect via FTP - at least in Active mode.
 

cPanelResources

Staff
Staff member
Apr 27, 2015
112
83
153
Houston, TX
cPanel Access Level
DataCenter Provider
cPanelResources submitted a new resource:

FAQ: Why do I see "Failed to retrieve directory listing" errors during FTP authentication attempts? - Learn why "Failed to retrieve directory listing" errors occur during FTP connection attempts.

Question:
Why do I see "Failed to retrieve directory listing" errors during FTP authentication attempts?

Answer:
FTP uses a data port and a command port to transfer information between a client and a server. During an active mode session, the command port uses port 21 and the data port uses port 20. During a passive mode session, however, the data port does not always use port 20. Instead, a data port range of 49152 through 65534 is utilized by default...
Read more about this resource...