The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FTP Connects but Timeout with Error Failed to retrieve directory listing

Discussion in 'General Discussion' started by Success1, Sep 8, 2016.

Tags:
  1. Success1

    Success1 Member

    Joined:
    Sep 8, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Famunda
    cPanel Access Level:
    Root Administrator
    We are in the process of setting up a new server and anytime we try to connect via FTP we get a message stating a successful login, but the connection can not get a directory listing.

    We have tried using the default cPanel user and tried setting up another test FTP account but all ends in the below Error Messsage.

    Code:
    Status:    Disconnected from server
    Status:    Resolving address of *****
    Status:    Connecting to **.**.**.**:21...
    Status:    Connection established, waiting for welcome message...
    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 (**,**,**,**,176,105)
    Command:    MLSD
    Error:    The data connection could not be established: ETIMEDOUT - Connection attempt timed out
    Error:    Connection timed out after 40 seconds of inactivity
    Error:    Failed to retrieve directory listing
    Status:    Disconnected from server
    Status:    Resolving address of *****
    Status:    Connecting to **.**.**.**:21...
    Status:    Connection established, waiting for welcome message...
    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 (**,**,**,**,118,88)
    Command:    MLSD
    Error:    The data connection could not be established: ETIMEDOUT - Connection attempt timed out
    Error:    Connection timed out after 40 seconds of inactivity
    Error:    Failed to retrieve directory listing
    
     
  2. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    You should follow the directions on cPanel's site for enabling Passive Mode FTP support on the server.

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

    In case you don't want to read that, below is what I do.

    You'll want to make sure you have Passive Mode FTP support enabled by uncommenting the appropriate line in /etc/pureftpd.conf and then making sure those ports are open in your firewall.

    1. Edit /etc/pureftpd.conf

    Uncomment the below line and save /etc/pureftpd.conf

    PassivePortRange 30000 50000

    2. Run /scripts/restartsrv_pureftpd to restart pureftpd

    3. Make sure your firewall is allowing incoming connections in the PassivePortRange

    If you are using CSF, look in /etc/csf/csf.conf for a line starting with TCP_IN =

    TCP_IN = "20,21,22,25,26,53,80,110,113,143,443,465,587,967,993,995,2077,2078,2082,2083,2086,2087,2095,2096,30000:35000"

    Notice how the allowing of ranges of ports is set up in CSF - you use 30000:35000.

    4. Run csf -r to apply the CSF config change

    5. In your FTP client make sure you are using Passive mode FTP. I never do this. But I know my firewall on my PC will not block outbound connections from my FTP client. If you aren't sure, then on your PC you will want to force passive mode.

    Mike
     
    cPanelMichael likes this.
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, as mentioned in the previous post, you should be able to follow the instructions on the following document to address the problem:

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

    Starting with version 60, the cPanel installation process will automatically enable passive mode and ensure the required ports are open as part of the standard firewall configuration.

    Thank you.
     
Loading...

Share This Page