Linux Cron Not Running: “Authentication token is no longer valid; new one required”

Last updated on

I was having an issue where my crontab was failing to run. This was causing the Linux log rotation to fail, creating huge log files in the gigabytes and exhausting disk space, which eventually caused MySQL to crash out of memory.

Checking the cron log with

sudo grep CRON /var/log/syslog

Output:

Aug 4 13:39:01 ubuntusrv CRON[2946]: Authentication token is no longer valid; new one required
Aug 4 14:09:01 ubuntusrv CRON[3285]: Authentication token is no longer valid; new one required
Aug 4 14:17:01 ubuntusrv CRON[3359]: Authentication token is no longer valid; new one required
Aug 4 14:39:01 ubuntusrv CRON[3606]: Authentication token is no longer valid; new one required
Aug 4 15:09:01 ubuntusrv CRON[4038]: Authentication token is no longer valid; new one required
Aug 4 15:17:01 ubuntusrv CRON[4125]: Authentication token is no longer valid; new one required

Check root Password Expiry

The error for me appeared to be related to an expired root password. To check the expiration status of the root password, run:

sudo chage -l root

Output:

Last password change                                    : password must be changed
Password expires                                        : password must be changed
Password inactive                                       : password must be changed
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 14600
Number of days of warning before password expires       : 14

Above we can see “password must be changed”, which seems to be preventing the crontab from running.

Change root Password

You should change your root password.

sudo passwd root

Click here to generate a strong password.

Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Once the password is changed, check the expiry again.

sudo chage -l root

Output:

Last password change                                    : Apr 24, 2020
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 14600
Number of days of warning before password expires       : 14

Your crontab should now run correctly.

Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.

Leave a reply

Your email address will not be published. Required fields are marked *