【问题标题】:how to change ProFTPd port without using "passive mode"如何在不使用“被动模式”的情况下更改 ProFTPd 端口
【发布时间】:2011-03-29 21:44:21
【问题描述】:

我刚刚重新安装了 Ubuntu 服务器 10.04,并决定更改我所有的默认端口以获得额外的安全性。一切正常,除非我决定将 FTP (ProFTPd) 端口从标准 21 更改为 3521。防火墙或端口转发没有问题。 ProFTPd 已重新启动,但当我尝试连接它时,即使它确实响应,它也会将客户端(FileZilla)置于“被动模式”,然后永远不会进入列出目录。 我真的不想使用“被动模式”,我在 proftpd.conf 中禁用了它,但是我似乎无法更改默认端口并使其正常工作。它似乎在 21 端口上运行良好。仅供参考,proftpd 是作为独立守护程序安装的,如果这很重要吗?

【问题讨论】:

    标签: ftp default port


    【解决方案1】:

    好的,我想我在阅读此页面后想通了:link。似乎大多数 FTP 连接确实是“被动”的,而“主动”连接的问题来自客户端使用防火墙,因为 FTP 服务器在某些 随机端口。在被动模式下,客户端启动与服务器的“命令”和“数据”连接,因此防火墙不是问题,但您应该指定在服务器上使用哪些“被动”端口。我启用了 3520 和 3521 PassivePorts,它现在可以工作了

    【讨论】:

    • 我没有,接受我自己的答案似乎有点违反直觉。 :)
    • 它可能 :) 但重点是下次有人说“更改端口后我的 proftpd 无法工作”时,这里有一个类似的问题 with answer 值得一读。 :)
    【解决方案2】:

    FTP Active Mode 根据定义要求服务器从端口L-1 发起其传出连接。您的防火墙是否也允许来自端口 3520 的传出连接?

    来自FTP RFC

    3.2。建立数据连接

      The mechanics of transferring data consists of setting up the data
      connection to the appropriate ports and choosing the parameters
      for transfer.  Both the user and the server-DTPs have a default
      data port.  The user-process default data port is the same as the
      control connection port (i.e., U).  The server-process default
      data port is the port adjacent to the control connection port
      (i.e., L-1).
    

    ...

    3.3。数据连接管理

      Default Data Connection Ports:  All FTP implementations must
      support use of the default data connection ports, and only the
      User-PI may initiate the use of non-default ports.
    
      Negotiating Non-Default Data Ports:   The User-PI may specify a
      non-default user side data port with the PORT command.  The
      User-PI may request the server side to identify a non-default
      server side data port with the PASV command.  Since a connection
      is defined by the pair of addresses, either of these actions is
      enough to get a different data connection, still it is permitted
      to do both commands to use new ports on both ends of the data
      connection.
    

    您可能希望借此机会将您的用户更改为SFTP,这是一个更好的协议。

    【讨论】:

    • 3520?不,防火墙仅用于“入站”连接,而不是“出站”。我也从未在端口 20 上启用它,但它只在仅启用端口 21 的情况下才起作用。我也只是尝试在 3520 上启用它,以防万一,但它仍然无法正常工作。
    • 好的,我想我在阅读此页面后想通了:link。似乎大多数 FTP 连接确实是“被动的”,而“主动”连接的问题来自客户端防火墙的使用,因为 FTP 服务器在某些随机上发起到客户端的传出“数据”连接b> 端口。在被动模式下,客户端启动与服务器的“命令”和“数据”连接,因此防火墙不是问题,但您应该指定在服务器上使用哪些“被动”端口。我启用了 3520 和 3521 PassivePorts,它现在可以工作了
    • @techexpert,优秀:) 我建议将您的评论移至答案,以便您可以接受它,并希望将来对其他人更加可见。感谢您的报告。 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-09
    • 1970-01-01
    • 1970-01-01
    • 2015-12-28
    • 1970-01-01
    • 2022-12-04
    相关资源
    最近更新 更多