简体   繁体   English

Telnet 和被动 FTP

[英]Telnet and passive FTP

I've a problem with my FTP test server.我的 FTP 测试服务器有问题。 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.我已经安装并配置了 FileZilla 服务器,它侦听端口 21 上的控制连接,然后它可以在 50100 和 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.我正在尝试本地连接 127.0.0.1:21 并检索根 FTP 目录中的文件和文件夹列表。

FileZilla Client: Works FileZilla 客户端:有效
FTP in MS-DOS: Works MS-DOS 中的 FTP:有效
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 "/"". MS-DOS 中的 TELNET:控制连接和用户身份验证 OK,然后我切换到被动模式,当我尝试使用命令 LIST 检索文件和文件夹时,它响应“无法打开数据连接以传输“/” ”。

I've tried setting firewall rules for ports 50100-51100 and the FileZilla server.我已经尝试为端口 50100-51100 和 FileZilla 服务器设置防火墙规则。 It's still not working.它仍然无法正常工作。

You cannot retrieve files over FTP protocol using a Telnet client.您不能使用 Telnet 客户端通过 FTP 协议检索文件。

While you can simulate the FTP client by typing FTP commands on a Telnet console, you cannot do file transfers this way.虽然您可以通过在 Telnet 控制台上键入 FTP 命令来模拟 FTP 客户端,但您不能以这种方式进行文件传输。 It's because for file transfer you need a separate data transfer connection, what the Telnet client cannot do.这是因为对于文件传输,您需要单独的数据传输连接,而 Telnet 客户端无法做到这一点。

That's why the FTP server fails.这就是 FTP 服务器失败的原因。 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.在更被动的情况下,它超时等待客户端连接到其数据端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM