cron 控制
cron 控制
cat /etc/cron.allow 2>/dev/null # 存在即白名单生效
cat /etc/cron.deny 2>/dev/null
# 加固做法:只留 allow
echo 'root' > /etc/cron.allow
chmod 600 /etc/cron.allow
rm -f /etc/cron.deny # 移除 deny,避免并存歧义at 同理
at 同理
ls -l /etc/at.allow /etc/at.deny 2>/dev/null
echo 'root' > /etc/at.allow && chmod 600 /etc/at.allow
rm -f /etc/at.deny改前统计现有任务归属:ls /var/spool/cron/ 看哪些用户已有 crontab,避免把在用账户锁出名单导致任务中断。