linux环境,crontab报错Authentication token is no longer valid; new one required You (aimonitor) are not allowed to access to (crontab) because of pam configuration.

Problem description :

  Today, my colleague responded that some data on a system was not generated. After reading it, I suspected that the scheduled task was not executed, so I looked at the crontab and found that the following error was reported:

[aimonitor@4A-LF-w08 ~]$ crontab -l

Authentication token is no longer valid; new one required
You (aimonitor) are not allowed to access to (crontab) because of pam configuration.

Problem solving :

1. Based on the above phenomenon, I found a solution on the Internet, saying that the user password may have expired

2. Check the user's password expiration time

[root@4A-LF-w08 ~]# chage -l aimonitor
Last password change                    : Jan 16, 2018
Password expires                    : Apr 16, 2018
Password inactive                    : never
Account expires                        : never
Minimum number of days between password change        : 6
Maximum number of days between password change        : 90
Number of days of warning before password expires    : 30

Note: From the above information, we know that the password expires on April 16, 2018, and no data will be generated in the future. The time is April 17.

3. Set the account so that the password never expires

[root@4A-LF-w08 ~]# chage -M 99999 aimonitor
[root@4A-LF-w08 ~]# chage -l aimonitor
Last password change                    : Jan 16, 2018
Password expires                    : never
Password inactive                    : never
Account expires                        : never
Minimum number of days between password change        : 6
Maximum number of days between password change        : 99999
Number of days of warning before password expires    : 30

4. Check the crontab again and find that the crontab can be displayed normally, and the scheduled tasks are also executed normally.

 

Document Creation Time: April 26, 2018 16:36:09

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324936338&siteId=291194637