# Création OpenLdap

Install package openldap, on utilise yum pour éviter les problèmes de dépendances

```bash
yum -y install openldap* migrationtools
```

[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/6pFWBPGhg6aFUvFp-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/6pFWBPGhg6aFUvFp-image.png)

Une fois installé, créé le Password admin du ldap

```bash
slappaswd
```

[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/nVO3YYlQsGhYUBU2-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/nVO3YYlQsGhYUBU2-image.png)

Copier le SHA pour l'intégrer plus tard dans le fichier de configuration  
Accéder au dossier config du ldap et modifier le fichier olcDatabase={2}hdb.ldif

[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/mX2nMVNaVkEcs8zC-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/mX2nMVNaVkEcs8zC-image.png)

Modifier les paramètres "olcSuffix" et "olcRootDN" selon votre domaine et ajouter "olcRootPW"[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/KSv6FAZmVwRVYopm-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/KSv6FAZmVwRVYopm-image.png)

Ajout des droits de monitor au compte en modifiant le fichier olcDatabase={1}monitor.ldif :[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/sc8SIODnHtPycGMq-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/sc8SIODnHtPycGMq-image.png)

Modifier les paramètres "olcAccess" de votre domaine et ajouter[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/V3qo37RaCQsIQA22-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/V3qo37RaCQsIQA22-image.png)

Verifier la configuration avec la commande suivante

```bash
slaptest -u
```

[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/O553EAckWXHMNXoX-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/O553EAckWXHMNXoX-image.png)

<p class="callout info"><span style="color: rgb(224, 62, 45);">Nous pouvons ignorer les erreurs checksum</span></p>

Démarrer le service, l'ajouter au démarrage automatique et vérifier le démarrage[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/0APwR6uCvu9Tdhcz-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/0APwR6uCvu9Tdhcz-image.png)  
  
Copier le sample de la base et attribuer les droits :  
[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/GHcbxl0ictEymSfO-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/GHcbxl0ictEymSfO-image.png)

Créé les schéma pour le ldap :

[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/wqWswXOl5DSi43dl-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/wqWswXOl5DSi43dl-image.png)

[![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/nwKxrIaG7NBysFDE-image.png)](https://cavallone.fr/uploads/images/gallery/2024-10/nwKxrIaG7NBysFDE-image.png)![image.png](https://cavallone.fr/uploads/images/gallery/2024-10/scaled-1680-/YYje1jM5kxVffr7d-image.png)