小编Ada*_*lik的帖子

用户 x 不能使用这个程序 (crontab)

Ubuntu 14.04

我不明白我在为服务(无登录)帐户(名为curator)设置 crontab 时看到的行为。

当我以 root 身份登录时,这就是我得到的:

# crontab -u curator -l
The user curator cannot use this program (crontab)
Run Code Online (Sandbox Code Playgroud)

但是,当我切换到用户的帐户时,它工作正常:

# su -s /bin/bash curator
curator@host$ crontab -l
no crontab for curator
Run Code Online (Sandbox Code Playgroud)

有一个空/etc/cron.allow文件,/etc/cron.deny系统上没有文件。根据man crontab

如果 /etc/cron.allow 文件存在,那么您必须在其中列出(每行一个用户)才能允许使用此命令。如果 /etc/cron.allow 文件不存在但 /etc/cron.deny 文件确实存在,则您不能被列在 /etc/cron.deny 文件中才能使用此命令。

我在运行第一个命令时理解错误,但是为什么crontab当我明确切换到用户帐户时它允许我运行?

添加用户/etc/cron.allow使这两个命令都能正常工作。

cron ubuntu

12
推荐指数
1
解决办法
3万
查看次数

标签 统计

cron ×1

ubuntu ×1