Friday, February 5, 2010

Solaris: Cron Jobs Don't Run (!bad user) locked account

It took a bit of time to find out that my cron jobs where not running for a given user on a Solaris box.

Looking at /var/cron/log I was seeing "!bad user" (userName).

But, the user was fine, I was using it, I'd already su'ed to become the user several times.

Turns out that the problem is that, cron does not like users that have been locked out due to not changing the password. I never saw a request to change the password because I always su to become the user rather than logging in as that user.

So, to fix the problem, run "passwd -u userName" as root or via sudo. After that, the cronjobs run fine.

Apparently, the fact that on Solaris, cron does not run the jobs of a locked user, is not documented in any visible manner.