The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General Discussion' started by Lucas, Jun 3, 2008.

  1. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Around the world
    cPanel Access Level:
    Root Administrator
    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
     
  2. natong

    natong Well-Known Member

    Joined:
    May 17, 2008
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
    #2 natong, Jun 4, 2008
    Last edited: Jun 4, 2008
  3. natong

    natong Well-Known Member

    Joined:
    May 17, 2008
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    by the way, I still get the problem.

    $ crontab -l
    cron/taoto: Permission denied
     
    #3 natong, Jun 4, 2008
    Last edited: Jun 4, 2008
  4. Ivan A

    Ivan A Well-Known Member

    Joined:
    Mar 7, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    ls -lo /usr/bin/crontab
    chflags noschg /usr/bin/crontab
    chmod 4755 /usr/bin/crontab
     
  5. natong

    natong Well-Known Member

    Joined:
    May 17, 2008
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    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
     
    #5 natong, Jun 4, 2008
    Last edited: Jun 4, 2008
  6. natong

    natong Well-Known Member

    Joined:
    May 17, 2008
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    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------


    I add bug report to
    http://bugzilla.cpanel.net/show_bug.cgi?id=6373
     
  7. tomdchi

    tomdchi Well-Known Member

    Joined:
    Feb 24, 2008
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    cPanel Access Level:
    DataCenter Provider
    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
     
    #7 tomdchi, Jul 2, 2008
    Last edited: Jul 2, 2008
  8. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    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
     
  9. Garry-UK

    Garry-UK Member

    Joined:
    Jul 18, 2004
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  10. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    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. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    This happened for me on a new install. I don't know if crontab permissions change, they were just wrong to start with.
     
  12. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    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. Babylon

    Babylon Member

    Joined:
    Aug 8, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    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
     
    #13 Babylon, Aug 19, 2008
    Last edited: Aug 19, 2008
  14. openaccess

    openaccess Active Member

    Joined:
    Jan 22, 2006
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
Loading...

Share This Page