Cannot login into new install of OpenLDAP

24,132

Solution 1

So first of all ubuntu manage to create a long how to (https://help.ubuntu.com/14.04/serverguide/openldap-server.html) about LDAP which omits an important phase:

You would have to run sudo dpkg-reconfigure slapd after you installed slapd and select : NO - your.domain.com - Organisation name - password - password - HDB - YES - YES - NO

I found the solution at Where is the dc=example,dc=com ldap dit?

Thank's for muru

Solution 2

Edit: Apparantly this is a very wide spread issue and it has been reported in many other forums without a viable soloution. while ago I solved and reported the soloution here but after awhile when I wanted to redo the steps I reslised that i can't replicate sucessfully. so after some try and error again I succeed so I will put the instructions here, this time not omting any details. hopefully it helps. before starting the steps please make sure you have the IP address of your maching (e.g. using ifconfig, for example 192.168.33.10)

  1. knowing/changing your hostname: open the file /etc/hostname. you may delete everything there and replace it with your domain (e.g. myserver.org).

  2. installing OpenLDAP packages: you need 3 packages slapd, ldap-utils and phpldapadmin. installing slapd you will be asked to enter admin password.

  3. configuring OpenLDAP: open /etc/ldap/ldap.conf uncomment the lines below (remove the # from the beginning of the lines)

    BASE dc=example,dc=com

    URI ldap://ldap.example.com ldap://ldap-master.example.com:666

    and change them to

    BASE dc=myserver,dc=org

    URI ldap://192.168.33.10 ldap://192.168.33.10:666

    please remember that you have to replace the example IP 192.168.33.10 with your IP adress.

  4. configuring phpldapadmin: open /etc/phpldapadmin/config.php in editor. Look for the lines having $servers->setValue, change 127.0.0.1 to the server IP address. change all examples and coms to the terms you have set in step a

  5. Reconfigure the OpenLDAP Server: you need to Reconfigure the OpenLDAP Server (I don't know why really!) sudo dpkg-reconfigure slapd then select : NO -> myserver.com -> OrganisationName -> password -> password -> HDB -> NO -> YES -> NO

  6. the problem should be solved by now. but when you go forward there is another problem as described here in this post. you can solve it by the instructions in the link

I should thanks Anandd Nayyar and refer to his youtube video which helped me a lot to solve these issues.

Share:
24,132

Related videos on Youtube

elemer82
Author by

elemer82

Updated on September 18, 2022

Comments

  • elemer82
    elemer82 over 1 year

    In Oracle VM Virtualbox I installed a fresh new copy of Ubuntu Server 14.04.1 64 bit version, with OpenSSH installed as well. Steps I done:

    1. sudo apt-get install slapd ldap-utils

    2. nano /etc/ldap/ldap.conf Here I entered BASE dc=elemer,dc=local URI ldap://192.168.0.14

    3. sudo apt-get install phpldapadmin

    4. sudo nano /etc/phpldapadmin/config.php and replaced all the "dc=example,dc=com" with "dc=elemer,dc=local"

    5. From the physical machine I bring up a webbrowser and type in 192.168.0.14/phpldapadmin It brings up the webpage and I type in my password (I set the LDAP password the same as the root).

    6. LDAP laughs at me and says

    "Unable to connect to LDAP server My LDAP Server

    Error: Invalid credentials (49) for user

    Failed to Authenticate to server

    Invalid Username or Password"

    The password is deffinetly right, I even created other virtual machines and repeated the process from scrath, used different approach at times but never managed to get it right.

    1. If I run ldapsearch -x it gives me: "Result: 32 No such object

    2. If I run ldapadd and put in my password it says:

    ldap_sasl_interactive_bind_s: INvalid credentials (49) additional info: SASL(-13): user not found: no secret in database

    1. ldapsearch -x -LLL -H ldap:/// -b dc=example,dc=com dn will give No such object (32)
  • runlevel0
    runlevel0 about 8 years
    Followed the howto and it does not work. I have reset the ldap password twice using dpkg-reconfigure, that's what's written in the solution. No luck thus. I have also restarted Apache and the slapd twice to force it to reread the documentation. Intriguing. I'll of course post a solution it I find one... even it is changing the LDAP admin GUI ;)
  • wjandrea
    wjandrea about 7 years
    I fixed up this answer, but I don't know anything about networking/servers, so someone should probably check my edit to make sure everything's OK.
  • Grant Curell
    Grant Curell over 3 years
    That first link is dead now.