Error Writing /etc/crontab Permission Denied
Contents |
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about ubuntu crontab permission denied Stack Overflow the company Business Learn more about hiring developers or posting ads with
Crontab Permission Denied Centos
us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and /var/spool/cron/: mkstemp: permission denied network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top What
Crontabs Fdopen Permission Denied
could cause “Permission denied” for command `crontab -e`? up vote 12 down vote favorite 2 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 crontab edit permission denied 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 cron share|improve this question edited Oct 25 '09 at 21:14 asked Oct 25 '09 at 20:57 nbolton 2,33293757 add a comment| 3 Answers 3 active oldest votes up vote 7 down vote accepted Does /usr/bin/crontab have the setgid permission set? -rwxr-sr-x 1 root crontab 32K 2008-09-28 14:07 /usr/bin/crontab* 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). share|improve this answer edited Oct 26 '09 at 7:23 answered Oct 25 '09 at 21:09 grawity 5,6291424 Thank you so much, that's been bugging me for ages! –nbolton Oct 25 '09 at 21:13 add a comment| up vote 10 down vote Also it's worth checking out the permissions at /var/spool/cron/crontabs by ls -al /var/spool/cron/crontabs In my case doing this showed that actually the user assigned to the crontab was 'whoopsie' which I assume means there was som
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might
Cron Permission Denied Php
have Meta Discuss the workings and policies of this site About
Usr Bin Crontab Permission Denied
Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads temporary crontab no longer owned by you with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it http://serverfault.com/questions/78159/what-could-cause-permission-denied-for-command-crontab-e only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top All commands in my crontab fail with “Permission denied” up vote 10 down vote favorite 1 Update: This issue will not be answered conclusively; I have moved to http://askubuntu.com/questions/296107/all-commands-in-my-crontab-fail-with-permission-denied another distro and have not observed this problem since. I was never able to fix it with the insightful answers available at the time, but your fuel efficiency may vary (YMMV). crontab -e and crontab -l work just fine: $ crontab -l | grep -v '^#' * * * * * /usr/bin/env * * * * * echo 'Hello from crontab' However, I see two messages like this every minute in /var/log/syslog: Mon DD hh:mm:01 username CRON[PID]: Permission denied So the crontab is being read, but somehow it can't execute anything at all (of course I verified the commands when logged in as the same user). Any idea why? /etc/cron.allow and /etc/cron.deny do not exist. crontab is set group setuid: $ stat --format '%A %U %G' /usr/bin/crontab -rwxr-sr-x root crontab The crontabs directory seems to have the right permissions: $ stat --format '%A %U %G' /var/spool/cron/crontabs drwx-wx--T root crontab The crontab itself is owned by me (not surprisingly, since I'm able to edit it): $ sudo stat --format
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads http://unix.stackexchange.com/questions/148123/cannot-edit-crontab-as-non-root-user with us Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Cannot edit crontab as non root user up vote 2 down vote favorite 2 When I use the permission denied command crontab -e on my Debian server as a non root user (in this case as postgres), I can't edit it because of "/tmp/crontab.SJlY0Y/crontab" [Permission Denied] crontab -l on the other hand works fine. How can I fix this problem? Here are the current permissions: $ ls -l /tmp/crontab.SJlY0Y/crontab -rw------- 1 root postgres 1.2K Aug 3 11:44 /tmp/crontab.SJlY0Y/crontab $ ls -l /var/spool/cron total 12K drwxrwx--T 2 daemon daemon 4.0K Sep 12 2012 atjobs drwxrwx--T 2 daemon daemon 4.0K Jun 9 2012 atspool drwx-wx--T 2 root crontab permission denied crontab 4.0K Aug 3 11:15 crontabs $ ls -l /var/spool/cron/crontabs total 12K -rw------- 1 git crontab 1.3K Mar 2 16:48 git -rw------- 1 postgres crontab 1.4K Aug 3 11:15 postgres -rw------- 1 root root 2.3K Jul 20 20:32 root $ ls -l /usr/bin/crontab -rwsr-xr-x 1 root root 36K Jul 3 2012 /usr/bin/crontab $ ls -ld /tmp/ drwxrwxrwt 6 root root 4.0K Aug 3 11:43 /tmp/ debian permissions cron share|improve this question edited Aug 3 '14 at 20:27 Gilles 371k696751126 asked Aug 3 '14 at 9:47 Thurion 134 Looking at the permissions on ` /tmp/crontab.SJlY0Y/crontab ` I can see that the postgres group has no permission to read or write the file. Check the permissions on the crontab folder above it as well and run the following : chmod -R g+rw /tmp/crontab.SJlY0Y –beans Aug 3 '14 at 10:12 The presence of postgres in ls -l /tmp/crontab.SJlY0Y/crontab is unexpected. Can you think of any reason why it should he there? –Faheem Mitha Aug 3 '14 at 11:47 Since the crontab is for the postgres user, I was expecting the postgres user and group to own it, so that is why I'm suggesting that the group should have permission to read and write –beans Aug 3 '14 at 15:00 @beans Sorry, I was not paying attention - didn't notice the user was postgres. –Faheem Mitha Aug 3 '14 at 17:47 What is the permissions on your /tmp directory? It should be drwxrwxrwt. –garethTheRed Aug 3 '14