cat /var/log/vsftpd.log
:查看完整日志(適用于小文件)。less /var/log/vsftpd.log
:分頁查看,支持上下翻頁。tail -f /var/log/vsftpd.log
:實時查看最新日志(常用)。/var/log/vsftpd.log
。/var/log/proftpd.log
。/var/log/pure-ftpd.log
。grep "username" /var/log/vsftpd.log
。grep -E "Failed password|Login incorrect" /var/log/vsftpd.log
。grep -E "UPLOAD|DOWNLOAD" /var/log/vsftpd.log
。awk '/username/ {count++} END {print count}' /var/log/vsftpd.log
。awk '{print $5}' /var/log/vsftpd.log | sort | uniq -c | sort -nr
。awk
匹配時間戳(需根據日志格式調整):awk '/[A-Z][a-z]{2} [0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/ && $0 ~ "$(date "+%b %d %H:%M:%S")"' /var/log/vsftpd.log
。gnome-system-log
、ksystemlog
(適合新手直觀查看)。Logwatch
(生成日志報告)。fail2ban
(防范暴力破解)。注意:不同FTP軟件日志格式可能不同,需根據實際調整命令。