21x9.org | System Administration | Home Automation | Smart Home
10.02.2013

Samba mit LDAP-Anbindung

Windows-Dateifreigaben sind auf allen Plattformen sehr einfach zu nutzen. Mit einer LDAP-Anbindung können alle Benutzer von allen Rechnern des Netzwerks aus auf die Freigaben zugreifen.

Installation

apt-get install samba smbldap-tools

Konfiguration

Die Konfiguration in diff-Form. Zeilen mit einem + wurden hinzugefügt, Zeilen mit einem - entfernt.

# diff –git a/samba/smb.conf b/samba/smb.conf

[global]

+ldap admin dn = cn=admin,dc=ldap,dc=cantbuyit,dc=com
+ldap group suffix = ou=group
+ldap machine suffix = ou=machines
+ldap user suffix = ou=people
+ldap suffix = dc=ldap,dc=cantbuyit,dc=com
+ldap passwd sync = yes
+ldap ssl = no

+#socket options = TCP_NODELAY SO_KEEPALIVE SO_SNDBUF=65535 SO_RCVBUF=65535

-# syslog only = no
+ syslog only = yes

– syslog = 0
+ syslog = 1

– passdb backend = tdbsam
+ passdb backend = ldapsam:ldap://localhost

obey pam restrictions = yes

– passwd program = /usr/bin/passwd %u
+ passwd program = /usr/bin/smbldappasswd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

-; add machine script = /usr/sbin/useradd -g machines -c “%u machine account” -d /var/lib/samba -s /bin/false %u
+add machine script = /usr/sbin/smbldap-useradd -t 0 -w “%u”

+[testshare]
+ path = /media/shares/testshare/
+ valid users = gpkvt
+ admin users = gpkvt
+ inherit permissions = yes
+ inherit user = yes
+ inherit acls = yes
+ inherit group = yes
+ oplocks = yes
+ writeable = yes
+ browseable = no
+ write list = gpkvt

Nun kann die Konfiguration aktiviert werden: /etc/init.d/samba restart

Tags: linux ldap debian samba

Tags

linux ldap debian samba

Feeds

Atom 1.0 RSS JSON
  • Datenschutz
  • Impressum
  • Archiv