Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


lpi2:ldap

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
Nächste Überarbeitung Beide Seiten, nächste Überarbeitung
lpi2:ldap [2015/07/19 08:01]
ingo_wichmann
lpi2:ldap [2017/09/28 12:52]
ingo_wichmann [slapd starten]
Zeile 3: Zeile 3:
 Debian: Debian:
   slapd   slapd
-SuSE: +SuSE: (( Bug in openSuSE 12.3 und 13.1 https://​bugzilla.novell.com/​show_bug.cgi?​id=777418 ))
   openldap2   openldap2
-Bug in openSuSE 12.3 und 13.1 (( https://​bugzilla.novell.com/​show_bug.cgi?​id=777418 )) 
  
-Fedora, ​CentOS 6: +CentOS ​(ab 6)
-  openldap-servers+  openldap-servers ​openldap-clients
  
-===== Minimal-Konfiguration =====+===== Initiale ​Konfiguration ===== 
 +==== Debian ​====
 Bei Debian wird das Paket mit folgenden Werten vorkonfiguriert ((Die Werte kann man natürlich auch interaktiv beim ''​apt-get install''​ eingeben)): Bei Debian wird das Paket mit folgenden Werten vorkonfiguriert ((Die Werte kann man natürlich auch interaktiv beim ''​apt-get install''​ eingeben)):
 <code bash> <code bash>
Zeile 29: Zeile 29:
 <code bash>​DEBCONF</​code>​ <code bash>​DEBCONF</​code>​
  
-Ab Debian 6.0 squeeze ​liegt die Konfiguration per default in einem LDAP-Baum. Wir empfehlen LDAP-Einsteigern, ​slapd über eine Konfigurationsdatei zu konfigurieren:​ +==== CentOS ​(7==== 
-  ​cat /usr/share/doc/slapd/examples/slapd.conf > /etc/ldap/slapd.conf+   
 +  shopt -s dotglob 
 +  rm -rf /​var/​lib/​ldap/​* 
 +  rm -rf /​etc/​openldap/​slapd.d/* 
 +  ​cp -a /usr/share/openldap-servers/slapd.ldif /usr/​share/​openldap-servers/slapd.ldif.orig 
 +  vim  ​/usr/share/​openldap-servers/slapd.ldif 
 +<file ldif> 
 +olcAccess: to dn.base=""​ by * read 
 +olcAccess: to dn.base="​cn=Subschema"​ by * read 
 +olcAccess: to * 
 +        by self write 
 +        by users read 
 +        by anonymous auth 
 +
 +# Server status monitoring 
 +#
  
-''/​etc/​default/​slapd'' ​( Debian 6.0 ) +dnolcDatabase=monitor,​cn=config 
-<​file>​ +objectClass:​ olcDatabaseConfig 
-SLAPD_CONF=/​etc/​ldap/​slapd.conf +olcDatabase:​ monitor 
-</​file>​+olcAccess: to *  
 +  by dn.base="​gidNumber=0+uidNumber=0,​cn=peercred,​cn=external,​cn=auth"​ read  
 +  by dn.base="​cn=admin,​dc=example,​dc=net"​ read 
 +  by * none
  
-Die wichtigsten Einstellungen für ''​slapd'':​+
 +# Backend database definitions 
 +#
  
-''/​etc/​ldap/​slapd.conf'' ​(Debian) +dnolcDatabase=hdb,​cn=config 
- +objectClass:​ olcDatabaseConfig 
-''/​etc/​openldap/​slapd.conf''​ (SuSE, Fedora) +objectClass:​ olcHdbConfig 
-<​file>​ +olcDatabase:​ hdb 
-include ​        /​etc/​openldap/​schema/​core.schema +olcSuffix: dc=linuxhotel,​dc=de 
-include ​        /​etc/​openldap/​schema/​cosine.schema +olcRootDN: cn=admin,​dc=linuxhotel,​dc=de 
-include ​        /etc/openldap/schema/​inetorgperson.schema +olcDbDirectory: ​/var/lib/ldap 
-include ​        /​etc/​openldap/​schema/​nis.schema+olcDbIndex: objectClass eq,pres 
 +olcDbIndex: ou,​cn,​mail,​surname,​givenname eq,pres,sub
 </​file>​ </​file>​
  
-Je nach Version der Distribution bzwvon OpenLDAP wird ein anderes Backend empfohlen+  /​usr/​libexec/​openldap/​convert-config.sh -f /​usr/​share/​openldap-servers/​slapd.ldif 
 +  cp /​usr/​share/​openldap-servers/​DB_CONFIG.example /​var/​lib/​ldap/​DB_CONFIG 
 +  systemctl start slapd 
 +  systemctl enable slapd
  
-Debian 6.0 :+===== root-Zugriff auf LDAP-Server über Socket ===== 
 +  vim ~/.ldaprc
  
 <​file>​ <​file>​
-moduleload ​     back_hdb+URI       ​ldapi://​ 
 +BASE      cn=config 
 +SASL_MECH EXTERNAL
 </​file>​ </​file>​
 +  ldapsearch -LLL '​(olcSuffix=*)'​ olcSuffix
  
-<​file>​ +===== Schemata hinzufügen ===== 
-backend hdb +  * [[http://​tools.ietf.org/​html/​draft-howard-rfc2307bis-01|rfc2307bis-01]] (expired: 20.08.2005){{:​rfc2307bis-draft01.ldif|LDIF}} ​ 
-</file>+  * [[http://​tools.ietf.org/​html/draft-howard-rfc2307bis-02|rfc2307bis-02]] (expired: 10.02.2010)
  
-<​file>​ +  ldapadd -f /​etc/​openldap/​schema/​core.ldif ​ 
-database hdb +  ​ldapadd -f /​etc/​openldap/​schema/​cosine.ldif ​ 
-</file>+  ​ldapadd -f /​etc/​openldap/​schema/​inetorgperson.ldif  
 +  ldapadd -f /​etc/​openldap/​schema/nis.ldif ​
  
-<​file>​ +{{:​yast.ldif|}}
-suffix ​         "​dc=linuxhotel,​dc=de"​+
  
-access to attrs=userPassword +  ldapsearch -b cn=schema,​cn=config ​-LLL dn
-        by dn="cn=admin,​dc=linuxhotel,​dc=de"​ write +
-        by anonymous auth +
-        by self write +
-        by * none +
- +
-access to * +
-        by dn="​cn=admin,​dc=linuxhotel,​dc=de"​ write +
-        by self read +
-        by * read +
-</​file>​ +
- +
-centos 5 : +
-  cp /​etc/​openldap/​DB_CONFIG.example /​var/​lib/​ldap/​DB_CONFIG +
-   +
-centos 6 : +
-<​file>​ +
-include /​etc/​openldap/​schema/​core.schema +
-include /​etc/​openldap/​schema/​cosine.schema +
-include /​etc/​openldap/​schema/​inetorgperson.schema +
-include /​etc/​openldap/​schema/​nis.schema +
-include /​etc/​openldap/​schema/​openldap.schema +
- +
-# modulepath /​usr/​lib/​openldap +
-modulepath /​usr/​lib64/​openldap +
- +
- +
-access to dn.base=""​ by * read +
- +
-database bdb +
-suffix "​dc=example,dc=com"​ +
-rootdn "​cn=admin,​dc=example,​dc=com"​ +
-rootpw villa +
-directory /​var/​lib/​ldap +
-</​file>​ +
- +
-==== slapd.conf prüfen ==== +
-  slapd -t  +
-  slaptest+
  
 ===== erste LDAP Einträge ===== ===== erste LDAP Einträge =====
- 
 Unter Debian werden bereits bei der Installation die ersten Werte, wie z.B. der Administrator-Benutzer in das Verzeichnis eingefügt. Unter SuSE und Fedora kann man das mit dem Befehl ''​slapadd''​ tun, das Administrator-Passwort wird mit dem Befehl ''​slappasswd''​ erzeugt: Unter Debian werden bereits bei der Installation die ersten Werte, wie z.B. der Administrator-Benutzer in das Verzeichnis eingefügt. Unter SuSE und Fedora kann man das mit dem Befehl ''​slapadd''​ tun, das Administrator-Passwort wird mit dem Befehl ''​slappasswd''​ erzeugt:
  
Zeile 138: Zeile 127:
 ===== slapd starten ===== ===== slapd starten =====
 SuSE, Centos, Fedora: ​ SuSE, Centos, Fedora: ​
-  ​/​etc/​init.d/​ldap restart+  ​service ​ldap restart
   chkconfig ldap on   chkconfig ldap on
  
 Debian: Debian:
-  ​/​etc/​init.d/​slapd restart+  ​service ​slapd restart
  
 ==== Fehler beim Starten finden ==== ==== Fehler beim Starten finden ====
lpi2/ldap.txt · Zuletzt geändert: 2024/03/21 10:58 von ingo_wichmann