今天同事來問一個怪問題,他使用 root 去執行 crontab 時,會出現:
Authentication service cannot retrieve authentication info.
You (root) are not allowed to access to (crontab) because of pam configuration.
用這些訊息去網路上找,發現大部份都講到存取權限跟認證的設定,有/etc/cron.allow
/etc/cron.deny
/etc/pam.d/crond
其至還有/etc/security/access.conf
不過將這些檔案別台的比對,均無不同之處,同事無頭緒,跑來問我,因為系統不是我管的,到底有動過什麼東西也不確定,在經過一番找查資訊後,有篇文章有提到跟/etc/shadow
有關,我便試著去檢查這個檔案,才發現這個檔案中並沒有 root 這個使用者的資料,不知道是什麼原因拿掉了,請同事試著把 root 的資料“加”回去,問題就解決了。