cp /etc/inetd.conf /etc/inetd.conf.bak
vi /etc/inetd.conf
找到 ftp 行,末尾加 -l 參數:
ftp stream tcp6 nowait root /usr/sbin/ftpd ftpd -l
vi /etc/syslog.conf
檔案末尾加入:
daemon.info /tmp/ftp.log
將 daemon 級資訊日誌輸出至指定檔案。
touch /tmp/ftp.log
refresh -s inetd
refresh -s syslogd
配置完成後,FTP 伺服器將傳輸日誌記錄至 /tmp/ftp.log。即時監控:
tail -f /tmp/ftp.log
-l 參數啟用 ftpd 內建日誌功能daemon.info 設施.優先級組合,捕獲 FTP 服務資訊級以上日誌refresh -s 為 AIX/某些 System V 風格系統重載服務命令,Linux 多用 service xinetd reload 或 systemctl reload/var/log/ftp.log 並配置 logrotate 輪轉