Friday, October 8, 2010

Openldap - opensource ldap server

1.     Download the below two files,
                                                                i.      openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe
                                                             ii.      openldap-for-windows.msi
2.     Edit slapd.conf under C:\Program Files\OpenLDAP location with below


# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.23.2.8 2003/05/24 23:19:14 kurt Exp $
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
ucdata-path     ./ucdata
#include                      ./schema/core.schema

## updated selfcare schemas
include                        ./schema/selfcare/Attributes.schema
include                        ./schema/selfcare/ObjClass.schema
include                        ./schema/selfcare/ppolicy.schema

#include                      ./schema/cosine.schema
#include                      ./schema/nis.schema
#include                      ./schema/inetorgperson.schema
#include                      ./schema/openldap.schema
#include                      ./schema/dyngroup.schema
#include                      ./schema/java.schema
#include                      ./schema/attribute.schema
#include                      ./schema/object.schema


# Load dynamic backend modules:
# modulepath /usr/lib/openldap # or /usr/lib64/openldap
# moduleload accesslog.la
# moduleload auditlog.la
# moduleload back_sql.la
# moduleload denyop.la
# moduleload dyngroup.la
# moduleload dynlist.la
# moduleload lastmod.la
# moduleload pcache.la
# moduleload ppolicy.la
# moduleload refint.la
# moduleload retcode.la
# moduleload rwm.la
# moduleload syncprov.la
# moduleload translucent.la
# moduleload unique.la
# moduleload valsort.la


# Global Definitions

serverID          1
password-hash     {SHA}
threads           20
concurrency       20
#gentlehup         on
#idletimeout       300
#loglevel          -1
sizelimit         1000
#timelimit         3600
#readonly          off
lastmod           on
#schemacheck            on

# Define global ACLs to disable default read access.

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral          ldap://root.openldap.org

pidfile              ./run/slapd.pid
argsfile            ./run/slapd.args

# Load dynamic backend modules:
# modulepath  ./libexec/openldap
# moduleload  back_bdb.la
# moduleload  back_ldap.la
# moduleload  back_ldbm.la
# moduleload  back_passwd.la
# moduleload  back_shell.la

# Enable TLS if port is defined for ldaps

TLSVerifyClient never
TLSCipherSuite HIGH:MEDIUM:-SSLv2
TLSCertificateFile ./secure/certs/server.pem
TLSCertificateKeyFile ./secure/certs/server.pem
TLSCACertificateFile ./secure/certs/server.pem

# Sample security restrictions
#          Require integrity protection (prevent hijacking)
#          Require 112-bit (3DES or better) encryption for updates
#          Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64

# Sample access control policy:
#          Root DSE: allow anyone to read it
#          Subschema (sub)entry DSE: allow anyone to read it
#          Other DSEs:
#                      Allow self write access
#                      Allow authenticated users read access
#                      Allow anonymous users to authenticate
#          Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
#          by self write
#          by users read
#          by anonymous auth
#
# if no access controls are present, the default policy is:
#          Allow read by all
#
# rootdn can always write!

#######################################################################
# bdb database definitions
#######################################################################

database         bdb
suffix               "o=Root"
rootdn              "o=Root"
# Cleartext passwords, especially for the rootdn, should
# be avoid.  See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
#rootpw                       secret
rootpw {SSHA}ZKKuqbEKJfKSXhUbHG3fG8MDn9j1v4QN
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory ./data
dirtyread
searchstack 20
# Indices to maintain
index mail pres,eq
index objectclass pres
index default eq,sub
index sn eq,sub,subinitial
index telephonenumber
index cn
index ou
#index numsubordinates pres



##extra
#pwdFailureCountInterval 1


3.     Start ldap server by running the run.cmd file from path
C:\Program Files\OpenLDAP\run
4.     Commands

slapd -d -1 -h ldap://127.0.0.1 -f slapd1.conf
ldapadd   -h <ip> -p <port> -D "o=Root" -w <password> -f openldap.ldif
ldapsearch -v -h <ip> -p <port> -D "o=Root" -w <password> -b 'o=Root' (ou=*)'
ldapmodify -h <IP> -p <port> -D "o=Root" -w <password> -f

No comments:

Post a Comment