Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
|
lpi2:sssd-ldap [2025/11/14 17:01] ingo_wichmann |
lpi2:sssd-ldap [2025/11/21 15:59] (aktuell) |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | TODO: mit [[fortgeschrittene:sssd-ldap]] zusammen führen. | + | ====== sssd gegen LDAP authentifizieren ====== |
| + | ===== Voraussetzungen ===== | ||
| + | * DNS [[dns|client-]] und [[bind|serverseitig]] korrekt | ||
| + | * (open)[[ldap]] inkl. [[ldap-ssl|TLS]] | ||
| + | * [[ldap-user|OpenLDAP als Benutzerdatenbank für Linux]] | ||
| + | * falls Gruppen in Gruppen verschachtelt (nested groups) werden sollen: [[ldap#schemata_hinzufuegen|RFC2307bis Schema hinzufügen]] | ||
| - | ====== Konfiguration OpenLDAP Server ====== | + | ===== Pakete ===== |
| - | + | * Debian (ab 8): ''sssd-ldap sssd-tools libnss-sss libpam-sss'' (( | |
| - | Vorraussetzung: | + | apt-get --no-install-recommends install sssd-ldap libnss-sss sssd-tools |
| - | * Serverseitig wird die selbe Konfiguration benötigt wie bei [[nss-ldap]]. | + | )) |
| - | * [[lpi2:sssd-ldap|LDAP-Server mit SSL/TLS]] | + | * CentOS (7): ''sssd-ldap sssd-tools'' |
| - | + | ||
| - | ====== Konfiguration sssd ====== | + | |
| - | + | ||
| - | Pakete: | + | |
| - | * Debian (7): ''sssd sssd-tools'' | + | |
| - | * ''nscd'' entfernen | + | |
| - | * Debian (10): ''sssd sssd-tools libnss-sss libpam-sss'' | + | |
| * openSuSE (12.3): ''sssd sssd-tools'' | * openSuSE (12.3): ''sssd sssd-tools'' | ||
| * ''nscd'' entfernen | * ''nscd'' entfernen | ||
| - | Debian (12): | + | ===== Konfiguration ====== |
| - | cp /usr/share/doc/sssd-common/examples/sssd-example.conf /etc/sssd/sssd/conf.d | + | Debian (ab 9): |
| + | cp /usr/share/doc/sssd-common/examples/sssd-example.conf /etc/sssd/sssd.conf | ||
| - | + | <file txt /etc/sssd/sssd.conf> | |
| - | ''/etc/sssd/sssd.conf'' : | + | |
| - | <file> | + | |
| [sssd] | [sssd] | ||
| services = nss, pam | services = nss, pam | ||
| domains = LDAP | domains = LDAP | ||
| + | |||
| [nss] | [nss] | ||
| + | |||
| [pam] | [pam] | ||
| + | |||
| [domain/LDAP] | [domain/LDAP] | ||
| id_provider = ldap | id_provider = ldap | ||
| auth_provider = ldap | auth_provider = ldap | ||
| - | # debian, redhat | + | |
| ldap_schema = rfc2307 | ldap_schema = rfc2307 | ||
| - | # suse | + | ldap_uri = ldap://vm1.z36.example.org |
| - | #ldap_schema = rfc2307bis | + | ldap_search_base = dc=example,dc=org |
| - | ldap_uri = ldap://vm1.example.com | + | |
| - | ldap_search_base = dc=example,dc=com | + | ldap_tls_cacert = /etc/ssl/certs/ca.example.org.cert.pem |
| + | |||
| + | ldap_default_bind_dn = cn=admin,dc=example,dc=org | ||
| + | ldap_default_authtok = villa | ||
| + | ldap_default_authtok_type = password | ||
| + | |||
| + | enumerate = true | ||
| cache_credentials = true | cache_credentials = true | ||
| Zeile 41: | Zeile 47: | ||
| chmod 600 /etc/sssd/sssd.conf | chmod 600 /etc/sssd/sssd.conf | ||
| + | sssctl config-check | ||
| - | ''/etc/nsswitch.conf'' : | + | service sssd restart |
| - | <file> | + | sssctl domain-list |
| - | passwd: files sss | + | -> ''LDAP'' |
| - | group: files sss | + | sssctl domain-status LDAP -a |
| - | shadow: files sss | + | -> ''LDAP: vm1.z45.internal'' |
| - | netgroup: nis sss | + | sssctl user-checks nutzer45 |
| - | </file> | + | -> ''pam_acct_mgmt: Success'' |
| - | OpenSuSE (12.3): | + | ===== nss ====== |
| - | pam-config --add --sss | + | grep -E '^(passwd|group|shadow)' /etc/nsswitch.conf |
| + | -> ''files sss'' | ||
| + | getent passwd {10000..10100} | ||
| + | -> LDAP-Benutzer werden angezeigt | ||
| - | Debian (7): | + | ===== PAM ===== |
| + | Debian (ab 8): | ||
| pam-auth-update | pam-auth-update | ||
| + | CentOS (7): | ||
| + | authconfig --enablesssd --update | ||
| + | authconfig --enablesssdauth --update | ||
| + | authconfig --enablemkhomedir --update | ||
| - | -> | + | ===== Fehlersuche ===== |
| + | service sssd stop | ||
| + | sssd -i -d 3 | ||
| - | ''/etc/pam.d/common-account'' : | + | ===== Doku ===== |
| - | <file> | + | * /usr/share/doc/sssd-common/examples/sssd-example.conf |
| - | account [default=bad success=ok user_unknown=ignore] pam_sss.so | + | * man sssd-ldap |
| - | </file> | + | |
| - | + | ||
| - | ''/etc/pam.d/common-auth'' : | + | |
| - | <file> | + | |
| - | auth [success=1 default=ignore] pam_sss.so use_first_pass | + | |
| - | </file> | + | |
| - | + | ||
| - | ''/etc/pam.d/common-password'' : | + | |
| - | <file> | + | |
| - | password sufficient pam_sss.so | + | |
| - | </file> | + | |
| - | + | ||
| - | ''/etc/pam.d/common-session'' : | + | |
| - | <file> | + | |
| - | session optional pam_sss.so | + | |
| - | </file> | + | |