Just like on cPanel servers, if your firewall policy or FTP configuration is not correct, you will receive an error when using FTP. Usually, the error manifests on ISPConfig servers as Failed to retrieve directory listing. It just means that either you have not specified passive ports or you have not opened the ports in your firewall. If you followed our guide on Setting Up A ISPConfig Firewall, we placed a port range to open in the firewall. These are the FTP Passive ports. The error you may see is;
ISPConfig Failed to retrieve directory listing
Status: Connecting to 218.104.22.168:21...
Status: Connection established, waiting for welcome message...
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Status: Logged in
Status: Retrieving directory listing...
Response: 257 "/" is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Response: 227 Entering Passive Mode (256,89,250,1,136,252)
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
Add Passive Port Range To PureFTP
First, you will need to add the port range to the pure-ftpd configuration file. Issue the command below. If your port range is different, just update the code.
echo "40110 40210" > /etc/pure-ftpd/conf/PassivePortRange
service pure-ftpd-mysql restart
Next, ensure the port range is open in your ISPConfig Firewall. If you are using our Security group, we already opened the above port range. You can also set a rule to allow all FTP connections incoming. The below image can be used to create your own rule in your network firewall.
Once done, try to connect to your VPS Server again and this time, you should see your directory tree instead of the Failed to retrieve directory listing error. There is no need to restart any services apart from the FTPD server if adding a passive port range like above.