proftpd は、421 タイムアウトエラーメッセージでセッションを終了します。

proftpd は、421 タイムアウトエラーメッセージでセッションを終了します。

質問

Proftpd 1.3.6 (1.3.1 で更新され、同じ問題がある) の接続は、次のメッセージでデータの転送中に終了します。

421送信タイムアウトなし(3600秒):制御接続を閉じます。

ログイン後にエラーが発生するのにかかる時間は5秒から数分です。ログ(下の抜粋)を確認しましたが、この動作の明確な理由が見つかりませんでした。このエラーは、1人のユーザーのみが接続されており、同じユーザーの同時セッションが開かれた場合に発生する可能性があります。

Wiresharkは、「421:No Transmit Timeout」がサーバーからクライアントに送信された応答であることを示します。

Proftpdは、ESXi 4.1のかなり古い仮想化openSuseシステムで実行されます。 FTP転送にはこのアカウントのみがftpusr使用されます。

助けてくれてありがとう。


ログ抜粋

FTPクライアントログ:

{snip}
150 Opening ASCII mode data connection for xyz_XML_Interface-Rawdata_20171124_16
1300_43864.tmp (597 bytes)
226 Transfer complete
ftp: 611 bytes received in 0.00Seconds 611000.00Kbytes/sec.
200 PORT command successful
150 Opening ASCII mode data connection for xyz_XML_Interface-Rawdata_20171209_06
5800_63895.tmp (443 bytes)
226 Transfer complete
ftp: 456 bytes received in 0.00Seconds 456.00Kbytes/sec.
200 PORT command successful
150 Opening ASCII mode data connection for xyz_XML_Interface-Rawdata_20171230_09
2000_93119.tmp (277 bytes)
226 Transfer complete
ftp: 288 bytes received in 0.00Seconds 288000.00Kbytes/sec.
421 No transfer timeout (3600 seconds): closing control connection
Connection closed by remote host.
ftp> mget *
Not connected.

Proftpd デバッグ出力:

次のコマンドでproftpdを起動すると、画面出力から次のログが取得されますproftpd -d 5 -c /etc/proftpd.conf -n

{snip}
2018-02-07 16:25:11,407 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): dispatching PRE_CMD command 'PORT 10,1,70,112,229,162' to mod_core
2018-02-07 16:25:11,407 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): dispatching PRE_CMD command 'PORT 10,1,70,112,229,162' to mod_core
2018-02-07 16:25:11,407 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): dispatching CMD command 'PORT 10,1,70,112,229,162' to mod_core
2018-02-07 16:25:11,407 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): dispatching LOG_CMD command 'PORT 10,1,70,112,229,162' to mod_log
2018-02-07 16:25:11,454 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): dispatching PRE_CMD command 'RETR xyz_XML_Interface-Rawdata_20171129_064100_50277.tmp' to mod_core
2018-02-07 16:25:11,454 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): dispatching PRE_CMD command 'RETR xyz_XML_Interface-Rawdata_20171129_064100_50277.tmp' to mod_core
2018-02-07 16:25:11,454 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): dispatching PRE_CMD command 'RETR xyz_XML_Interface-Rawdata_20171129_064100_50277.tmp' to mod_auth
2018-02-07 16:25:11,454 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): dispatching PRE_CMD command 'RETR xyz_XML_Interface-Rawdata_20171129_064100_50277.tmp' to mod_xfer
2018-02-07 16:25:11,454 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): dispatching CMD command 'RETR xyz_XML_Interface-Rawdata_20171129_064100_50277.tmp' to mod_xfer
2018-02-07 16:25:11,505 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): active data connection opened - local  : 10.15.87.17:20
2018-02-07 16:25:11,505 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): active data connection opened - remote : 10.1.70.112:58786
2018-02-07 17:38:29,580 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): Data transfer stall timeout: 3600 seconds
2018-02-07 16:25:11,566 Oracle2db proftpd[15663] 10.15.87.17 (10.1.70.112[10.1.70.112]): notice: user ftpusr: aborting transfer: Data connection closed

ワイヤーシャークのスクリーンショット:

記録された要求と応答


構成

proftpd.conf:

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                      "3.0 Linux-FTP"
ServerType standalone
DefaultServer                   on
RequireValidShell off
ExtendedLog /var/log/ftp.log
UseReverseDNS off
IdentLookups off
TimeoutLogin 120
TimeoutIdle 3600
TimeoutNoTransfer 3600
TimeoutStalled 3600
MaxClientsPerHost 2 "Two clients by hostname max"
MaxClientsPerUser 5 "Only one connection per user allowed"
MaxClients 4 "Too many users, please try again later"
MaxHostsPerUser 5 "Only one host per user allowed"
MaxLoginAttempts 2 "You've reached the max. login attempts"
UseSendfile off

# Port 21 is the standard FTP port.
Port                            21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances                    30

# Set the user and group under which the server will run.
User                            ftpusr
Group                           ftpusers

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot /home/ftpusr/xml-export
# DefaultRoot ~

# Normally, we want files to be overwriteable.
AllowOverwrite          on

<Directory /home/ftpusr/xml-export>
Umask 022 022
</Directory>

ベストアンサー1

Wiresharkを見ると、クライアントはFTPアクティブモードを使用しているようです。手動モードFTPを使用することをお勧めします。

パッシブモードはファイアウォールルールと連携して機能します。

バラよりアクティブFTPとパッシブFTP、権威ある説明

また、見ることができます手動およびアクティブFTPを確認する方法

アクティブモード接続では、クライアントが初期接続を確立してPORTを送信すると、サーバーは2番目の接続を開始します。手動接続では、クライアントが接続するポート番号の要求として機能するPASVコマンドを接続して送信します。

おすすめ記事