近三个星期,在我的停机时间里,我试图找出文件cron.allow
的cron.deny
位置Debian7发行版。没办法,好像默认情况下他们不在系统里。
“只是”为了强化目的,我会让这些文件在我的系统中可用。我的问题实际上是我是否可以只使用touch
它们并使用它们而无需进行其他配置。
root@asw-deb:~# touch /etc/cron.allow
root@asw-deb:~# touch /etc/cron.deny
或者,如果我可能必须“映射”这些文件,也许会编辑一些 cron 配置文件,“说明”cron 可以在哪里找到我创建的两个文件。
抱歉,如果我听起来有点菜鸟。
答案1
从手册中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 上尝试过,它的工作方式正是如此。