


先日、CentOS 7にpoppassdをインストールしました。
インストールしたpam対応のpoppassd-cetiはデフォルトで/var/log/messagesにログを出力します。
1 |
Mar 21 14:00:55 centos7 poppassd[60669]: old password is incorrect for user test |
/var/log/messagesでもいいのですが、別ファイルに出力してみました。
ソースコードpoppassd.cをみるとLOCAL4でsyslog指定の記述があるので変更してみます。
- /etc/rsyslog.conf
- rsyslogの再起動
- logrotate
1 2 3 4 5 6 7 8 9 |
# vi /etc/rsyslog.conf # cat /etc/rsyslog.conf (snip) # Don't log private authentication messages! *.info;mail.none;authpriv.none;cron.none;local4.none /var/log/messages (snip) # poppassd local4.* /var/log/poppassd.log (snip) |
1 |
# systemctl restart rsyslog |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# vi /etc/logrotate.d/poppassd # cat /etc/logrotate.d/poppassd /var/log/poppassd.log { weekly rotate 4 missingok notifempty compress delaycompress sharedscripts postrotate doveadm log reopen endscript } |
動作確認で/var/log/poppassd.logにログが書き出されると思います。
1 2 3 4 5 |
Mar 21 14:31:49 centos7 poppassd[60714]: PAM error: BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word Mar 21 14:31:49 centos7 poppassd[60714]: PAM error: Password change aborted. Mar 21 14:31:49 centos7 poppassd[60714]: PAM error: Password change aborted. Mar 21 14:31:49 centos7 poppassd[60714]: PAM error: Password change aborted. Mar 21 14:32:45 centos7 poppassd[60716]: changed POP3 password for test |