Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
|
lpi2:samba-ldap [2011/04/07 16:26] |
lpi2:samba-ldap [2011/04/07 16:26] (aktuell) |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== Samba: Einfache LDAP Anbindung ====== | ||
| + | Vorraussetzung: | ||
| + | * [[nss-ldap|LDAP als Linux Benutzerdatenbank]] | ||
| + | * [[samba|Einfache Samba Installation]] | ||
| + | |||
| + | ====== OpenLDAP Server ====== | ||
| + | ===== Benötigte Pakete ===== | ||
| + | Debian: | ||
| + | samba-doc | ||
| + | |||
| + | ===== Konfiguration slapd ===== | ||
| + | Das Samba Schema muß auf dem LDAP-Server eingebunden sein. Unter Debian ist das Schema im Paket ''samba-doc'' enthalten: | ||
| + | zcat /usr/share/doc/samba-doc/examples/LDAP/samba.schema.gz > /etc/ldap/schema/samba.schema | ||
| + | |||
| + | Fedora: | ||
| + | cp /usr/share/doc/samba-3.0.14a/LDAP/samba.schema /etc/openldap/schema/ | ||
| + | |||
| + | ''/etc/ldap/slapd.conf'' : ( Debian ) | ||
| + | |||
| + | <file> | ||
| + | include /etc/ldap/schema/samba.schema | ||
| + | </file> | ||
| + | |||
| + | ''/etc/openldap/slapd.conf'' : ( Fedora ) | ||
| + | <file> | ||
| + | include /etc/openldap/schema/samba.schema | ||
| + | </file> | ||
| + | |||
| + | ''/etc/openldap/slapd.conf'' : ( SuSE ) | ||
| + | <file> | ||
| + | include /etc/openldap/schema/samba3.schema | ||
| + | </file> | ||
| + | |||
| + | ( SuSE, CentOS & Debian ) | ||
| + | <file> | ||
| + | access to attrs=userPassword,sambaNTPassword,sambaLMPassword | ||
| + | </file> | ||
| + | <file> | ||
| + | index uid,uidNumber,gidNumber,memberUid eq | ||
| + | index cn,mail,surname,givenname eq,subinitial | ||
| + | index sambaSID eq | ||
| + | index sambaPrimaryGroupSID eq | ||
| + | index sambaDomainName eq | ||
| + | </file> | ||
| + | |||
| + | Debian: | ||
| + | /etc/init.d/slapd restart | ||
| + | |||
| + | Fedora: | ||
| + | /etc/init.d/ldap restart | ||
| + | |||
| + | ====== Konfiguration samba ====== | ||
| + | ''/etc/samba/smb.conf'' : | ||
| + | <file> | ||
| + | [global] | ||
| + | workgroup = kurs | ||
| + | interfaces = eth0 | ||
| + | |||
| + | #LDAP Anbindung: | ||
| + | passdb backend = ldapsam:ldap://ldap1.villa.local | ||
| + | ldap suffix = dc=villa,dc=local | ||
| + | ldap admin dn = "cn=admin,dc=villa,dc=local" | ||
| + | ldap user suffix = ou=people | ||
| + | ldap group suffix = ou=groups | ||
| + | ldap ssl = off | ||
| + | |||
| + | [daten] | ||
| + | path = /tmp | ||
| + | writable = yes | ||
| + | </file> | ||
| + | |||
| + | Das Passwort des in der 'smb.conf' genannten LDAP Admin muß dem Samba Server im Klartext vorliegen: | ||
| + | smbpasswd -W | ||
| + | |||
| + | /etc/init.d/samba restart | ||
| + | |||
| + | ===== Benutzer anlegen ===== | ||
| + | Auch mit LDAP als Backend muß ein Samba-Benutzer einen Linux/Unix Account haben. Der kann sowohl durch einen lokalen Eintrag in der '/etc/passwd', als auch durch einen "posixAccount" im LDAP Verzeichnis realisiert sein. (( Die hier beschriebenen Lösung bevorzugen wir aktuell, aber seit Samba 3.0.25 gibt es noch einen anderen Weg: http://wiki.samba.org/index.php/Ldapsam_Editposix . )) | ||
| + | |||
| + | smbpasswd -a iw | ||
| + | |||
| + | ===== Bestehende Benutzer importieren ===== | ||
| + | Bestehende Samba Benutzer können z.B. mit | ||
| + | pdbedit -i tdbsam | ||
| + | aus einer Samba-tdb-Datenbank importiert werden. | ||
| + | |||
| + | ====== Todo ====== | ||
| + | ===== ldaps dokumentieren ===== | ||
| + | ''/etc/samba/smb.conf'' : | ||
| + | <file> | ||
| + | passdb backend = ldapsam:ldaps://ldap1.villa.local | ||
| + | </file> | ||