Symptoms
When logged into the command line (SSH) as a cPanel user, attempts to edit the user's crontab fail.
Description
When a cPanel user tries to invoke crontab -e to edit their cron jobs, the operation fails with a "Permission Denied" error related to the temporary crontab file.
Example: (errors that may appear)
# su - cptest -s /bin/bash
$ whoami
cptest
$ crontab -e
[ Path '/tmp/crontab.L17pbe' is not accessible ]
$ crontab -e
Temporary crontab no longer owned by you.
Error while editing crontab
We've opened an internal case for our development team to investigate this further. For reference, the case number is CPANEL-46079. Follow this article to receive an email notification when a solution is published in the product.
Workaround
This issue appears to be caused by incorrect permissions on the crontab binary—specifically, the group SUID bit is not set.
To resolve this, run the following commands as the root user:
chmod g+s /usr/bin/crontab
chmod u-s /usr/bin/crontab
This will set the Permission on 'crontab' to 2755, which works for the users and root.
# stat /usr/bin/crontab
File: /usr/bin/crontab
Size: 39568 Blocks: 80 IO Block: 4096 regular file
Device: fc01h/64513d Inode: 1921 Links: 1
Access: (2755/-rwxr-sr-x) Uid: ( 0/ root) Gid: ( 104/ crontab)
Please Note: This workaround may be temporary, as system updates or core functions could reset the permissions.
Comments
0 comments
Article is closed for comments.