1

Oracle Linux 5.10

Root user can access crontrab, but not any other user. There is no /etc/cron.allow and the /etc/cron.deny is an empty file.

Using Oracle user account:

[oracle@dub-ImrORA2 ~]$ crontab -e

Authentication failure
You (oracle) are not allowed to access to (crontab) because of pam configuration.

/etc/pam.d/crond listing:

auth       sufficient pam_env.so
auth       required   pam_rootok.so
auth       include    system-auth
account    required   pam_access.so
account    include    system-auth
session    required   pam_loginuid.so
session    include    system-auth

crond is running

[root@dub-ImrORA2 pam.d]# ps -aef | grep cron
root      3559     1  0 Jan29 ?        00:00:05 crond
root     25518 25279  0 13:19 pts/2    00:00:00 grep cron

Permissions on crontab

[root@dub-ImrORA2 ]# ls -al /usr/bin/crontab
-rwxr-xr-x 1 root root 315640 Dec 20  2011 /usr/bin/crontab

Permission on /var/spool/cron/oracle

[root@dub-ImrORA2 ]# ls -al /var/spool/cron/oracle
-rw------- 1 root root 125 Feb 24 11:43 /var/spool/cron/oracle
  • What do the logs say? /var/log/cron and /var/log/secure? – KM. Feb 24 '15 at 21:55
  • There are no entries for Oracle in var/log/cron and I don't see anything in var/log/secure that would indicate a problem. – Stringer Feb 24 '15 at 22:06
2

Problem resolved:

Change permissions on /usr/bin/crontab

[root@dub-ImrORA2 log]# ls -al /usr/bin/crontab
-rwxr-xr-x 1 root root 315640 Dec 20  2011 /usr/bin/crontab

[root@dub-ImrORA2 log]# chmod 4775 /usr/bin/crontab
[root@dub-ImrORA2 log]# ls -al /usr/bin/crontab
-rwsrwxr-x 1 root root 315640 Dec 20  2011 /usr/bin/crontab

Change owner on /var/spool/cron/oracle

[root@dub-ImrORA2 spool]# cd /var/spool/cron
[root@dub-ImrORA2 cron]# ls -al
total 24
drwx------  2 root root 4096 Feb 24 11:43 .
drwxr-xr-x 13 root root 4096 Feb 13  2014 ..
-rw-------  1 root root  125 Feb 24 11:43 oracle

[root@dub-ImrORA2 cron]# chown oracle:root oracle
[root@dub-ImrORA2 cron]# ls -al
total 24
drwx------  2 root   root 4096 Feb 24 11:43 .
drwxr-xr-x 13 root   root 4096 Feb 13  2014 ..
-rw-------  1 oracle root  125 Feb 24 11:43 oracle

Proof

[root@dub-ImrORA2 cron]# su - oracle
[oracle@dub-ImrORA2 ~]$ crontab -l
55 23 * * 0-4 /home/oracle/scripts/tblspc_usage_rpt.sh >> /home/oracle/scripts/tblspc_usage.log 2>&1
1

Just comment pam_access.so in the /etc/pam.d/cron

0

I had this problem and it turns out that it was because my sssd daemon was disabled. Starting (and enabling) sssd was the fix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.