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?

1
  • 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, 2014 at 14:36

3 Answers 3

22

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

4
  • 1
    I am glad this solution is still being useful, even though it was decided that the problem was too vague. Jul 16, 2015 at 16:03
  • Not sure why the problem was flagged as too vague. I had the same problem, and this answer worked perfectly.
    – Hazok
    Oct 27, 2015 at 9:16
  • Why are each of these elements necessary? Especially the :0?
    – MikeyB
    May 13, 2016 at 15:53
  • Expired password was the reason in my case. Changed password, and everything works fine.
    – rohitmohta
    Oct 5, 2017 at 18:44
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.

-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
1
  • 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. Sep 22, 2017 at 18:38

Not the answer you're looking for? Browse other questions tagged .