通过查看/var/log/cron日志发现有错误提示
Mar 16 11:14:01 5g42u crond[29065]: (root) FAILED to authorize user with PAM (Authentication failure) Mar 16 11:15:01 5g42u crond[29180]: (root) PAM ERROR (Authentication failure)
意思是授权模块认证失败,任务计划的配置是在/etc/pam.d/crond,但是查看以后发现文件不存在,把另一台同版本的系统文件拷贝了过来。
[root@5g42u ~]# 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 system-auth session required pam_loginuid.so session include system-auth auth include system-auth
推测是因为任务计划启动后要用哪个用户去运行,但是又找不到系统的PAM插件认证模块中(Pluggable Authentication Module)关于任务计划的配置信息导致认证失败。
pam这个东西还是接触比较少。
创建文件完成后,重启cron服务解决。
原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/4718.html