2

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: Works
FTP in MS-DOS: Works
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.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Giorgio.dev
  • 131
  • 2
  • 12
  • 2
    Why do you want to use telnet to connect to an FTP server? You'll need at least two telnet instances, one command connection and one data connection. After the PASV command the FTP server tells to which IP and port you must connect to receive the data response of the next command. Anyway, offtopic for SO and lacking detail of what exactly you're trying to do and what you have tried. – CodeCaster May 29 '15 at 18:08
  • @CodeCaster It's for didactic use, I'm studying FTP protocol. So telnet, after the PASV command, can't create the data connection, I need to set it manually, isn't it? – Giorgio.dev May 29 '15 at 18:12
  • 1
    If you use wireshark, you can study the data sent between client and server. So you can study the ftp clients case and attempt to duplicate it using 2 telnet connections. – Robert Jacobs May 29 '15 at 18:17
  • Tested and It's working !!! Thanks – Giorgio.dev May 29 '15 at 18:18

1 Answers1

5

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.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992