SlideShare a Scribd company logo
LDAP Configuration Documentation
Installation Guide 01.
Network Details: Below is the network details used while writing this article.
System name: openldap.example.com
System IP: 192.168.10.50
Domain Name: example.com
Step 1: Create Test Accounts
Firsty create two test user accounts in your linux system using following commnands.
# useradd ldapuser1
# useradd ldapuser2
# passwd ldapuser1
# passwd ldapuser2
Step 2: Install Requird Packages
Below is list of software required for setup openldap
 compat-openldap
 openldap-clients
 openldap-devel
 openldap-servers
 openldap-servers-sql
Install all packages using following command.
# yum install *openldap* -y
Step 3: Setup OpenLDAP root Password
After installing openldap packages, First create OpenLDAP root user password
# slappasswd
New password:
Re-enter new password:
{SSHA}BONOBgJZNZc3A+UFq3fcjRn2YHsZVkXw
Step 4:Edit Configuration File
Edit openldap configuration file with new values , use rootpw value get from slappasswd
command in above step
# vi /etc/openldap/slapd.conf
database bdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
rootpw {SSHA}BONOBgJZNZc3A+UFq3fcjRn2YHsZVkXw
Step 5:Setup LDAP Database File
Copye example LDAP database file at below location. Use given example file from openldap
# cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
Step 6 Start Services
Start openldap service and setup service to auto start on system boot
# service ldap start
# chkconfig ldap on
Step 7: Create Domain LDIF File
Now Create ldif (LDAP Data Interchange Format) file for your domain example.com, You
can use any filename with extension ldif
# vim /etc/openldap/base.ldif
dn: dc=example,dc=com
dc: example
objectClass: top
objectClass: domain
dn: ou=users,dc=example,dc=com
ou: users
objectClass: top
objectClass: organizationalUnit
dn: ou=Group,dc=example,dc=com
ou: Group
objectClass: top
objectClass: organizationalUnit
Step 8: Create Users LDIF File
After creating ldif file for your domain, Let create ldif file for all test users.
# cd /usr/share/openldap/migration/
# grep root /etc/passwd > /etc/openldap/passwd.root
# grep ldapuser1 /etc/passwd > /etc/openldap/passwd.ldapuser1
# grep ldapuser2 /etc/passwd > /etc/openldap/passwd.ldapuser2
# ./migrate_passwd.pl /etc/openldap/passwd.root
/etc/openldap/root.ldif
# ./migrate_passwd.pl /etc/openldap/passwd.ldapuser1
/etc/openldap/ldapuser1.ldif
# ./migrate_passwd.pl /etc/openldap/passwd.ldapuser1
/etc/openldap/ldapuser2.ldif
Step 9: Edit Users LDIF Files
Modify all LDIF files created for users as per below given example for ldapuser1.
# vim /etc/openldap/ldapuser1.ldif
dn: uid=ldapuser1,dc=example,dc=com
uid: ldapuser1
cn: ldapuser1
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
objectClass: radiusprofile
description: 802.1x user
radiusFilterId: "Enterasys:version=1:policy=Enterprise User"
userPassword: {crypt}$1$rN6WLraT$9skdu7BpRUM6v7DiEhQXt1
shadowLastChange: 15419
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 612
gidNumber: 612
homeDirectory: /home/ldapuser1
Note: Make sure you have added below 3 file in ldif for integrating radius-ldap
authentication
 objectClass: radiusprofile
 description: 802.1x user
 radiusFilterId: “Enterasys:version=1:policy=Enterprise User”
Step 10: Import All Data
Import all Data from configuration files to LDAP database
Importing base.ldif:
# ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f
/etc/openldap/base.ldif
Enter LDAP Password:
adding new entry "dc=example,dc=com"
adding new entry "ou=users,dc=example,dc=com"
adding new entry "ou=Group,dc=example,dc=com"
Importing root.ldif:
# ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f
/etc/openldap/root.ldif
Enter LDAP Password:
adding new entry "uid=root,ou=users,dc=example,dc=com"
adding new entry "uid=operator,ou=users,dc=example,dc=com"
Importing ldapuser1.ldif:
# ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f
/etc/openldap/ldapuser1.ldif
Enter LDAP Password:
adding new entry "uid=ldapuser1,ou=users,dc=example,dc=com"
Importing ldapuser2.ldif:
# ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f
/etc/openldap/ldapuser2.ldif
Enter LDAP Password:
adding new entry "uid=ldapuser2,ou=users,dc=example,dc=com"
Step 11: Restart LDAP Service
Stop and Start LDAP service using following command.
# /etc/init.d/ldap stop
# /etc/init.d/ldap start
Step 12: Test Your Setup
You setup has been completed, Lets test your ldap server using ldapsearch
# ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'
Congratulation’s your ldap setup has been completed.
Installation Guide 01 Completed
Installation Guide 02 Start
Step by Step Installation and Configuration OpenLDAP Server
Software: OS-Cent OS 4.4, openldap 2.2.13-6.4E
System name: ldap.shree.com
Domain name: shree.com
System IP: 192.168.1.212
Note: Use your domain name and IP instead of adminmart.
Easy steps for adding users:
1. Create unix user
2. Create unix user's ldap passwd file
3. Convert passwd.file to ldif file
4. Add ldap file to LDAP Directory using ldapadd
Step #1. Requirements
compat-openldap.i386 0:2.1.30-6.4E
openldap-clients.i386 0:2.2.13-6.4E
openldap-devel.i386 0:2.2.13-6.4E
openldap-servers.i386 0:2.2.13-6.4E
openldap-servers-sql.i386 0:2.2.13-6.4E
You can install them using the command:
yum install *openldap* -y
Step #2. Start the service
[root@ldap ~]# chkconfig --levels 235 ldap on
[root@ldap ~]# service ldap start
Step #3. Create LDAP root user password
[root@ldap ~]# slappasswd
New password:
Re-enter new password:
{SSHA}cWB1VzxDXZLf6F4pwvyNvApBQ8G/DltW
[root@ldap ~]#
Step #4. Update /etc/openldap/slapd.conf for the root password
[root@ldap ~]# vi /etc/openldap/slapd.conf
#68 database bdb
#69 suffix "dc=adminmart,dc=com"
#70 rootdn "cn=Manager,dc=adminmart,dc=com"
#71 rootpw {SSHA}cWB1VzxDXZLf6F4pwvyNvApBQ8G/DltW
Step #5. Apply Changes
[root@ldap ~]# service ldap restart
Step #6. Create test users
[root@ldap ~]# useradd test1
[root@ldap ~]# passwd test1
Changing password for user test1.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@ldap ~]# useradd test2
[root@ldap ~]# passwd test2
Changing password for user test2.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@ldap ~]#
Note: Repeat the same for the rest of users
Step #7. Migrate local users to LDAP
[root@ldap ~]# grep root /etc/passwd > /etc/openldap/passwd.root
[root@ldap ~]# grep test1 /etc/passwd > /etc/openldap/passwd.test1
[root@ldap ~]# grep test2 /etc/passwd > /etc/openldap/passwd.test2
Note: Repeat the same for the rest of users
Step #8. Update default settings on file
/usr/share/openldap/migration/migrate_common.ph
#71 $DEFAULT_MAIL_DOMAIN = "shree.com";
#74 $DEFAULT_BASE = "dc=adminmart,dc=com";
Step #9. Convert passwd.file to ldif (LDAP Data Interchange Format) file
[root@ldap ~]# /usr/share/openldap/migration/migrate_passwd.pl
/etc/openldap/passwd.root /etc/openldap/root.ldif
[root@ldap ~]# /usr/share/openldap/migration/migrate_passwd.pl
/etc/openldap/passwd.test1 /etc/openldap/test1.ldif
[root@ldap ~]# /usr/share/openldap/migration/migrate_passwd.pl
/etc/openldap/passwd.test2 /etc/openldap/test2.ldif
Note: Repeat the same for the rest of users
Step #10. Update root.ldif file for the "Manager" of LDAP Server
[root@ldap ~]# vi /etc/openldap/root.ldif
#1 dn: uid=root,ou=People,dc=adminmart,dc=com
#2 uid: root
#3 cn: Manager
#4 objectClass: account
Step #11. Create a domain ldif file (/etc/openldap/shree.com.ldif)
[root@ldap ~]# cat /etc/openldap/shree.com.ldif
dn: dc=adminmart,dc=com
dc: adminmart
description: LDAP Admin
objectClass: dcObject
objectClass: organizationalUnit
ou: rootobject
dn: ou=People, dc=adminmart,dc=com
ou: People
description: Users of adminmart
objectClass: organizationalUnit
Step #12. Import all users in to the LDAP
Add the Domain ldif file
[root@ldap ~]# ldapadd -x -D "cn=Manager,dc=adminmart,dc=com" -W -
f /etc/openldap/shree.com.ldif
Enter LDAP Password:
adding new entry "dc=adminmart,dc=com"
adding new entry "ou=People, dc=adminmart,dc=com"
[root@ldap ~]#
Add the users:
[root@ldap ~]# ldapadd -x -D "cn=Manager,dc=adminmart,dc=com" -W -
f /etc/openldap/root.ldif
Enter LDAP Password:
adding new entry "uid=root,ou=People,dc=adminmart,dc=com"
adding new entry "uid=operator,ou=People,dc=adminmart,dc=com"
[root@ldap ~]#
[root@ldap ~]# ldapadd -x -D "cn=Manager,dc=adminmart,dc=com" -W -
f /etc/openldap/test1.ldif
Enter LDAP Password:
adding new entry "uid=test1,ou=People,dc=adminmart,dc=com"
[root@ldap ~]#
[root@ldap ~]# ldapadd -x -D "cn=Manager,dc=adminmart,dc=com" -W -
f /etc/openldap/test2.ldif
Enter LDAP Password:
adding new entry "uid=test2,ou=People,dc=adminmart,dc=com"
[root@ldap ~]#
Note: Repeat the same for the rest of users
Step #13. Apply Changes
[root@ldap ~]# service ldap restart
Step #14. Test LDAP Server
It prints all the user information:
[root@ldap ~]# ldapsearch -x -b 'dc=adminmart,dc=com' '(objectclass=*)'
Installation Guide 02 Completed
Shree H. Niraula
sriniraula@gmail.com

More Related Content

What's hot

Hadoop File System Shell Commands,
Hadoop File System Shell Commands,Hadoop File System Shell Commands,
Hadoop File System Shell Commands,
Hadoop online training
 
Rhel6
Rhel6Rhel6
TP2 Big Data HBase
TP2 Big Data HBaseTP2 Big Data HBase
TP2 Big Data HBase
Amal Abid
 
6 technical-dns-workshop-day3
6 technical-dns-workshop-day36 technical-dns-workshop-day3
6 technical-dns-workshop-day3
DNS Entrepreneurship Center
 
Anatomy of file write in hadoop
Anatomy of file write in hadoopAnatomy of file write in hadoop
Anatomy of file write in hadoop
Rajesh Ananda Kumar
 
Hadoop file
Hadoop fileHadoop file
Hadoop file
HR Krutika Meheta
 
Hadoop basic commands
Hadoop basic commandsHadoop basic commands
Hadoop basic commands
bispsolutions
 
Introduction to Flume
Introduction to FlumeIntroduction to Flume
Introduction to Flume
Rupak Roy
 
2 technical-dns-workshop-day1
2 technical-dns-workshop-day12 technical-dns-workshop-day1
2 technical-dns-workshop-day1
DNS Entrepreneurship Center
 
Hadoop Introduction
Hadoop IntroductionHadoop Introduction
Hadoop Introduction
tutorialvillage
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 Days
Léopold Gault
 
Hadoop single node installation on ubuntu 14
Hadoop single node installation on ubuntu 14Hadoop single node installation on ubuntu 14
Hadoop single node installation on ubuntu 14
jijukjoseph
 
Hadoop file
Hadoop fileHadoop file
Hadoop file
HR Krutika Meheta
 
Hadoop admin
Hadoop adminHadoop admin
Hadoop admin
Balaji Rajan
 
4 technical-dns-workshop-day2
4 technical-dns-workshop-day24 technical-dns-workshop-day2
4 technical-dns-workshop-day2
DNS Entrepreneurship Center
 
Http
HttpHttp
Hadoop HDFS Architeture and Design
Hadoop HDFS Architeture and DesignHadoop HDFS Architeture and Design
Hadoop HDFS Architeture and Design
sudhakara st
 
Perl Programming - 04 Programming Database
Perl Programming - 04 Programming DatabasePerl Programming - 04 Programming Database
Perl Programming - 04 Programming Database
Danairat Thanabodithammachari
 
5 technical-dns-workshop-day3
5 technical-dns-workshop-day35 technical-dns-workshop-day3
5 technical-dns-workshop-day3
DNS Entrepreneurship Center
 
Configuring and manipulating HDFS files
Configuring and manipulating HDFS filesConfiguring and manipulating HDFS files
Configuring and manipulating HDFS files
Rupak Roy
 

What's hot (20)

Hadoop File System Shell Commands,
Hadoop File System Shell Commands,Hadoop File System Shell Commands,
Hadoop File System Shell Commands,
 
Rhel6
Rhel6Rhel6
Rhel6
 
TP2 Big Data HBase
TP2 Big Data HBaseTP2 Big Data HBase
TP2 Big Data HBase
 
6 technical-dns-workshop-day3
6 technical-dns-workshop-day36 technical-dns-workshop-day3
6 technical-dns-workshop-day3
 
Anatomy of file write in hadoop
Anatomy of file write in hadoopAnatomy of file write in hadoop
Anatomy of file write in hadoop
 
Hadoop file
Hadoop fileHadoop file
Hadoop file
 
Hadoop basic commands
Hadoop basic commandsHadoop basic commands
Hadoop basic commands
 
Introduction to Flume
Introduction to FlumeIntroduction to Flume
Introduction to Flume
 
2 technical-dns-workshop-day1
2 technical-dns-workshop-day12 technical-dns-workshop-day1
2 technical-dns-workshop-day1
 
Hadoop Introduction
Hadoop IntroductionHadoop Introduction
Hadoop Introduction
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 Days
 
Hadoop single node installation on ubuntu 14
Hadoop single node installation on ubuntu 14Hadoop single node installation on ubuntu 14
Hadoop single node installation on ubuntu 14
 
Hadoop file
Hadoop fileHadoop file
Hadoop file
 
Hadoop admin
Hadoop adminHadoop admin
Hadoop admin
 
4 technical-dns-workshop-day2
4 technical-dns-workshop-day24 technical-dns-workshop-day2
4 technical-dns-workshop-day2
 
Http
HttpHttp
Http
 
Hadoop HDFS Architeture and Design
Hadoop HDFS Architeture and DesignHadoop HDFS Architeture and Design
Hadoop HDFS Architeture and Design
 
Perl Programming - 04 Programming Database
Perl Programming - 04 Programming DatabasePerl Programming - 04 Programming Database
Perl Programming - 04 Programming Database
 
5 technical-dns-workshop-day3
5 technical-dns-workshop-day35 technical-dns-workshop-day3
5 technical-dns-workshop-day3
 
Configuring and manipulating HDFS files
Configuring and manipulating HDFS filesConfiguring and manipulating HDFS files
Configuring and manipulating HDFS files
 

Similar to Ldap configuration documentation

Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
Vicent Selfa
 
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On UblAsian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ubl
newrforce
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
CloudLinux
 
RHCE Training
RHCE TrainingRHCE Training
RHCE Training
ajeet yadav
 
My SQL 101
My SQL 101My SQL 101
My SQL 101
Dave Stokes
 
Setting up LAMP for Linux newbies
Setting up LAMP for Linux newbiesSetting up LAMP for Linux newbies
Setting up LAMP for Linux newbies
Shabir Ahmad
 
#WeSpeakLinux Session
#WeSpeakLinux Session#WeSpeakLinux Session
#WeSpeakLinux Session
Kellyn Pot'Vin-Gorman
 
Hadoop installation on windows
Hadoop installation on windows Hadoop installation on windows
Hadoop installation on windows
habeebulla g
 
Sistemas operacionais 8
Sistemas operacionais 8Sistemas operacionais 8
Sistemas operacionais 8
Nauber Gois
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloud
Tahsin Hasan
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
Dana Luther
 
LDAP(In_Linux).pptx
LDAP(In_Linux).pptxLDAP(In_Linux).pptx
LDAP(In_Linux).pptx
ShanmugapriyaSenthil3
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
sandeepkumar907
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
sandeepkumar907
 
Install ldap server
Install ldap serverInstall ldap server
Install ldap server
Mawardi 12
 
Install ldap server
Install ldap serverInstall ldap server
Install ldap server
Mawardi 12
 
Linux lecture6
Linux lecture6Linux lecture6
Linux lecture6
Haider Adnan
 
Apache
ApacheApache
Apache
Mindtree
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
kuldeepakgautam
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
Омские ИТ-субботники
 

Similar to Ldap configuration documentation (20)

Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On UblAsian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ubl
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
 
RHCE Training
RHCE TrainingRHCE Training
RHCE Training
 
My SQL 101
My SQL 101My SQL 101
My SQL 101
 
Setting up LAMP for Linux newbies
Setting up LAMP for Linux newbiesSetting up LAMP for Linux newbies
Setting up LAMP for Linux newbies
 
#WeSpeakLinux Session
#WeSpeakLinux Session#WeSpeakLinux Session
#WeSpeakLinux Session
 
Hadoop installation on windows
Hadoop installation on windows Hadoop installation on windows
Hadoop installation on windows
 
Sistemas operacionais 8
Sistemas operacionais 8Sistemas operacionais 8
Sistemas operacionais 8
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloud
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
LDAP(In_Linux).pptx
LDAP(In_Linux).pptxLDAP(In_Linux).pptx
LDAP(In_Linux).pptx
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
Install ldap server
Install ldap serverInstall ldap server
Install ldap server
 
Install ldap server
Install ldap serverInstall ldap server
Install ldap server
 
Linux lecture6
Linux lecture6Linux lecture6
Linux lecture6
 
Apache
ApacheApache
Apache
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 

Recently uploaded

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Diana Rendina
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 

Recently uploaded (20)

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 

Ldap configuration documentation

  • 1. LDAP Configuration Documentation Installation Guide 01. Network Details: Below is the network details used while writing this article. System name: openldap.example.com System IP: 192.168.10.50 Domain Name: example.com Step 1: Create Test Accounts Firsty create two test user accounts in your linux system using following commnands. # useradd ldapuser1 # useradd ldapuser2 # passwd ldapuser1 # passwd ldapuser2 Step 2: Install Requird Packages Below is list of software required for setup openldap  compat-openldap  openldap-clients  openldap-devel  openldap-servers  openldap-servers-sql Install all packages using following command. # yum install *openldap* -y
  • 2. Step 3: Setup OpenLDAP root Password After installing openldap packages, First create OpenLDAP root user password # slappasswd New password: Re-enter new password: {SSHA}BONOBgJZNZc3A+UFq3fcjRn2YHsZVkXw Step 4:Edit Configuration File Edit openldap configuration file with new values , use rootpw value get from slappasswd command in above step # vi /etc/openldap/slapd.conf database bdb suffix "dc=example,dc=com" rootdn "cn=Manager,dc=example,dc=com" rootpw {SSHA}BONOBgJZNZc3A+UFq3fcjRn2YHsZVkXw Step 5:Setup LDAP Database File Copye example LDAP database file at below location. Use given example file from openldap # cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG Step 6 Start Services Start openldap service and setup service to auto start on system boot
  • 3. # service ldap start # chkconfig ldap on Step 7: Create Domain LDIF File Now Create ldif (LDAP Data Interchange Format) file for your domain example.com, You can use any filename with extension ldif # vim /etc/openldap/base.ldif dn: dc=example,dc=com dc: example objectClass: top objectClass: domain dn: ou=users,dc=example,dc=com ou: users objectClass: top objectClass: organizationalUnit dn: ou=Group,dc=example,dc=com ou: Group objectClass: top objectClass: organizationalUnit Step 8: Create Users LDIF File After creating ldif file for your domain, Let create ldif file for all test users. # cd /usr/share/openldap/migration/
  • 4. # grep root /etc/passwd > /etc/openldap/passwd.root # grep ldapuser1 /etc/passwd > /etc/openldap/passwd.ldapuser1 # grep ldapuser2 /etc/passwd > /etc/openldap/passwd.ldapuser2 # ./migrate_passwd.pl /etc/openldap/passwd.root /etc/openldap/root.ldif # ./migrate_passwd.pl /etc/openldap/passwd.ldapuser1 /etc/openldap/ldapuser1.ldif # ./migrate_passwd.pl /etc/openldap/passwd.ldapuser1 /etc/openldap/ldapuser2.ldif Step 9: Edit Users LDIF Files Modify all LDIF files created for users as per below given example for ldapuser1. # vim /etc/openldap/ldapuser1.ldif dn: uid=ldapuser1,dc=example,dc=com uid: ldapuser1 cn: ldapuser1 objectClass: account objectClass: posixAccount objectClass: top objectClass: shadowAccount objectClass: radiusprofile description: 802.1x user radiusFilterId: "Enterasys:version=1:policy=Enterprise User" userPassword: {crypt}$1$rN6WLraT$9skdu7BpRUM6v7DiEhQXt1
  • 5. shadowLastChange: 15419 shadowMin: 0 shadowMax: 99999 shadowWarning: 7 loginShell: /bin/bash uidNumber: 612 gidNumber: 612 homeDirectory: /home/ldapuser1 Note: Make sure you have added below 3 file in ldif for integrating radius-ldap authentication  objectClass: radiusprofile  description: 802.1x user  radiusFilterId: “Enterasys:version=1:policy=Enterprise User” Step 10: Import All Data Import all Data from configuration files to LDAP database Importing base.ldif: # ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /etc/openldap/base.ldif Enter LDAP Password: adding new entry "dc=example,dc=com" adding new entry "ou=users,dc=example,dc=com" adding new entry "ou=Group,dc=example,dc=com" Importing root.ldif: # ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /etc/openldap/root.ldif
  • 6. Enter LDAP Password: adding new entry "uid=root,ou=users,dc=example,dc=com" adding new entry "uid=operator,ou=users,dc=example,dc=com" Importing ldapuser1.ldif: # ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /etc/openldap/ldapuser1.ldif Enter LDAP Password: adding new entry "uid=ldapuser1,ou=users,dc=example,dc=com" Importing ldapuser2.ldif: # ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /etc/openldap/ldapuser2.ldif Enter LDAP Password: adding new entry "uid=ldapuser2,ou=users,dc=example,dc=com" Step 11: Restart LDAP Service Stop and Start LDAP service using following command. # /etc/init.d/ldap stop # /etc/init.d/ldap start Step 12: Test Your Setup You setup has been completed, Lets test your ldap server using ldapsearch # ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'
  • 7. Congratulation’s your ldap setup has been completed. Installation Guide 01 Completed
  • 8. Installation Guide 02 Start Step by Step Installation and Configuration OpenLDAP Server Software: OS-Cent OS 4.4, openldap 2.2.13-6.4E System name: ldap.shree.com Domain name: shree.com System IP: 192.168.1.212 Note: Use your domain name and IP instead of adminmart. Easy steps for adding users: 1. Create unix user 2. Create unix user's ldap passwd file 3. Convert passwd.file to ldif file 4. Add ldap file to LDAP Directory using ldapadd Step #1. Requirements compat-openldap.i386 0:2.1.30-6.4E openldap-clients.i386 0:2.2.13-6.4E openldap-devel.i386 0:2.2.13-6.4E openldap-servers.i386 0:2.2.13-6.4E openldap-servers-sql.i386 0:2.2.13-6.4E You can install them using the command: yum install *openldap* -y Step #2. Start the service [root@ldap ~]# chkconfig --levels 235 ldap on [root@ldap ~]# service ldap start Step #3. Create LDAP root user password [root@ldap ~]# slappasswd New password: Re-enter new password: {SSHA}cWB1VzxDXZLf6F4pwvyNvApBQ8G/DltW [root@ldap ~]# Step #4. Update /etc/openldap/slapd.conf for the root password [root@ldap ~]# vi /etc/openldap/slapd.conf #68 database bdb #69 suffix "dc=adminmart,dc=com"
  • 9. #70 rootdn "cn=Manager,dc=adminmart,dc=com" #71 rootpw {SSHA}cWB1VzxDXZLf6F4pwvyNvApBQ8G/DltW Step #5. Apply Changes [root@ldap ~]# service ldap restart Step #6. Create test users [root@ldap ~]# useradd test1 [root@ldap ~]# passwd test1 Changing password for user test1. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@ldap ~]# useradd test2 [root@ldap ~]# passwd test2 Changing password for user test2. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@ldap ~]# Note: Repeat the same for the rest of users Step #7. Migrate local users to LDAP [root@ldap ~]# grep root /etc/passwd > /etc/openldap/passwd.root [root@ldap ~]# grep test1 /etc/passwd > /etc/openldap/passwd.test1 [root@ldap ~]# grep test2 /etc/passwd > /etc/openldap/passwd.test2 Note: Repeat the same for the rest of users Step #8. Update default settings on file /usr/share/openldap/migration/migrate_common.ph #71 $DEFAULT_MAIL_DOMAIN = "shree.com"; #74 $DEFAULT_BASE = "dc=adminmart,dc=com"; Step #9. Convert passwd.file to ldif (LDAP Data Interchange Format) file [root@ldap ~]# /usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.root /etc/openldap/root.ldif [root@ldap ~]# /usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.test1 /etc/openldap/test1.ldif [root@ldap ~]# /usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.test2 /etc/openldap/test2.ldif
  • 10. Note: Repeat the same for the rest of users Step #10. Update root.ldif file for the "Manager" of LDAP Server [root@ldap ~]# vi /etc/openldap/root.ldif #1 dn: uid=root,ou=People,dc=adminmart,dc=com #2 uid: root #3 cn: Manager #4 objectClass: account Step #11. Create a domain ldif file (/etc/openldap/shree.com.ldif) [root@ldap ~]# cat /etc/openldap/shree.com.ldif dn: dc=adminmart,dc=com dc: adminmart description: LDAP Admin objectClass: dcObject objectClass: organizationalUnit ou: rootobject dn: ou=People, dc=adminmart,dc=com ou: People description: Users of adminmart objectClass: organizationalUnit Step #12. Import all users in to the LDAP Add the Domain ldif file [root@ldap ~]# ldapadd -x -D "cn=Manager,dc=adminmart,dc=com" -W - f /etc/openldap/shree.com.ldif Enter LDAP Password: adding new entry "dc=adminmart,dc=com" adding new entry "ou=People, dc=adminmart,dc=com" [root@ldap ~]# Add the users: [root@ldap ~]# ldapadd -x -D "cn=Manager,dc=adminmart,dc=com" -W - f /etc/openldap/root.ldif
  • 11. Enter LDAP Password: adding new entry "uid=root,ou=People,dc=adminmart,dc=com" adding new entry "uid=operator,ou=People,dc=adminmart,dc=com" [root@ldap ~]# [root@ldap ~]# ldapadd -x -D "cn=Manager,dc=adminmart,dc=com" -W - f /etc/openldap/test1.ldif Enter LDAP Password: adding new entry "uid=test1,ou=People,dc=adminmart,dc=com" [root@ldap ~]# [root@ldap ~]# ldapadd -x -D "cn=Manager,dc=adminmart,dc=com" -W - f /etc/openldap/test2.ldif Enter LDAP Password: adding new entry "uid=test2,ou=People,dc=adminmart,dc=com" [root@ldap ~]# Note: Repeat the same for the rest of users Step #13. Apply Changes [root@ldap ~]# service ldap restart Step #14. Test LDAP Server It prints all the user information: [root@ldap ~]# ldapsearch -x -b 'dc=adminmart,dc=com' '(objectclass=*)' Installation Guide 02 Completed Shree H. Niraula sriniraula@gmail.com