crontab无法查看,原来是密码过期了

【crontab无法查看,原来是密码过期了】想查看下crontab 信息,发现报错:

$ crontab -e You (testerzhang) are not allowed to access to (crontab) because of pam configuration.

查看/var/log/secure日志:
May3 03:25:01 izwz95pyalh1f7lwmd4u62z crond[6000]: pam_unix(crond:account): password for user testerzhang will expire in 4 days

也可以直接查看过期时间
# chage -l testerzhang Last password change: Feb 05, 2021 Password expires: May 06, 2021 Password inactive: never Account expires: never Minimum number of days between password change: 7 Maximum number of days between password change: 90 Number of days of warning before password expires: 7

好吧,设置下密码:
# passwd testerzhang

账号正常了。
# chage -l testerzhang Last password change: May 08, 2021 Password expires: Aug 06, 2021 Password inactive: never Account expires: never Minimum number of days between password change: 7 Maximum number of days between password change: 90 Number of days of warning before password expires: 7

欢迎关注我的公众号testerzhang,原创技术文章第一时间推送。

    推荐阅读