标题: You (oracle) are not allowed to access to (crontab) becaus of pam configuration. [打印本页] 作者: jiawang 时间: 2025-1-2 09:17 标题: You (oracle) are not allowed to access to (crontab) becaus of pam configuration. 本帖最后由 jiawang 于 2025-1-2 09:17 编辑
oracle用户下查看计划任务时,报错如下:
--查看计划任务
[oracle@sztech ~]$ crontab -l
You (oracle) are not allowed to access to (crontab) because of pam configuration.
检查PAM模块,cat /etc/pam.d/crond,文件中配置是否正常
[root@sztech ~]# 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
查看系统日志cat /var/log/secure的错误信息
Mar 3 16:54:01 sztech crond[103891]: pam_unix(crond:account): expired password for user oracle (password aged)
Mar 3 16:54:25 sztech su: pam_unix(su-l:session): session opened for user root by root2(uid=1001)
Mar 3 16:55:47 sztech crontab: pam_unix(crond:account): expired password for user oracle (password aged)
Chage命令查看oracle用户密码有效期
--查看oracle用户密码有效期
[root@sztech ~]# chage -l oracle
Last password change : Aug 31, 2020
Password expires : Feb 27, 2023
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
Password expires : Feb 27, 2023部分,显示oracle的密码到期时间为Feb 27, 2023。
--chage -l oracle查看命令,再看密码过期时间为never
[root@sztech ~]# chage -l oracle
Last password change : Aug 31, 2020
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 10
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7Minimum number of days between password change : 10
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
经再次验证,oracle下的crontab命令可以正常编辑。