≡ Menu

Force OpenSSH (SSHD) to use authentication via LDAP server

Lightweight Directory Access Protocol, or LDAP , is a directory services running over TCP/IP. Most large business and organization use LDAP for centralized authentication.

You can read LDAP Linux HOWTO for setup and configuration. If your workstation or server setup to authenticate via LDAP, open ssh will not work when user try to connect from remote system. You need to make little modification to openssh, so that it can authenticate you via LDAP:

Open /etc/ssh/sshd_config file
# vi /etc/ssh/sshd_config file

Append or modify line as follows:
PAMAuthenticationViaKbdInt yes

Restart OpenSSH
# /etc/init.d/sshd restart

Now ssh server will accept login for remote users.

Share this on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 5 comments… add one }
  • Aneesh November 24, 2006, 11:37 pm

    I think no additional configuration is needed because the file /etc/nsswitch.conf

  • Aneesh November 24, 2006, 11:39 pm

    I think no additional configuration is needed because the file /etc/nsswitch.conf contains the entry
    passwd: files ldap

    This will do the trick.

  • nixCraft November 25, 2006, 8:41 am

    LDAP and authentication mechanism is already configured. But you need to tell this to OpenSSH.

  • Benny Chitambira December 11, 2008, 10:29 am

    The 1st method suggested is now deprecated
    The second solution is usually configured already, so that not a solution
    The real problem is usually in the configuration of pam
    edit or create file:
    comment out or delete line:
    # account required pam_access.so
    This removes the requirement that the user should have a local account.
    The above line is usually present in systems installed via kickstart

  • richard March 15, 2016, 9:32 pm

    PAMAuthenticationViaKbdInt yes is deprecated.

Security: Are you a robot or human?

Leave a Comment