Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to login to an Ubuntu VM using LDAP credentials. I have followed an internal company wiki and gotten as far as a successful login. However, I can only login with LDAP intermittently.

Most often, if I reboot the VM, I can not log in with LDAP credentials. It passes the username/password, but hangs on a black screen. I then reboot, log in to the local account and check /var/log/auth.log. I read errors similar to the following:

could not search LDAP server - Server is unavailable

failed to bind to LDAP server ldap://hostname.our.server: Can't contact LDAP server

I am able to ping hostname.our.server.

Now, if I run "su myldapusername", I am prompted for my password and successfully switch. At this point I can sometimes log out of the local account and successfully log in to the LDAP account.

I can't explain why I can only intermittently complete the log in via LDAP. I'm guessing there is some kind of race condition. Anyway, while I still have hair, I would appreciate any help you can offer.



P.S. I suppose I should mention I'm using Ubuntu Desktop 12.04. For a hypervisor I have tried both VMware and VirtualBox, in order to rule out any weird bridged networking problem.

share|improve this question
This looks an awful lot like a DNS or network issue. LDAP authentication works if the network is stable. You should grab Wireshark or tcpdump and look at the network traffic. The LDAP protocol itself isn't too complicated either, you might be able to figure out what's going on. – Janoszen Jun 13 '13 at 22:02

I ran the commands below based on this guide

sudo apt-get install ldap-auth-client nscd

sudo auth-client-config -t nss -p lac_ldap

This differed from the commands I ran based on our internal documents. Seems to work now, so I'm going to move on. Thanks for the input.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.