service ldap stop
slapadd -c -l djibtel.dj.ldif pour continuer malgré les erreurs
proxy wrote:service ldap stop
slapadd -c -l djibtel.dj.ldif pour continuer malgré les erreurs
même chose
Ton fichier ldif est incorrect : pour initialiser ta base, il faut commencer par un objet de type objectclass: top
j'ai fais des modifications mais s'est toujour pareille

slapd.con

database bdb
suffix "dc=djibtel,dc=dj"
rootdn "cn=Manager,dc=djibtel,dc=dj"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw secret
rootpw {MD5}X03MO1qnZdYdgyfeuILPmQ==

# 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

# allow onlu rootdn to read the monitor
access to attrs=userPassword
by self write
by dn="cn=Manager,dc=djibtel,dc=dj" write
by anonymous auth
by * none

access to *
by dn="cn=Manager,dc=djibtel,dc=dj" write
by self write
by * read


djibtel.ldif

dn: dc=djibtel,dc=dj
changetype: add
objectclass: top
objectclass: dcObject
objectclass: organization
o: djibtel
dc: djibtel
description: Racine de l'annuaire

dn: ou=Manager,dc=djibtel,dc=dj
changetype: add
ou: Manager
objectClass: organizationalUnit
description: unite organisationnelle admin


pour le mot de passe


slappasswd -s password -h {MD5}


Je doit comprendre de travers ou je passe à coté de qqchose
neowdj wrote:essaye juste avec
slappasswd
rien à faire cette espece de tête de mule ne veut rien entendre

ldapadd -h localhost -x -D "cn=Manager,dc=djibtel,dc=dj" -W -f djibtel.ldif

voici le contenue du repertoire openldap
-rw-r--r-- 1 root root 295 aoû 21 12:18 djibtel.ldif
-rw-r--r-- 1 root root 245 jui 21 11:03 ldap.conf
drwxr-xr-x 3 root root 4096 aoû 21 10:08 schema
-rw-r----- 1 root ldap 4282 aoû 21 12:18 slapd.conf
-rw-r----- 1 root root 4134 aoû 21 10:24 slapd.conf.old
problème résolu avec la commande
slappasswd -h crypt

je ne suis pas foutu de vous dire pourquoi
J'ai parlé trop vite

[root@gate djibtel]# ldapadd -h localhost -x -D "cn=Manager,dc=djibtel,dc=dj" -W -f djibtel.ldif
Enter LDAP Password:
ldapadd: attributeDescription "dn": (possible missing newline after line 8, entry "dc=djibtel,dc=dj"?)
ldapadd: attributeDescription "dn": (possible missing newline after line 9, entry "dc=djibtel,dc=dj"?)
ldapadd: attributeDescription "dn": (possible missing newline after line 10, entry "dc=djibtel,dc=dj"?)
adding new entry "dc=djibtel,dc=dj"
ldap_add: Type or value exists (20)
additional info: objectClass: value #3 provided more than once


voici mon fichier ldif

dn: dc=djibtel,dc=dj
objectClass: dcObject
objectClass: organization
o: djibtel Organization
dc: djibtel

dn: cn=Manager, dc=djibtel,dc=dj
objectClass: organizationalRole
cn: Manager

dn: ou=People,dc=djibtel,dc=dj
objectClass: organizationalUnit
ou: People

dn: ou=Group,dc=djibtel,dc=dj
objectClass: organizationalUnit
ou: Group
problème trouver et résolut

dn: cn=Manager, dc=djibtel,dc=dj

espace après cn=Manager

merci
Salut,

apparement l'espace entre le cn=Manager, et le dc=djibtel,dc=dj de ton premier dn: perturbe le parser de ldapadd, l'amenant à tenter une nouvelle définition de dc=djibtel,dc=dj.

Simple hypothèse de ma part mais ldap étant assez chatouilleux sur la syntaxe des dn elle mérite d'être vérifiée.

Dès que tu as passé cette phase je t'invite à mettre en oeuvre l'excellent phpldapadmin (il est dans les dépots officiels) c'est encore ce que j'ai trouvé de mieux pour rajouter des entrées de manière conviviale.

A+
A
3 ans plus tard
Bonjour j'ai le même problème avec ldapadd , j'ai fait assez de bricole tel que changer le nom de slapd.d, et videz var /lib/ldap sans succès , g vous donne ma configuration pour que vous m'aidiez , ça fait une semaine que je galère . j'obtiens toujours cette erreur ldap_bind: Invalid credentials (49)

slappasswd
New password:
Re-enter new password:
{SSHA}NKSSfMzsKq1aN4AlvpWXKOSRS0NcswOd

2) recupération du fichier slapd.conf

cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.conf

3) modification de slapd.conf

vi /etc/oopenldap/slapd.conf

j' ajoute : include /etc/openldap/schema/RADIUS-LDAPv3.schema

database bdb
suffix "dc=ircoms,dc=com"
checkpoint 1024 15
rootdn "cn=Manager,dc=ircoms,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw secret
# rootpw {crypt}ijFYNcSNctBYg
rootpw {SSHA}NKSSfMzsKq1aN4AlvpWXKOSRS0NcswOd (mot de pass crypté obtenu au préalable)
# 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



4)modification du fichier ldap.conf


vi /etc/openldap/ldap.conf

BASE dc =ircoms,dc=com,
HOST localhost

5) test de la configuration



[root@bob /]# slaptest -u
config file testing succeeded

6) Copie de DB_CONFIG vers la librairie ldap

cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG

7) definition de ldif.file
cd /etc/openldap
vi file.ldif

dn: dc=ircoms,dc=com
changetype: add
objectClass: top
objectClass: dcObject
objectClass: Organization
o: ircoms
dc: ircoms
#description racine de l'annuaire

dn: ou=People,dc=ircoms,dc=com
changetype: add
objectClass: top
objectClass: OrganizationalUnit
ou: People

dn: ou=Group,dc=ircoms,dc=com
changetype: add
objectClass: top
objectClass: OrganizationalUnit
ou: Group

dn: ou=addressbook,dc=ircoms,dc=com
changetype: add
objectClass: top
objectClass: OrganizationalUnit
ou: addressbook
#description: unite organisationnelles


8)
chown -R ldap:ldap file.ldif

9)
demarrage de ldap:
service slapd start
Starting slapd (via systemctl): [ OK ]
[root@bob openldap]#

10)
Vérification du démarrage de ldap

[root@bob openldap]# pgrep slapd
3034
[root@bob openldap]#


11) Activation du demarrage automatique

[root@bob openldap]# chkconfig slapd on

12) chargement du file.ldif dans l'annuaire ldap

[root@bob openldap]# ldapadd -x -D 'cn=Manager,dc=ircoms,dc=com' -f file.ldif -W
Enter LDAP Password: mot de passe crypté
ldap_bind: Invalid credentials (49)
[root@bob openldap]# ldapadd -x -D 'cn=Manager,dc=ircoms,dc=com' -f file.ldif -W
Enter LDAP Password: mot de passe en clair
ldap_bind: Invalid credentials (49)