FTP command in Windows hangs with “150 Opening data channel for file download from server of …”

前端 未结 1 1995
走了就别回头了
走了就别回头了 2021-01-06 23:53

I have a FTP server on a Windows Server 2012 machine and I am trying to get setup.exe from it.

CMD.EXE log:

C:\\>ftp 1.2.3.4
Connect         


        
1条回答
  •  隐瞒了意图╮
    2021-01-07 00:58

    It works in FileZilla, because FileZilla defaults to the passive FTP mode, which is more firewall/NAT friendly. The Windows FTP command-line client (ftp.exe) not only defaults to the active mode, it does not even support the passive mode, on any version of Windows. It makes it pretty useless nowadays due to ubiquitous firewalls and NATs.

    Read my article about the active and passive FTP connection modes to understand why the passive mode is a must.


    Use any other Windows FTP command-line client instead. Most other support the passive mode.

    For example WinSCP defaults to the passive mode and there's a guide available for converting Windows FTP script to WinSCP script.

    Your can specifically use a batch file (.bat) like:

    winscp.com /command ^
        "open ftp://my_username:password@1.2.3.4/" ^
        "get setup.exe" ^
        "exit"
    

    (I'm the author of WinSCP)

    0 讨论(0)
提交回复
热议问题