【发布时间】:2017-09-19 21:10:27
【问题描述】:
执行此操作时出现此错误。
crontab -e
You (root) are not allowed to access to (crontab) because of pam configuration.
我评论了下面的所有内容
cat /etc/pam.d/crond
#
# 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
我在/etc/security/access.conf下面添加了
#+ : ALL : ALL
#+ : root : cron
这是 cron 日志
Sep 19 21:01:01 localhost crond[65409]: (root) PAM ERROR (Authentication failure)
Sep 19 21:01:01 localhost crond[65409]: (root) FAILED to authorize user with PAM (Authentication failure)
Sep 19 21:02:01 localhost crond[65541]: (root) PAM ERROR (Authentication failure)
Sep 19 21:02:01 localhost crond[65541]: (root) FAILED to authorize user with PAM (Authentication failure)
Sep 19 21:03:01 localhost crond[65677]: (root) PAM ERROR (Authentication failure)
Sep 19 21:03:01 localhost crond[65677]: (root) FAILED to authorize user with PAM (Authentication failure)
Sep 19 21:04:01 localhost crond[65785]: (root) PAM ERROR (Authentication failure)
Sep 19 21:04:01 localhost crond[65785]: (root) FAILED to authorize user with PAM (Authentication failure)
Sep 19 21:05:01 localhost crond[65892]: (root) PAM ERROR (Authentication failure)
Sep 19 21:05:01 localhost crond[65892]: (root) FAILED to authorize user with PAM (Authentication failure)
root密码设置为永不过期
chage -l root
Last password change : never
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 90
Number of days of warning before password expires : 7
我重启了 crond 几次都没有用。
非常感谢任何帮助。
【问题讨论】:
-
这个问题与 StackOverflow 定义的编程无关。它可能在 S.E. 上更合适。相关网站unix.stackexchange.com(Unix 和 Linux)或superuser.com。使用 Q 底部的
flag链接并要求版主移动它。请不要在 2 个不同的网站上发布相同的 Q。请先阅读stackoverflow.com/help/how-to-askstackoverflow.com/help/dont-ask 和stackoverflow.com/help/mcve,然后再在此处发布更多问题。祝你好运。 -
Stack Overflow 是一个编程和开发问题的网站。这个问题似乎离题了,因为它与编程或开发无关。请参阅帮助中心的What topics can I ask about here。也许Super User 或Unix & Linux Stack Exchange 会是一个更好的提问地点。