Here's some output that I hope is helpful:
nick@home-sv-1:~$ crontab -e
/var/spool/cron/crontabs/nick: Permission denied
nick@home-sv-1:~$ echo $EDITOR
emacs
nick@home-sv-1:~$ ls /var/spool/cron/crontabs
ls: cannot open directory /var/spool/cron/crontabs: Permission denied
nick@home-sv-1:~$ sudo ls -al /var/spool/cron/crontabs
total 12
drwx-wx--T 2 root crontab 4096 2009-10-25 20:45 .
drwxr-xr-x 3 root root 4096 2009-05-18 01:19 ..
-rw------- 1 root root 612 2009-10-25 01:20 root
Problem:
Crontab does not have setguid, and is not in the crontab group.
home-sv-1:~# ls -al /usr/bin/crontab
-rwxr-xr-x 1 root root 32048 2009-08-30 03:34 /usr/bin/crontab
Solution:
As root...
home-sv-1:~# chown root.crontab /usr/bin/crontab
home-sv-1:~# chmod g+s /usr/bin/crontab
home-sv-1:~# ls -al /usr/bin/crontab
-rwxr-sr-x 1 root crontab 32048 2009-08-30 03:34 /usr/bin/crontab
Also it's worth checking out the permissions at /var/spool/cron/crontabs by
In my case doing this showed that actually the user assigned to the crontab was 'whoopsie' which I assume means there was some error in setting up the user.
Performing...
Fixed this completely :)
Does
/usr/bin/crontab
have thesetgid
permission set?If not,
chmod g+s
it (and if needed,chown
before that)Edit: Note that this only applies to Vixie Cron (used by most distros); other daemons (such as
dcron
) may use different permissions (setuid
).I had the same problem. I solved it this way.
I hope it helps you.
Check for an /etc/cron.allow and /etc/cron.deny file. If those files exist, make sure your user name is in /etc/cron.allow.