在CentOS中查看vsftpd日志的方法如下:
常用日志文件路徑
/var/log/vsftpd.log
:主日志文件,記錄連接、傳輸等詳細信息。/var/log/xferlog
:傳輸日志(需在配置文件中啟用xferlog_enable=YES
)。/var/log/messages
或 /var/log/secure
:系統級日志,可能包含vsftpd相關記錄。查看命令
tail -f /var/log/vsftpd.log
。less /var/log/vsftpd.log
或 more /var/log/vsftpd.log
。grep "關鍵字" /var/log/vsftpd.log
(如grep "Failed password" /var/log/vsftpd.log
)。配置檢查
若未找到日志,需檢查vsftpd配置文件/etc/vsftpd/vsftpd.conf
,確認xferlog_enable
和xferlog_file
參數是否正確設置。
注意:部分系統可能需安裝vsftpd
日志模塊或調整syslog
配置,確保日志功能已啟用。