Giter VIP home page Giter VIP logo

openldap's Introduction

OpenLDAP

OpenLDAP - Installation (for CentOS/RedHat 7.x) and setup

Assuming that the domain is dev.dept.example.com (for example.com just use dc=example,dc=com)

  1. Install OpenLDAP

yum install -y openldap openldap-clients openldap-servers

  1. Start slapd service

systemctl start slapd

systemctl enable slapd

  1. Create db.ldif file with below content
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=example,dc=com

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=Manager,dc=example,dc=com

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: ldappassw
  1. Add configurations using:

ldapmodify -Y EXTERNAL -H ldapi:/// -f db.ldif

  1. Do a LDAP shearch

ldapsearch -x -b "dc=example,dc=com"

  1. Create a base.ldif file
#messaging node
dn: ou=messaging,dc=example,dc=com
objectclass: top
objectclass: organizationalUnit
ou: messaging
  1. Create the base using

ldapadd -x -W -D "cn=Manager,dc=example,dc=com" -f base.ldif

  1. Create users.ldif with below content
dn: ou=users,ou=messaging,dc=example,dc=com
objectclass: top
objectclass: organizationalUnit
ou: users
  1. Create users OU using:

ldapadd -x -W -D "cn=Manager,dc=example,dc=com" -f users.ldif

  1. Create a user admin in the OU users using admin.ldif
dn: uid=admin,ou=users,ou=messaging,dc=example,dc=com
cn: admin
displayname: 
gidnumber: 0
givenname: admin
homedirectory: /home/admin
loginshell: admin
objectclass: posixAccount
objectclass: top
objectclass: inetOrgPerson
sn: admin
uid: admin
uidnumber: 27600
userpassword: admin
  1. Add user to the ldap db

ldapadd -x -W -D "cn=Manager,dc=example,dc=com" -f admin.ldif

  1. Create groups OU using groups.ldif
dn: ou=groups,ou=messaging,dc=example,dc=com
objectclass: top
objectclass: organizationalUnit
ou: groups
  1. Add groups OU to the ldap db

ldapadd -x -W -D "cn=Manager,dc=example,dc=com" -f groups.ldif

  1. Add admins group and users to OU groups using admins.ldif
dn: cn=admins,ou=groups,ou=messaging,dc=example,dc=com
cn: admins
member: uid=admin,ou=users,ou=messaging,dc=example,dc=com
objectclass: groupOfNames
  1. Add admins.ldif using

ldapadd -x -W -D "cn=Manager,dc=example,dc=com" -f admins.ldif

openldap's People

Contributors

istrate avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.