====== 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 ) include /etc/ldap/schema/samba.schema ''/etc/openldap/slapd.conf'' : ( Fedora ) include /etc/openldap/schema/samba.schema ''/etc/openldap/slapd.conf'' : ( SuSE ) include /etc/openldap/schema/samba3.schema ( SuSE, CentOS & Debian ) access to attrs=userPassword,sambaNTPassword,sambaLMPassword index uid,uidNumber,gidNumber,memberUid eq index cn,mail,surname,givenname eq,subinitial index sambaSID eq index sambaPrimaryGroupSID eq index sambaDomainName eq Debian: /etc/init.d/slapd restart Fedora: /etc/init.d/ldap restart ====== Konfiguration samba ====== ''/etc/samba/smb.conf'' : [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 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'' : passdb backend = ldapsam:ldaps://ldap1.villa.local