查看cron運行日誌
tail -f /var/log/cron
報如下錯誤:
May 8 10:14:01 localhost crond[9399]: (root) FAILED to authorize user with PAM (Module is unknown)
May 8 10:14:01 localhost crond[9400]: (root) FAILED to authorize user with PAM (Module is unknown)
網上有如下解決方法:
禁用SELinux,可以使用getenforce命令查看是否禁用。
修改/etc/cron.allow,添加
root
myuser
修改/etc/pam.d/crond,把把所有required改成sufficient,這個可能對非root用戶管用。
#
# The PAM configuration file for the cron daemon
#
#
# No PAM authentication called, auth modules not needed
account required pam_access.so
account include password-auth
session required pam_loginuid.so
session include password-auth
auth include password-auth
最終解決辦法:
重啓crond服務
/etc/init.d/crond restart
————————————————
版權聲明:本文爲CSDN博主「小龍在山東」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/lilongsy/article/details/71404119