I'm getting baffled by a seemingly simple problem: When I connect via VPN to my remote network, I can't connect via FTP to my FTP server - but I can do everything else (including Remote Desktop).

I've tried completely disabling the remote Firewall and I can ping the FTP Server successfully, but I still can't FTP to it.

If I use the command prompt I get:

ftp> open
Connected to
Connection closed by remote host.

I thought it was probably the Firewall... but obviously it's not. What else could be blocking it?

It's a Windows Server 2008 R2 machine running IIS7 (natch). On the machine itself I can navigate to ftp://localhost and see the files, I just can't do it when I'm "local" to it via VPN.

Thanks for any help, I'm sure it's something really simple...!

  • Would you mind trying to remember how you fixed this? We're getting the same error. This doesn't seem to be a firewall issue, because I can connect with telnet to port 21, but it just doesn't send anything back (ftp hello) and disconnects on any attempt to send a command
    – mistika
    Jun 30, 2014 at 14:57
  • Sorry :-/ It's worth noting that just because Port 21 is open, it doesn't it's not a firewall issue. FTP uses more ports than just 21. Jun 30, 2014 at 16:35
  • Hmm. FTP won't use other ports (that are used by active/passive mode for data transfer) until you log in. But server even doesn't accept USER command and closes the connection. PS: we are on IIS8 and Windows Server 2012
    – mistika
    Jun 30, 2014 at 17:06
  • Right, I see what you're saying. Sorry it's been a while :( Jun 30, 2014 at 17:25

2 Answers 2


If you can connect you have port 21 opened. However that is not all that is needed as port 21 is just control port and an FTP server opens other ports for actual data transmission. See if there is something within your firewall config that can unblock FTP as a whole service (not just port 21).

Also you should probably stay away from FTP Active connections and do Passive instead. Unfortunately the ftp command supports only active ones.

Set IE to do passive mode and try using it from other machine like

  • Can't remember how I solved this now, but we're still using Active FTP and it works (thankfully). Dec 22, 2009 at 14:16

I recognize the original post specifically mentions FTP not SFTP. I am providing an answer despite that because the two are easily - and often - confused and I fought the exact “Connection closed by remote host.” error message" in an enterprise setting.

In our case the client's SFTP Server had black-listed our connecting public IP Address (IPv4). I had to work with our Network Administration to determine that the SSH/SFTP server's expected reply was not being received and there was no evidence our firewall(s) were blocking it. Once we determined that and provided our public IP Address, the client was able to see (presumably in their Server's logs) that we were blocked. The client white listed our address and that resolved this problem.

It should be noted that one key to diagnosing this was successfully connecting to the client's SFTP server from outside our enterprise network, i.e. proving it was not related to our SFTP account (credentials) and not an inherent failure of the SFTP Server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .