Show/Hide Toolbars

MongoDB Notes

Navigation: Other Tools > OpenLDAP

Installing LDAP Client

Scroll Prev Top Next More

 

In this procedure, you will be installing client software on Ubuntu that allows searching an LDAP server.  This software allows testing of connectivity and queries against an LDAP server.

 

Note: The LDAP client software is not necessary for the LDAP authentication or authorization in MongoDB to work.  However, it is helpful in testing.

 

Prerequisites

 

You have a computer or virtual machine with an LDAP server installed.

Your client machine can connect to the LDAP server.  For example, you can ping the LDAP server using its domain name.

You have the host name, port (if not using the default port), and the distinguished name of the base.  For example:

 

LDAP server domain name

ldap.waysysweb.us.com

LDAP default port

389

Base distinguished name

dc=waysysweb,dc=us,dc=com

URI for LDAP server

ldap://ldap.waysysweb.us.com

LDAP administrative account

cn=admin,dc=waysysweb,dc=us,dc=com

LDAP administrative password

jamaica

 

Procedure (Ubuntu)

 

1.Log into an Ubuntu terminal on a computer where you have are running MongoDB.

2.Update the list of software.

 

sudo apt-get update

 

3.Install the LDAP client packages.  The command prompts for the LDAP server URI and the base distinguished name.  Enter the information described in the prerequisites.  In addition, when prompted:

oselect LDAP Version 3

oNo to making local root database admin.

oNo to requiring login to the database to retrieve entries

 

sudo apt-get -y install libnss-ldap libpam-ldap ldap-utils nscd

 

4.Edit the /etc/ldap/ldap.conf file and set the BASE and URI parameters to described in the prerequisites.

 

Test the Installation

 

To test connectivity with your LDAP server, execute this command.  The command prompts for the LDAP administrative password, which you should enter.

 

ldapsearch -x -W -D 'cn=admin,dc=waysysweb,dc=us,dc=com' -b "" -s base