I just had an issue where I tried to issue
crontab -e as a user and got
crontabs/username: Permission denied
The problem was traced to deleting an old account that had a crontab then recreating the account later which had a different user id.
Note here how the username directory has a uid “1000” and not a login name associated with it. Therefore when attempting to run crontab -e permission is denied because the user doesn’t have access to it’s own crontab file.
[email protected]:/var/spool/cron/crontabs# ls -al
-rw------- 1 user1 crontab 298 2008-04-27 18:02 user1
-rw------- 1 1000 crontab 230 2008-03-13 14:00 username
The fix – change the ownership of the crontab file:
[email protected]:/var/spool/cron/crontabs# chown username.crontab username -Rv
changed ownership of `username' to username:crontab