6

I'm trying to set up an openLdap server and after following the instructions I'm stuck at the point where I can't add any data.

The error I'm getting is

ldap_bind: Invalid credentials (49)

Please help me in this issue. And be patient while reading the debug data and the slapd.conf file because they are quite long.

My system is: Red Hat Enterprise Linux 6.0
Installed openLdap using yum openldap*.

Here is 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=ttsbroot,dc=teleotele
#checkpoint 1024 15
rootdn cn=shamal,dc=ttsbroot,dc=teleotele
# Cleartext passwords, especially for the rootdn, should
# be avoided.  See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw {crypt}49/WKVk.6oz3o
# 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/[email protected]


# enable monitoring
database monitor

# allow onlu rootdn to read the monitor
access to * by * write by * read by * search by * auth

I'm adding the debug data returned when I added -d 255 argument.

[root@TTSBROOT Documents]# ldapadd -D "cn=shamal,dc=TTSBROOT,dc=teleotele" -W -x -a -f teleotele.ldif -d 255
ldap_create
Enter LDAP Password: 
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP localhost:389
ldap_new_socket: 4
ldap_prepare_socket: 4
ldap_connect_to_host: Trying 127.0.0.1:389
ldap_pvt_connect: fd: 4 tm: -1 async: 0
ldap_open_defconn: successful
ldap_send_server_request
ber_scanf fmt ({it) ber:
ber_dump: buf=0x18345d0 ptr=0x18345d0 end=0x1834612 len=66
  0000:  30 84 00 00 00 3c 02 01  01 60 84 00 00 00 33 02   0....<...`....3.  
  0010:  01 03 04 22 63 6e 3d 73  68 61 6d 61 6c 2c 64 63   ..."cn=shamal,dc  
  0020:  3d 54 54 53 42 52 4f 4f  54 2c 64 63 3d 74 65 6c   =TTSBROOT,dc=tel  
  0030:  65 6f 74 65 6c 65 80 0a  73 68 61 6d 61 6c 31 32   eotele..shamal12  
  0040:  33 34                                              34                
ber_scanf fmt ({i) ber:
ber_dump: buf=0x18345d0 ptr=0x18345d9 end=0x1834612 len=57
  0000:  60 84 00 00 00 33 02 01  03 04 22 63 6e 3d 73 68   `....3...."cn=sh  
  0010:  61 6d 61 6c 2c 64 63 3d  54 54 53 42 52 4f 4f 54   amal,dc=TTSBROOT  
  0020:  2c 64 63 3d 74 65 6c 65  6f 74 65 6c 65 80 0a 73   ,dc=teleotele..s  
  0030:  68 61 6d 61 6c 31 32 33  34                        hamal1234         
ber_flush2: 66 bytes to sd 4
  0000:  30 84 00 00 00 3c 02 01  01 60 84 00 00 00 33 02   0....<...`....3.  
  0010:  01 03 04 22 63 6e 3d 73  68 61 6d 61 6c 2c 64 63   ..."cn=shamal,dc  
  0020:  3d 54 54 53 42 52 4f 4f  54 2c 64 63 3d 74 65 6c   =TTSBROOT,dc=tel  
  0030:  65 6f 74 65 6c 65 80 0a  73 68 61 6d 61 6c 31 32   eotele..shamal12  
  0040:  33 34                                              34                
ldap_write: want=66, written=66
  0000:  30 84 00 00 00 3c 02 01  01 60 84 00 00 00 33 02   0....<...`....3.  
  0010:  01 03 04 22 63 6e 3d 73  68 61 6d 61 6c 2c 64 63   ..."cn=shamal,dc  
  0020:  3d 54 54 53 42 52 4f 4f  54 2c 64 63 3d 74 65 6c   =TTSBROOT,dc=tel  
  0030:  65 6f 74 65 6c 65 80 0a  73 68 61 6d 61 6c 31 32   eotele..shamal12  
  0040:  33 34                                              34                
ldap_result ld 0x182c3e0 msgid 1
wait4msg ld 0x182c3e0 msgid 1 (infinite timeout)
wait4msg continue ld 0x182c3e0 msgid 1 all 1
** ld 0x182c3e0 Connections:
* host: localhost  port: 389  (default)
  refcnt: 2  status: Connected
  last used: Fri Apr 22 14:24:17 2011


** ld 0x182c3e0 Outstanding Requests:
 * msgid 1,  origid 1, status InProgress
   outstanding referrals 0, parent count 0
  ld 0x182c3e0 request count 1 (abandoned 0)
** ld 0x182c3e0 Response Queue:
   Empty
  ld 0x182c3e0 response count 0
ldap_chkResponseList ld 0x182c3e0 msgid 1 all 1
ldap_chkResponseList returns ld 0x182c3e0 NULL
ldap_int_select
read1msg: ld 0x182c3e0 msgid 1 all 1
ber_get_next
ldap_read: want=8, got=8
  0000:  30 84 00 00 00 10 02 01                            0.......          
ldap_read: want=14, got=14
  0000:  01 61 84 00 00 00 07 0a  01 31 04 00 04 00         .a.......1....    
ber_get_next: tag 0x30 len 16 contents:
ber_dump: buf=0x1835a50 ptr=0x1835a50 end=0x1835a60 len=16
  0000:  02 01 01 61 84 00 00 00  07 0a 01 31 04 00 04 00   ...a.......1....  
read1msg: ld 0x182c3e0 msgid 1 message type bind
ber_scanf fmt ({eAA) ber:
ber_dump: buf=0x1835a50 ptr=0x1835a53 end=0x1835a60 len=13
  0000:  61 84 00 00 00 07 0a 01  31 04 00 04 00            a.......1....     
read1msg: ld 0x182c3e0 0 new referrals
read1msg:  mark request completed, ld 0x182c3e0 msgid 1
request done: ld 0x182c3e0 msgid 1
res_errno: 49, res_error: <>, res_matched: <>
ldap_free_request (origid 1, msgid 1)
ldap_parse_result
ber_scanf fmt ({iAA) ber:
ber_dump: buf=0x1835a50 ptr=0x1835a53 end=0x1835a60 len=13
  0000:  61 84 00 00 00 07 0a 01  31 04 00 04 00            a.......1....     
ber_scanf fmt (}) ber:
ber_dump: buf=0x1835a50 ptr=0x1835a60 end=0x1835a60 len=0

ldap_msgfree
ldap_err2string
ldap_bind: Invalid credentials (49)
1
  • 1
    To ask the obvious, did you restart OpenLDAP after editing slapd.conf? Also, any errors in the log files for OpenLDAP? The error is more likely server-side, if you could run slapd with -d 255 instead. 255 might be a little high for the server-side, I'd be a little more selective. Is the database currently empty? Does slapcat dump the existing, possibly empty database?
    – penguin359
    Commented Apr 21, 2011 at 16:27

2 Answers 2

2

Error code 49 indicates a wrong password! Please make sure you typed the same password when creating the crypt-hash. Maybe you want to debug this part and use a clear-text password instead a hash at this position in your slapd.conf:

rootpw {crypt}49/WKVk.6oz3o

Btw. which ldap version do you use? Afaik it supports better hash mechanisms, like MD5 or SHA1. Not sure, but there may be a problem with the / in your crypt hash!?

2
  • Thanks @binfalse Will check soon. As you pointed out, / may be the problem. Commented Apr 25, 2011 at 5:04
  • Well spotted @binfalse
    – AndyM
    Commented Jun 24, 2011 at 8:27
1

To rule out the password issue , why dont you try with a clear text simple password in the conf file and restart LDAP ?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .