Got an interesting report of an error on one of our servers. I was told crons for a user account on our server weren’t running. I tailed the cron log (/var/log/cron) and came to find these errors:
Oct 13 06:32:01 secure crond: CRON (clients) ERROR: failed to open PAM security session: Protocol not supported
Oct 13 06:32:01 secure crond: CRON (clients) ERROR: cannot set security context
I’ve never seen the error before. I dug around in various PAM and related security configs, but didn’t see any issues. I then wanted to run the cron manually via the user, and tried to sudo down into the user’s account.
[root@secure~]# sudo su - clients
Too many logins for 'clients'.
could not open session
There is the problem! Cron can’t run because two techs were logged into the ‘clients’ user account and it was being limited. In this case I decided to bump the limit to 5 users. Here is what I did:
[root@secure~]# nano -w /etc/security/limits.conf
Now I added the following line:
clients hard maxlogins 5
The crons were now running, problem solved.