1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 15. A Collection of Useful Tidbits</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="Samba-3 by Example"><link rel="up" href="RefSection.html" title="Part III. Reference Section"><link rel="prev" href="ch14.html" title="Chapter 14. Samba Support"><link rel="next" href="primer.html" title="Chapter 16. Networking Primer"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. A Collection of Useful Tidbits</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch14.html">Prev</a> </td><th width="60%" align="center">Part III. Reference Section</th><td width="20%" align="right"> <a accesskey="n" href="primer.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="appendix"></a>Chapter 15. A Collection of Useful Tidbits</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="appendix.html#domjoin">Joining a Domain: Windows 200x/XP Professional</a></span></dt><dt><span class="sect1"><a href="appendix.html#id2590459">Samba System File Location</a></span></dt><dt><span class="sect1"><a href="appendix.html#id2590879">Starting Samba</a></span></dt><dt><span class="sect1"><a href="appendix.html#id2591228">DNS Configuration Files</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix.html#id2591240">The Forward Zone File for the Loopback Adaptor</a></span></dt><dt><span class="sect2"><a href="appendix.html#id2591288">The Reverse Zone File for the Loopback Adaptor</a></span></dt><dt><span class="sect2"><a href="appendix.html#id2591392">DNS Root Server Hint File</a></span></dt></dl></dd><dt><span class="sect1"><a href="appendix.html#altldapcfg">Alternative LDAP Database Initialization</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix.html#id2591451">Initialization of the LDAP Database</a></span></dt></dl></dd><dt><span class="sect1"><a href="appendix.html#id2592021">The LDAP Account Manager</a></span></dt><dt><span class="sect1"><a href="appendix.html#id2593010">IDEALX Management Console</a></span></dt><dt><span class="sect1"><a href="appendix.html#ch12-SUIDSGID">Effect of Setting File and Directory SUID/SGID Permissions Explained</a></span></dt><dt><span class="sect1"><a href="appendix.html#ch12dblck">Shared Data Integrity</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix.html#id2593485">Microsoft Access</a></span></dt><dt><span class="sect2"><a href="appendix.html#id2593632">Act! Database Sharing</a></span></dt><dt><span class="sect2"><a href="appendix.html#id2593716">Opportunistic Locking Controls</a></span></dt></dl></dd></dl></div><p>
2 <a class="indexterm" name="id2589880"></a>
3 <a class="indexterm" name="id2589886"></a>
4 Information presented here is considered to be either basic or well-known material that is informative
5 yet helpful. Over the years, I have observed an interesting behavior. There is an expectation that
6 the process for joining a Windows client to a Samba-controlled Windows domain may somehow involve steps
7 different from doing so with Windows NT4 or a Windows ADS domain. Be assured that the steps are identical,
8 as shown in the example given below.
9 </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="domjoin"></a>Joining a Domain: Windows 200x/XP Professional</h2></div></div></div><p>
10 <a class="indexterm" name="id2589917"></a>
11 Microsoft Windows NT/200x/XP Professional platforms can participate in Domain Security.
12 This section steps through the process for making a Windows 200x/XP Professional machine a
13 member of a Domain Security environment. It should be noted that this process is identical
14 when joining a domain that is controlled by Windows NT4/200x as well as a Samba PDC.
15 </p><div class="procedure"><a name="id2589931"></a><p class="title"><b>Procedure 15.1. Steps to Join a Domain</b></p><ol type="1"><li><p>
16 Click <span class="guimenu">Start</span>.
18 Right-click <span class="guimenu">My Computer</span>, and then select <span class="guimenuitem">Properties</span>.
20 The opening panel is the same one that can be reached by clicking <span class="guimenu">System</span> on the Control Panel.
21 See <a href="appendix.html#swxpp001" title="Figure 15.1. The General Panel.">???</a>.
22 </p><div class="figure"><a name="swxpp001"></a><p class="title"><b>Figure 15.1. The General Panel.</b></p><div class="mediaobject"><img src="images/wxpp001.png" alt="The General Panel."></div></div><p>
24 Click the <span class="guimenu">Computer Name</span> tab.
25 This panel shows the <span class="guimenuitem">Computer Description</span>, the <span class="guimenuitem">Full computer name</span>,
26 and the <span class="guimenuitem">Workgroup</span> or <span class="guimenuitem">Domain name</span>.
28 Clicking the <span class="guimenu">Network ID</span> button launches the configuration wizard. Do not use this with
29 Samba-3. If you wish to change the computer name, or join or leave the domain, click the <span class="guimenu">Change</span> button.
30 See <a href="appendix.html#swxpp004" title="Figure 15.2. The Computer Name Panel.">???</a>.
31 </p><div class="figure"><a name="swxpp004"></a><p class="title"><b>Figure 15.2. The Computer Name Panel.</b></p><div class="mediaobject"><img src="images/wxpp004.png" alt="The Computer Name Panel."></div></div><p>
33 Click on <span class="guimenu">Change</span>. This panel shows that our example machine (TEMPTATION) is in a workgroup called WORKGROUP.
34 We join the domain called MIDEARTH. See <a href="appendix.html#swxpp006" title="Figure 15.3. The Computer Name Changes Panel">???</a>.
35 </p><div class="figure"><a name="swxpp006"></a><p class="title"><b>Figure 15.3. The Computer Name Changes Panel</b></p><div class="mediaobject"><img src="images/wxpp006.png" alt="The Computer Name Changes Panel"></div></div><p>
37 Enter the name <span class="guimenu">MIDEARTH</span> in the field below the Domain radio button.
39 This panel shows that our example machine (TEMPTATION) is set to join the domain called MIDEARTH. See <a href="appendix.html#swxpp007" title="Figure 15.4. The Computer Name Changes Panel Domain MIDEARTH">???</a>.
40 </p><div class="figure"><a name="swxpp007"></a><p class="title"><b>Figure 15.4. The Computer Name Changes Panel Domain MIDEARTH</b></p><div class="mediaobject"><img src="images/wxpp007.png" alt="The Computer Name Changes Panel Domain MIDEARTH"></div></div><p>
42 Now click the <span class="guimenu">OK</span> button. A dialog box should appear to allow you to provide the credentials (username and password)
43 of a domain administrative account that has the rights to add machines to the domain.
45 Enter the name “<span class="quote">root</span>” and the root password from your Samba-3 server. See <a href="appendix.html#swxpp008" title="Figure 15.5. Computer Name Changes User name and Password Panel">???</a>.
46 </p><div class="figure"><a name="swxpp008"></a><p class="title"><b>Figure 15.5. Computer Name Changes User name and Password Panel</b></p><div class="mediaobject"><img src="images/wxpp008.png" alt="Computer Name Changes User name and Password Panel"></div></div><p>
48 Click <span class="guimenu">OK</span>.
50 The “<span class="quote">Welcome to the MIDEARTH domain</span>” dialog box should appear. At this point, the machine must be rebooted.
51 Joining the domain is now complete.
52 </p></li></ol></div><p>
53 <a class="indexterm" name="id2590349"></a>
54 <a class="indexterm" name="id2590356"></a>
55 The screen capture shown in <a href="appendix.html#swxpp007" title="Figure 15.4. The Computer Name Changes Panel Domain MIDEARTH">???</a> has a button labeled <span class="guimenu">More...</span>. This button opens a
56 panel in which you can set (or change) the Primary DNS suffix of the computer. This is a parameter that mainly affects members
57 of Microsoft Active Directory. Active Directory is heavily oriented around the DNS namespace.
59 <a class="indexterm" name="id2590382"></a>
60 <a class="indexterm" name="id2590389"></a>
61 Where NetBIOS technology uses WINS as well as UDP broadcast as key mechanisms for name resolution, Active Directory servers
62 register their services with the Microsoft Dynamic DNS server. Windows clients must be able to query the correct DNS server
63 to find the services (like which machines are domain controllers or which machines have the Netlogon service running).
65 <a class="indexterm" name="id2590407"></a>
66 The default setting of the Primary DNS suffix is the Active Directory domain name. When you change the Primary DNS suffix,
67 this does not affect domain membership, but it can break network browsing and the ability to resolve your computer name to
70 The Primary DNS suffix parameter principally affects MS Windows clients that are members of an Active Directory domain.
71 Where the client is a member of a Samba domain, it is preferable to leave this field blank.
73 <a class="indexterm" name="id2590431"></a>
74 According to Microsoft documentation, “<span class="quote">If this computer belongs to a group with <code class="constant">Group Policy</code>
75 enabled on <span><strong class="command">Primary DNS suffice of this computer</strong></span>, the string specified in the Group Policy is used
76 as the primary DNS suffix and you might need to restart your computer to view the correct setting. The local setting is
77 used only if Group Policy is disabled or unspecified.</span>”
78 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2590459"></a>Samba System File Location</h2></div></div></div><p><a class="indexterm" name="id2590466"></a><a class="indexterm" name="id2590474"></a><a class="indexterm" name="id2590482"></a>
79 One of the frustrations expressed by subscribers to the Samba mailing lists revolves around the choice of where the default Samba Team
80 build and installation process locates its Samba files. The location, chosen in the early 1990s, for the default installation is
81 in the <code class="filename">/usr/local/samba</code> directory. This is a perfectly reasonable location, particularly given all the other
82 Open Source software that installs into the <code class="filename">/usr/local</code> subdirectories.
84 Several UNIX vendors, and Linux vendors in particular, elected to locate the Samba files in a location other than the Samba Team
86 </p><p><a class="indexterm" name="id2590518"></a><a class="indexterm" name="id2590529"></a><a class="indexterm" name="id2590537"></a><a class="indexterm" name="id2590548"></a><a class="indexterm" name="id2590556"></a><a class="indexterm" name="id2590567"></a><a class="indexterm" name="id2590575"></a><a class="indexterm" name="id2590583"></a><a class="indexterm" name="id2590591"></a><a class="indexterm" name="id2590598"></a><a class="indexterm" name="id2590606"></a><a class="indexterm" name="id2590614"></a><a class="indexterm" name="id2590622"></a><a class="indexterm" name="id2590630"></a><a class="indexterm" name="id2590638"></a><a class="indexterm" name="id2590646"></a>
87 Linux vendors, working in conjunction with the Free Standards Group (FSG), Linux Standards Base (LSB), and File Hierarchy
88 System (FHS), have elected to locate the configuration files under the <code class="filename">/etc/samba</code> directory, common binary
89 files (those used by users) in the <code class="filename">/usr/bin</code> directory, and the administrative files (daemons) in the
90 <code class="filename">/usr/sbin</code> directory. Support files for the Samba Web Admin Tool (SWAT) are located under the
91 <code class="filename">/usr/share</code> directory, either in <code class="filename">/usr/share/samba/swat</code> or in
92 <code class="filename">/usr/share/swat</code>. There are additional support files for <span><strong class="command">smbd</strong></span> in the
93 <code class="filename">/usr/lib/samba</code> directory tree. The files located there include the dynamically loadable modules for the
94 passdb backend as well as for the VFS modules.
95 </p><p><a class="indexterm" name="id2590715"></a><a class="indexterm" name="id2590723"></a><a class="indexterm" name="id2590731"></a>
96 Samba creates runtime control files and generates log files. The runtime control files (tdb and dat files) are stored in
97 the <code class="filename">/var/lib/samba</code> directory. Log files are created in <code class="filename">/var/log/samba.</code>
99 When Samba is built and installed using the default Samba Team process, all files are located under the
100 <code class="filename">/usr/local/samba</code> directory tree. This makes it simple to find the files that Samba owns.
101 </p><p><a class="indexterm" name="id2590770"></a>
102 One way to find the Samba files that are installed on your UNIX/Linux system is to search for the location
103 of all files called <span><strong class="command">smbd</strong></span>. Here is an example:
104 </p><pre class="screen">
105 <code class="prompt">root# </code> find / -name smbd -print
107 You can find the location of the configuration files by running:
108 </p><pre class="screen">
109 <code class="prompt">root# </code> /path-to-binary-file/smbd -b | more
114 SWATDIR: /usr/share/samba/swat
115 CONFIGFILE: /etc/samba/smb.conf
116 LOGFILEBASE: /var/log/samba
117 LMHOSTSFILE: /etc/samba/lmhosts
118 LIBDIR: /usr/lib/samba
120 LOCKDIR: /var/lib/samba
121 PIDDIR: /var/run/samba
122 SMB_PASSWD_FILE: /etc/samba/smbpasswd
123 PRIVATE_DIR: /etc/samba
126 If you wish to locate the Samba version, just run:
127 </p><pre class="screen">
128 <code class="prompt">root# </code> /path-to-binary-file/smbd -V
132 Many people have been caught by installation of Samba using the default Samba Team process when it was already installed
133 by the platform vendor's method. If your platform uses RPM format packages, you can check to see if Samba is installed by
134 executing:<a class="indexterm" name="id2590843"></a>
135 </p><pre class="screen">
136 <code class="prompt">root# </code> rpm -qa | grep samba
139 samba3-winbind-3.0.20-1
141 samba3-python-3.0.20-1
142 samba3-utils-3.0.20-1
144 samba3-client-3.0.20-1
145 samba3-cifsmount-3.0.20-1
146 </pre><p><a class="indexterm" name="id2590866"></a>
147 The package names, of course, vary according to how the vendor, or the binary package builder, prepared them.
148 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2590879"></a>Starting Samba</h2></div></div></div><p><a class="indexterm" name="id2590886"></a>
149 Samba essentially consists of two or three daemons. A daemon is a UNIX application that runs in the background and provides services.
150 An example of a service is the Apache Web server for which the daemon is called <span><strong class="command">httpd</strong></span>. In the case of Samba, there
151 are three daemons, two of which are needed as a minimum.
153 The Samba server is made up of the following daemons:
154 </p><div class="example"><a name="ch12SL"></a><p class="title"><b>Example 15.1. A Useful Samba Control Script for SUSE Linux</b></p><pre class="screen">
157 # Script to start/stop samba
158 # Locate this in /sbin as a file called 'samba'
162 if [ z$1 == 'z' ]; then
163 echo $0 - No arguments given; must be start or stop.
167 if [ $1 == 'start' ]; then
173 if [ $1 == 'stop' ]; then
178 if [ $1 == 'restart' ]; then
188 </pre></div><div class="variablelist"><dl><dt><span class="term">nmbd</span></dt><dd><p>
189 <a class="indexterm" name="id2590948"></a>
190 <a class="indexterm" name="id2590955"></a>
191 This daemon handles all name registration and resolution requests. It is the primary vehicle involved
192 in network browsing. It handles all UDP-based protocols. The <span><strong class="command">nmbd</strong></span> daemon should
193 be the first command started as part of the Samba startup process.
194 </p></dd><dt><span class="term">smbd</span></dt><dd><p>
195 <a class="indexterm" name="id2590985"></a>
196 <a class="indexterm" name="id2590991"></a>
197 This daemon handles all TCP/IP-based connection services for file- and print-based operations. It also
198 manages local authentication. It should be started immediately following the startup of <span><strong class="command">nmbd</strong></span>.
199 </p></dd><dt><span class="term">winbindd</span></dt><dd><p>
200 <a class="indexterm" name="id2591020"></a>
201 <a class="indexterm" name="id2591027"></a>
202 This daemon should be started when Samba is a member of a Windows NT4 or ADS domain. It is also needed when
203 Samba has trust relationships with another domain. The <span><strong class="command">winbindd</strong></span> daemon will check the
204 <code class="filename">smb.conf</code> file for the presence of the <em class="parameter"><code>idmap uid</code></em> and <em class="parameter"><code>idmap gid</code></em>
205 parameters. If they are not found, <span><strong class="command">winbindd</strong></span> bails out and refuses to start.
206 </p></dd></dl></div><p>
207 When Samba has been packaged by an operating system vendor, the startup process is typically a custom feature of its
208 integration into the platform as a whole. Please refer to your operating system platform administration manuals for
209 specific information pertaining to correct management of Samba startup.
210 </p><div class="example"><a name="ch12RHscript"></a><p class="title"><b>Example 15.2. A Sample Samba Control Script for Red Hat Linux</b></p><pre class="screen">
213 # chkconfig: 345 81 35
214 # description: Starts and stops the Samba smbd and nmbd daemons \
215 # used to provide SMB network services.
217 # Source function library.
218 . /etc/rc.d/init.d/functions
219 # Source networking configuration.
220 . /etc/sysconfig/network
221 # Check that networking is up.
222 [ ${NETWORKING} = "no" ] && exit 0
223 CONFIG=/etc/samba/smb.conf
224 # Check that smb.conf exists.
225 [ -f $CONFIG ] || exit 0
227 # See how we were called.
230 echo -n "Starting SMB services: "
231 daemon smbd -D; daemon nmbd -D; echo;
232 touch /var/lock/subsys/smb
235 echo -n "Shutting down SMB services: "
236 smbdpids=`ps guax | grep smbd | grep -v grep | awk '{print $2}'`
237 for pid in $smbdpids; do
240 killproc nmbd -TERM; rm -f /var/lock/subsys/smb
244 status smbd; status nmbd;
247 echo -n "Restarting SMB services: "
252 echo "Usage: smb {start|stop|restart|status}"
255 </pre></div><p><a class="indexterm" name="id2591149"></a>
256 SUSE Linux implements individual control over each Samba daemon. A Samba control script that can be conveniently
257 executed from the command line is shown in <a href="appendix.html#ch12SL" title="Example 15.1. A Useful Samba Control Script for SUSE Linux">???</a>. This can be located in the directory
258 <code class="filename">/sbin</code> in a file called <code class="filename">samba</code>. This type of control script should be
259 owned by user root and group root, and set so that only root can execute it.
260 </p><p><a class="indexterm" name="id2591185"></a>
261 A sample startup script for a Red Hat Linux system is shown in <a href="appendix.html#ch12RHscript" title="Example 15.2. A Sample Samba Control Script for Red Hat Linux">???</a>.
262 This file could be located in the directory <code class="filename">/etc/rc.d</code> and can be called
263 <code class="filename">samba</code>. A similar startup script is required to control <span><strong class="command">winbind</strong></span>.
264 If you want to find more information regarding startup scripts please refer to the packaging section of
265 the Samba source code distribution tarball. The packaging files for each platform include a
266 startup control file.
267 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2591228"></a>DNS Configuration Files</h2></div></div></div><p>
268 The following files are common to all DNS server configurations. Rather than repeat them multiple times, they
269 are presented here for general reference.
270 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2591240"></a>The Forward Zone File for the Loopback Adaptor</h3></div></div></div><p>
271 The forward zone file for the loopback address never changes. An example file is shown
272 in <a href="appendix.html#loopback" title="Example 15.3. DNS Localhost Forward Zone File: /var/lib/named/localhost.zone">???</a>. All traffic destined for an IP address that is hosted on a
273 physical interface on the machine itself is routed to the loopback adaptor. This is
274 a fundamental design feature of the TCP/IP protocol implementation. The loopback adaptor
275 is called <code class="constant">localhost</code>.
276 </p><div class="example"><a name="loopback"></a><p class="title"><b>Example 15.3. DNS Localhost Forward Zone File: <code class="filename">/var/lib/named/localhost.zone</code></b></p><pre class="screen">
287 </pre></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2591288"></a>The Reverse Zone File for the Loopback Adaptor</h3></div></div></div><p>
288 The reverse zone file for the loopback address as shown in <a href="appendix.html#dnsloopy" title="Example 15.4. DNS Localhost Reverse Zone File: /var/lib/named/127.0.0.zone">???</a>
289 is necessary so that references to the address <code class="constant">127.0.0.1</code> can be
290 resolved to the correct name of the interface.
291 </p><div class="example"><a name="dnsloopy"></a><p class="title"><b>Example 15.4. DNS Localhost Reverse Zone File: <code class="filename">/var/lib/named/127.0.0.zone</code></b></p><pre class="screen">
293 @ IN SOA localhost. root.localhost. (
302 </pre></div><div class="example"><a name="roothint"></a><p class="title"><b>Example 15.5. DNS Root Name Server Hint File: <code class="filename">/var/lib/named/root.hint</code></b></p><pre class="screen">
303 ; This file is made available by InterNIC under anonymous FTP as
304 ; file /domain/named.root
305 ; on server FTP.INTERNIC.NET
306 ; last update: Nov 5, 2002. Related version of root zone: 2002110501
307 ; formerly NS.INTERNIC.NET
308 . 3600000 IN NS A.ROOT-SERVERS.NET.
309 A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
310 ; formerly NS1.ISI.EDU
311 . 3600000 NS B.ROOT-SERVERS.NET.
312 B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
314 . 3600000 NS C.ROOT-SERVERS.NET.
315 C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
316 ; formerly TERP.UMD.EDU
317 . 3600000 NS D.ROOT-SERVERS.NET.
318 D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
319 ; formerly NS.NASA.GOV
320 . 3600000 NS E.ROOT-SERVERS.NET.
321 E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
322 ; formerly NS.ISC.ORG
323 . 3600000 NS F.ROOT-SERVERS.NET.
324 F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
325 ; formerly NS.NIC.DDN.MIL
326 . 3600000 NS G.ROOT-SERVERS.NET.
327 G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
328 ; formerly AOS.ARL.ARMY.MIL
329 . 3600000 NS H.ROOT-SERVERS.NET.
330 H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
331 ; formerly NIC.NORDU.NET
332 . 3600000 NS I.ROOT-SERVERS.NET.
333 I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
334 ; operated by VeriSign, Inc.
335 . 3600000 NS J.ROOT-SERVERS.NET.
336 J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30
337 ; housed in LINX, operated by RIPE NCC
338 . 3600000 NS K.ROOT-SERVERS.NET.
339 K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
341 . 3600000 NS L.ROOT-SERVERS.NET.
342 L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12
343 ; housed in Japan, operated by WIDE
344 . 3600000 NS M.ROOT-SERVERS.NET.
345 M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
347 </pre></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2591392"></a>DNS Root Server Hint File</h3></div></div></div><p>
348 The content of the root hints file as shown in <a href="appendix.html#roothint" title="Example 15.5. DNS Root Name Server Hint File: /var/lib/named/root.hint">???</a> changes slowly over time.
349 Periodically this file should be updated from the source shown. Because
350 of its size, this file is located at the end of this chapter.
351 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="altldapcfg"></a>Alternative LDAP Database Initialization</h2></div></div></div><p><a class="indexterm" name="id2591423"></a><a class="indexterm" name="id2591434"></a>
352 The following procedure may be used as an alternative means of configuring
353 the initial LDAP database. Many administrators prefer to have greater control
354 over how system files get configured.
355 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2591451"></a>Initialization of the LDAP Database</h3></div></div></div><p><a class="indexterm" name="id2591458"></a><a class="indexterm" name="id2591466"></a><a class="indexterm" name="id2591478"></a>
356 The first step to get the LDAP server ready for action is to create the LDIF file from
357 which the LDAP database will be preloaded. This is necessary to create the containers
358 into which the user, group, and other accounts are written. It is also necessary to
359 preload the well-known Windows NT Domain Groups, as they must have the correct SID so
360 that they can be recognized as special NT Groups by the MS Windows clients.
361 </p><div class="procedure"><a name="ldapinit"></a><p class="title"><b>Procedure 15.2. LDAP Directory Pre-Load Steps</b></p><ol type="1"><li><p>
362 Create a directory in which to store the files you use to generate
363 the LDAP LDIF file for your system. Execute the following:
364 </p><pre class="screen">
365 <code class="prompt">root# </code> mkdir /etc/openldap/SambaInit
366 <code class="prompt">root# </code> chown root:root /etc/openldap/SambaInit
367 <code class="prompt">root# </code> chmod 700 /etc/openldap/SambaInit
370 Install the files shown in <a href="appendix.html#sbehap-ldapreconfa" title="Example 15.6. LDAP Pre-configuration Script: SMBLDAP-ldif-preconfig.sh Part A">???</a>, <a href="appendix.html#sbehap-ldapreconfb" title="Example 15.7. LDAP Pre-configuration Script: SMBLDAP-ldif-preconfig.sh Part B">???</a>,
371 and <a href="appendix.html#sbehap-ldapreconfc" title="Example 15.8. LDAP Pre-configuration Script: SMBLDAP-ldif-preconfig.sh Part C">???</a> into the directory
372 <code class="filename">/etc/openldap/SambaInit/SMBLDAP-ldif-preconfig.sh.</code> These three files are,
373 respectively, parts A, B, and C of the <code class="filename">SMBLDAP-ldif-preconfig.sh</code> file.
375 Install the files shown in <a href="appendix.html#sbehap-ldifpata" title="Example 15.9. LDIF Pattern File Used to Pre-configure LDAP Part A">???</a> and <a href="appendix.html#sbehap-ldifpatb" title="Example 15.10. LDIF Pattern File Used to Pre-configure LDAP Part B">???</a> into the directory
376 <code class="filename">/etc/openldap/SambaInit/.</code> These two files are
377 parts A and B, respectively, of the <code class="filename">init-ldif.pat</code> file.
379 Change to the <code class="filename">/etc/openldap/SambaInit</code> directory. Execute the following:
380 </p><pre class="screen">
381 <code class="prompt">root# </code> sh SMBLDAP-ldif-preconfig.sh
383 How do you wish to refer to your organization?
385 Black Tire Company, Inc.
387 How would you like your organization name to appear?
388 Your organization name is: My Organization
389 Enter a new name is this is not what you want, press Enter to Continue.
390 Name [My Organization]: Abmas Inc.
392 Samba Config File Location [/etc/samba/smb.conf]:
393 Enter a new full path or press Enter to continue.
394 Samba Config File Location [/etc/samba/smb.conf]:
395 Domain Name: MEGANET2
396 Domain SID: S-1-5-21-3504140859-1010554828-2431957765
398 The name of your Internet domain is now needed in a special format
399 as follows, if your domain name is mydomain.org, what we need is
400 the information in the form of:
403 If your fully qualified hostname is: snoopy.bazaar.garagesale.net
404 where "snoopy" is the name of the machine,
405 Then the information needed is:
406 Domain ID: garagesale
409 Found the following domain name: abmas.biz
410 I think the bit we are looking for might be: abmas
411 Enter the domain name or press Enter to continue:
413 The top level organization name I will use is: biz
414 Enter the top level org name or press Enter to continue:
415 <code class="prompt">root# </code>
417 This creates a file called <code class="filename">MEGANET2.ldif</code>.
419 It is now time to preload the LDAP database with the following
421 </p><pre class="screen">
422 <code class="prompt">root# </code> slapadd -v -l MEGANET2.ldif
423 added: "dc=abmas,dc=biz" (00000001)
424 added: "cn=Manager,dc=abmas,dc=biz" (00000002)
425 added: "ou=People,dc=abmas,dc=biz" (00000003)
426 added: "ou=Computers,dc=abmas,dc=biz" (00000004)
427 added: "ou=Groups,dc=abmas,dc=biz" (00000005)
428 added: "ou=Domains,dc=abmas,dc=biz" (00000006)
429 added: "sambaDomainName=MEGANET2,ou=Domains,dc=abmas,dc=biz" (00000007)
430 added: "cn=domadmins,ou=Groups,dc=abmas,dc=biz" (00000008)
431 added: "cn=domguests,ou=Groups,dc=abmas,dc=biz" (00000009)
432 added: "cn=domusers,ou=Groups,dc=abmas,dc=biz" (0000000a)
434 You should verify that the account information was correctly loaded by executing:
435 </p><pre class="screen">
436 <code class="prompt">root# </code> slapcat
438 objectClass: dcObject
439 objectClass: organization
442 description: Posix and Samba LDAP Identity Database
443 structuralObjectClass: organization
444 entryUUID: af552f8e-c4a1-1027-9002-9421e01bf474
445 creatorsName: cn=manager,dc=abmas,dc=biz
446 modifiersName: cn=manager,dc=abmas,dc=biz
447 createTimestamp: 20031217055747Z
448 modifyTimestamp: 20031217055747Z
449 entryCSN: 2003121705:57:47Z#0x0001#0#0000
452 dn: cn=domusers,ou=Groups,dc=abmas,dc=biz
453 objectClass: posixGroup
454 objectClass: sambaGroupMapping
457 sambaSID: S-1-5-21-3504140859-1010554828-2431957765-513
459 displayName: Domain Users
460 description: Domain Users
461 structuralObjectClass: posixGroup
462 entryUUID: af7e98ba-c4a1-1027-900b-9421e01bf474
463 creatorsName: cn=manager,dc=abmas,dc=biz
464 modifiersName: cn=manager,dc=abmas,dc=biz
465 createTimestamp: 20031217055747Z
466 modifyTimestamp: 20031217055747Z
467 entryCSN: 2003121705:57:47Z#0x000a#0#0000
470 Your LDAP database is ready for testing. You can now start the LDAP server
471 using the system tool for your Linux operating system. For SUSE Linux, you can
473 </p><pre class="screen">
474 <code class="prompt">root# </code> rcldap start
477 It is now a good idea to validate that the LDAP server is running correctly.
478 Execute the following:
479 </p><pre class="screen">
480 <code class="prompt">root# </code> ldapsearch -x -b "dc=abmas,dc=biz" "(ObjectClass=*)"
484 # base <dc=abmas,dc=biz> with scope sub
485 # filter: (ObjectClass=*)
491 objectClass: dcObject
492 objectClass: organization
495 description: Posix and Samba LDAP Identity Database
497 # domusers, Groups, abmas.biz
498 dn: cn=domusers,ou=Groups,dc=abmas,dc=biz
499 objectClass: posixGroup
500 objectClass: sambaGroupMapping
503 sambaSID: S-1-5-21-3504140859-1010554828-2431957765-513
505 displayName: Domain Users
506 description: Domain Users
515 Your LDAP server is ready for creation of additional accounts.
516 </p></li></ol></div></div><div class="example"><a name="sbehap-ldapreconfa"></a><p class="title"><b>Example 15.6. LDAP Pre-configuration Script: <code class="filename">SMBLDAP-ldif-preconfig.sh</code> Part A</b></p><pre class="screen">
519 # This script prepares the ldif LDAP load file only
525 # The name of my organization
526 ORGNAME="My Organization"
528 # My Internet domain. ie: if my domain is: buckets.org, INETDOMAIN="buckets"
529 INETDOMAIN="my-domain"
531 # In the above case, md domain is: buckets.org, TLDORG="org"
534 # This is the Samba Domain/Workgroup Name
535 DOMNAME="MYWORKGROUP"
543 How do you wish to refer to your organization?
546 Black Tire Company, Inc.
549 How would you like your organization name to appear?
553 echo "Your organization name is: $ORGNAME"
555 echo "Enter a new name or, press Enter to Continue."
557 </pre></div><div class="example"><a name="sbehap-ldapreconfb"></a><p class="title"><b>Example 15.7. LDAP Pre-configuration Script: <code class="filename">SMBLDAP-ldif-preconfig.sh</code> Part B</b></p><pre class="screen">
558 echo -e -n "Name [$ORGNAME]: "
561 if [ ! -z "$name" ]; then
565 sed "s/ORGNAME/${ORGNAME}/g" < $file > $file.tmp1
567 # Try to find smb.conf
569 if [ -e /usr/local/samba/lib/smb.conf ]; then
570 CONF=/usr/local/samba/lib/smb.conf
571 elif [ -e /etc/samba/smb.conf ]; then
572 CONF=/etc/samba/smb.conf
575 echo "Samba Config File Location [$CONF]: "
577 echo "Enter a new full path or press Enter to continue."
579 echo -n "Samba Config File Location [$CONF]: "
581 if [ ! -z "$name" ]; then
586 # Find the name of our Domain/Workgroup
587 DOMNAME=`grep -i workgroup ${CONF} | sed "s/ //g" | cut -f2 -d=`
588 echo Domain Name: $DOMNAME
591 sed "s/DOMNAME/${DOMNAME}/g" < $file.tmp1 > $file.tmp2
593 DOMSID=`net getlocalsid ${DOMNAME} | cut -f2 -d: | sed "s/ //g"`
594 echo Domain SID: $DOMSID
596 sed "s/DOMSID/${DOMSID}/g" < $file.tmp2 > $file.tmp1
597 </pre></div><div class="example"><a name="sbehap-ldapreconfc"></a><p class="title"><b>Example 15.8. LDAP Pre-configuration Script: <code class="filename">SMBLDAP-ldif-preconfig.sh</code> Part C</b></p><pre class="screen">
599 The name of your Internet domain is now needed in a special format
600 as follows, if your domain name is mydomain.org, what we need is
601 the information in the form of:
605 If your fully qualified hostname is: snoopy.bazaar.garagesale.net
606 where "snoopy" is the name of the machine,
607 Then the information needed is:
608 Domain ID: garagesale
612 INETDOMAIN=`hostname -d | cut -f1 -d.`
613 echo Found the following domain name: `hostname -d`
614 echo "I think the bit we are looking for might be: $INETDOMAIN"
616 echo -n "Enter the domain name or press Enter to continue: "
618 if [ ! -z $domnam ]; then
622 sed "s/INETDOMAIN/${INETDOMAIN}/g" < $file.tmp1 > $file.tmp2
623 TLDORG=`hostname -d | sed "s/${INETDOMAIN}.//g"`
624 echo "The top level organization name I will use is: ${TLDORG}"
626 echo -n "Enter the top level org name or press Enter to continue: "
628 if [ ! -z $domnam ]; then
631 sed "s/TLDORG/${TLDORG}/g" < $file.tmp2 > $DOMNAME.ldif
634 </pre></div><div class="example"><a name="sbehap-ldifpata"></a><p class="title"><b>Example 15.9. LDIF Pattern File Used to Pre-configure LDAP Part A</b></p><pre class="screen">
635 dn: dc=INETDOMAIN,dc=TLDORG
636 objectClass: dcObject
637 objectClass: organization
640 description: Posix and Samba LDAP Identity Database
642 dn: cn=Manager,dc=INETDOMAIN,dc=TLDORG
643 objectClass: organizationalRole
645 description: Directory Manager
647 dn: ou=People,dc=INETDOMAIN,dc=TLDORG
649 objectClass: organizationalUnit
652 dn: ou=Computers,dc=INETDOMAIN,dc=TLDORG
654 objectClass: organizationalUnit
657 dn: ou=Groups,dc=INETDOMAIN,dc=TLDORG
659 objectClass: organizationalUnit
662 dn: ou=Idmap,dc=INETDOMAIN,dc=TLDORG
664 objectClass: organizationalUnit
667 dn: ou=Domains,dc=INETDOMAIN,dc=TLDORG
669 objectClass: organizationalUnit
672 dn: sambaDomainName=DOMNAME,ou=Domains,dc=INETDOMAIN,dc=TLDORG
673 objectClass: sambaDomain
674 sambaDomainName: DOMNAME
676 sambaAlgorithmicRidBase: 1000
677 structuralObjectClass: sambaDomain
678 </pre></div><div class="example"><a name="sbehap-ldifpatb"></a><p class="title"><b>Example 15.10. LDIF Pattern File Used to Pre-configure LDAP Part B</b></p><pre class="screen">
679 dn: cn=domadmins,ou=Groups,dc=INETDOMAIN,dc=TLDORG
680 objectClass: posixGroup
681 objectClass: sambaGroupMapping
686 displayName: Domain Admins
687 description: Domain Administrators
689 dn: cn=domguests,ou=Groups,dc=INETDOMAIN,dc=TLDORG
690 objectClass: posixGroup
691 objectClass: sambaGroupMapping
696 displayName: Domain Guests
697 description: Domain Guests Users
699 dn: cn=domusers,ou=Groups,dc=INETDOMAIN,dc=TLDORG
700 objectClass: posixGroup
701 objectClass: sambaGroupMapping
706 displayName: Domain Users
707 description: Domain Users
708 </pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2592021"></a>The LDAP Account Manager</h2></div></div></div><p>
709 <a class="indexterm" name="id2592029"></a>
710 <a class="indexterm" name="id2592035"></a>
711 <a class="indexterm" name="id2592044"></a>
712 <a class="indexterm" name="id2592051"></a>
713 <a class="indexterm" name="id2592058"></a>
714 <a class="indexterm" name="id2592064"></a>
715 <a class="indexterm" name="id2592071"></a>
716 The LDAP Account Manager (LAM) is an application suite that has been written in PHP.
717 LAM can be used with any Web server that has PHP4 support. It connects to the LDAP
718 server either using unencrypted connections or via SSL/TLS. LAM can be used to manage
719 Posix accounts as well as SambaSAMAccounts for users, groups, and Windows machines
722 LAM is available from the <a href="http://sourceforge.net/projects/lam/" target="_top">LAM</a>
723 home page and from its mirror sites. LAM has been released under the GNU GPL version 2.
724 The current version of LAM is 0.4.9. Release of version 0.5 is expected in the third quarter
727 <a class="indexterm" name="id2592102"></a>
728 <a class="indexterm" name="id2592109"></a>
729 <a class="indexterm" name="id2592116"></a>
731 </p><div class="itemizedlist"><ul type="disc"><li><p>A web server that will work with PHP4.</p></li><li><p>PHP4 (available from the <a href="http://www.php.net/" target="_top">PHP</a> home page.)</p></li><li><p>OpenLDAP 2.0 or later.</p></li><li><p>A Web browser that supports CSS.</p></li><li><p>Perl.</p></li><li><p>The gettext package.</p></li><li><p>mcrypt + mhash (optional).</p></li><li><p>It is also a good idea to install SSL support.</p></li></ul></div><p>
732 LAM is a useful tool that provides a simple Web-based device that can be used to
733 manage the contents of the LDAP directory to:
734 <a class="indexterm" name="id2592177"></a>
735 <a class="indexterm" name="id2592184"></a>
736 <a class="indexterm" name="id2592191"></a>
737 </p><div class="itemizedlist"><ul type="disc"><li><p>Display user/group/host and Domain entries.</p></li><li><p>Manage entries (Add/Delete/Edit).</p></li><li><p>Filter and sort entries.</p></li><li><p>Store and use multiple operating profiles.</p></li><li><p>Edit organizational units (OUs).</p></li><li><p>Upload accounts from a file.</p></li><li><p>Is compatible with Samba-2.2.x and Samba-3.</p></li></ul></div><p>
738 When correctly configured, LAM allows convenient management of UNIX (Posix) and Samba
739 user, group, and windows domain member machine accounts.
741 <a class="indexterm" name="id2592245"></a>
742 <a class="indexterm" name="id2592252"></a>
743 <a class="indexterm" name="id2592259"></a>
744 <a class="indexterm" name="id2592265"></a>
745 The default password is “<span class="quote">lam.</span>” It is highly recommended that you use only
746 an SSL connection to your Web server for all remote operations involving LAM. If you
747 want secure connections, you must configure your Apache Web server to permit connections
748 to LAM using only SSL.
749 </p><div class="procedure"><a name="sbehap-laminst"></a><p class="title"><b>Procedure 15.3. Apache Configuration Steps for LAM</b></p><ol type="1"><li><p>
750 Extract the LAM package by untarring it as shown here:
751 </p><pre class="screen">
752 <code class="prompt">root# </code> tar xzf ldap-account-manager_0.4.9.tar.gz
754 Alternatively, install the LAM DEB for your system using the following command:
755 </p><pre class="screen">
756 <code class="prompt">root# </code> dpkg -i ldap-account-manager_0.4.9.all.deb
759 Copy the extracted files to the document root directory of your Web server.
760 For example, on SUSE Linux Enterprise Server 9, copy to the
761 <code class="filename">/srv/www/htdocs</code> directory.
763 <a class="indexterm" name="id2592345"></a>
764 Set file permissions using the following commands:
765 </p><pre class="screen">
766 <code class="prompt">root# </code> chown -R wwwrun:www /srv/www/htdocs/lam
767 <code class="prompt">root# </code> chmod 755 /srv/www/htdocs/lam/sess
768 <code class="prompt">root# </code> chmod 755 /srv/www/htdocs/lam/tmp
769 <code class="prompt">root# </code> chmod 755 /srv/www/htdocs/lam/config
770 <code class="prompt">root# </code> chmod 755 /srv/www/htdocs/lam/lib/*pl
773 <a class="indexterm" name="id2592398"></a>
774 Using your favorite editor create the following <code class="filename">config.cfg</code>
775 LAM configuration file:
776 </p><pre class="screen">
777 <code class="prompt">root# </code> cd /srv/www/htdocs/lam/config
778 <code class="prompt">root# </code> cp config.cfg_sample config.cfg
779 <code class="prompt">root# </code> vi config.cfg
781 <a class="indexterm" name="id2592439"></a>
782 <a class="indexterm" name="id2592448"></a>
783 An example file is shown in <a href="appendix.html#lamcfg" title="Example 15.11. Example LAM Configuration File config.cfg">???</a>.
784 This is the minimum configuration that must be completed. The LAM profile
785 file can be created using a convenient wizard that is part of the LAM
788 Start your Web server then, using your Web browser, connect to
789 <a href="http://localhost/lam" target="_top">LAM</a> URL. Click on the
790 the <em class="parameter"><code>Configuration Login</code></em> link then click on the
791 Configuration Wizard link to begin creation of the default profile so that
792 LAM can connect to your LDAP server. Alternately, copy the
793 <code class="filename">lam.conf_sample</code> file to a file called
794 <code class="filename">lam.conf</code> then, using your favorite editor,
795 change the settings to match local site needs.
796 </p></li></ol></div><p>
797 <a class="indexterm" name="id2592508"></a>
798 An example of a working file is shown here in <a href="appendix.html#lamconf" title="Example 15.12. LAM Profile Control File lam.conf">???</a>.
799 This file has been stripped of comments to keep the size small. The comments
800 and help information provided in the profile file that the wizard creates
801 is very useful and will help many administrators to avoid pitfalls.
802 Your configuration file obviously reflects the configuration options that
803 are preferred at your site.
805 <a class="indexterm" name="id2592531"></a>
806 It is important that your LDAP server is running at the time that LAM is
807 being configured. This permits you to validate correct operation.
808 An example of the LAM login screen is provided in <a href="appendix.html#lam-login" title="Figure 15.6. The LDAP Account Manager Login Screen">???</a>.
809 </p><div class="figure"><a name="lam-login"></a><p class="title"><b>Figure 15.6. The LDAP Account Manager Login Screen</b></p><div class="mediaobject"><img src="images/lam-login.png" width="270" alt="The LDAP Account Manager Login Screen"></div></div><p>
810 <a class="indexterm" name="id2592594"></a>
811 The LAM configuration editor has a number of options that must be managed correctly.
812 An example of use of the LAM configuration editor is shown in <a href="appendix.html#lam-config" title="Figure 15.7. The LDAP Account Manager Configuration Screen">???</a>.
813 It is important that you correctly set the minimum and maximum UID/GID values that are
814 permitted for use at your site. The default values may not be compatible with a need to
815 modify initial default account values for well-known Windows network users and groups.
816 The best work-around is to temporarily set the minimum values to zero (0) to permit
817 the initial settings to be made. Do not forget to reset these to sensible values before
818 using LAM to add additional users and groups.
819 </p><div class="figure"><a name="lam-config"></a><p class="title"><b>Figure 15.7. The LDAP Account Manager Configuration Screen</b></p><div class="mediaobject"><img src="images/lam-config.png" width="270" alt="The LDAP Account Manager Configuration Screen"></div></div><p>
820 <a class="indexterm" name="id2592666"></a>
821 LAM has some nice, but unusual features. For example, one unexpected feature in most application
822 screens permits the generation of a PDF file that lists configuration information. This is a well
823 thought out facility. This option has been edited out of the following screen shots to conserve
826 <a class="indexterm" name="id2592681"></a>
827 When you log onto LAM the opening screen drops you right into the user manager as shown in
828 <a href="appendix.html#lam-user" title="Figure 15.8. The LDAP Account Manager User Edit Screen">???</a>. This is a logical action as it permits the most-needed facility
829 to be used immediately. The editing of an existing user, as with the addition of a new user,
830 is easy to follow and very clear in both layout and intent. It is a simple matter to edit
831 generic settings, UNIX specific parameters, and then Samba account requirements. Each step
832 involves clicking a button that intuitively drives you through the process. When you have
833 finished editing simply press the <span class="guimenu">Final</span> button.
834 </p><div class="figure"><a name="lam-user"></a><p class="title"><b>Figure 15.8. The LDAP Account Manager User Edit Screen</b></p><div class="mediaobject"><img src="images/lam-users.png" width="270" alt="The LDAP Account Manager User Edit Screen"></div></div><p>
835 The edit screen for groups is shown in <a href="appendix.html#lam-group" title="Figure 15.9. The LDAP Account Manager Group Edit Screen">???</a>. As with the edit screen
836 for user accounts, group accounts may be rapidly dealt with. <a href="appendix.html#lam-group-mem" title="Figure 15.10. The LDAP Account Manager Group Membership Edit Screen">???</a>
837 shows a sub-screen from the group editor that permits users to be assigned secondary group
839 </p><div class="figure"><a name="lam-group"></a><p class="title"><b>Figure 15.9. The LDAP Account Manager Group Edit Screen</b></p><div class="mediaobject"><img src="images/lam-groups.png" width="270" alt="The LDAP Account Manager Group Edit Screen"></div></div><div class="figure"><a name="lam-group-mem"></a><p class="title"><b>Figure 15.10. The LDAP Account Manager Group Membership Edit Screen</b></p><div class="mediaobject"><img src="images/lam-group-members.png" width="270" alt="The LDAP Account Manager Group Membership Edit Screen"></div></div><p>
840 <a class="indexterm" name="id2592861"></a><a class="indexterm" name="id2592866"></a>
841 The final screen presented here is one that you should not normally need to use. Host accounts will
842 be automatically managed using the smbldap-tools scripts. This means that the screen <a href="appendix.html#lam-host" title="Figure 15.11. The LDAP Account Manager Host Edit Screen">???</a>
843 will, in most cases, not be used.
844 </p><div class="figure"><a name="lam-host"></a><p class="title"><b>Figure 15.11. The LDAP Account Manager Host Edit Screen</b></p><div class="mediaobject"><img src="images/lam-hosts.png" width="270" alt="The LDAP Account Manager Host Edit Screen"></div></div><p>
845 One aspect of LAM that may annoy some users is the way it forces certain conventions on
846 the administrator. For example, LAM does not permit the creation of Windows user and group
847 accounts that contain spaces even though the underlying UNIX/Linux
848 operating system may exhibit no problems with them. Given the propensity for using upper-case
849 characters and spaces (particularly in the default Windows account names) this may cause
850 some annoyance. For the rest, LAM is a very useful administrative tool.
852 The next major release, LAM 0.5, will have fewer restrictions and support the latest Samba features
853 (e.g., logon hours). The new plugin-based architecture also allows management of much more different
854 account types like plain UNIX accounts. The upload can now handle groups and hosts, too. Another
855 important point is the tree view which allows browsing and editing LDAP objects directly.
856 </p><div class="example"><a name="lamcfg"></a><p class="title"><b>Example 15.11. Example LAM Configuration File <code class="filename">config.cfg</code></b></p><pre class="screen">
857 # password to add/delete/rename configuration profiles
860 # default profile, without ".conf"
862 </pre></div><div class="example"><a name="lamconf"></a><p class="title"><b>Example 15.12. LAM Profile Control File <code class="filename">lam.conf</code></b></p><pre class="screen">
863 ServerURL: ldap://massive.abmas.org:389
864 Admins: cn=Manager,dc=abmas,dc=biz
866 usersuffix: ou=People,dc=abmas,dc=biz
867 groupsuffix: ou=Groups,dc=abmas,dc=biz
868 hostsuffix: ou=Computers,dc=abmas,dc=biz
869 domainsuffix: ou=Domains,dc=abmas,dc=biz
876 userlistAttributes: #uid;#givenName;#sn;#uidNumber;#gidNumber
877 grouplistAttributes: #cn;#gidNumber;#memberUID;#description
878 hostlistAttributes: #cn;#description;#uidNumber;#gidNumber
880 defaultLanguage: en_GB:ISO-8859-1:English (Great Britain)
886 </pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2593010"></a>IDEALX Management Console</h2></div></div></div><p>
887 IMC (the IDEALX Mamagement Console) is a tool that can be used as the basis for a comprehensive
888 web-based management interface for UNIX and Linux systems.
890 The Samba toolset is the first console developped for IMC. It offers a simple and ergonomic
891 interface for managing a Samba domain controler. The goal is to give Linux administrators who
892 need to manage production Samba servers an effective, intuitive and consistent management
893 experience. An IMC screenshot of the user management tool is shown in <a href="appendix.html#imcidealx" title="Figure 15.12. The IMC Samba User Account Screen">???</a>.
894 </p><div class="figure"><a name="imcidealx"></a><p class="title"><b>Figure 15.12. The IMC Samba User Account Screen</b></p><div class="mediaobject"><img src="images/imc-usermanager2.png" width="216" alt="The IMC Samba User Account Screen"></div></div><p>
895 IMC is built on a set of Perl modules. Most modules are standard CPAN modules. Some are bundled with IMC,
896 but will soon to be hosted on the CPAN independently, like Struts4P, a port of Struts to the Perl language.
898 For further information regarding IMC refer to the web <a href="http://imc.sourceforge.net/" target="_top">site.</a>
899 Prebuilt RPM packages are also <a href="http://imc.sourceforge.net/download.html" target="_top">available.</a>
900 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ch12-SUIDSGID"></a>Effect of Setting File and Directory SUID/SGID Permissions Explained</h2></div></div></div><a class="indexterm" name="id2593115"></a><a class="indexterm" name="id2593122"></a><p>
901 The setting of the SUID/SGID bits on the file or directory permissions flag has particular
902 consequences. If the file is executable and the SUID bit is set, it executes with the privilege
903 of (with the UID of) the owner of the file. For example, if you are logged onto a system as
904 a normal user (let's say as the user <code class="constant">bobj</code>), and you execute a file that is owned
905 by the user <code class="constant">root</code> (uid = 0), and the file has the SUID bit set, then the file is
906 executed as if you had logged in as the user <code class="constant">root</code> and then executed the file.
907 The SUID bit effectively gives you (as <code class="constant">bobj</code>) administrative privilege for the
908 use of that executable file.
910 The setting of the SGID bit does precisely the same as the effect of the SUID bit, except that it
911 applies the privilege to the UNIX group setting. In other words, the file executes with the force
912 of capability of the group.
914 When the SUID/SGID permissions are set on a directory, all files that are created within that directory
915 are automatically given the ownership of the SUID user and the SGID group, as per the ownership
916 of the directory in which the file is created. This means that the system level <span><strong class="command">create()</strong></span>
917 function executes with the SUID user and/or SGID group of the directory in which the file is
920 If you want to obtain the SUID behavior, simply execute the following command:
921 </p><pre class="screen">
922 <code class="prompt">root# </code> chmod u+s file-or-directory
924 To set the SGID properties on a file or a directory, execute this command:
925 </p><pre class="screen">
926 <code class="prompt">root# </code> chmod g+s file-or-directory
928 And to set both SUID and SGID properties, execute the following:
929 </p><pre class="screen">
930 <code class="prompt">root# </code> chmod ug+s file-or-directory
933 Let's consider the example of a directory <code class="filename">/data/accounts</code>. The permissions on this
934 directory before setting both SUID and SGID on this directory are:
935 </p><pre class="screen">
936 <code class="prompt">root# </code> ls -al /data/accounts
938 drwxr-xr-x 10 root root 232 Dec 18 17:08 .
939 drwxr-xr-x 21 root root 600 Dec 17 23:15 ..
940 drwxrwxrwx 2 bobj Domain Users 48 Dec 18 17:08 accounts/
941 drwx------ 2 root root 48 Jan 26 2002 lost+found
943 In this example, if the user <code class="constant">maryv</code> creates a file, it is owned by her.
944 If <code class="constant">maryv</code> has the primary group of <code class="constant">Accounts</code>, the file is
945 owned by the group <code class="constant">Accounts</code>, as shown in this listing:
946 </p><pre class="screen">
947 <code class="prompt">root# </code> ls -al /data/accounts/maryvfile.txt
948 drw-rw-r-- 2 maryv Accounts 12346 Dec 18 17:53
951 Now you set the SUID and SGID and check the result as follows:
952 </p><pre class="screen">
953 <code class="prompt">root# </code> chmod ug+s /data/accounts
954 <code class="prompt">root# </code> ls -al /data/accounts
956 drwxr-xr-x 10 root root 232 Dec 18 17:08 .
957 drwxr-xr-x 21 root root 600 Dec 17 23:15 ..
958 drwsrwsr-x 2 bobj Domain Users 48 Dec 18 17:08 accounts
959 drwx------ 2 root root 48 Jan 26 2002 lost+found
961 If <code class="constant">maryv</code> creates a file in this directory after this change has been made, the
962 file is owned by the user <code class="constant">bobj</code>, and the group is set to the group
963 <code class="constant">Domain Users</code>, as shown here:
964 </p><pre class="screen">
965 <code class="prompt">root# </code> chmod ug+s /data/accounts
966 <code class="prompt">root# </code> ls -al /data/accounts/maryvfile.txt
968 drw-rw-r-- 2 bobj Domain Users 12346 Dec 18 18:11 maryvfile.txt
970 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ch12dblck"></a>Shared Data Integrity</h2></div></div></div><p><a class="indexterm" name="id2593353"></a><a class="indexterm" name="id2593361"></a>
971 The integrity of shared data is often viewed as a particularly emotional issue, especially where
972 there are concurrent problems with multiuser data access. Contrary to the assertions of some who have
973 experienced problems in either area, the cause has nothing to do with the phases of the moons of Jupiter.
975 The solution to concurrent multiuser data access problems must consider three separate areas
976 from which the problem may stem:<a class="indexterm" name="id2593384"></a><a class="indexterm" name="id2593396"></a><a class="indexterm" name="id2593407"></a>
977 </p><div class="itemizedlist"><ul type="disc"><li><p>application-level locking controls</p></li><li><p>client-side locking controls</p></li><li><p>server-side locking controls</p></li></ul></div><p><a class="indexterm" name="id2593440"></a><a class="indexterm" name="id2593448"></a>
978 Many database applications use some form of application-level access control. An example of one
979 well-known application that uses application-level locking is Microsoft Access. Detailed guidance
980 is provided here because this is the most common application for which problems have been reported.
981 </p><p><a class="indexterm" name="id2593464"></a><a class="indexterm" name="id2593472"></a>
982 Common applications that are affected by client- and server-side locking controls include MS
983 Excel and Act!. Important locking guidance is provided here.
984 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2593485"></a>Microsoft Access</h3></div></div></div><p>
985 The best advice that can be given is to carefully read the Microsoft knowledgebase articles that
986 cover this area. Examples of relevant documents include:
987 </p><div class="itemizedlist"><ul type="disc"><li><p>http://support.microsoft.com/default.aspx?scid=kb;en-us;208778</p></li><li><p>http://support.microsoft.com/default.aspx?scid=kb;en-us;299373</p></li></ul></div><p><a class="indexterm" name="id2593512"></a><a class="indexterm" name="id2593523"></a>
988 Make sure that your MS Access database file is configured for multiuser access (not set for
989 exclusive open). Open MS Access on each client workstation, then set the following: <span class="guimenu">(Menu bar) Tools</span>+<span class="guimenu">Options</span>+<span class="guimenu">[tab] General</span>. Set network path to Default database folder: <code class="filename">\\server\share\folder</code>.
991 You can configure MS Access file sharing behavior as follows: click <span class="guimenu">[tab] Advanced</span>.
992 Set:<a class="indexterm" name="id2593574"></a>
993 </p><div class="itemizedlist"><ul type="disc"><li><p>Default open mode: Shared</p></li><li><p>Default Record Locking: Edited Record</p></li><li><p>Open databases using record_level locking</p></li></ul></div><p><a class="indexterm" name="id2593603"></a>
994 You must now commit the changes so that they will take effect. To do so, click
995 <span class="guimenu">Apply</span><span class="guimenu">Ok</span>. At this point, you should exit MS Access, restart
996 it, and then validate that these settings have not changed.
997 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2593632"></a>Act! Database Sharing</h3></div></div></div><p><a class="indexterm" name="id2593639"></a><a class="indexterm" name="id2593647"></a>
998 Where the server sharing the ACT! database(s) is running Samba,or Windows NT, 200x, or XP, you
999 must disable opportunistic locking on the server and all workstations. Failure to do so
1000 results in data corruption. This information is available from the Act! Web site
1001 knowledgebase articles
1002 <a href="http://itdomino.saleslogix.com/act.nsf/docid/1998223162925" target="_top">1998223162925</a>
1003 as well as from article
1004 <a href="http://itdomino.saleslogix.com/act.nsf/docid/200110485036" target="_top">200110485036</a>.
1005 </p><p><a class="indexterm" name="id2593677"></a><a class="indexterm" name="id2593685"></a>
1006 These documents clearly state that opportunistic locking must be disabled on both
1007 the server (Samba in the case we are interested in here), as well as on every workstation
1008 from which the centrally shared Act! database will be accessed. Act! provides
1009 a tool called <span><strong class="command">Act!Diag</strong></span> that may be used to disable all workstation
1010 registry settings that may otherwise interfere with the operation of Act!
1011 Registered Act! users may download this utility from the Act! Web
1012 <a href="http://www.act.com/support/updates/index.cfm" target="_top">site.</a>
1013 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2593716"></a>Opportunistic Locking Controls</h3></div></div></div><p><a class="indexterm" name="id2593723"></a>
1014 Third-party Windows applications may not be compatible with the use of opportunistic file
1015 and record locking. For applications that are known not to be compatible,<sup>[<a name="id2593735" href="#ftn.id2593735">14</a>]</sup> oplock
1016 support may need to be disabled both on the Samba server and on the Windows workstations.
1017 </p><p><a class="indexterm" name="id2593750"></a><a class="indexterm" name="id2593757"></a><a class="indexterm" name="id2593765"></a>
1018 Oplocks enable a Windows client to cache parts of a file that are being
1019 edited. Another windows client may then request to open the file with the
1020 ability to write to it. The server will then ask the original workstation
1021 that had the file open with a write lock to release its lock. Before
1022 doing so, that workstation must flush the file from cache memory to the
1023 disk or network drive.
1024 </p><p><a class="indexterm" name="id2593787"></a>
1025 Disabling of Oplocks usage may require server and client changes.
1026 Oplocks may be disabled by file, by file pattern, on the share, or on the
1029 The following are examples showing how Oplock support may be managed using
1030 Samba <code class="filename">smb.conf</code> file settings:
1031 </p><pre class="screen">
1032 By file: veto oplock files = myfile.mdb
1034 By Pattern: veto oplock files = /*.mdb/
1036 On the Share: oplocks = No
1040 (in [global]) oplocks = No
1044 The following registry entries on Microsoft Windows XP Professional, 2000 Professional, and Windows NT4
1045 workstation clients must be configured as shown here:
1046 </p><pre class="screen">
1049 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
1050 Services\LanmanServer\Parameters]
1051 "EnableOplocks"=dword:00000000
1053 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
1054 Services\LanmanWorkstation\Parameters]
1055 "UseOpportunisticLocking"=dword:00000000
1058 Comprehensive coverage of file and record-locking controls is provided in TOSHARG2, Chapter 13.
1059 The information in that chapter was obtained from a wide variety of sources.
1060 </p></div></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch14.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="RefSection.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="primer.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 14. Samba Support </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 16. Networking Primer</td></tr></table></div></body></html>