• Health tips to prevent the spread of COVID-19:
    • Wash your hands frequently;
    • Maintain 2 meters social distancing;
    • Minimise outdoor activities.
    Stay safe in your bubble!

Fixing DirectAdmin: You (user) are not allowed to use this program (crontab)

Andy

Administrator
User ID
1
Joined
7 Jan 2019
Messages
175
Reaction score
7
Points
18
Screen Shot 2020-05-11 at 9.09.12 AM.png

Scenario:
You have granted a user package with Cron Jobs ticked, but when the user creates a cron job from DirectAdmin or from the shell, they got:
Bash:
saputra@cana:~$ crontab -l
/etc/cron.deny: Permission denied
You (saputra) are not allowed to use this program (crontab)
See crontab(1) for more information
saputra@cana:~$
It's most likely related to the +s flag on the crontab binary, check using this command:
Bash:
root@cana:~# ls -al /usr/bin/crontab
-rwxr-sr-x 1 root crontab 36008 Mar 22  2019 /usr/bin/crontab
root@cana:~#
And here's how to fix it:
Bash:
root@cana:~# chmod 4755 /usr/bin/crontab
root@cana:~# ls -al /usr/bin/crontab
-rwsr-xr-x 1 root crontab 36008 Mar 22  2019 /usr/bin/crontab
root@cana:~#
Now the users will be able to setup their cron:
Bash:
saputra@cana:~$ crontab -l
#direct_crons enabled. Safe to edit this file. DirectAdmin will update accordingly.
MAILTO=""
saputra@cana:~$
Reference: https://help.directadmin.com/item.php?id=615
 
 Short URL:
Top