Telnet and passive FTP

2019-02-21 06:23发布

问题:

I've a problem with my FTP test server. I've installed and configured FileZilla Server, It's listening for control connection on port 21, then it can provide passive mode data connection on ports between 50100 and 51100.

I'm trying a local connection 127.0.0.1:21 and retrieve the LIST of files and folders in the root FTP directory.

Filezilla Client: WORK !!! FTP in MS-DOS: WORK !!! TELNET in MS-DOS: Control connection and user authentication OK, then I switch to passive mode, and when I'm trying to retrieve files and folder with the command LIST It respond "Can't open data connection for transfer of "/"".

I've tried setting firewall rules for ports 50100-51100 and the filezilla server, It's still not working.

Thanks for your help.

回答1:

You cannot retrieve files over FTP protocol using a Telnet client.

While you can simulate the FTP client by typing FTP commands on a Telnet console, you cannot do file transfers this way. It's because for file transfer you need a separate data transfer connection, what the Telnet client cannot do.

That's why the FTP server fails. In an active mode, it fails to connect back to your client machine, because there's nothing listening. In a passive more, it timeouts waiting for the client to connect to its data port.