not allowed to access to crontab because of pam configuration
如果運行crontab如遇下面這樣的錯誤:
$ crontab -l
You (zhangsan) are not allowed to access to (crontab) because of pam configuration.
原因可能是因為用戶zhangsan密碼過期了。當嘗試以密碼登錄時,會報提示需要立即修改密碼:
$ su - zhangsan
Password:
You are required to change your password immediately (password aged)
Changing password for zhangsan.
(current) UNIX password:
如果正好是hadoop集群,由於需要免密碼登錄,密碼不能過期。
可以使用命名chage查看實際情況,比如(請以root用戶運行):
#chage -l zhangsan
Last password change : Nov 23, 2015
Password expires : Feb 21, 2016
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
從上可以看到:每90天需要修改一次密碼,密碼到期前7天會告警。
為了讓密碼永久有效,可這樣設置一下:
chage -M 99999 zhangsan
再次查看:
#chage -l zhangsan
Last password change : Nov 23, 2015
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7