Results 1 to 9 of 9
Ok, I have just installed openldap on my Red Hat server and it is running:
[root@server init.d]# ps aux | grep slapd
ldap 4538 0.0 0.0 645736 5752 ? Ssl ...
- 05-10-2011 #1Just Joined!
- Join Date
- Dec 2010
- Location
- Key-stone state
- Posts
- 54
Setting up openldap
Ok, I have just installed openldap on my Red Hat server and it is running:
[root@server init.d]# ps aux | grep slapd
ldap 4538 0.0 0.0 645736 5752 ? Ssl 18:18 0:00 /usr/sbin/slapd -h ldap:/// ldaps:/// -u ldap
root 4551 0.0 0.0 103152 804 pts/0 S+ 18:21 0:00 grep slapd
However when I try to add my first ldif file base.ldif, no matter how many time I enter in the correct password I get invalid credentials.
[root@server init.d]# ldapadd -D "cn=Manager,dc=mathcs.duq,dc=edu" -W -f /home/oberlanderm/base.ldif
Enter LDAP Password:
ldap_bind: Invalid credentials (49)
I have to be forgetting someting simple, I appreciate any help any one can give.
My slapd.conf file:
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/openldap/schema/corba.schema
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/duaconf.schema
include /etc/openldap/schema/dyngroup.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/java.schema
include /etc/openldap/schema/misc.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/openldap.schema
include /etc/openldap/schema/ppolicy.schema
include /etc/openldap/schema/collective.schema
# Allow LDAPv2 client connections. This is NOT the default.
allow bind_v2
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
# Load dynamic backend modules:
# Module syncprov.la is now statically linked with slapd and there
# is no need to load it here
# modulepath /usr/lib/openldap # or /usr/lib64/openldap
# moduleload accesslog.la
# moduleload auditlog.la
## To load this module, you have to install openldap-server-sql first
# moduleload back_sql.la
## Following two modules can't be loaded simultaneously
# 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 translucent.la
# moduleload unique.la
# moduleload valsort.la
# The next three lines allow use of TLS for encrypting connections using a
# dummy test certificate which you can generate by changing to
# /etc/pki/tls/certs, running "make slapd.pem", and fixing permissions on
# slapd.pem so that the ldap user or group can read it. Your client software
# may balk at self-signed certificates, however.
# TLSCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
# TLSCertificateFile /etc/pki/tls/certs/slapd.pem
# TLSCertificateKeyFile /etc/pki/tls/certs/slapd.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
# allows anyone and everyone to read anything but restricts
# updates to rootdn. (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!
################################################## #####################
# ldbm and/or bdb database definitions
################################################## #####################
database bdb
suffix "dc=mathcs.duq,dc=edu"
checkpoint 1024 15
rootdn "cn=Manager,dc=mathcs.duq,dc=edu"
#...
# allow only rootdn to read the monitor
access to *
by dn.exact="cn=Manager,dc=mathcs.duq,dc=edu" red
by * none
rootpw {SSHA}gMj4UtZVwbACjTFJNXRTo78IVEXyRGi7
TLSCertificateFile /etc/openldap/ssl/slapdcert.pem
TLSCertificateKeyFile /etc/openldap/ssl/slapdkey.pem
#database bdb
#suffix "dc=my-domain,dc=com"
#checkpoint 1024 15
#rootdn "cn=Manager,dc=my-domain,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(
and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw secret
# rootpw {crypt}ijFYNcSNctBYg
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /var/lib/ldap/
# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
# bindmethod=sasl saslmech=GSSAPI
# authcId=host/ldap-master.example.com@EXAMPLE.COM
# enable monitoring
database monitor
- 05-11-2011 #2Just Joined!
- Join Date
- Dec 2010
- Location
- Key-stone state
- Posts
- 54
I was able to figure out the problem, turns out there were spaces in the in the config file where I delcared the database.
For anyone that is planning or is creating an LDAP database, make sure the lines have no space before them.
Also when using your .ldif files make sure there are no spaces before or after your lines.
- 05-12-2011 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 4
RE:openldap
Hello, i have been having the same error as u had when u configured your openldap. After reading your solution, you said "I was able to figure out the problem, turns out there were spaces in the in the config file where I delcared the database.
For anyone that is planning or is creating an LDAP database, make sure the lines have no space before them.
Also when using your .ldif files make sure there are no spaces before or after your lines." where precisely did you detect the space in your configuration?
I will be very grateful for your response.
Many thanks
- 05-12-2011 #4Just Joined!
- Join Date
- Dec 2010
- Location
- Key-stone state
- Posts
- 54
When I was copying and pasting over the online documentation into the .config file turns out nano was adding extra spaces when adding the new lines.
I ended up using vi to find the spaces, and remove them from the beginning and the end of each line. Ya, you have to make sure that there are no extra spaces in the.ldif and config files at the beginning and end of each line.
Hope this helps.
- 05-12-2011 #5Just Joined!
- Join Date
- Aug 2007
- Posts
- 4
Thank you so much for the quickk reply, i really appreciate. I have checked to see if there are any spaces in both my .config file and .ldif file, they seem to both look ok.Yet i am still encountering the same error.
Any other suggestion?
Thanks
- 05-12-2011 #6Just Joined!
- Join Date
- Dec 2010
- Location
- Key-stone state
- Posts
- 54
Can you post the troublesome file?
- 05-13-2011 #7Just Joined!
- Join Date
- Aug 2007
- Posts
- 4
Re:
Thank you so much for wanting to help me. below is the config file
slapd.conf file
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/openldap/schema/corba.schema
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/duaconf.schema
include /etc/openldap/schema/dyngroup.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/java.schema
include /etc/openldap/schema/misc.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/openldap.schema
include /etc/openldap/schema/ppolicy.schema
include /etc/openldap/schema/collective.schema
# Allow LDAPv2 client connections. This is NOT the default.
allow bind_v2
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
# Load dynamic backend modules:
# Module syncprov.la is now statically linked with slapd and there
# is no need to load it here
# modulepath /usr/lib/openldap # or /usr/lib64/openldap
# moduleload accesslog.la
# moduleload auditlog.la
## To load this module, you have to install openldap-server-sql first
# moduleload back_sql.la
## Following two modules can't be loaded simultaneously
# 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 translucent.la
# moduleload unique.la
# moduleload valsort.la
# The next three lines allow use of TLS for encrypting connections using a
# dummy test certificate which you can generate by changing to
# /etc/pki/tls/certs, running "make slapd.pem", and fixing permissions on
# slapd.pem so that the ldap user or group can read it. Your client software
# may balk at self-signed certificates, however.
# TLSCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
# TLSCertificateFile /etc/pki/tls/certs/slapd.pem
# TLSCertificateKeyFile /etc/pki/tls/certs/slapd.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
# allows anyone and everyone to read anything but restricts
# updates to rootdn. (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!
################################################## #####################
# ldbm and/or bdb database definitions
################################################## #####################
database bdb
suffix "dc=tgold,dc=com"
checkpoint 1024 15
rootdn "cn=Manager,dc=tgold,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(
and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw secret
rootpw {SSHA}S34wsOQJ1nZz7zTIv+UUR5oZsrCuGwRj
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /var/lib/ldap/DB_CONFIG
# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
# bindmethod=sasl saslmech=GSSAPI
# authcId=host/ldap-master.example.com@EXAMPLE.COM
# enable monitoring
database monitor
# allow onlu rootdn to read the monitor
access to *
by dn.exact="cn=Manager,dc=tgold,dc=com" read
by * none
tgold.ldif file
dn: dc=tgold,dc=com
dc: tgold
objectClass: top
objectClass: domain
dn: cn=Manager,dc=tgold,dc=com
cn: Manager
objectClass: top
objectClass: organizationalRole
dn: ou=Services,dc=tgold,dc=com
ou: Services
objectClass: top
objectClass: organizationalUnit
Many thanks
- 05-16-2011 #8Just Joined!
- Join Date
- Dec 2010
- Location
- Key-stone state
- Posts
- 54
Sorry for the long reply, been busy.
I'll admit I can not seam to find anything wrong with the config file or the ldif files.
I'll keep looking, one thing you can try is commit out the secret password and try running a plain text password (for the sake of troubleshooting).
I'll keep looking.
- 05-16-2011 #9Just Joined!
- Join Date
- Aug 2007
- Posts
- 4
Hello, no worries as per the long delays. I have tried using a plane text passwd but to no avail. I am begining to think if it cld be a bug with fedora 14?
I really appreciate you for taking time out of precious to help.
Thanks


Reply With Quote