Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

/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:
    132
    Likes Received:
    3
    Trophy Points:
    168
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. natong

    natong Well-Known Member

    Joined:
    May 17, 2008
    Messages:
    89
    Likes Received:
    1
    Trophy Points:
    56
    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:
    89
    Likes Received:
    1
    Trophy Points:
    56
    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. Lazek

    Lazek Well-Known Member

    Joined:
    Mar 7, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    166
    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:
    89
    Likes Received:
    1
    Trophy Points:
    56
    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:
    89
    Likes Received:
    1
    Trophy Points:
    56
    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:
    133
    Likes Received:
    2
    Trophy Points:
    68
    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:
    833
    Likes Received:
    1
    Trophy Points:
    168
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Garry-UK

    Garry-UK Member

    Joined:
    Jul 18, 2004
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    151
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,569
    Likes Received:
    45
    Trophy Points:
    308
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    833
    Likes Received:
    1
    Trophy Points:
    168
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,569
    Likes Received:
    45
    Trophy Points:
    308
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Babylon

    Babylon Member

    Joined:
    Aug 8, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    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:
    156
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice