Cron: Permission denied?
Posted by Tom Whiting on 30 Nov 2007 at 07:48 pm | Tagged as: administration
When setting up new server this week, and trying to add cronjobs, I noticed that I was getting an error:
cron/user: Permission denied
What caused this? Why is it here? How to resolve? Read more
This was caused because of a faulty CPanel setup, or a faulty server setup. Either way, permissions were not set appropriately for fixing this issue. Here’s how I got it fixed, and a brief explanation of HOW this happens, WHY it happens, and whatnot (ie: the tech crap)
This happens because the user did not have permission to write to the specific file that cron needs to change in the /var/spool/cron directory. There are two ways to change this:
- Make the directory world writable. This is a security risk, because this would let anything write anything to this directory, without any sort of security. Bad idea, but if you want to do this, you can do this like so.
chmod a+w /var/spool/cron
- Fix the permissions on cron so that the user can execute it with suid priviledges. This will allow the binary to write to this specific file, but ONLY the binary.
chmod 4775 /usr/bin/crontab
Obviously the second way is more secure, because it enforces strict rules as to what can be done, what can’t be done, and the like. This keeps things secured to a degree, while still allowing security measures to be in place. Of course, someone abusing the crontab binary is STILL possible, but that’s for another entry.
Leave a reply
You must be logged in to post a comment.














