Chapter 56. Annexes à la séquence sur LDAP

Table of Contents

Exemple de fichier LDIF
L'annuaire ldap vu de konqueror
L'annuaire ldap vu de gq
Le schéma vu de gq
Authentification avec php sur LDAP

Exemple de fichier LDIF

Exemple de fichier utilisable

# Penser à recoder en UTF-8
# avec recode ou iconv
dn: dc=point-libre,dc=org
objectclass: organization
objectclass: dcObject
o: point-libre.org
dc: point-libre.org
description: Annuaire de test
postalCode: 87000


dn: ou=ressource,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalUnit
ou: ressource
description: Branche ressource

dn: ou=user,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalUnit
ou: user
description: Branche utilisateurs


dn: ou=agenda,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalUnit
ou: agenda
description: Branche contact


dn: ou=people,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalUnit
ou: people
description: Branche personne

dn: ou=service,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalUnit
ou: service
description: Branche service

dn: ou=etudiant,ou=people,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalUnit
ou:etudiant
description:Branche etudiant

dn: ou=personnel,ou=people,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalUnit
ou: personnel
description: Branche personnel

dn: ou=nfs,ou=service,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalUnit
ou:nfs
description:nfs

dn: ou=groupe,ou=service,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalUnit
ou:groupe
description: Groupes

dn: cn=manager,ou=ressource,dc=point-libre,dc=org
objectclass: top
objectclass: organizationalrole
cn:manager

#Ajout d'un contact

dn: cn=Aline BOURG, ou=agenda, dc=point-libre,dc=org
objectclass: top
objectclass: person
objectclass: inetOrgPerson
cn: BOURG Aline
sn: Bourg
givenName: Aline
mail: bingo@point-libre.org
telephoneNumber: 00-00-00-00-00
street: none
postalCode: 87400
postaladdress: Chabant
preferredLanguage: fr

#Ajout d'un utilisateur

dn: cn=Aline BOURG, ou=user, dc=point-libre,dc=org
objectclass: top
objectclass: person
objectclass: inetOrgPerson
objectclass: posixAccount
cn: BOURG Aline
sn: Bourg
givenName: Aline
uid: mlx
uidNumber:1005
gidNumber:1005
homedirectory:/home/mlx
loginshell:/bin/bash
userpassword:{crypt}2/yajBmqc3tYw
mail: bingo@point-libre.org
telephoneNumber: 00-00-00-00-00
street: none
postalCode: 87400
postaladdress: Chabant
preferredLanguage: fr

dn: cn=Marine BOURG, ou=user, dc=point-libre,dc=org
objectclass: top
objectclass: person
objectclass: inetOrgPerson
objectclass: posixAccount
cn: BOURG Marine
sn: Bourg
givenName: Marine
uid: mly
uidNumber:1006
gidNumber:1006
homedirectory:/home/mly
loginshell:/bin/bash
userpassword:{crypt}2/yajBmqc3tYw
mail: bingo@point-libre.org
telephoneNumber: 00-00-00-00-00
street: none
postalCode: 87400
postaladdress: Chabant
preferredLanguage: fr

Création de l'annuaire, ajout de données et test.

# slapadd -l init.ldiff
# slapcat

dn: dc=point-libre,dc=org
objectClass: organization
objectClass: dcObject
o: point-libre.org
dc: point-libre.org
description: Annuaire de test
postalCode: 87000

dn: ou=ressource,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalUnit
ou: ressource
description: Branche ressource

dn: ou=user,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalUnit
ou: user
description: Branche utilisateurs

dn: ou=agenda,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalUnit
ou: agenda
description: Branche contact

dn: ou=people,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalUnit
ou: people
description: Branche personne

dn: ou=service,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalUnit
ou: service
description: Branche service

dn: ou=etudiant,ou=people,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalUnit
ou: etudiant
description: Branche etudiant

dn: ou=personnel,ou=people,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalUnit
ou: personnel
description: Branche personnel

dn: ou=nfs,ou=service,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalUnit
ou: nfs
description:: bmZzICA=

dn: ou=groupe,ou=service,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalUnit
ou: groupe
description:: R3JvdXBlcyA=

dn: cn=manager,ou=ressource,dc=point-libre,dc=org
objectClass: top
objectClass: organizationalrole
cn: manager

dn: cn=Jean BOURG, ou=agenda, dc=point-libre,dc=org
objectClass: top
objectClass: person
objectClass: inetOrgPerson
cn: BOURG Jean
sn: Bourg
givenName: Jean
mail: bingo@point-libre.org
telephoneNumber: 00-00-00-00-00
street: none
postalCode: 87400
postalAddress: Chabant
preferredLanguage: fr

dn: cn=Jean BOURG, ou=user, dc=point-libre,dc=org
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: posixAccount
cn: BOURG Jean
sn: Bourg
givenName: Jean
uid: mlx
uidNumber: 1005
gidNumber: 1005
homeDirectory: /home/mlx
loginShell: /bin/bash
userPassword:: e2NyeXB0fTIveWFqQm1xYzN0WXc=
mail: bingo@point-libre.org
telephoneNumber: 00-00-00-00-00
street: none
postalCode: 87400
postalAddress: Chabant
preferredLanguage: fr



dn: cn=Marine BOURG, ou=user, dc=point-libre,dc=org
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: posixAccount
cn: BOURG Marine
sn: Bourg
givenName: Marine
uid: mly
uidNumber: 1006
gidNumber: 1006
homeDirectory: /home/mly
loginShell: /bin/bash
userPassword:: e2NyeXB0fTIveWFqQm1xYzN0WXc=
mail: bingo@point-libre.org
telephoneNumber: 00-00-00-00-00
street: none
postalCode: 87400
postalAddress: Chabant
preferredLanguage: fr