ldap_bind: 잘못된 자격 증명 (49)

ldap_bind: 잘못된 자격 증명 (49)

openLdap 서버를 설정하려고 하는데 지침을 따른 후에도 데이터를 추가할 수 없는 상태가 됩니다.

내가 얻는 오류는 다음과 같습니다.

ldap_bind: Invalid credentials (49)

이 문제를 해결하도록 도와주세요. 디버그 데이터와 파일이 꽤 길기 때문에 slapd.conf인내심을 갖고 읽으십시오 .

내 시스템은
OpenLdap이 설치된 Red Hat Enterprise Linux 6.0입니다 yum openldap*.

이것은 내 slapd.conf파일입니다:

#
# 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

매개변수를 추가할 때 반환되는 디버그 데이터를 추가하고 있습니다 -d 255.

[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

오류 코드는 49비밀번호가 잘못되었음을 의미합니다! crypt-hash를 생성할 때 동일한 비밀번호를 입력했는지 확인하세요. 어쩌면 이 부분을 디버그하고 다음에서 해시 대신 일반 텍스트 비밀번호를 사용하고 싶을 수도 있습니다 slapd.conf.

rootpw {crypt}49/WKVk.6oz3o

그런데. 어떤 LDAP 버전을 사용하고 있나요? 내가 아는 한, MD5나 SHA1과 같은 더 나은 해싱 메커니즘을 지원합니다. 확실하지는 않지만 /비밀번호 해시에 문제가 있을 수 있습니다! ?

답변2

비밀번호 문제를 배제하려면 conf 파일에서 일반 텍스트 단순 비밀번호를 시도하고 LDAP를 다시 시작해 보는 것이 어떨까요?

관련 정보