Tuesday, November 27, 2012

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

” -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.