Linux / UNIX Restrict at / cron Usage To Authorized Users

Linux / UNIX Restrict at / cron Usage To Authorized Users

To restrict at and cron usage to authorized users on a Linux or Unix system, you can use the following methods:

  1. Use the at.allow and at.deny files: The at daemon reads the at.allow and at.deny files to determine which users are allowed or denied access to the at command. By default, the at.allow file is empty and the at.deny file contains the entry "ALL", which means that all users are denied access to the at command.

To allow certain users access to the at command, you can add their username to the at.allow file. For example:

echo "user1" >> /etc/at.allow
echo "user2" >> /etc/at.allow
So‮‬urce:www.lautturi.com

This will allow the user1 and user2 users to use the at command. To deny certain users access to the at command, you can add their username to the at.deny file. For example:

echo "user3" >> /etc/at.deny
echo "user4" >> /etc/at.deny

This will deny the user3 and user4 users access to the at command.

  1. Use the cron.allow and cron.deny files: Similar to the at daemon, the cron daemon reads the cron.allow and cron.deny files to determine which users are allowed or denied access to the cron command. By default, the cron.allow file is empty and the cron.deny file contains the entry "ALL", which means that all users are denied access to the cron command.
Created Time:2017-10-29 22:08:55  Author:lautturi