20080908

Obscure Ubuntu Tip: CRON User account has expired

No, I haven't forgotten that I have a blog. I've just been keeping busy with a lot going on at work, and a backlog of “projects” at home after finishing up the kitchen project. Some of those projects have involved getting down-and-dirty with Ubuntu, and I thought I would share a quick tip I discovered yesterday.

I was looking through the system log (/var/log/syslog) on one of my servers and I noticed it was full of “CRON[xxxx]: User account has expired” messages. A little searching on the web pointed to the fact that the root account had been locked. While setting up this server, I had followed some instructions I found on the web that required me to unlock the root account, then re-lock it when I was done with the

sudo passwd -l root
command. Locking an account this way also causes the password to be expired, one of the results of which is the above mentioned log entries. Most of the solutions I found on the web involved either unlocking the root again and giving it a long, random password, or manually editing the password files. I think I've found the correct way to fix this though, by using the
sudo chage -E-1 root
command, which sets the root's password to never expire. (Note that the -1 is negative one, not dash L). After using the above command, the system log showed normal CRON log entries, and the root account remained locked.

I hope someone else will find this information to be of use. That's it for my very obscure Ubuntu tip. Join me again soon for another exciting post. I actually have a good sized list of topics to cover on the blog, so hopefully things will settle down and you will hear more from me soon. Thanks for stopping by!

16 comments:

Anonymous said...

Thanks! That fixed the problem with my cron jobs not running!

Anonymous said...

This really helped me out. Thanks.

Anonymous said...

Well, how do you say this? It saved my day, I guess... I was really pulling my hair on that one!!!

xdanx said...

Thx mate.. it really worked out for me. And the lazy Ubuntu forums didn't help me after 20 mins of searching . Cheers, keep up the good work

Anonymous said...

Thanks. Your post saved me. I wasn't finding much help in the ubuntu forums.

Anonymous said...

Thankyou, very useful tip! Problem solved :o)

Unknown said...

I had exactly this problem. Thanks for solving it for me.

billy said...

Thank you very much, I used the "passwd -l" command in a hurry and was wondering why my cron jobs did not run...

Frank said...

Awesome thank you very much, you fixed my problem!!

Colin said...

Thank you!

Anonymous said...

Very nice! Thanks a lot.

Unknown said...

Thanks for the tip! Because of the expired root password, the cleanup of PHP sessions on Ubuntu located at /var/lib/php5. The rate that these session files were growing was just amazing.

Anonymous said...

Thanks! Fixed my problem!

Anonymous said...

Great solution, thank you!

Anonymous said...

7 years later, this tip still helps :) thanks.

Anonymous said...

8 years later, this tip still helps :) Thanks a lot!

 
Template design by Amanda @ Blogger Buster