top of page
Search
  • parimalanitesh

Openldap Server configuration and user creation

Updated: Sep 17, 2022

OpenLdap

OpenLDAP is a free, open-source implementation of the Lightweight Directory Access Protocol (LDAP) developed by the OpenLDAP Project.


Installation

You can install openldap with the following command

sudo apt install slapd ldap-utils

You can reconfigure the openldap server with the following command

sudo dpkg-reconfigure slapd

You can reconfigure the cn=admin and domain as nitesh.com . Please don't forgot to remember the password that you have entered for the cn and domain creation


This is what the dc=nitesh,dc=com DIT looks like:

ldapsearch -x -LLL -H ldap:/// -b dc=nitesh,dc=com dn

dn: dc=nitesh,dc=com
dn: cn=admin,dc=nitesh,dc=com

User Creation

Initially we have to create a organization unit. You can create ou by adding this openldap_ou.ldif

dn: ou=openldap,dc=nitesh,dc=com
dc: openldap
objectClass: dcObject
objectClass: organizationalUnit
ou: openldap

Use below command for adding ou to this ldap database

ldapadd -x  -D "cn=admin,dc=nitesh,dc=com" -W  -f openldap_ou.ldif

Create users for OpenLdap. Initially we have to create openldap_user1.ldif

dn: uid=openldap_user1,ou=openldap,dc=nitesh,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: openldap_user1
sn: OLUser1
givenName: User1
cn: openldap_user1
displayName: openldap_user1
uidNumber: 1810
gidNumber: 1700
userPassword: openldap_user1
gecos: Openldap User1
homeDirectory: /home/openldap_user1

Add user with following command

ldapadd -x  -D "cn=admin,dc=nitesh,dc=com" -W  -f openldap_user1.ldif

You can check with ldapsearch command if the user is added to the database or not

ldapsearch -h localhost -x  -D "cn=admin,dc=nitesh,dc=com" -W
93 views0 comments

Recent Posts

See All

SSSD Integration with 389ds LDAP

SSSD: The System Security Services Daemon (SSSD) provides access to remote identity and authentication providers. Providers are configured as back ends with SSSD acting as an intermediary between loca

Multiple LDAP Integration with Openstack Keystone

I've got a task to integrate Multiple LDAP with Openstack Keystone. Below are the same steps which you have to follow for External LDAP integration with Openstack Keystone also. I followed below steps

Post: Blog2_Post
bottom of page