Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 14 of 14
  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    112

    Default /usr/bin/crontab permissions are wrong. Please set to 4755

    Could someone explain me why would cPanel change the permissions of crontab incorrectly? I had fixed them and on the update they got messed up again. Is this a bug or is there something wrong on my server?

    /usr/bin/crontab permissions are wrong. Please set to 4755
    Learning.

  2. #2
    Member
    Join Date
    May 2008
    Posts
    83

    Default

    I faced this problem too.
    It's CentOS 5 and cPanel bug 6 months ago.


    To fix these, run

    chmod 4755 /usr/bin/crontab

    from the command line as root.
    Last edited by natong; 06-04-2008 at 03:40 PM.

  3. #3
    Member
    Join Date
    May 2008
    Posts
    83

    Default

    by the way, I still get the problem.

    $ crontab -l
    cron/taoto: Permission denied
    Last edited by natong; 06-04-2008 at 04:10 PM.

  4. #4
    Member
    Join Date
    Mar 2007
    Posts
    133

    Default

    ls -lo /usr/bin/crontab
    chflags noschg /usr/bin/crontab
    chmod 4755 /usr/bin/crontab

  5. #5
    Member
    Join Date
    May 2008
    Posts
    83

    Default

    Found solution:

    chmod 4775 /usr/bin/crontab

    After run those command, check permission of /var/spool/cron and user owner permission files too.

    They should be:

    root 04:00:15 AM /var/spool/cron 900 # ls -al
    total 24
    drwxr-xr-x 2 root root 4096 Jun 5 03:41 ./
    drwxr-xr-x 12 root root 4096 May 23 22:53 ../
    -rw------- 1 root root 1394 Jun 4 12:04 mailman
    -rw------- 1 root root 385 Jun 5 00:47 root
    -rw------- 1 taoto taoto 154 Jun 5 03:38 taoto
    -rw------- 1 thumb thumb 51 Jun 5 03:41 thumb
    Last edited by natong; 06-04-2008 at 04:11 PM.

  6. #6
    Member
    Join Date
    May 2008
    Posts
    83

    Default

    When user use cPanel to add cron job, system reset owner of /var/spool/cron/* to root

    Then user can't use command line "crontab -l".

    Sometime system also reset permission of folder /var/spool/cron/ to drwx------


    root 03:22:59 AM /var/spool/cron 1015 # ls -l

    drwxr-xr-x 2 root root 4096 Jun 8 03:22 ./
    drwxr-xr-x 12 root root 4096 May 23 22:53 ../
    -rw------- 1 root root 1394 Jun 7 00:49 mailman
    -rw------- 1 root root 385 Jun 8 00:47 root
    -rw------- 1 root taotoo 101 Jun 8 03:22 taotoo
    -rw------- 1 thumbno thumbno 51 Jun 5 03:41 thumbno
    I add bug report to
    http://bugzilla.cpanel.net/show_bug.cgi?id=6373

  7. #7
    Member
    Join Date
    Feb 2008
    Location
    Atlanta, GA
    Posts
    77
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    this is happening to me as well. any word on a fix?


    edit:
    found a fix a from a few months ago. I had to run
    chattr -i /usr/bin/crontab
    Last edited by tomdchi; 07-02-2008 at 03:10 PM.

  8. #8
    Member rs-freddo's Avatar
    Join Date
    May 2003
    Location
    Australia
    Posts
    836
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    problem still happening

    WHM 11.23.2 cPanel 11.23.4-R26138
    REDHAT Enterprise 5.2 x86_64 on standard - WHM X v3.1.0
    Michael

  9. #9
    Member
    Join Date
    Jul 2004
    Posts
    16

    Default

    Hi,

    I was having problems with this as well cPanel users was not able to create a cron, but after running: chmod 4755 /usr/bin/crontab
    It fixed the problem. I am running:

    WHM 11.23.2 cPanel 11.23.4-R26138
    CENTOS Enterprise 5.2 x86_64 on virtuozzo - WHM X v3.1.0
    Regards,
    Garry

  10. #10
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    cPanel does not modify the permissions of the crontab binary.

    Even if your permissions on /var/spool/cron are set to 0700, a normal user in a normal shell should be able to modify and display his own crontab from the command line.

    Tested on CentOS 4.6 and FreeBSD 7 (display below is from CentOS, however permissions are the same on the FreeBSD server).

    Code:
    root@mundane [~]# ls -l /usr/bin/crontab 
    -rwsr-xr-x  1 root root 82916 Aug  2  2007 /usr/bin/crontab*
    root@mundane [~]# ls -l /var/spool/cron
    total 36
    drwx------   2 root root     4096 Jul 30 13:15 ./
    drwxr-xr-x  17 root root     4096 Mar  2  2007 ../
    -rw-------   1 root root     1430 Jul 17 15:40 mailman
    -rw-------   1 root mysqlbug   10 Dec  7  2006 mysqlbug
    -rw-------   1 root root      496 Jul 30 09:37 root
    -rw-------   1 root root       87 Jul 30  2007 standard
    -rw-------   1 root abcdee    318 Jul 30 13:15 tramel
    root@mundane [~]# su - tramel
    tramel@abc.com [~]# echo $SHELL
    /bin/bash
    tramel@abc.com [~]# crontab -l
    MAILTO="tramel"
    0 0 * * * echo "Test the 6th" >> /tmp/cptest
    0 5 * * * echo "Test the 5th" >> /tmp/cptest
    0 4,8,12,22 * * * echo "mimi" >> /dev/null
    0 0 * * * echo "hi test me" > /tmp/cptest
    0 3 * * * echo "Another test" >> /tmp/cptest
    0 3 * * * echo "Test the 4th" >> /dev/null
    tramel@abc.com [~]# crontab -e
    crontab: installing new crontab
    tramel@abc.com [~]# crontab -l
    MAILTO="tramel"
    0 0 * * * echo "Test the 6th" >> /tmp/cptest
    0 5 * * * echo "Test the 5th" >> /tmp/cptest
    0 4,8,12,22 * * * echo "mimi" >> /dev/null
    0 0 * * * echo "hi test me" > /tmp/cptest
    0 3 * * * echo "Another test" >> /tmp/cptest
    0 3 * * * echo "Test the 4th" >> /dev/null
    0 0 * * * echo "CLI Test" >> /dev/null
    tramel@abc.com [~]# logout

    If something keeps changing the permissions of /usr/bin/crontab then you need to hunt down what is causing that change.

  11. #11
    Member rs-freddo's Avatar
    Join Date
    May 2003
    Location
    Australia
    Posts
    836
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    This happened for me on a new install. I don't know if crontab permissions change, they were just wrong to start with.
    Michael

  12. #12
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by rs-freddo View Post
    This happened for me on a new install. I don't know if crontab permissions change, they were just wrong to start with.
    Correct. /usr/bin/crontab gets installed non-setuid by the distro, but cPanel wants the permissions to be setuid, likely because of applying 0700 permissions to /var/spool/cron

  13. #13
    Member
    Join Date
    Aug 2003
    Posts
    17

    Default

    Anyone able to help further with this? I tried the noted solutions above, however:

    crontab -l
    cron/root: Permission denied


    Running CentOS 5 here as well.

    Edit: nevermind. I had to chown root:root /usr/bin/crontab

    Then chmod 4755 /usr/bin/crontab
    Last edited by Babylon; 08-19-2008 at 10:31 AM.

  14. #14
    Member
    Join Date
    Jan 2006
    Posts
    18

    Default

    I have opened bug #9689 on this topic since this thread provided no
    satisfactory resolution. Please read this bug for my experience and recommendations.

    Bug 9689 - /usr/bin/crontab permissions get lost on CentOS

    Thank you
    David Manifold

Similar Threads & Tags
Similar threads

  1. Crontab permissions wrong warning
    By Sindre in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 02-16-2010, 01:38 PM
  2. Unable to set UID permissions for /usr/bin/crontab
    By Chriz1977 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 06-28-2009, 06:28 AM
  3. /usr/bin/crontab permissions are wrong. Please set to 4755
    By sadanoops in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-29-2008, 08:52 PM
  4. /usr/bin/crontab permissions are wrong. Please set to 4755
    By molpad in forum New User Questions
    Replies: 1
    Last Post: 02-13-2008, 03:22 AM
  5. Replies: 0
    Last Post: 02-26-2007, 04:19 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube