CentOS - 6.8 - vsftpd - 再起動・ドットファイル表示・ログ

 クラウディア
1. 再起動
2. dot ファイルの表示を許可するには
3. 詳細なログを収集する

1. 再起動

 vsftpd を起動している状態で再起動するには root ユーザで

> service vsftpd restart
vsftpd を停止中:                                           [  OK  ]
vsftpd 用の vsftpd を起動中:                               [  OK  ]

2. dot ファイルの表示を許可するには

 「vsftpd」はデフォルトの設定では 「.」(ドット) で始まるファイルが表示されません。  表示させるには

/etc/vsftpd/vsftpd.conf
 に

force_dot_files=YES
 という行を加えて再起動します。

3. 詳細なログを収集する

 デフォルトの設定でログは

/var/log/xferlog
 に出力されます。  デフォルトで出力する内容は

Tue Dec 19 08:53:12 2017 1 x.x.x.x 4254 /ディレクトリ名/ファイル名 b _ o r ユーザ名 ftp 0 * c
Tue Dec 19 08:53:34 2017 1 x.x.x.x 4362 /ディレクトリ名/ファイル名 b _ i r ユーザ名 0 * c
 といった、ファイルごとの送受信の記録です。  これに加えて、接続/切断などの詳細なログを出力するには、/etc/vsftpd/vsftpd.conf を以下のように編集します。

xferlog_file=/var/log/xferlog			←	ログの出力ファイルを指定
vsftpd_log_file=/var/log/xferlog		←	ログの出力ファイルを指定
xferlog_std_format=NO					←	標準以外のログを出力
log_ftp_protocol=YES					←	プロトコルのログも出力
dual_log_enable=YES						←	なんでも出力
 編集後、再起動すれば、デフォルトのログに加えて、以下のようなログが出力されます。

Tue Dec 19 10:59:06 2017 [pid 30988] CONNECT: Client "x.x.x.x"
Tue Dec 19 10:59:06 2017 [pid 30988] FTP response: Client "x.x.x.x", "220 (vsFTPd 2.2.2)"
Tue Dec 19 10:59:06 2017 [pid 30988] FTP command: Client "x.x.x.x", "OPTS UTF8 ON"
Tue Dec 19 10:59:06 2017 [pid 30988] FTP response: Client "x.x.x.x", "200 Always in UTF8 mode."
Tue Dec 19 10:59:10 2017 [pid 30988] FTP command: Client "x.x.x.x", "USER ユーザ名"
Tue Dec 19 10:59:10 2017 [pid 30988] [qews] FTP response: Client "x.x.x.x", "331 Please specify the password."
Tue Dec 19 10:59:11 2017 [pid 30988] [qews] FTP command: Client "x.x.x.x", "PASS <password>"
Tue Dec 19 10:59:11 2017 [pid 30987] [qews] OK LOGIN: Client "x.x.x.x"
Tue Dec 19 10:59:11 2017 [pid 30989] [qews] FTP response: Client "x.x.x.x", "230 Login successful."
earthcar(アースカー)