Linux + Cron + Pam Access

RedhatSo I ran into the following issue when attempting to setup a user to have cron access on a RHEL 4 box.

Oct  7 10:34:01 ‘hostname’ pam_access[20206]: access denied for user `user’ from `cron’
Oct  7 10:34:01 ‘hostname’ crond[20206]: Permission denied

First and foremost, you should know that any user that you want to be able to user cron should be added to /etc/cron.allow. Almost anyone who is familiar with Cron should already know this.

Poking around a bit on google indicated that I needed to add the following to /etc/security/access.conf

+ALL:cron crond

Make sure that the line above comes before the line below.


Below is the /etc/pam.d/crond file that I used

# The PAM configuration file for the cron daemon
auth       sufficient
auth       required service=system-auth
auth       required
account    sufficient /lib/security/$ISA/
account    required service=system-auth
account    required
session    required
session    required

One thought on “Linux + Cron + Pam Access

  1. Thanks for the advice – helped me with a cron job on XenServer.

    Also had to modify the .sh job with ‘chmod u+x’…


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.