Issue :-
[oracle@testserv1~]$ crontab -l
You (oracle) are not allowed to access to (crontab) because of pam configuration.
[oracle@testserv1~]$
When you will check the log file /var/log/cron you will be able to see the error in logfile.
May 22 12:28:57 testserv1 crontab[48079]: (oracle) PAM ERROR (Authentication token is no longer valid; new one required)
May 22 12:29:37 testserv1 crontab[48205]: (oracle) PAM ERROR (Authentication token is no longer valid; new one required)
Solution :-
There could be two reason for this error:
1. Expired password for the user.
2. User not allowed to cron in /etc/security/access.conf file.
Check for expired user password.
1. First of all, check the password expiry for the user using chage command.
[root@testserv1 ~]# chage -l oracle
Last password change : Feb 19, 2021
Password expires : May 20, 2021 ## Password Expired for oracle user.
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
[root@testserv1 ~]#
From the output above we can say that the password has expired on May 20th 2021. Crontab command will fail if it is run as user whose password is expired. PAM will not allow to run cronjob as user if the password of that user is expired.
2. If password is expired, new password will need to be set for the user in order to allow user to run cronjobs. To set password for user, run following command as root:
[root@testserv1 ~]# passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@testserv1 ~]#
After changing the password now you can try to access the cronjobs again.
Hope the above solution helped you to resolve the issue.
Comments
Post a Comment