XK0-005 practice question 9 of 10

A systems administrator created a user cron to run a scheduled database backup cronjob on the server at 1 a.m. every day. The following is the…

Full set: 487 questions
A systems administrator created a user cron to run a scheduled database backup cronjob on the server at 1 a.m. every day. The following is the cronjob syntax: 0 1 * * * /bin/sh backup.sh The backups, however, are not being created. When checking the crontab file, the administrator sees the following error: /var/spool/cron/crontab/cron: Permission denied Which of the following will permit the cronjob to execute?
Answer options
A: Creating the file cron.allow and adding user cron to it Correct answer
B: Giving cron ownership of the file /usr/bin/crontab
C: Running sudo cron restart to activate the cronjob
D: Running sudo crontab -u cron -e to edit the file with sudo
Correct Answer:
A. Creating the file cron.allow and adding user cron to it
Explanation

Cron daemon security and user execution privileges on Linux systems are governed by the access control files cron.allow and cron.deny, typically located in /etc/. When /etc/cron.allow exists on a system, only user accounts explicitly listed within that file are permitted to submit, edit, or execute scheduled jobs via the crontab spool service. If the user cron encounters a permission denied error when accessing /var/spool/cron/crontab/cron, it indicates that user-level access to the cron subsystem is restricted. Creating the cron.allow file and adding the username cron to it explicitly authorizes the user account to access the spool directory and execute scheduled crontab jobs successfully.

Why Incorrect

B. Changing ownership of /usr/bin/crontab breaks system security permissions; crontab must remain owned by root with setuid/setgid bits intact.
C. Restarting the cron daemon does not resolve permission denied errors caused by access control restrictions on user accounts.
D. Editing another user's crontab with sudo bypasses editing restrictions once, but does not grant the cron user execution permission for running scheduled jobs.

References

IEEE Std 1003.1-2017 (POSIX.1-2017) Standard Shell & Utilities: crontab.

Linux man-pages project: crontab(1) - maintain crontab files for individual users.

Scroll to Top