tech:ldap
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:ldap [2025/04/30 14:53] – Jean-Baptiste | tech:ldap [2026/06/29 17:53] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes LDAP | ||
| + | |||
| + | Voir : | ||
| + | * curl | ||
| + | * [LDAP Glossary](https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * [LDAP Synchronization Connector (LSC)](https:// | ||
| + | * https:// | ||
| + | |||
| + | Serveurs : | ||
| + | * OpenLDAP | ||
| + | * 389 Directory Server | ||
| + | |||
| + | Scripts : | ||
| + | * https:// | ||
| + | * Paquet Debian " | ||
| + | |||
| + | Interface Web de changement de MDP compte utilisateur : | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ## Interface d' | ||
| + | |||
| + | Voir | ||
| + | * PhpLDAPadmin | ||
| + | * LDAPadmin | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install cockpit-389-ds | ||
| + | ~~~ | ||
| + | |||
| + | Interface WebUI | ||
| + | * https:// | ||
| + | |||
| + | ## Création de compte LDAP | ||
| + | |||
| + | ### Trouver le uidNumber maximal | ||
| + | |||
| + | Si accès console sur le serveur : | ||
| + | ~~~bash | ||
| + | slapcat | grep uidNumber | awk ' | ||
| + | slapcat | grep gidNumber | awk ' | ||
| + | ~~~ | ||
| + | |||
| + | Sinon : Find max uidNumber on LDAP \ | ||
| + | Dans mon cas ça n'a pas fonctionné. | ||
| + | ~~~bash | ||
| + | ldapsearch -H ldaps:// | ||
| + | ~~~ | ||
| + | Source : https:// | ||
| + | |||
| + | |||
| + | ## Vérifier / lister les compte locké / verrouillés | ||
| + | |||
| + | ~~~bash | ||
| + | ldapsearch -x -b " | ||
| + | ~~~ | ||
| + | |||
| + | ## Les filtres | ||
| + | |||
| + | ~~~bash | ||
| + | curl -u USERNAME ' | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | $ curl " | ||
| + | -u " | ||
| + | Enter host password for user ' | ||
| + | DN: uid=mathieu, | ||
| + | homephone: +1 225 216 5900 | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ldapsearch -x -LLL -H ldap:// | ||
| + | ldapsearch -x -LLL -H ldap:// | ||
| + | ldapsearch -x -LLL -H ldap:// | ||
| + | ~~~ | ||
| + | |||
| + | Afficher les membres d'un groupe CN | ||
| + | ~~~bash | ||
| + | ldapsearch -x -LLL -D " | ||
| + | ~~~ | ||
| + | |||
| + | Autre | ||
| + | ~~~bash | ||
| + | ldapsearch -h ldap.acme.fr -D " | ||
| + | -s sub " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | BASE dc=acme, | ||
| + | URI | ||
| + | SIZELIMIT | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | echo -n P@ssw0rd > ~/ | ||
| + | chmod 600 !$ | ||
| + | ldapsearch -x -LLL -D " | ||
| + | ~~~ | ||
| + | |||
| + | Cherche le login d'un utilisateur | ||
| + | ~~~bash | ||
| + | #echo | ldapsearch -E pr=1000 -D " | ||
| + | echo | ldapsearch -LLL -o ldif-wrap=no -D " | ||
| + | |||
| + | # MARLEY Robert, Utilisateurs, | ||
| + | dn: CN=MARLEY Robert, | ||
| + | sAMAccountName: | ||
| + | ~~~ | ||
| + | |||
| + | No wrap | ||
| + | ~~~ | ||
| + | -o ldif-wrap=no | ||
| + | ~~~ | ||
| + | |||
| + | ## ldapsearch authentification Kerberos GSSAPI | ||
| + | |||
| + | ~~~bash | ||
| + | export KRB5CCNAME=/ | ||
| + | ldapsearch -H ldap:// | ||
| + | ~~~ | ||
| + | |||
| + | ## Netgroup | ||
| + | |||
| + | `nisNetgroupTriple` correspond aux utilisateurs \ | ||
| + | `memberNisNetgroup` correspond aux autres netgroups | ||
| + | |||
| + | Netgroup | ||
| + | |||
| + | Voir http:// | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | netgroup: ldap | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | getent netgroup sysadmin | ||
| + | |||
| + | getent netgroup $(hostname -s) | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ipa netgroup-add --desc=" | ||
| + | |||
| + | ipa netgroup-add-member --users=user_name --groups=group_name --hosts=host_name \ | ||
| + | | ||
| + | |||
| + | |||
| + | ipa netgroup-add-member --users={user1; | ||
| + | | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | nisNetgroupTriple: | ||
| + | memberNisNetgroup: | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | + : @QAUsers@@QASystems : 10. | ||
| + | + : root : LOCAL | ||
| + | + : @Admins : 10. | ||
| + | - : ALL : ALL | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | account required pam_access.so accessfile=/ | ||
| + | ~~~ | ||
| + | |||
| + | https:// | ||
| + | |||
| + | |||
| + | ## Autoriser l' | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | +:root:ALL | ||
| + | +:admin:ALL | ||
| + | +:@srv1:ALL | ||
| + | -:ALL:ALL | ||
| + | ~~~ | ||
| + | |||
| + | Dans notre exemple " | ||
| + | |||
| + | ## Pb | ||
| + | |||
| + | ~~~ | ||
| + | openldap sizelimit. Can't receive more than 500 entries | ||
| + | ~~~ | ||
| + | |||
| + | Solution `-E pr=1000` | ||
| + | |||
| + | Ou | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | SIZELIMIT | ||
| + | ~~~ | ||
