0

When I type the last command, I see a bunch of entries in there for cron. Every single cron job that gets run creates an entry and it's flooding wtmp with unnecessary entries. Any ideas how I can stop cron from doing that? The entries look like the following:

root cron Sat Feb 06 12:50 - 12:50 (00:00) root cron Sat Feb 06 12:40 - 12:40 (00:00) root cron Sat Feb 06 12:30 - 12:30 (00:00) myuser pts/0 :0.0 Sat Feb 06 10:30 - 12:30 (02:00)

chizou
  • 457
  • 3
  • 8
  • 15

1 Answers1

2

This is likely done by your pam configuration. Check either /etc/pam.conf or the files in /etc/pam.d/* for lines containing pam_lastlog.so. From the pam_lastlog(8) manual:

DESCRIPTION
pam_lastlog is a PAM module to display a line of information about the last login of the user. In addition, the module maintains the /var/log/lastlog file.

The exact solution depends on your overall pam configuration. You can either tell pam_lastlog no not write to /var/log/wtmp or you can skip pam_lastlog only for cron sessions.