You (root) are not allowed to access to (crontab) because of pam configuration,crontabpam

來源:互聯網
上載者:User

You (root) are not allowed to access to (crontab) because of pam configuration,crontabpam

巡檢發現一台Linux伺服器上的作業沒有如期發送郵件,登入伺服器檢查後發現作業並沒有執行,於是檢查一下crontab的設定。結果發現如下錯誤:

 

[root@mylnx2 ~]# crontab -l

 

Authentication token is no longer valid; new one required

You (root) are not allowed to access to (crontab) because of pam configuration.

[root@mylnx2 ~]#

 

 

 

 

查看了一下/etc/pam.d/crond,仔細檢查後發現我們設定了密碼到期策略,當密碼到期後,作業由於許可權認證是不會執行的,這個可以參考Linux帳號密碼到期會導致crontab作業不能執行和 Linux賬戶密碼到期安全性原則設定

 

 

[root@mylnx2 ~]# more /etc/pam.d/crond

#

# The PAM configuration file for the cron daemon

#

#

# No PAM authentication called, auth modules not needed

account    required   pam_access.so

account    include   password-auth

session    required   pam_loginuid.so

session    include   password-auth

auth     include   password-auth

 

 

想必細心的人發現上面裡面都是root帳號, 那如果密碼到期了後,你怎麼使用root登入呢? 其實這裡我們訪問伺服器通過Jump Server(跳板機)登入,登入後使用sudo su - 切換到root帳號,所以沒有遇到類似下面需要修改密碼的通知。

 

You are required to change your password immediately (password aged)

Last login: Wed Jun 28 15:42:13 2017 from xxx.xxx.xxx.xxx

Changing password for root.

(current) UNIX password:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.