title: You (root) are not allowed to access to (crontab) because of pam configuration centOS
body: <p>I am getting this error when I do.</p>
  
  <pre><code>crontab -e
  You (root) are not allowed to access to (crontab) because of pam configuration.
  </code></pre>
  
  <p>I commented everything under</p>
  
  <pre><code>cat /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
  </code></pre>
  
  <p>I added below in <code>/etc/security/access.conf</code></p>
  
  <pre><code>#+ : ALL : ALL
  #+ : root : cron
  </code></pre>
  
  <p>Here is cron log</p>
  
  <pre><code>Sep 19 21:01:01 localhost crond[65409]: (root) PAM ERROR (Authentication failure)
  Sep 19 21:01:01 localhost crond[65409]: (root) FAILED to authorize user with PAM (Authentication failure)
  Sep 19 21:02:01 localhost crond[65541]: (root) PAM ERROR (Authentication failure)
  Sep 19 21:02:01 localhost crond[65541]: (root) FAILED to authorize user with PAM (Authentication failure)
  Sep 19 21:03:01 localhost crond[65677]: (root) PAM ERROR (Authentication failure)
  Sep 19 21:03:01 localhost crond[65677]: (root) FAILED to authorize user with PAM (Authentication failure)
  Sep 19 21:04:01 localhost crond[65785]: (root) PAM ERROR (Authentication failure)
  Sep 19 21:04:01 localhost crond[65785]: (root) FAILED to authorize user with PAM (Authentication failure)
  Sep 19 21:05:01 localhost crond[65892]: (root) PAM ERROR (Authentication failure)
  Sep 19 21:05:01 localhost crond[65892]: (root) FAILED to authorize user with PAM (Authentication failure)
  </code></pre>
  
  <p>root password was set never to expire </p>
  
  <pre><code>chage -l root
  Last password change                    : never
  Password expires                    : never
  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
  </code></pre>
  
  <p>I restarted crond several times nothing helped.</p>
  
  <p>Any help greatly appreciated. </p>