WinSCP client unable to retrieve remote directory from Windows FTP server using Passive mode

Advertisement

yN
Joined:
Posts:
2

WinSCP client unable to retrieve remote directory from Windows FTP server using Passive mode

Hi,

I am writing a C# script that when run on a client, will transfer some files from the server to the client's device. I am using Windows 10 Pro as an FTP server, and WinSCP version 5.19.6 (the latest version at the time of writing) as the client.

To set up Passive mode on the FTP server, I have set the Firewall external IP address and the data channel port range as 63000-65000. I have also opened the port range on the inbound Firewall, and enabled all FTP rules on the server.

When I run the script on Passive mode, the client is able to connect to the server, but I receive a timeout exception when it is retrieving the server's directory listing. Looking at the log files, the data channel seems to close at PASV.

I have no problems connecting and retrieving the files through Active mode (as long as Firewall exceptions are allowed on the client). However, I hope to entirely eliminate the need for user interaction with the file transfer process, therefore it would be great to avoid the Firewall message popup entirely when running the script, which is why I am trying to use Passive mode.

I have attached the relevant log files below. I would appreciate to have some help on this issue.

Regards,
yN
Description: WinSCP client C# logfile
Description: FTP server logfile

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,034
Location:
Prague, Czechia

Re: WinSCP client unable to retrieve remote directory from Windows FTP server using Passive mode

In general, this is not really a WinSCP question. Unless it's only WinSCP that does not work, and other FTP clients do.
Anyway, did you follow all instructions from this guide?
Installing a secure FTP server on Windows using IIS
Particularly, did you restart the server after you have enabled the firewall rules?
If you need further help, WinSCP session log file might be useful.

Reply with quote

yN
Joined:
Posts:
2

Hi Martin,

I've managed to solve my problem. After checking my configurations again, it seems that I simply did not configure port forwarding on the data channel port range, which I did only for port 21. After port forwarding on the data channel ports, I was able to operate on the server directory.

Thank you very much for the assistance!

Reply with quote

Advertisement

You can post new topics in this forum