Cannot connect to FTP in passive mode

Created:

2016-11-16 13:03:41 UTC

Modified:

2017-07-26 10:37:36 UTC

27

Was this article helpful?


Have more questions?

Submit a request

Cannot connect to FTP in passive mode

Applicable to:

  • Plesk for Linux

Symptoms

It is not possible to connect to FTP in passive mode on a Plesk server. One of the following errors occurs when connecting via FTP:

227 Entering Passive Mode
ftp: connect: Connection refused

OR

Response:       227 Entering Passive Mode (1,2,3,4,5,17).
Error: Connection timed out
Error: Failed to retrieve directory listing

OR

Response:       227 Entering Passive Mode (1,2,3,4,5,17).
ftp: connect: Connection timed out

OR

Response:       227 Entering Passive Mode (111,235,75,26,192,30).
Command: LIST
Response: 425 Can't open data connection.
Error: Failed to retrieve directory listing.

Cause

  1. Issues with the network configuration. See also KB article How to configure a passive ports range for ProFTPd on a server behind a firewall?
  2. The passive ports range is not configured, either in /etc/proftpd.conf or /etc/proftpd.d/*.conf . Alternatively, passive ports are not open in the firewall.

Resolution

  1. If you are using NAT, make sure it is configured correctly. You need to configure the ProFTPD service properly by adding the PassivePorts and MasqueradeAddress parameters. If you are using Amazon services, please contact Amazon AWS support to resolve the issue.

  2. Connect to the server using SSH and open the /etc/proftpd.conf file for editing and add the following line anywhere in the <Global> section: 

    PassivePorts 49152 65534

    The file may look like this after you add the line:

    74644.png

    The port range selected must be in the non-privileged range (e.g., greater than or equal to 1024); it is STRONGLY RECOMMENDED the chosen range be large enough to handle many simultaneous passive connections (for example, 49152-65534, the IANA-registered ephemeral port range).
    The ports range also should be allowed for incoming connections in your firewall. Please contact your server administrator to configure it if required.

    For additional instruction on configuring Passive FTP port range on a Windows Server, please refer to How to configure Passive FTP port range on Windows Server

Have more questions? Submit a request
Please sign in to leave a comment.