Samba with LDAP

For Samba I don't go through the hassle of converting existing info in the smbpasswd file - instead the accounts will be added with smbpasswd utility after changing Samba's config file.

Before we can add Samba accounts to the LDAP Server we need a schemafile wich is available from the samba-doc package:

#> apt-get install samba-doc
#> zcat /usr/share/doc/samba-doc/examples/LDAP/samba.schema.gz \
   > /etc/ldap/schema/samba.schema

Edit /etc/ldap/slapd.conf to include this schema and restart the server.

Now we can reconfigure Samba - you should stop Samba before doing so. Now edit /etc/samba/smb.conf and add some LDAP options to the global section:

passdb backend = ldapsam
ldap server   = 127.0.0.1
ldap admin dn = cn=admin,dc=my,dc=home
ldap suffix   = dc=my,dc=home

Restart Samba and give it the LDAP admin password with smbpasswd -w <secret>. Now you can add samba password to your existing users with smbpasswd -a <user>..