Can't connect to a local FTP - "Connection closed by remote host."

27,203

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 ftp://10.0.2.1.

Share:
27,203

Related videos on Youtube

Django Reinhardt
Author by

Django Reinhardt

Hello.

Updated on September 17, 2022

Comments

  • Django Reinhardt
    Django Reinhardt almost 2 years

    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 10.0.2.1
    Connected to 10.0.2.1.
    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...!

    • mistika
      mistika almost 10 years
      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
    • Django Reinhardt
      Django Reinhardt almost 10 years
      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.
    • mistika
      mistika almost 10 years
      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
    • Django Reinhardt
      Django Reinhardt almost 10 years
      Right, I see what you're saying. Sorry it's been a while :(
  • Django Reinhardt
    Django Reinhardt over 14 years
    Can't remember how I solved this now, but we're still using Active FTP and it works (thankfully).