<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="https://www.stress-free.co.nz"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>stressfree - ldap</title>
 <link>https://www.stress-free.co.nz/tech/ldap</link>
 <description></description>
 <language>en</language>
<item>
 <title>Adventures in Samba with LDAP</title>
 <link>https://www.stress-free.co.nz/adventures_in_samba_with_ldap</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img src=&quot;/sites/default/files/images/news/samba-logo.jpg&quot; alt=&quot;&quot; width=&quot;160&quot; height=&quot;81&quot; /&gt;&lt;/div&gt;&lt;p&gt;Over the last week I have been experimenting with &lt;a href=&quot;http://sourceforge.net/projects/smbldap-tools/&quot;&gt;SMBLDAP-Tools&lt;/a&gt; and some of the new features available in the latest versions of Samba 3. Whilst I&#039;ve written about &lt;a href=&quot;/suse_openldap_samba_howto&quot;&gt;setting up a Samba Primary Domain Controller with an LDAP-backend&lt;/a&gt; before SMBLDAP-Tools makes configuring this potentially troublesome (but very powerful) combination a lot easier.&lt;/p&gt;&lt;p&gt;For my testing I have been using the Factory build of &lt;a href=&quot;http://ftp.suse.com/pub/projects/samba/3.0/10.0/&quot;&gt;Samba 3.0.23C for Suse 10&lt;/a&gt;. Suse 10 does not have a package for SMBLDAP-Tools but Suse 10.1+ does so I used the 10.1 source package and built it for Suse 10. After a bit of hassle I also applied a &lt;a href=&quot;http://www.active.ee/download/smbldap-useradd-0.9.1.diff&quot;&gt;patch&lt;/a&gt; that fixed &lt;a href=&quot;http://lists.samba.org/archive/samba/2005-June/106478.html&quot;&gt;Computer creation account problems&lt;/a&gt;. If you are using Suse 10.0 the SMBLDAP-Tools package I built can be downloaded from &lt;a href=&quot;/sites/default/files/suse/smbldap-tools-0.9.1-11.noarch.rpm&quot;&gt;here&lt;/a&gt;, otherwise compiling it from source is difficult as its just a collection of Perl scripts.&lt;!--break--&gt;&lt;/p&gt;&lt;h2&gt;Configuring SMBLDAP-Tools &lt;/h2&gt;&lt;p&gt;The easiest way to configure SMBLDAP-Tools is to run its configuration script at the command prompt:&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;configure.pl &lt;em&gt;(Enter)&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This will ask a range of questions ranging from the authentication details of your LDAP server to the specifics of your user profiles. Once configured it will save the &lt;strong&gt;smbldap.conf&lt;/strong&gt; and &lt;strong&gt;smbldap_bind.conf&lt;/strong&gt; files to the &lt;strong&gt;/etc/smbldap-tools&lt;/strong&gt; directory ready to use.&lt;/p&gt;&lt;p&gt;After tailoring the configuration scripts as root run the smbldap-populate command to generate most of the required LDAP entries. Unfortunately it looks like Samba 3.0.23 expects a few other Domain groups which can be created with the following commands:&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;smbldap-groupadd -s S-1-5-32-545 -a -g 545 -t builtin &quot;Users&quot; &lt;em&gt;(Enter)&lt;/em&gt;&lt;br /&gt;smbldap-groupadd -s S-1-5-32-546 -a -g 546 -t builtin &quot;Guests&quot; &lt;em&gt;(Enter)&lt;/em&gt;&lt;br /&gt;smbldap-groupadd -s S-1-5-32-547 -a -g 547 -t builtin &quot;Power Users&quot; &lt;em&gt;(Enter)&lt;/em&gt;&lt;/p&gt;&lt;p&gt;To create users use the smbldap-useradd command. The &lt;a href=&quot;http://sourceforge.net/docman/display_doc.php?docid=33543&amp;amp;group_id=166108&quot;&gt;documentation for SMBLDAP-Tools&lt;/a&gt; is very comprehensive plus the help provided by the individual commands is very explanatory.  &lt;/p&gt;&lt;h2&gt;The smb.conf file&lt;/h2&gt;&lt;p&gt;With SMBLDAP-Tools in place and configured it is now time to configure Samba. Below is my &lt;strong&gt;/etc/samba/smb.conf&lt;/strong&gt; file. Please note this file has been processed by a Perl script hence all the spaces between configuration options are missing (do not worry Samba does not mind).&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;[global]&lt;br /&gt;        preservecase              = yes&lt;br /&gt;        bindinterfacesonly        = true&lt;br /&gt;        nameresolveorder          = wins lmhosts bcast&lt;br /&gt;        maptoguest                = Bad User&lt;br /&gt;        printcapname              = /dev/null&lt;br /&gt;        domainlogons              = Yes&lt;br /&gt;        disablenetbios            = yes&lt;br /&gt;        preferredmaster           = Yes&lt;br /&gt;        strictlocking             = no&lt;br /&gt;        socketoptions             = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 IPTOS_LOWDELAY&lt;br /&gt;        printing                  = bsd&lt;br /&gt;        workgroup                 = STRESSFREE&lt;br /&gt;        useclientdriver           = no&lt;br /&gt;        security                  = user&lt;br /&gt;        domainmaster              = Yes&lt;br /&gt;        timeserver                = yes&lt;br /&gt;        ldapadmindn               = cn=admin,o=sfs&lt;br /&gt;        ldapsuffix                = o=sfs&lt;br /&gt;        ldapusersuffix            = ou=Users&lt;br /&gt;        ldapgroupsuffix           = ou=Groups&lt;br /&gt;        ldapmachinesuffix         = ou=Computers&lt;br /&gt;        ldapdeletedn              = Yes&lt;br /&gt;        adduserscript             = /usr/sbin/smbldap-useradd -m &quot;%u&quot;&lt;br /&gt;addgroupscript            = /usr/sbin/smbldap-groupadd -p &quot;%g&quot;&lt;br /&gt;        deleteuserfromgroupscript = /usr/sbin/smbldap-groupmod -x &quot;%u&quot; &quot;%g&quot;&lt;br /&gt;        deletegroupscript         = /usr/sbin/smbldap-groupdel &quot;%g&quot;&lt;br /&gt;        addusertogroupscript      = /usr/sbin/smbldap-groupmod -m &quot;%u&quot; &quot;%g&quot;&lt;br /&gt;        setprimarygroupscript     = /usr/sbin/smbldap-usermod -g &quot;%g&quot; &quot;%u&quot;&lt;br /&gt;        addmachinescript          = /usr/sbin/smbldap-useradd -w &quot;%u&quot;&lt;br /&gt;        deleteuserscript          = /usr/sbin/smbldap-userdel &quot;%u&quot;&lt;br /&gt;        passwdchat                = &quot;Changing password for*\nNew password*&quot; %n\n &quot;*Retype new passw$&lt;br /&gt;         passwdprogram             = /usr/sbin/smbldap-passwd -u %u&lt;br /&gt;unixpasswordsync = yes&lt;br /&gt;ldappasswdsync = yes&lt;br /&gt;        ldaptimeout               = 5  &lt;br /&gt;        loglevel                  = 0 &lt;br /&gt;        interfaces                = eth0,lo&lt;br /&gt;        passdbbackend             = ldapsam:ldap://ldap.stress-free.co.nz/&lt;br /&gt;        loadprinters              = no&lt;br /&gt;        winssupport               = yes&lt;br /&gt;        changesharecommand        = /usr/local/sbin/add_delete_share.pl&lt;br /&gt;        addsharecommand           = /usr/local/sbin/add_delete_share.pl&lt;br /&gt;        deletesharecommand        = /usr/local/sbin/add_delete_share.pl&lt;br /&gt;        serverstring              = StressFree file and print server&lt;br /&gt;        oslevel                   = 65&lt;br /&gt;        svcctllist                = cups apache2 mysql scalix scalix-tomcat dnsmasq smb nmb &lt;br /&gt;&lt;br /&gt;        ## Section - [netlogon]&lt;br /&gt;[netlogon]&lt;br /&gt;        browseable                = No&lt;br /&gt;        comment                   = Network Logon Service&lt;br /&gt;        path                      = /var/lib/samba/netlogon&lt;br /&gt;        writelist                 = root &lt;br /&gt;&lt;br /&gt; ## Section - [profiles]&lt;br /&gt; [profiles]&lt;br /&gt;         cscpolicy                 = disable&lt;br /&gt;         directorymask             = 0700&lt;br /&gt;         createmask                = 0600&lt;br /&gt;         browseable                = No&lt;br /&gt;         path                      = /home/profiles&lt;br /&gt;         forceuser                 = %U   &lt;br /&gt;         guestok                   = Yes&lt;br /&gt;         readonly                  = no&lt;br /&gt;         profileacls               = yes&lt;br /&gt;&lt;br /&gt;## Section - [music]&lt;br /&gt;[music]&lt;br /&gt;        createmask                = 664&lt;br /&gt;        directorymask             = 0775&lt;br /&gt;        browseable                = yes&lt;br /&gt;        writeable                 = yes&lt;br /&gt;        path                      = /home/music&lt;br /&gt;        guestok                   = no  &lt;br /&gt;        comment                   = Music volume&lt;br /&gt;        forcegroup                = users&lt;br /&gt;&lt;br /&gt;## Section - [homes]&lt;br /&gt;[homes]&lt;br /&gt;        readonly                  = No   &lt;br /&gt;        browseable                = No&lt;br /&gt;        comment                   = Home Directories&lt;br /&gt;        inheritacls               = Yes&lt;br /&gt;        validusers                = %S &lt;br /&gt;&lt;/p&gt;&lt;p&gt;With the above configuration many aspects of Samba can be configured directly within Windows (NT4, 2000, XP) using the &lt;a href=&quot;http://support.microsoft.com/kb/173673&quot;&gt;srvtools.exe&lt;/a&gt; package. To administer these settings you must be logged into the domain as a Domain Administrator. This &lt;a href=&quot;http://www.informationweek.com/news/showArticle.jhtml?articleID=193303529&amp;amp;pgno=1&amp;amp;queryText=&quot;&gt;InformationWeek article&lt;/a&gt; talks more about the extended Samba/Windows administration features which turn out to be quite powerful. &lt;/p&gt;&lt;p&gt;In the above example I have configured Windows-based services and shares controlling. Whilst not as powerful as command line access these pieces of functionality are very useful to have in environments where the day-to-day administrator is not competent with a Linux command line.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When setting these things up always remember to checkout the very thorough &lt;a href=&quot;http://samba.org/samba/docs/man/manpages-3/smb.conf.5.html&quot;&gt;smb.conf Man file&lt;/a&gt; and &lt;a href=&quot;http://samba.org/samba/docs/&quot;&gt;Samba documentation&lt;/a&gt;.&lt;/p&gt;&lt;table border=&quot;0&quot; class=&quot;imagetable&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;/sites/default/files/images/tutorials/samba/samba_services_lg.jpg&quot;&gt;&lt;img src=&quot;/sites/default/files/images/tutorials/samba/samba_services_sm.jpg&quot; alt=&quot;&quot; width=&quot;225&quot; height=&quot;168&quot; /&gt;&lt;br /&gt;Manage Linux services from Windows &lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;/sites/default/files/images/tutorials/samba/samba_shares_lg.jpg&quot;&gt;&lt;img src=&quot;/sites/default/files/images/tutorials/samba/samba_shares_sm.jpg&quot; alt=&quot;&quot; width=&quot;225&quot; height=&quot;168&quot; /&gt;&lt;br /&gt;Manage Samba shares from the desktop&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Services Control&lt;/h2&gt;&lt;p&gt;The services running on the Linux server can be controlled from Windows via Samba as of version 3.0.21. This functionality integrates into the NT4 Server Manager applet and 2000/XP MMC snap-in. Configuring it is very easy and requires two steps:&lt;/p&gt;&lt;p&gt;1. Create symlinks for the services you wish Samba to be able to control in &lt;strong&gt;/usr/lib/samba/svcctl&lt;/strong&gt; to the service scripts in &lt;strong&gt;/etc/init.d&lt;/strong&gt;. For example to control MySQL from Samba:&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;ln -s /etc/init.d/mysql /usr/lib/samba/svcctl/mysql &lt;/p&gt;&lt;p&gt;2. Once the symlinks are created to the relevant Linux services edit the &lt;strong&gt;/etc/samba/smb.conf&lt;/strong&gt; file and set the svcctl parameter in the [global] section:&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;        svcctllist                = mysql&lt;/p&gt;&lt;p&gt;Restart Samba and now when you browse to the Linux server in Server Manager or MMC and view its services you will see the MySQL service, its status and have the option to start or stop it.&lt;/p&gt;&lt;h2&gt;Share Management&lt;/h2&gt;&lt;p&gt;NT4 Server Manager allows the directory shares for the server to be manipulated. This task is performed by either a perl or python script found in &lt;strong&gt;/usr/share/doc/packages/samba/examples/scripts/shares&lt;/strong&gt;. &lt;/p&gt;&lt;p&gt;Locate the modify_samba_config.pl file found within the above directory and copy it to /usr/local/sbin. For clarity I also rename it to &lt;strong&gt;add_delete_share.pl&lt;/strong&gt;. I have found that in Samba 3.0.23 this script must be modified in order for things to work correctly, edit the file and find the following lines:&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;elsif ($#ARGV == 3) {&lt;br /&gt;        $add_mode = 1;&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;and change it to read (change the 3 to a 4):&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;elsif ($#ARGV == 4) {&lt;br /&gt;        $add_mode = 1;&lt;br /&gt;} &lt;/p&gt;&lt;p&gt;Now edit the &lt;strong&gt;/etc/samba/smb.conf&lt;/strong&gt; file and add the following configuration options:&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;changesharecommand        = /usr/local/sbin/add_delete_share.pl&lt;br /&gt;        addsharecommand           = /usr/local/sbin/add_delete_share.pl&lt;br /&gt;        deletesharecommand        = /usr/local/sbin/add_delete_share.pl&lt;/p&gt;&lt;p&gt;Restart Samba and you should find the shares on the server can be modified as required. Do note however that this script is not very advanced and does not provide advanced privileges support, it only creates basic shares. Also be aware that when using the Server Management tool the path to shared directories must be entered in a Windows centric format, for example c:\home\david for /home/david.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/samba&quot;&gt;samba&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/ldap&quot;&gt;ldap&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Mon, 30 Oct 2006 05:00:56 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">343 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>SuSE/OpenLDAP/Samba Howto</title>
 <link>https://www.stress-free.co.nz/suse_openldap_samba_howto</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;p&gt;This tutorial assumes you are familar with basic Linux and Windows concepts and are comfortable using SuSE Linux 9 (Professional or Enterprize). SuSE 9.2 Professional was used during the production of this guide but for most part the commands, software and general concepts should be applicable on any current version of SuSE (or OpenSUSE).    &lt;br /&gt;To ease configuration it is very helpful to do most things from another desktop so that you can use really useful utilities like graphical Internet browsers and copy/paste tools. &lt;/p&gt;&lt;h2&gt;Setting up the basic system&lt;/h2&gt;  &lt;p&gt;First off install your basic SuSE system. For this tutorial I used SuSE 9.2 Professional with the network install CD using the local New Zealand mirror at &lt;a href=&quot;http://linux.jetstreamgames.co.nz/suse/i386/9.2&quot;&gt;http://linux.jetstreamgames.co.nz/suse/i386/9.2&lt;/a&gt;    &lt;br /&gt;I prefer to perform an initial basic install with no extra packages or windowing environment. Using this strategy I have complete control over what goes on the system as far as software is concerned. This is important as a default SuSE install will put alot of unnecessary applications and libraries onto your server. &lt;/p&gt;&lt;p&gt;Once the base install is complete using Yast to install openldap, samba, apache2-prefork and php (with ldap &amp;amp; session support). If you are not sure how to do this log in as root and type yast (enter) in the terminal. To install packages select Software -&amp;gt; Install and Remove Software. &lt;/p&gt;&lt;p&gt;Run Online update (Software -&amp;gt; Online Update) afterwards to make sure you are at current working levels. There is a bug in the default install of PHP session support on SuSE 9.2. Without running Online Update you won’t get far in this tutorial as Apache will have problems running. &lt;/p&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/suse&quot;&gt;suse&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tutorials&quot;&gt;software tutorials&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/samba&quot;&gt;samba&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/ldap&quot;&gt;ldap&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Thu, 24 Aug 2006 03:55:25 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">490 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>SuSE/OpenLDAP/Samba Added to Tutorials</title>
 <link>https://www.stress-free.co.nz/suse_openldap_samba_added_to_tutorials</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img src=&quot;/sites/default/files/images/news/suse.gif&quot; border=&quot;0&quot; alt=&quot;Novell SuSE&quot; hspace=&quot;0&quot; vspace=&quot;0&quot; width=&quot;160&quot; height=&quot;114&quot; /&gt;&lt;/div&gt; Today I finished a howto that goes through the steps to &lt;a href=&quot;/node/126/59/&quot;&gt;setup a Samba Primary Domain Controller (PDC) with an OpenLDAP backend on SuSE&lt;/a&gt;. The tutorial draws together a lot of the things I have learnt over the last few weeks working with Samba and OpenLDAP. If anyone reads it through and finds errors (both practical and grammatical) then please &lt;a href=&quot;https://www.stress-free.co.nz/contact/&quot;&gt;get in touch&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/samba&quot;&gt;samba&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/ldap&quot;&gt;ldap&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Mon, 12 Sep 2005 11:30:20 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">127 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>SuSE, Samba3 &amp; OpenLDAP</title>
 <link>https://www.stress-free.co.nz/suse_samba3_openldap</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    Over the last week I have been doing quite a bit of work with SuSE, Samba3 and OpenLDAP. I must say although difficult to setup the first time it is really nice to have all your user accounts managed from one central location. I have just installed a new SuSE server running this combination into a clients office and it is looking very good indeed. All of the basic work is done all that needs to happen now is get all the Windows machines bound the domain and install the printer drivers onto the server for painless printer adding.&lt;br /&gt;&lt;br /&gt;Some useful links I have found to help set all this up are:&lt;br /&gt;&lt;a href=&quot;http://www.osnews.com/story.php?news_id=6684&amp;amp;page=1&quot;&gt;Setting up Samba3 as a PDC&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://ccfaq.valar.co.uk/modules.php?name=News&amp;amp;file=article&amp;amp;sid=254&quot;&gt;How to create a PDC with Samba3&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.oreilly.com/catalog/samba/chapter/book/ch06_06.html&quot;&gt;Samba Logon Scripts&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: bold&quot;&gt;Update: &lt;/span&gt;Getting the machines on the domain was simplier than I imagined. Everything seems to be running very well so tonight I will give the &lt;a href=&quot;http://www.openantivirus.org/projects.php&quot;&gt;Samba-Vscan&lt;/a&gt; module a go. If this works out I should have server side anti-virus scanning of my Samba shares thanks to &lt;a href=&quot;http://www.clamav.net/&quot;&gt;ClamAV&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;   &lt;br /&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/suse&quot;&gt;suse&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/samba&quot;&gt;samba&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/ldap&quot;&gt;ldap&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Sun, 28 Aug 2005 12:02:05 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">117 at https://www.stress-free.co.nz</guid>
</item>
</channel>
</rss>
