FTP手動モード、失敗

FTP手動モード、失敗

こんにちは。 FTPを許可するようにiptablesを設定しようとしています。 FTPに接続すると、ファイルジラに次のメッセージが表示されます。

Status: Connected
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/" is the current directory.
Command:    TYPE I
Response:   200 Type set to: Binary.
Command:    PASV
Response:   227 Entering passive mode (X,X,X,X,225,8).
Command:    MLSD
Response:   150 File status okay. About to open data connection.
Error:  Connection timed out
Error:  Failed to retrieve directory listing

私のIPテーブルは次のとおりです。http://pastebin.com/er1CtZjZ

どんな助けにも感謝します。

ベストアンサー1

ftpデーモンを実行するには、受信TCPポート範囲(40000:41999など)を開き、これらのポートをftpデーモンの一致設定ファイルと一致させる必要があります。たとえば、私のファイルには次のものがあります/etc/proftpd.conf

<VirtualHost ftp.foo.bar>
  Port 21
  DefaultRoot ~
  HiddenStores on
  PathDenyFilter (\\.ftpaccess|\\.htaccess|\\.php|\\.rar)
  Umask 077
  DirFakeGroup on
  DirFakeUser on
  DefaultTransferMode binary
  DeferWelcome on
  MaxClients 12 "Too many logins"
  MaxClientsPerHost 4 "Too many logins"
  PassivePorts  40000 41999
</VirtualHost>

PS:もっと話すべきですか?もちろん、制御接続のために受信ポート20と21も開いている必要があります。

おすすめ記事