Debian

debian7 cron.allow & cron.deny 文件

  • May 20, 2014

將近 3 週,在我的停機時間裡,我試圖找出文件cron.allow&cron.denydebian7發行版中的位置。沒辦法,似乎預設情況下它們不在系統中。

“只是”出於強化目的,我會在我的系統中提供這些文件。我的問題實際上是我是否可以只touch使用它們並使用它們而不必進行其他配置。

root@asw-deb:~# touch /etc/cron.allow
root@asw-deb:~# touch /etc/cron.deny

或者,如果我可能必須“映射”這些文件,也許是編輯一些 cron 配置文件,“說”cron 可以在哪裡找到我創建的兩個文件。

對不起,如果我聽起來有點笨拙。

從手冊man 1 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.

If neither of these files exists, then depending on site-dependent configuration
parameters, only the super user will be allowed to use this command, or all users
will be able to use this command.

If  both  files  exist  then  /etc/cron.allow  takes  precedence.  Which  means that
/etc/cron.deny is not considered and your user must be listed in /etc/cron.allow in
order to be able to use the crontab.

Regardless of the existance of any of these files, the root administrative user is
always allowed to setup a crontab. For standard Debian systems, all users may use
this command.

我在 Debian 7 上試了一下,它就是這樣工作的。

引用自:https://unix.stackexchange.com/questions/131145