Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot list directory on IIS FTP server on Azure, even after configuring Azure inbound rules and Windows firewall

I'am running Windows Server 2012 in Azure, and I've configured the FTP server in IIS. When I try to connect the server, it accepts the username and password and log me in but not showing the directory listing.

  1. I've tried using FileZilla FTP client to connect and it saying the same error.

    Status: Resolving address of jothiprakashanandan.southindia.cloudapp.azure.com
    Status: Connecting to 104.211.244.241:21...
    Status: Connection established, waiting for welcome message...
    Status: Insecure server, it does not support FTP over TLS.
    Status: Logged in
    Status: Retrieving directory listing...
    Command:    PWD
    Response:   257 "/" is current directory.
    Command:    TYPE I
    Response:   200 Type set to I.
    Command:    PASV
    Error:  Connection timed out after 20 seconds of inactivity
    Error:  Failed to retrieve directory listing
    Status: Disconnected from server
    
  2. The inbound rule of Azure is this:

    Azure Inbound Rule

  3. The VM's firewall inbound rule. VM's inbound rule

  4. However when I try to login from the VM's browser it is working fine and showing the directory list.

like image 837
Jothi Prakash Anandan Avatar asked Feb 05 '23 02:02

Jothi Prakash Anandan


1 Answers

In Azure, we should deploy the passive mode FTP, we should add data channel ports range in FTP Firewall Support, then add those ports to NSG and windows firewall inbound rules.

enter image description here

By the way, although the windows firewall seems to allow all traffic that’s required, we also need to enable stateful FTP filtering on the firewall:

netsh advfirewall set global StatefulFtp enable

Then restart the FTP windows service and we should be up and running:

net stop ftpsvc
net start ftpsvc

Here is a similar case, same error as you, please refer to it.

Check which port does the FTP site listen on: enter image description here

like image 54
Jason Ye Avatar answered Feb 12 '23 17:02

Jason Ye