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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content