Open source software security

Crontab -e You are not allowed to use this program (crontab)

30 November -0001

I recently noticed that my user account wasn't able to use crontab on a newly installed Mandriva 2007.1 machine. This was pretty troubling since it meant I couldn't schedule jobs as a regular user. Running scheduled tasks as root is often unwise given the power of that account. Every time I tried to edit my user crontab using the '-e' flag I got the following message:

[justin ~]$ crontab -e
You (justin) are not allowed to use this program (crontab)
See crontab(1) for more information

It turns out that Mandriva doesn't create default rules for crontab's use by users. Instead, on a new install crontab is restricted to the root account. There are two files that control usage of crontab, both in /etc. These are:

/etc/cron.allow
/etc/cron.deny

The system checks cron.allow first, and if it doesn't exist checks cron.deny. If neither file exists then the system won't allow anyone but root to utilize cron.

In order to allow normal users to use crontab you have to add their user account to the cron.allow file like so:

[justin ~]$ su
Password:
[root justin]# echo justin > /etc/cron.allow

This will create the new cron.allow file and add my user account to that file. Once this is done you can utilize crontab as normal.