Debian系统SFTP日志分析方法如下:
/var/log/auth.log中。tail -f /var/log/auth.log | grep sftp。grep 'sftp' /var/log/auth.log。Accepted password for user from IP port ssh2。Failed password for user from IP port ssh2。channel_open_session: session 1: sftp表示SFTP会话开始。awk/sed:提取特定字段(如时间、IP、用户名)。logwatch:定期生成日志分析报告。logrotate自动压缩归档旧日志,避免文件过大。fail2ban识别暴力破解尝试。journalctl -u sshd.service查看系统级SSH/SFTP日志。注:部分场景需调整/etc/ssh/sshd_config中LogLevel参数(如设为VERBOSE)获取更详细日志。