Ubuntu – Ubuntu 12.04 LDAP client issue

ldapopenldap

I followed the guide described here configure LDAP, but I keep getting following error when running "getent passwd", is there any reason for that?

Error:

Jul 16 15:58:33 wso2-VirtualBox getent: nss_ldap: could not search LDAP server - Server is unavailable
^[[AJul 16 15:59:34 wso2-VirtualBox getent: nss_ldap: failed to bind to LDAP server ldapi:///192.168.4.152/: Invalid credentials
Jul 16 15:59:34 wso2-VirtualBox getent: nss_ldap: could not search LDAP server - Server is unavailable

Configuration files:

vi /etc/ldap.conf

base dc=example,dc=com

uri  ldapi:///192.168.4.152/

ldap_version 3

timelimit 4

bind_timelimit 4

bind_policy soft

pam_password md5

nss_initgroups_ignoreusers avahi,avahi-
autoipd,backup,bin,colord,daemon,games,gnats,hplip,irc,kernoops,libuuid,lightdm,list,lp,mail,man,messagebus,news,nslcd,openldap,proxy,pulse,root,rtkit,saned,speech-dispatcher,sshd,sync,sys,syslog,usbmux,uucp,whoopsie,www-data

Best Answer

Use the ldapsearch command line tool to verify that the server is running and the credentials you are using are correct:

ldapsearch -D the-dn-you-use -w -the-password-you-use \
    -H 192.168.4.152:389 -s base -b dc=example,dc=com '(&)' 1.1

If ldapsearch succeeds, the server is listening, the LDAP client has sufficient permission to perform this search, and the authentication was correct.

Related Question