Using OpenLDAP with Samba

Go into Yast -> Network Services -> Samba Server
If this is the first time you have run this you will be prompted for your workgroup/domain name. In my case I used STRESSFREE. The next question is whether you want to run a Primary Domain Controller. The default is yes so just press Next.

Select the startup tab -> Set to load on boot and if you are running the service on the firewall protected network port enable the option to have the correct ports opened on the firewall. The Shares tab can stay at the default for the time being as we will do this manually later. Go to the Identity tab:

  • Set the Workgroup/Domain Name to something that takes your fancy (STRESSFREE)
  • Select the PDC Option in the Domain Controller dropdown
  • For NetBIOS name put the name you would like to call the server in the Windows world.
    Press the Advanced Settings button and select LDAP Settings
  • In the search base DN type where you would like to begin your searches for users/names (ie o=sfs, the root of the tree)
  • Set the administrator dn (in this case it is cn=admin,o=sfs)
  • Set the LDAP Administrator password. Yast uses this to setup some objects in the tree for Samba configuration information
  • Once done press OK to dorp back to the Identies tab. Press the FInish button to complete the initial setup
Yast will go off and do a bunch of things. Half way through you should get a message saying Yast needs to setup a Samba root account which is used to manage the domain. Remember the password you assign as this will be needed to add desktops to your domain.

 

Now that the initial Samba Server settings are initialized we need to tell it to use an LDAP user source.
Select the Samba Server from the Yast list and then go to the Identities tab.
Press the Advanced Settings button and select User Authentication Sources.

The default install only uses a text based user password system. We want to add LDAP and drop the default smbpasswd file

Add an LDAP source and enter the URI for the LDAP server (ldap://127.0.0.1 if you are running LDAP on the same server as the Samba service)

Delete the smbpasswd source from the list

Press OK and then Finish from the Identies tab. Watch Yast setup some Samba ldap objects. You will be asked for the Samba root password again.