FTP server on IIS10, "Retrieving directory listing...'' issue

Srinivas Obili 25 Reputation points
2023-06-15T11:36:59.7433333+00:00

I have VM on Azure. Windows 2019 with IIS10. I configured the FTP Server. Configured the the Windows Firewall also. But failing to Retrieving directory listing.

Unable to identify the root cause.

Need help.

Thank you.

Internet Information Services
Windows Server Security
Windows Server Security
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
1,721 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jackson Martins 9,646 Reputation points MVP
    2023-06-15T13:01:34.77+00:00

    Hi Srinivas Obili

    Given your setup and the error you're encountering, the issue could be with the way FTP modes are being handled. FTP operates in two modes, active and passive, which determine how the connection between client and server is established, especially for transferring data such as directory listings.

    Here is a brief description of the modes:

    Active FTP: In active mode, the client opens a port and listens. The server must actively connect to the client to establish a data transfer connection.

    Passive FTP: In passive mode, it is the server that opens a port and waits for a connection from the client. The client then initiates the data transfer connection to the server.

    Now, in your case, passive mode is generally the preferred option for modern FTP services as it is more firewall friendly on the client side. As Azure by default uses NSG, ensuring that Passive mode is configured correctly is crucial as they often have ingress security rules in place.

    Configure FTP Server for Passive Mode: On your FTP Server in IIS, you need to specify the range of ports that will be used for passive mode. This is usually a range of high ports (1024-65535) you can create your range of ports (for example, 5000-5100)

    Refence: https://learn.microsoft.com/en-us/iis/publish/using-the-ftp-service/configuring-ftp-firewall-settings-in-iis-7#step-1-configure-the-passive-port-range-for-the-ftp-service

    you need to ensure the Network Security Group attached to your Azure VM allows inbound traffic over the range of passive ports you've selected, as well as port 21 for the FTP control connection.

    Reference:

    https://learn.microsoft.com/en-us/azure/virtual-network/manage-network-security-group?tabs=network-security-group-portal#view-details-of-a-security-rule

    Get in touch if you need more help with this issue.

    --please don't forget to "[Accept the answer]" if the reply is helpful--

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Srinivas Obili 25 Reputation points
    2023-06-16T03:22:39.8933333+00:00

    Hi Jackson Martins,

    I wholeheartedly Thank you for responding to my issue.

    I would like to mention that the specific cause that resolved the issue was the range of ports only. Earlier I tried various port ranges such as 3000-3005, 5000-5100, etc., etc., but the issue got resolved only when I set the port range to 49152-65535. To ensure that this is the actual cause, I tried changing the port ranges to the earlier port ranges and I faced issue with all other port ranges that I tried earlier. So in my current scenario with Azure, Windows server 2019 and IIS 10, the FTP server worked without any issue with port range 49152-65535 only.

    Thank you once again Jackson Martins for sending me the following link, which helped resolve my issue:

    Refence: https://learn.microsoft.com/en-us/iis/publish/using-the-ftp-service/configuring-ftp-firewall-settings-in-iis-7#step-1-configure-the-passive-port-range-for-the-ftp-service

    Best Regards.

    1 person found this answer helpful.