proftp限制FTP模式

以前搞過proftp禁止主動模式,但是這兩天有這個需求的時候卻忘記了,看來得寫一日誌記錄下。

首先,環境是 fedora 17 + proftp 。

默認的配置是主動模式和被動模式都可用。

主動模式下訪問記錄:

Command:    PORT 127,0,0,1,237,87
Response:    200 PORT command successful

被動模式訪問記錄:

Command:    PASV
Response:    227 Entering Passive Mode (127,0,0,1,157,107).

如果需要禁止主動模式訪問,則只需要在/etc/proftd.conf的<Global>段中添加如下三行:

<Limit PORT>
  DenyAll
</Limit>

即禁止PORT指令,則主動模式訪問記錄變爲:

Command:    PORT 127,0,0,1,199,3
Response:    501 PORT: Operation not permitted

如果需要禁止被動模式訪問,則只需要在/etc/proftd.conf的<Global>段中添加如下三行:

<Limit PASV>
  DenyAll
</Limit>

即禁止PASV指令,則被動模式訪問記錄變爲:

Command:    PASV
Response:    501 PASV: Operation not permitted

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章