I cannot edit my user crontab without being superuser.

I expected the following to work, but I get an error message:

$ crontab -e
crontabs/gauthier/: fdopen: Permission denied

The following is working, but I don't think I should need sudo to edit my user-specific crontab:

$ sudo crontab -u gauthier -e

The permissions on my user crontab:

$ sudo ls -l /var/spool/cron/crontabs
total 4
-rw------- 1 1001 crontab 1139 Sep 10 08:36 gauthier

I tried adding myself to the crontab group, to no av (I understand now that I shouldn't be in that group, it's only for SGID to work).

An answer to this question says to change the permissions, owner, and group of /usr/bin/crontab, but that file does not seem involved here. And I don't see why these permissions would have changed from system defaults.

Where am I wrong? Is it normal that crontab -e doesn't work? Even if I am in the crontab group? What should I do instead? If I need to change the permissions and owner of /usr/bin/crontab, why aren't they working in the default installation?

  • What are the permissions on /usr/bin/crontab ? I know you referenced a post about this but your symptoms sound like it isn't setuid root. Let's just eliminate this. Should be ... nph9@goat$ ls -l /usr/bin/crontab -rwsr-xr-x. 1 root root 51784 Nov 23 2013 /usr/bin/crontab nph9@goat$ – Paul Haldane Nov 29 '14 at 10:24

The permission for your crontab is wrong, it is owned by an (nonexistant?) user with the uid 1001, not the user gauthier (or you have some further issues with your system if your uid is 1001).

Try sudo chown gauthier /var/spool/cron/crontabs/gauthier and see if this fixes this.

| improve this answer | |
  • Correct! I recall changing my uid from 1001 to 1000 long ago, it never seemed a good idea but it gave some promises with another issue. I got it confirmed: it was not a good idea :) Thanks ! – Gauthier Dec 2 '14 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.