0

I have a virtual machine with the FTP server configured. I'm transferring files in ACTIVE mode and at a random file I get disconnected.

I cannot reconnect to the FTP server nor connect remotely to the machine. I have to restart the machine and wait a while to regain access.

What can I do in this situation to prevent the complete disconnect?


I ended up using the Passive mode, even though it does not suit me because the Active mode kept failing.

Dan
  • 1,555
  • 2
  • 14
  • 30

2 Answers2

1

You most likely need to open the FTP Endpoint on the VM: This answer will give you some backgroudn you how to add endpoints: How to Setup FTP on Azure VM

You can also use powershell to add endpoint: Add Azure Endpoint

Community
  • 1
  • 1
Grady G Cooper
  • 1,044
  • 8
  • 19
  • Thank you, for your answer. I already have 2 open endpoints for port 20 and 21. – Dan May 23 '15 at 17:45
1

You need more than just those two ports open - the design of FTP (either passive or active) is that the FTP server will send data back on a randomised range of ports (see: http://slacksite.com/other/ftp.html) which presents a problem when using a stateless service like Azure's Load Balancing that requires Endpoints that must be explicitly opened. This setup guide is best to see how to achieve what you want on an Azure VM: http://itq.nl/walkthrough-hosting-ftp-on-iis-7-5-a-windows-azure-vm-2/ (and is linked from the SO post referenced by Grady).

Simon W
  • 5,481
  • 3
  • 24
  • 35
  • I apprectiate your answer, are you sure that the FTP Server sends a random port for the Active mode? According to this article http://www.jscape.com/blog/bid/80512/Active-v-s-Passive-FTP-Simplified it isn't. – Dan May 24 '15 at 18:15
  • You will see that either the server or client will send / receive on random ports - in both cases you will have issues if your server sits behind a stateless firewall. You can restrict the port range that is used by the server and then open those ports on the Azure Cloud Service (which is effectively what the guide provides you). – Simon W May 24 '15 at 23:56