How to disable LDAP Authentication in Linux

After a customer had performed some bad edits on various LDAP configuration files, users were locked out and unable to access the system. Root could still login however.

I logged in as root, and rather than mess with various config files, eg under /etc/pam.d, ran this command to disable LDAP authentication and enable “normal” authentication using /etc/shadow:

# authconfig --disableldapauth --disableldap --enableshadow --updateall

After which users could login again.

Footnote

This was a “lab” system located on an isolated network. On a production server, having direct root login is not recommended, and great care should be exercised before using the authconfig command.

5 thoughts on “How to disable LDAP Authentication in Linux

  1. Thank you very much for posting this. It fixed my server. How would I make this permanent? I only want local users, no LDAP, my LDAP servers time out and slow everything down.

    • Hi Denis. As far as I am aware, the authconfig command is permanent. Once the above command has been issued, LDAP will no longer be used for authentication.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.