Cron jobs and root password expiration
From MyWiki
(Difference between revisions)
(Created page with 'Recently stepped onto the good old time bomb. When you set password expiration on accounts and never use root, cron jobs scheduled for root will stop working when root's password…') |
(added error message to the article.) |
||
Line 1: | Line 1: | ||
Recently stepped onto the good old time bomb. When you set password expiration on accounts and never use root, cron jobs scheduled for root will stop working when root's password expires. | Recently stepped onto the good old time bomb. When you set password expiration on accounts and never use root, cron jobs scheduled for root will stop working when root's password expires. | ||
+ | When it happens, you may see something like this in the logs: | ||
+ | |||
+ | <pre> | ||
+ | CRON[25674]: Authentication token is no longer valid; new one required | ||
+ | </pre> | ||
To fix that on Ubuntu I setup pwgen and added this cron job for root: | To fix that on Ubuntu I setup pwgen and added this cron job for root: |
Revision as of 10:59, 13 June 2013
Recently stepped onto the good old time bomb. When you set password expiration on accounts and never use root, cron jobs scheduled for root will stop working when root's password expires. When it happens, you may see something like this in the logs:
CRON[25674]: Authentication token is no longer valid; new one required
To fix that on Ubuntu I setup pwgen and added this cron job for root:
# changing root password to prevent cron freeze 0 0 1 * * PASS=`/usr/bin/pwgen -s -y 15 1`; echo -e "$PASS\n$PASS" | (passwd root)
Ubuntu seems to be different and doesn't have --stdin option for passwd commans, so I had to go around it after asking almighty search engine for help.
I don't care what's the password, because I use my personal account with sudo elevation to root ;-)