Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
fortgeschrittene:ldap-config [2014/02/20 20:46] ingo_wichmann |
fortgeschrittene:ldap-config [2018/02/27 14:45] (aktuell) ingo_wichmann [bearbeiten] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== Tips & Tricks: OpenLDAP mit cn=config ====== | ||
+ | ===== root Zugriff auf slapd-Konfiguration geben ===== | ||
''~/.ldaprc'' für root: | ''~/.ldaprc'' für root: | ||
- | <file> | + | <file txt ~/.ldaprc> |
- | URI ldapi:// | + | URI ldapi:/// |
BASE cn=config | BASE cn=config | ||
SASL_MECH EXTERNAL | SASL_MECH EXTERNAL | ||
</file> | </file> | ||
- | Schema auslesen: | + | ==== Übersicht Server Konfiguration ==== |
+ | ldapsearch -LLL dn | ||
+ | |||
+ | ==== Schema auslesen ==== | ||
ldapsearch -b cn=schema,cn=config -LLL dn | ldapsearch -b cn=schema,cn=config -LLL dn | ||
- | Übersicht Server Konfiguration: | + | ==== Welche Verzeichnisse/Bäume sind enthalten ==== |
- | ldapsearch -LLL dn | + | ldapsearch -LLL '(olcSuffix=*)' olcSuffix |
- | Übersicht Konfiguration des ersten Baums: | + | ==== Übersicht Konfiguration des ersten (Daten-)Baums ==== |
- | ldapsearch -b 'olcDatabase={1}hdb,cn=config' -LLL | + | ldapsearch -b 'olcDatabase={1}mdb,cn=config' -LLL |
- | Konfiguration bearbeiten: | + | ===== LDAP ACL ===== |
- | ldapvi -Y EXTERNAL -b 'olcDatabase={1}hdb,cn=config' | + | ==== lesen ==== |
+ | ldapsearch -LL -b olcDatabase={1}mdb,cn=config olcAccess | ||
+ | |||
+ | ==== bearbeiten ==== | ||
+ | <file ldif olcAccess.ldif> | ||
+ | dn: olcDatabase={1}mdb,cn=config | ||
+ | changetype: modify | ||
+ | replace: olcAccess | ||
+ | olcAccess: {0}to attrs=userPassword | ||
+ | by self write | ||
+ | by dn="cn=admin,dc=example,dc=org" write | ||
+ | by anonymous auth | ||
+ | by * none | ||
+ | olcAccess: {1}to attrs=shadowLastChange | ||
+ | by self write | ||
+ | by dn="cn=admin,dc=example,dc=org" write | ||
+ | by * read | ||
+ | olcAccess: {2}to * | ||
+ | by dn="cn=admin,dc=example,dc=org" write | ||
+ | by * read | ||
- | Default bei Debian: | ||
- | <file> | ||
- | 0 olcDatabase={1}hdb,cn=config | ||
- | objectClass: olcDatabaseConfig | ||
- | objectClass: olcHdbConfig | ||
- | olcDatabase: {1}hdb | ||
- | olcDbDirectory: /var/lib/ldap | ||
- | olcSuffix: dc=dom11,dc=example,dc=com | ||
- | olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymous auth by dn="cn=admin,dc=dom11,dc=example,dc=com" write by * none | ||
- | olcAccess: {1}to dn.base="" by * read | ||
- | olcAccess: {2}to * by self write by dn="cn=admin,dc=dom11,dc=example,dc=com" write by * read | ||
- | olcLastMod: TRUE | ||
- | olcRootDN: cn=admin,dc=dom11,dc=example,dc=com | ||
- | olcRootPW: {SSHA}Jmxfia13Hrp8rD/fsr+q3hkNHUQvEa+n | ||
- | olcDbCheckpoint: 512 30 | ||
- | olcDbConfig: {0}set_cachesize 0 2097152 0 | ||
- | olcDbConfig: {1}set_lk_max_objects 1500 | ||
- | olcDbConfig: {2}set_lk_max_locks 1500 | ||
- | olcDbConfig: {3}set_lk_max_lockers 1500 | ||
- | olcDbIndex: objectClass eq | ||
</file> | </file> | ||
+ | |||
+ | ldapmodify -f olcAccess.ldif | ||
+ | ===== Konfiguration bearbeiten ===== | ||
+ | ldapvi -Y EXTERNAL -b 'olcDatabase={1}mdb,cn=config' | ||
+ | |||