Ubuntu 14.04
I don't understand the behaviour I'm seeing with setting up crontab for a service (no login) account (named curator
).
When I'm logged in as root, this is what I get:
# crontab -u curator -l
The user curator cannot use this program (crontab)
But, when I switch to the user's account, it works fine:
# su -s /bin/bash curator
curator@host$ crontab -l
no crontab for curator
There is an empty /etc/cron.allow
file and no /etc/cron.deny
file on the system. According to man crontab
:
If the /etc/cron.allow file exists, then you must be listed (one user per line) therein in order to be allowed to use this command. If the /etc/cron.allow file does not exist but the /etc/cron.deny file does exist, then you must not be listed in the /etc/cron.deny file in order to use this command.
I understand the error when I'm running the first command, but why does it allow me to run crontab
when I explicitly switch to the user's account?
Adding the user to /etc/cron.allow
makes both commands work fine.
crontab -e
(as user curator)? – FelixJN Jul 27 '16 at 16:02cron.allow
file, both theroot
crontab -u vagrant -l
andcrontab -l
asvagrant
result in aare not allowed to use this program
message (which is different from the message you quote). – thrig Jul 27 '16 at 16:45