-bash: /usr/bin/crontab: Permission denied

28 Feb, 2007  |  Posted by Danesh  |  in Linux

” -bash: /usr/bin/crontab: Permission denied “.

I was getting this error earlier today while trying to add cron jobs for my login on my SLES 10 box at work. Turns out that all users in SLES 10 by default have no access to cron.

The fix is to add the user to the “trusted” group in the group file (/etc/group). Let’s assume mu login is “elf”.

1. Make sure you are “root”.

2. #usermod -G trusted elf
This will add the user to the “trusted” group.

3. #id elf
Display groups the user belongs to. Make sure “trusted” is on the list too.
The output might look like this. “uid=502(danny) gid=502(users) groups=502(elf),11(trusted)”
4. #su - elf
Change user

5. #crontab -e
Add/Remove/Edit user cron jobs.

6. #crontab -l
List user scheduled cron jobs

Please do comment if you have an alternative way to accomplish this or if I made a mistake.

  • Digg
  • del.icio.us
  • BlinkList
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Furl
  • Google
  • Live
  • Facebook
  • Pownce
  • TwitThis
  • E-mail this story to a friend!
  • LinkedIn
  • Ping.fm
Tags:

2 Responses so far | Have Your Say!

  1. Sal  |  May 25th, 2007 at 2:43 am #

    Thanks for blogging this. I was looking all over to find out why adding a user to /etc/cron.allow did not allow users to edit cron.

    Sal - Gravatar
  2. Andy  |  November 15th, 2007 at 4:16 am #

    Thanks, i have the Novell SLES books in front of me and they dont mention that crucial piece of info!!

    Andy - Gravatar

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>