Login denied after setting nofile limits. Secure log shows the error "error: PAM: pam_open_session(): Permission denied"

Solution Verified - Updated -

Issue

  • Setting a hard limit in ulimit on nofile to anything higher than 1048576 (including unlimited) fails, and prevents logins from working.

  • After setting the following in /etc/security/limits.conf

    * soft nofile 5000000
    * hard nofile 5000000 
    

no one can login, and /var/log/secure file shows

sshd[3889]: error: PAM: pam_open_session(): Permission denied

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.