若執行 crontab -l 遇到錯誤:
You (zhangsan) are not allowed to access to (crontab) because of pam configuration.
原因可能是使用者 zhangsan 密碼過期。嘗試以密碼登入時會提示需立即修改密碼:
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
問題即可解決。