This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Thursday, February 1, 2018

User not allowed to access to (crontab) because of pam configuration - SOLVED

Situation:
While running the crontab command user getting the below error.
[root@testserver ~]# su - user13
[user13@testserver ~]$ crontab -l
Authentication token is no longer valid; new one required
You (user13) are not allowed to access to (crontab) because of pam configuration.

Solution:
First check the age before adding the user in /etc/security/access.conf
If it is expired, set the password.

[root@testserver ~]# chage -l user13
Last password change                                                    : Sep 06, 2017
Password expires                                                            : Dec 05, 2017
Password inactive                                                           : never
Account expires                                                              : never
Minimum number of days between password change    : 1
Maximum number of days between password change   : 90
Number of days of warning before password expires     : 7

Set the password
[root@testserver ~]# passwd user13
Enter new password:
Re-type new password:
passwd: all authentication tokens updated successfully.

[root@testserver ~]# chage -l user13
Last password change                                                     : Jan 31, 2018
Password expires                                                             : May 01, 2018
Password inactive                                                            : never
Account expires                                                               : never
Minimum number of days between password change     : 1
Maximum number of days between password change    : 90
Number of days of warning before password expires      : 7

Then now add the user in /etc/security/access.conf file above -: ALL : ALL line.
+ : user13 : cron crond crontab

[root@testserver ~]# su - user13
[user13@testserver ~]$ crontab -l
no crontab for user13
[user13@testserver ~]$ exit

Hope it is help.

No comments:

Post a Comment