PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : OpenLDAP Problem - ldap_bind: Invalid credentials



DaQuark
23.02.04, 15:17
Hallo liebe Gemeinschaft,

habe schon gegoogelt und hier einige Post's zu LDAP gefunden - habe auch alles ausprobiert, hat bis jetzt aber nix geholfen.

mein Problem :

Ich möchte ein LDAP Server aufsetzen. Nun möchte ich eine Datenbank zum LDAP Server hinzufügen.

Dies tue ich mit dem Befehl :

ldapadd -D "cn=admin,dc=structure-net.de" < /etc/openldap/ldif/firmenstruktur.ldif -x -W

ich habe auch schon probiert :

ldapadd -h localhost -D "cn=admin,dc=structure-net.de" < /etc/openldap/ldif/firmenstruktur.ldif -x -W


Danach werde ich aufgefordert, dass Passwort einzugeben. Wenn ich es eingeben kommt folgende Fehlermeldung :

ldap_bind: Invalid credentials

wenn ich kein PW eingebe kommt folgendes :

adding new entry "dc=structure-net, dc=de "
ldap_add: Invalid syntax
additional info: objectclass: value #0 invalid per syntax

ldif_record() = 21



Was mache ich falsch ? Ich poste hier mal meine Conf-Datei und die Datenbank, die ich einfügen will :



ldap.conf
=======

# $OpenLDAP: pkg/ldap/libraries/libldap/ldap.conf,v 1.4.8.6 2000/09/05 17:54:38 kurt Exp $
#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.

#BASE dc=example, dc=com
URI ldap://localhost:389";

#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
#HOST ldap.structure-net.de
#HOST 127.0.0.1
BASE dc=structure-net.de,dc=de



sldap.conf
========


# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/redhat/rfc822-MailMember.schema
include /etc/openldap/schema/redhat/autofs.schema
include /etc/openldap/schema/redhat/kerberosobject.schema

#include /etc/openldap/slapd.at.conf
include /etc/openldap/slapd.oc.conf

schemacheck off

# 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 //var/run/slapd.pid
argsfile //var/run/slapd.args

# Create a replication log in /var/lib/ldap for use by slurpd.
#replogfile /var/lib/ldap/master-slapd.replog

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

#
# The next three lines allow use of TLS for connections using a dummy test
# certificate, but you should generate a proper certificate by changing to
# /usr/share/ssl/certs, running "make slapd.pem", and fixing permissions on
# slapd.pem so that the ldap user or group can read it.
# TLSCertificateFile /usr/share/ssl/certs/slapd.pem
# TLSCertificateKeyFile /usr/share/ssl/certs/slapd.pem
# TLSCACertificateFile /usr/share/ssl/certs/ca-bundle.crt
#
# Sample Access Control
# Allow read access of root DSE
# Allow self write access
# Allow authenticated users read access
# Allow anonymous users to authenticate
#
#access to dn="" by * read
#access to *
# by self write
# by users read
# by anonymous auth
#
# if no access controls are present, the default is:
# Allow read by all
#
# rootdn can always write!

################################################## #####################
# ldbm database definitions
################################################## #####################

database ldbm
suffix "dc=structure-net,dc=de"
#suffix "o=Synemedia Technologie ,dc=DE"
rootdn "cn=admin,dc=structure-net,dc=de"
#rootdn "uid=admin,o=Synemedia Technologie,dc=DE"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw marcel
#rootpw {crypt}ijFYNcSNctBYg
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd/tools. Mode 700 recommended.
directory /var/lib/ldap
# Indices to maintain



Hier noch meine Datenbank, die ich einfügen will
==================================

dn: uid=csy,ou=Geschaeftsfuehrung,dc=structure-net,dc=de
objectclass: person
dn: dc=structure-net, dc=de
objectclass: organization
objectclass: top
o:Synemedia Technologie
l: Berlin
postcode: 10715
streetadress: Hildegardstr. 28

dn: ou=Geschaeftsfuehrung, dc=structure-net, dc=de
objectclass: organizationalunit
ou: Geschaeftsfuehrung
description: Chef
telephonenumber: 00 49 30 862 00 00
facsmiletelephonenumber: 00 49 30 862 00 00

dn: ou=Entwicklung, dn=structure-net, dc=de
objectclass: organizationalunit
ou: Entwicklung
description: JAVA Entwicklung
telephonenumber: 00 49 30 862 00 00
facsmiletelephonenumber: 00 49 30 862 00 00

dn: ou=Netzwerk, dn=structure-net, dc=de
objectclass: organizationalunit
ou: Netzwerk
description: Administration des Netzwerkes



Danke für Eure Hilfe im Vorraus.

THX Marcel

oafish
23.02.04, 15:48
ldapadd -h localhost -D "cn=admin,dc=structure-net.de" < /etc/openldap/ldif/firmenstruktur.ldif -x -W

müsste es nicht cn=admin,dc=structure,dc=de heißen?

oafish

DaQuark
24.02.04, 09:53
So jetzt gebe ich

ldapadd -D "cn=admin,dc=structure-net,dc=de" < /etc/openldap/ldif/firmenstruktur.ldif -x -W

in die Console ein. Richtig, muss ja dc=structure-net,dc=de heißen ! Aber jetzt zeigt er mir den Fehler nach der Passworteingabe an :

adding new entry "dc=structure-net, dc=de "
ldap_add: Invalid syntax
additional info: objectclass: value #0 invalid per syntax

ldif_record() = 21


Das Passwort ist in der sldap.conf eingetragen. Aber so wie es aussieht ist ein Fehler in der Datenbank, die ich einfügen will, oder ? PLZ Help

Gruß Marcel

DaQuark
24.02.04, 10:19
jetzt hab ich mal aus der Datei firmenstruktur.ldif alle Leerzeichen am Ende der Zeilen rausgenommen. Außerdem habe ich bei

dn: ou=Geschaeftsfuehrung, dc=structure-net,dc=de

auch die Leerzeichen zwischen zwischen Geschaeftsfuerhung, und dc=structure rausgenommen. hinter dem Komma war nämlich auch ein Leerzeichen - keine Ahnung, ob das dort auch hingehört.

Jetzt zeigt er mir folgendes an :

adding new entry "dc=structure-net,dc=de"
ldap_add: Undefined attribute type
additional info: postcode: attribute type undefined

ldif_record() = 17


Hm aber wie geht's jetzt weiter ?

Danke und Gruß Marcel

DaQuark
24.02.04, 11:37
Hallo, nach einiger Suche im Netz, bin ich darauf gestoßen, dass bei dieser Fehlermeldung in der Datenbank höchstwahrscheinlich ein Fehler vorliegt.

Hier die Datei : firmenstruktur

dn: dc=structure-net,dc=de
objectclass: organization
objectclass: top
o:Synemedia Technologie
l: Berlin
postcode: 10715
streetadress: Hildegardstr 28

dn: ou=Geschaeftsfuehrung,dc=structure-net,dc=de
objectclass: organizationalunit
ou: Geschaeftsfuehrung
description: Chef
telephonenumber: 00 49 30 862 23 80
facsmiletelephonenumber: 00 49 30 862 23 80

dn: ou=Entwicklung,dn=structure-net,dc=de
objectclass: organizationalunit
ou: Entwicklung
description: JAVA Entwicklung
telephonenumber: 00 49 30 862 23 80
facsmiletelephonenumber: 00 49 30 862 23 80

dn: ou=Netzwerk,dn=structure-net,dc=de
objectclass: organizationalunit
ou: Netzwerk
mail:
l: Berlin
postalcode: 10715
streetadress: Hildegardstr 28
telephonenumber: 00 49 30 862 23 80
facsmiletelephonenumber: 00 49 30 862 23 80



Was anderes :

Muss man eine LDIF Datei erst in das LDBM Format umwandeln, beovr man es in die Datenbank einbindet ?

Ich hab was zu "Umwandeln der LDIF Datei in das LDBM Format" gelesen, allerdings kommt bei meiner Distribution (RedHat 9) nicht der Befehl "ldif2ldbm" vor, mitdem man die Dateien umwandeln kann.

Weiß jemand Rat ?

Gruß und Danke Marcel

FlorianSp
24.02.04, 14:59
versuchs mal mit:

ldapadd -x -D "cn=admin,dc=structure-net,dc=de" -W -f /etc/openldap/ldif/firmenstruktur.ldif

ldif-dateien müssen nicht umgewandelt werden, zumindest musste ich das noch nie.


streetadress: Hildegardstr 28 <-- sollte sein:
street: Hildegardstr 28
oder
streetaddress: Hildegardstr 28

vergleiche auch:
http://www.it.ufl.edu/projects/directory/ldap-schema/objectclasses.html