当我遇到权限问题时,我尝试以非 root 用户“coins”的身份访问我的 crontab,如以下提到 pam 配置的错误消息所示:
[coins@COINS-TEST ~]$ crontab -l
Authentication service cannot retrieve authentication info You (coins) are not allowed to access to (crontab) because of pam configuration.
Run Code Online (Sandbox Code Playgroud)
此 crontab 访问问题最常见的修复方法是什么?
gee*_*eya 21
您需要允许用户在登录访问控制表文件中/etc/security/access.conf
使用cron使用以下条目将允许硬币用户运行 cron 作业:
# Allow the coins user to run cron jobs
+: coins : cron crond :0
Run Code Online (Sandbox Code Playgroud)
确保它位于最后一个条目之上:
# Deny all other users access by any means.
-: ALL : ALL
Run Code Online (Sandbox Code Playgroud)
由于此条目拒绝 ( -) 从所有来源访问文件中先前未提及的所有其他用户。
另请注意,
过期帐户会收到与不允许的帐户相同的错误消息。
请检查被拒绝的帐户是否已过期:
chage -l accountname
小智 4
你可以检查一下这里有什么:
/etc/cron.allow
Run Code Online (Sandbox Code Playgroud)
并查看 selinux 是否正在运行并导致问题。建议查看 /var/log/messages 或 syslog。