vsftpdは使ったことないので、慣れているproftpdをインストール。
vsftpdをアンインストール。
# yum remove vsftpd
proftpdをインストール
# yum install proftpd
# vi /etc/proftpd.conf
------------------------------------------------------------------------------
ServerType inetd
DefaultRoot ~ !wheel
# 30秒待たされないための設定
IdentLookups off
UseReverseDNS off
#
User nobody
Group nobody
TransferLog /var/log/proftpd/xferlog
SystemLog /var/log/proftpd/proftpd.log
LogFormat allinfo "%t : %u (%a [%h]) : [%s], %T, %m (%f)"
LogFormat write "%t : %u : %F (%a)"
LogFormat read "%t : %u : %F (%a)"
LogFormat auth "%t : %u (%a [%h])"
ExtendedLog /var/log/proftpd/all.log ALL allinfo
ExtendedLog /var/log/proftpd/write.log WRITE write
ExtendedLog /var/log/proftpd/read.log READ read
ExtendedLog /var/log/proftpd/auth.log AUTH auth
TimeoutIdle 300 #アイドル状態で接続を維持する秒数
TimeoutNoTransfer 300 #データ転送がない状態で、接続を維持する秒数
TimeoutStalled 600 #止まった状態で、接続を維持する秒数
DeleteAbortedStores on #転送失敗したデータを自動削除
MaxClientsPerHost 2 #ホストあたりのクライアント数の上限
MaxHostsPerUser 2 #ユーザあたりのホスト数の上限
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol SSLv23
# Are clients required to use FTP over TLS when talking to this server?
TLSRequired on # "on"にすると、TLS以外の接続を受け付けない
# Server's certificate
TLSRSACertificateFile /path/to/xxx.crt
TLSRSACertificateKeyFile /path/to/xxx.key
# Authenticate clients that want to use FTP over TLS?
TLSVerifyClient off
------------------------------------------------------------------------------
■ xinetdの設定
# vi /etc/xinet.d/xproftpd
------------------------------------------------------------------------------
service ftp
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/proftpd
server_args = -c /etc/proftpd.conf
log_on_success += DURATION HOST
log_on_failure += HOST USERID
nice = 10
cps = 20 30
# 毎秒20接続以上は許可しない。上限に達した場合は30秒休憩。
env = TZ=JST-9
# ログが9時間前になるのを防ぐ。
}
------------------------------------------------------------------------------
※ "log_on_success"に"USERID"を加えると、劇的に接続が遅くなる模様。詳細は不明。
■ hosts.allowの設定
# vi /etc/hosts.allow
------------------------------------------------------------------------------
proftpd: xxx.xxx.xxx.xxxx : allow
------------------------------------------------------------------------------
vsftpdをアンインストール。
# yum remove vsftpd
proftpdをインストール
# yum install proftpd
# vi /etc/proftpd.conf
------------------------------------------------------------------------------
ServerType inetd
DefaultRoot ~ !wheel
# 30秒待たされないための設定
IdentLookups off
UseReverseDNS off
#
User nobody
Group nobody
TransferLog /var/log/proftpd/xferlog
SystemLog /var/log/proftpd/proftpd.log
LogFormat allinfo "%t : %u (%a [%h]) : [%s], %T, %m (%f)"
LogFormat write "%t : %u : %F (%a)"
LogFormat read "%t : %u : %F (%a)"
LogFormat auth "%t : %u (%a [%h])"
ExtendedLog /var/log/proftpd/all.log ALL allinfo
ExtendedLog /var/log/proftpd/write.log WRITE write
ExtendedLog /var/log/proftpd/read.log READ read
ExtendedLog /var/log/proftpd/auth.log AUTH auth
TimeoutIdle 300 #アイドル状態で接続を維持する秒数
TimeoutNoTransfer 300 #データ転送がない状態で、接続を維持する秒数
TimeoutStalled 600 #止まった状態で、接続を維持する秒数
DeleteAbortedStores on #転送失敗したデータを自動削除
MaxClientsPerHost 2 #ホストあたりのクライアント数の上限
MaxHostsPerUser 2 #ユーザあたりのホスト数の上限
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol SSLv23
# Are clients required to use FTP over TLS when talking to this server?
TLSRequired on # "on"にすると、TLS以外の接続を受け付けない
# Server's certificate
TLSRSACertificateFile /path/to/xxx.crt
TLSRSACertificateKeyFile /path/to/xxx.key
# Authenticate clients that want to use FTP over TLS?
TLSVerifyClient off
------------------------------------------------------------------------------
■ xinetdの設定
# vi /etc/xinet.d/xproftpd
------------------------------------------------------------------------------
service ftp
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/proftpd
server_args = -c /etc/proftpd.conf
log_on_success += DURATION HOST
log_on_failure += HOST USERID
nice = 10
cps = 20 30
# 毎秒20接続以上は許可しない。上限に達した場合は30秒休憩。
env = TZ=JST-9
# ログが9時間前になるのを防ぐ。
}
------------------------------------------------------------------------------
※ "log_on_success"に"USERID"を加えると、劇的に接続が遅くなる模様。詳細は不明。
■ hosts.allowの設定
# vi /etc/hosts.allow
------------------------------------------------------------------------------
proftpd: xxx.xxx.xxx.xxxx : allow
------------------------------------------------------------------------------