15

I attempted to access my crontab as the non-root user "coins" when I encountered a permissions issue as shown in the following error message mentioning the pam configuration:

[coins@COINS-TEST ~]$ crontab -l

Authentication service cannot retrieve authentication info You (coins) are not allowed to access to (crontab) because of pam configuration.

What's the most common fix for this crontab access issue?

MikeyB
  • 38,725
  • 10
  • 102
  • 186
Raj
  • 161
  • 1
  • 1
  • 3
  • 3
    It helps if you include some more details about your system, such as the operating system and main release. Often log files will include more information than the error you get to see as a user `/var/log/messages` and `/var/log/secure` on Linux system. – HBruijn Aug 13 '14 at 14:36

3 Answers3

21

You need to enable the user to use cron in the login access control table file /etc/security/access.conf
Use the following entry which will allow the coins user to run cron jobs:

# Allow the coins user to run cron jobs
+: coins : cron crond :0

Ensure it is above the last entry:

# Deny all other users access by any means.
-: ALL : ALL

As this entry denies (-) access from all sources to all other users not previously mentioned in the file.

Also Note
Expired accounts get the same error message as accounts not allowed.
Please check the account that's denied to see if it is expired:

chage -l accountname

geedoubleya
  • 672
  • 4
  • 10
4

You might check what's in here:

/etc/cron.allow

and also see if selinux is running and causing the problem. Poking around /var/log/messages or syslog is recommended.

kokoto
  • 156
  • 3
-1

If you have sudo access, you can work around this with:

$ sudo crontab -u `whoami` -l

For a permanent solution with above, create an alias in your .bashrc:

alias crontab='sudo crontab -u `whoami`'

After adding the alias, open new terminal and try running the crontab command again:

$ crontab -l
  • 2
    That would be a great solution, but at least on my flavor of Linux (CentOS 7.3) it has the same failure: `% sudo crontab -u foo -l` - `You (foo) are not allowed to access to (crontab) because of pam configuration.` – Ken Williams Sep 22 '17 at 18:38