2011-03-29 33 views
1

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

回答

0

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,一个好得多的协议的机会。

+0

3520?不,防火墙仅用于“入站”连接,而不是“传出”。我从来没有在端口20上启用它,但只有在启用了端口21的情况下才能找到它。我只是试图在3520上启用它,以防万一,但它仍然无法正常工作。 – techexpert 2011-03-29 22:27:30

+0

好吧,我想我读了这个网页后得出这个结论:[link](http://slacksite.com/other/ftp.html)。看起来,大多数FTP连接确实是“被动”的,并且“主动”连接的问题来自使用客户端的防火墙,因为FTP服务器正在一些**随机**端口上启动到客户端的传出“数据”连接。在被动模式下,客户端启动到服务器的“命令”和“数据”连接,因此防火墙不是问题,但您应指定在服务器上使用哪些“被动”端口。我启用了3520和3521 PassivePorts并且它现在可以运行 – techexpert 2011-03-30 02:05:49

+1

@techexpert,优秀:)我建议将您的评论移至答案,以便您可以接受它,并且希望未来其他人能够更清楚地看到它。感谢您的报告。 :) – sarnold 2011-03-30 20:42:02

2

好吧,我想我读了这个页面后得出了这个结论:link。看起来,大多数FTP连接确实是“被动”的,并且“主动”连接的问题来自客户端的防火墙使用,因为FTP服务器正在启动到客户端的一个输出“数据”连接,其中一个端口为随机端口。在被动模式下,客户端启动到服务器的“命令”和“数据”连接,因此防火墙不是问题,但您应指定在服务器上使用哪些“被动”端口。我启用了3520和3521 PassivePorts,它现在正在运行

+0

不要忘记接受你的答案:) – sarnold 2011-03-31 10:11:03

+0

我没有,这似乎有点违反直觉接受我自己的答案。 :) – techexpert 2011-03-31 17:40:36

+0

它可能:)但整点是有人说“我无法让我的proftpd在改变端口后工作”,这里有一个类似的问题_with答案值得阅读。 :) – sarnold 2011-03-31 23:46:25

相关问题