1
My user "craig" is in the /etc/sudoers
file on my CentOS 5.6 VM, however when I try to access the crontab using the command below I am presented with an error message:
sudo crontab -e -u crmpicco-stock-dev
[sudo] password for craig:
Sorry, user craig is not allowed to execute '/usr/bin/crontab -e' as root on dev.localdomain.
Why do I get this message as I can see in my /etc/sudoers
file that I can access the crontab requested.
Here is the entry from my /etc/sudoers
file:
craig ALL=(crmpicco-stock-dev) /usr/bin/crontab, /var/spool/cron/crmpicco-stock-dev
No, this produces the same error. So I don't think the order matters here.
[craig@dev53 dev_crmpicco]$ sudo crontab -u crmpicco-stock-dev -e [sudo] password for craig: Sorry, user craig is not allowed to execute '/usr/bin/crontab -u crmpicco-stock-dev -e' as root on dev.localdomain.
– crmpicco – 2012-12-20T17:03:08.783An alternative could be to run: sudo su -c "crontab -e" crmpicco-stock-dev – ricciocri – 2012-12-20T17:19:02.970
Same again, unfortunately.
Sorry, user craig is not allowed to execute '/bin/su -c crontab -e crmpicco-stock-dev' as root on dev.localdomain.
– crmpicco – 2012-12-20T17:22:04.173Have you changed /etc/sudoers to allow craig to execute /bin/su ? – ricciocri – 2012-12-20T17:39:12.703
I have editedmy sudoers file with visudo to include the line
Cmnd_Alias SU = /bin/su
, there is no mention of thecraig
user in the file. Should adding the command alias line open it up for all users? After adding this line there has been no change to the problem - i'm still unable to access thecrmpicco-stock-dev
crontab with thecraig
user. Anything else I can try? – crmpicco – 2013-01-07T11:44:32.590Changing
/etc/sudoers
tocraig ALL=(ALL) ALL
works, but it's not exactly what I was looking for. – crmpicco – 2013-01-07T11:58:02.173