ctdb: Accept the key in hex format for the pstore command
[Samba.git] / docs-xml / Samba3-ByExample / SBE-2000UserNetwork.xml
blobcfd6981758af422ff988deb3aa268015023c9de8
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="net2000users">
4   <title>A Distributed 2000-User Network</title>
6 <para>
7 There is something indeed mystical about things that are
8 big. Large networks exhibit a certain magnetism and exude a sense of
9 importance that obscures reality. You and I know that it is no more
10 difficult to secure a large network than it is a small one. We all
11 know that over and above a particular number of network clients, the
12 rules no longer change; the only real dynamic is the size of the domain
13 (much like a kingdom) over which the network ruler (oops, administrator)
14 has control. The real dynamic then transforms from the technical to the
15 political. Then again, that point is often reached well before the
16 kingdom (or queendom) grows large.
17 </para>
19 <para>
20 If you have systematically worked your way to this chapter, hopefully you
21 have found some gems and techniques that are applicable in your
22 world. The network designs you have worked with in this book have their
23 strong points as well as weak ones. That is to be expected given that
24 they are based on real business environments, the specifics of which are
25 molded to serve the purposes of this book.
26 </para>
28 <para>
29 This chapter is intent on wrapping up issues that are central to
30 implementation and design of progressively larger networks. Are you ready
31 for this chapter? Good, it is time to move on.
32 </para>
34 <para>
35 In previous chapters, you made the assumption that your network
36 administration staff need detailed instruction right down to the
37 nuts and bolts of implementing the solution. That is still the case,
38 but they have graduated now. You decide to document only those issues,
39 methods, and techniques that are new or complex. Routine tasks such as
40 implementing a DNS or a DHCP server are under control. Even the basics of
41 Samba are largely under control. So in this section you focus on the
42 specifics of implementing LDAP changes, Samba changes, and approach and
43 design of the solution and its deployment.
44 </para>
46 <sect1>
47 <title>Introduction</title>
49 <para>
50 Abmas is a miracle company. Most businesses would have collapsed under
51 the weight of rapid expansion that this company has experienced. Samba 
52 is flexible, so there is no need to reinstall the whole operating 
53 system just because you need to implement a new network design. In fact, 
54 you can keep an old server running right up to the moment of cutover 
55 and then do a near-live conversion. There is no need to reinstall a 
56 Samba server just to change the way your network should function.
57 </para>
59 <para>
60 <indexterm><primary>LDAP</primary></indexterm>
61 Network growth is common to all organizations. In this exercise,
62 your preoccupation is with the mechanics of implementing Samba and
63 LDAP so that network users on each network segment can work
64 without impediment.
65 </para>
67         <sect2>
68         <title>Assignment Tasks</title>
70         <para>
71         Starting with the configuration files for the server called
72         <constant>MASSIVE</constant> in <link linkend="happy"/>, you now deal with the
73         issues that are particular to large distributed networks. Your task
74         is simple &smbmdash; identify the challenges, consider the 
75         alternatives, and then design and implement a solution.
76         </para>
78         <para>
79         <indexterm><primary>VPN</primary></indexterm>
80         Remember, you have users based in London (UK), Los Angeles,
81         Washington. DC, and, three buildings in New York. A significant portion
82         of your workforce have notebook computers and roam all over the
83         world. Some dial into the office, others use VPN connections over the
84         Internet, and others just move between buildings.i
85         </para>
87         <para>
88         What do you say to an employee who normally uses a desktop
89         system but must spend six weeks on the road with a notebook computer?
90         She is concerned about email access and how to keep coworkers current
91         with changing documents.
92         </para>
94                 <para>
95         To top it all off, you have one network support person and one 
96         help desk person based in London, a single person dedicated to all 
97         network operations in Los Angeles, five staff for user administration 
98         and help desk in New York, plus one <emphasis>floater</emphasis> for 
99         Washington.
100         </para>
102                 <para>
103         You have outsourced all desktop deployment and management to
104         DirectPointe. Your concern is server maintenance and third-level
105         support. Build a plan and show what must be done.
106         </para>
108         </sect2>
109 </sect1>
111 <sect1>
112 <title>Dissection and Discussion</title>
114 <para>
115 <indexterm><primary>passdb backend</primary></indexterm>
116 <indexterm><primary>LDAP</primary></indexterm>
117 In <link linkend="happy"/>, you implemented an LDAP server that provided the
118 <parameter>passdb backend</parameter> for the Samba servers. You
119 explored ways to accelerate Windows desktop profile handling and you
120 took control of network performance.
121 </para>
123 <para>
124 <indexterm><primary>ldapsam</primary></indexterm>
125 <indexterm><primary>tdbsam</primary></indexterm>
126 <indexterm><primary>smbpasswd</primary></indexterm>
127 <indexterm><primary>replicated</primary></indexterm>
128 The implementation of an LDAP-based passdb backend (known as
129 <emphasis>ldapsam</emphasis> in Samba parlance), or some form of database
130 that can be distributed, is essential to permit the deployment of Samba
131 Primary and Backup Domain Controllers (PDC/BDCs). You see, the problem
132 is that the <emphasis>tdbsam</emphasis>-style passdb backend does not
133 lend itself to being replicated. The older plain-text-based
134 <emphasis>smbpasswd</emphasis>-style passdb backend can be replicated
135 using a tool such as <command>rsync</command>, but
136 <emphasis>smbpasswd</emphasis> suffers the drawback that it does not
137 support the range of account facilities demanded by modern network
138 managers.
139 </para>
141 <para>
142 <indexterm><primary>XML</primary></indexterm>
143 <indexterm><primary>SQL</primary></indexterm>
144 The new <emphasis>tdbsam</emphasis> facility supports functionality
145 that is similar to an <emphasis>ldapsam</emphasis>, but the lack of
146 distributed infrastructure sorely limits the scope for its
147 deployment. This raises the following questions: Why can't I just use
148 an XML-based backend, or for that matter, why not use an SQL-based
149 backend? Is support for these tools broken? Answers to these
150 questions require a bit of background.</para>
152 <para>
153 <indexterm><primary>directory</primary></indexterm>
154 <indexterm><primary>database</primary></indexterm>
155 <indexterm><primary>transaction processing</primary></indexterm>
156 <indexterm><primary>LDAP</primary></indexterm>
157 <emphasis>What is a directory?</emphasis> A directory is a
158 collection of information regarding objects that can be accessed to
159 rapidly find information that is relevant in a particular and
160 consistent manner. A directory differs from a database in that it is
161 generally more often searched (read) than updated. As a consequence, the
162 information is organized to facilitate read access rather than to
163 support transaction processing.</para>
165 <para>
166 <indexterm><primary>Lightweight Directory Access Protocol</primary><see>LDAP</see></indexterm>
167 <indexterm><primary>LDAP</primary></indexterm>
168 <indexterm><primary>master</primary></indexterm>
169 <indexterm><primary>slave</primary></indexterm>
170 The Lightweight Directory Access Protocol (LDAP) differs
171 considerably from a traditional database. It has a simple search
172 facility that uniquely makes a highly preferred mechanism for managing
173 user identities. LDAP provides a scalable mechanism for distributing
174 the data repository and for keeping all copies (slaves) in sync with
175 the master repository.</para>
177 <para>
178 <indexterm><primary>identity management</primary></indexterm>
179 <indexterm><primary>Active Directory</primary></indexterm>
180 <indexterm><primary>OpenLDAP</primary></indexterm>
181 Samba is a flexible and powerful file and print sharing
182 technology. It can use many external authentication sources and can be
183 part of a total authentication and identity management
184 infrastructure. The two most important external sources for large sites
185 are Microsoft Active Directory and LDAP. Sites that specifically wish to
186 avoid the proprietary implications of Microsoft Active Directory
187 naturally gravitate toward OpenLDAP.</para>
189 <para>
190 <indexterm><primary>network</primary><secondary>routed</secondary></indexterm>
191 In <link linkend="happy"/>, you had to deal with a locally routed
192 network. All deployment concerns focused around making users happy,
193 and that simply means taking control over all network practices and
194 usage so that no one user is disadvantaged by any other. The real
195 lesson is one of understanding that no matter how much network
196 bandwidth you provide, bandwidth remains a precious resource.</para>
198 <para>In this chapter, you must now consider how the overall network must
199 function. In particular, you must be concerned with users who move
200 between offices. You must take into account the way users need to
201 access information globally. And you must make the network robust
202 enough so that it can sustain partial breakdown without causing loss of
203 productivity.</para>
205         <sect2>
206         <title>Technical Issues</title>
208         <para>
209         There are at least three areas that need to be addressed as you
210         approach the challenge of designing a network solution for the newly
211         expanded business:
212         </para>
214         <itemizedlist>
215                 <listitem><para><indexterm><primary>mobility</primary></indexterm>
216                 User needs such as mobility and data access</para></listitem>
218                 <listitem><para>The nature of Windows networking protocols</para></listitem>
220                 <listitem><para>Identity management infrastructure needs</para></listitem>
221         </itemizedlist>
223         <para>Let's look at each in turn.</para>
225         <sect3>
226           <title>User Needs</title>
228         <para>
229         The new company has three divisions. Staff for each division are spread across
230         the company. Some staff are office-bound and some are mobile users. Mobile
231         users travel globally. Some spend considerable periods working in other offices.
232         Everyone wants to be able to work without constraint of productivity.
233         </para> 
235         <para>
236         The challenge is not insignificant. In some parts of the world, even dial-up
237         connectivity is poor, while in other regions political encumbrances severely
238         curtail user needs. Parts of the global Internet infrastructure remain shielded
239         off for reasons outside the scope of this discussion.
240         </para>
242         <para>
243         <indexterm><primary>synchronize</primary></indexterm>
244         Decisions must be made regarding where data is to be stored, how it will be
245         replicated (if at all), and what the network bandwidth implications are. For
246         example, one decision that can be made is to give each office its own master
247         file storage area that can be synchronized to a central repository in New
248         York. This would permit global data to be backed up from a single location.
249         The synchronization tool could be <command>rsync,</command> run via a cron
250         job. Mobile users may use off-line file storage under Windows XP Professional.
251         This way, they can synchronize all files that have changed since each logon
252         to the network.
253         </para>
255         <para>
256         <indexterm><primary>bandwidth</primary><secondary>requirements</secondary></indexterm>
257         <indexterm><primary>roaming profile</primary></indexterm>
258         No matter which way you look at this, the bandwidth requirements
259         for acceptable performance are substantial even if only 10 percent of
260         staff are global data users. A company with 3,500 employees,
261         280 of whom are mobile users who use a similarly distributed
262         network, found they needed at least 2 Mb/sec connectivity
263         between the UK and US offices. Even over 2 Mb/sec bandwidth, this
264         company abandoned any attempt to run roaming profile usage for
265         mobile users. At that time, the average roaming profile took 480
266         KB, while today the minimum Windows XP Professional roaming
267         profile involves a transfer of over 750 KB from the profile
268         server to and from the client.
269         </para>
271         <para>
272         <indexterm><primary>wide-area</primary></indexterm>
273         Obviously then, user needs and wide-area practicalities dictate the economic and
274         technical aspects of your network design as well as for standard operating procedures.
275         </para>
277         </sect3>
279         <sect3>
280           <title>The Nature of Windows Networking Protocols</title>
282         <para>
283         <indexterm><primary>profile</primary><secondary>mandatory</secondary></indexterm>
284         Network logons that include roaming profile handling requires from 140 KB to 2 MB.
285         The inclusion of support for a minimal set of common desktop applications can push
286         the size of a complete profile to over 15 MB. This has substantial implications
287         for location of user profiles. Additionally, it is a significant factor in
288         determining the nature and style of mandatory profiles that may be enforced as
289         part of a total service-level assurance program that might be implemented.
290         </para>
292         <para>
293         <indexterm><primary>logon traffic</primary></indexterm>
294         <indexterm><primary>redirected folders</primary></indexterm>
295         One way to reduce the network bandwidth impact of user logon
296         traffic is through folder redirection. In <link linkend="happy"/>, you
297         implemented this in the new Windows XP Professional standard
298         desktop configuration. When desktop folders such as <guimenu>My
299         Documents</guimenu> are redirected to a network drive, they should
300         also be excluded from synchronization to and from the server on
301         logon or logout. Redirected folders are analogous to network drive
302         connections.
303         </para>
305         <para><indexterm><primary>application servers</primary></indexterm>
306         Of course, network applications should only be run off
307         local application servers. As a general rule, even with 2 Mb/sec
308         network bandwidth, it would not make sense at all for someone who
309         is working out of the London office to run applications off a
310         server that is located in New York.
311         </para>
313         <para>
314         <indexterm><primary>affordability</primary></indexterm>
315         When network bandwidth becomes a precious commodity (that is most
316         of the time), there is a significant demand to understand network
317         processes and to mold the limits of acceptability around the
318         constraints of affordability.
319         </para>
321         <para>
322         When a Windows NT4/200x/XP Professional client user logs onto
323         the network, several important things must happen.
324         </para>
326         <itemizedlist>
327                 <listitem><para>
328                 <indexterm><primary>DHCP</primary></indexterm>
329                 The client obtains an IP address via DHCP. (DHCP is
330                 necessary so that users can roam between offices.)
331                 </para></listitem>
333                 <listitem><para>
334                 <indexterm><primary>WINS</primary></indexterm>
335                 <indexterm><primary>DNS</primary></indexterm>
336                 The client must register itself with the WINS and/or DNS server.
337                 </para></listitem>
339                 <listitem><para>
340                 <indexterm><primary>Domain Controller</primary><secondary>closest</secondary></indexterm>
341                 The client must locate the closest domain controller.
342                 </para></listitem>
344                 <listitem><para>
345                 The client must log onto a domain controller and obtain as part of
346                 that process the location of the user's profile, load it, connect to
347                 redirected folders, and establish all network drive and printer connections.
348                 </para></listitem>
350                 <listitem><para>
351                 The domain controller must be able to resolve the user's
352                 credentials before the logon process is fully implemented.
353                 </para></listitem>
354         </itemizedlist>
356         <para>
357         Given that this book is about Samba and that it implements the Windows
358         NT4-style domain semantics, it makes little sense to compare Samba with
359         Microsoft Active Directory insofar as the logon protocols and principles
360         of operation are concerned. The following information pertains exclusively
361         to the interaction between a Windows XP Professional workstation and a
362         Samba-3.0.20 server. In the discussion that follows, use is made of DHCP and WINS.
363         </para>
365         <para>
366         As soon as the Windows workstation starts up, it obtains an
367         IP address. This is immediately followed by registration of its
368         name both by broadcast and Unicast registration that is directed
369         at the WINS server.
370         </para>
372         <para>
373         <indexterm><primary>Unicast</primary></indexterm>
374         <indexterm><primary>broadcast</primary><secondary>directed</secondary>
375         </indexterm><indexterm><primary>NetBIOS</primary></indexterm>
376         Given that the client is already a domain member, it then sends
377         a directed (Unicast) request to the WINS server seeking the list of
378         IP addresses for domain controllers (NetBIOS name type 0x1C). The
379         WINS server replies with the information requested.</para>
381         <para>
382         <indexterm><primary>broadcast</primary><secondary>mailslot</secondary></indexterm>
383         <indexterm><primary>Unicast</primary></indexterm>
384         <indexterm><primary>WINS</primary></indexterm>
385         The client sends two netlogon mailslot broadcast requests
386         to the local network and to each of the IP addresses returned by
387         the WINS server. Whichever answers this request first appears to
388         be the machine that the Windows XP client attempts to use to
389         process the network logon. The mailslot messages use UDP broadcast
390         to the local network and UDP Unicast directed at each machine that
391         was listed in the WINS server response to a request for the list of
392         domain controllers.
393         </para>
395         <para>
396         <indexterm><primary>protocol</primary><secondary>negotiation</secondary></indexterm>
397         <indexterm><primary>logon server</primary></indexterm>
398         <indexterm><primary>fail</primary></indexterm>
399         The logon process begins with negotiation of the SMB/CIFS
400         protocols that are to be used; this is followed by an exchange of
401         information that ultimately includes the client sending the
402         credentials with which the user is attempting to logon. The logon
403         server must now approve the further establishment of the
404         connection, but that is a good point to halt for now. The priority
405         here must center around identification of network infrastructure
406         needs. A secondary fact we need to know is, what happens when
407         local domain controllers fail or break?
408         </para>
410         <para>
411         <indexterm><primary>Domain Controller</primary></indexterm>
412         <indexterm><primary>PDC</primary></indexterm>
413         <indexterm><primary>BDC</primary></indexterm>
414         <indexterm><primary>netlogon</primary></indexterm>
415         Under most circumstances, the nearest domain controller
416         responds to the netlogon mailslot broadcast. The exception to this
417         norm occurs when the nearest domain controller is too busy or is out
418         of service. Herein lies an important fact. This means it is
419         important that every network segment should have at least two
420         domain controllers. Since there can be only one PDC, all additional
421         domain controllers are by definition BDCs.
422         </para>
424         <para>
425         <indexterm><primary>authentication</primary></indexterm>
426         <indexterm><primary>Identity Management</primary></indexterm>
427         The provision of sufficient servers that are BDCs is an
428         important design factor. The second important design factor
429         involves how each of the BDCs obtains user authentication
430         data. That is the subject of the next section, which involves key
431         decisions regarding Identity Management facilities.
432         </para>
434         </sect3>
436         <sect3>
437         <title>Identity Management Needs</title>
439         <para>
440         <indexterm><primary>privacy</primary></indexterm>
441         <indexterm><primary>user credentials</primary></indexterm>
442         <indexterm><primary>validated</primary></indexterm>
443         <indexterm><primary>privileges</primary></indexterm>
444         Network managers recognize that in large organizations users
445         generally need to be given resource access based on needs, while
446         being excluded from other resources for reasons of privacy. It is
447         therefore essential that all users identify themselves at the
448         point of network access. The network logon is the principal means
449         by which user credentials are validated and filtered and appropriate
450         rights and privileges are allocated.
451         </para>
453         <para>
454         <indexterm><primary>Identity Management</primary></indexterm>
455         <indexterm><primary>Yellow Pages</primary></indexterm>
456         <indexterm><primary>NIS</primary></indexterm>
457         Unfortunately, network resources tend to have their own Identity 
458         Management facilities, the quality and manageability of which varies 
459         from quite poor to exceptionally good. Corporations that use a mixture 
460         of systems soon discover that until recently, few systems were 
461         designed to interoperate. For example, UNIX systems each have an 
462         independent user database. Sun Microsystems developed a facility that 
463         was originally called <constant>Yellow Pages</constant>, and was renamed 
464         when a telephone company objected to the use of its trademark. 
465         What was once called <constant>Yellow Pages</constant> is today known 
466         as <constant>Network Information System</constant> (NIS).
467         </para>
469         <para>
470         <indexterm><primary>NIS+</primary></indexterm>
471         NIS gained a strong following throughout the UNIX/VMS space in a short
472         period of time and retained that appeal and use for over a decade.
473         Security concerns and inherent limitations have caused it to enter its
474         twilight. NIS did not gain widespread appeal outside of the UNIX world
475         and was not universally adopted. Sun updated this to a more secure
476         implementation called NIS+, but even it has fallen victim to changing
477         demands as the demand for directory services that can be coupled with
478         other information systems is catching on.
479         </para>
482         <para>
483         <indexterm><primary>NIS</primary></indexterm>
484         <indexterm><primary>government</primary></indexterm>
485         <indexterm><primary>education</primary></indexterm>
486         Nevertheless, both NIS and NIS+ continue to hold ground in
487         business areas where UNIX still has major sway. Examples of
488         organizations that remain firmly attached to the use of NIS and
489         NIS+ include large government departments, education institutions,
490         and large corporations that have a scientific or engineering
491         focus.
492         </para>
494         <para>
495         <indexterm><primary>scalable</primary></indexterm>
496         <indexterm><primary>distributed</primary></indexterm>
497         Today's networking world needs a scalable, distributed Identity 
498         Management infrastructure, commonly called a directory. The most 
499         popular technologies today are Microsoft Active Directory service 
500         and a number of LDAP implementations.
501         </para>
503         <para>
504         <indexterm><primary>multiple directories</primary></indexterm>
505         The problem of managing multiple directories has become a focal
506         point over the past decade, creating a large market for
507         metadirectory products and services that allow organizations that
508         have multiple directories and multiple management and control
509         centers to provision information from one directory into
510         another. The attendant benefit to end users is the promise of
511         having to remember and deal with fewer login identities and
512         passwords.</para>
514         <para>
515         <indexterm><primary>network</primary><secondary>bandwidth</secondary></indexterm>
516         The challenge of every large network is to find the optimum
517         balance of internal systems and facilities for Identity
518         Management resources. How well the solution is chosen and
519         implemented has potentially significant impact on network bandwidth
520         and systems response needs.</para>
522         <para>
523         <indexterm><primary>LDAP server</primary></indexterm>
524         <indexterm><primary>LDAP</primary><secondary>master</secondary></indexterm>
525         <indexterm><primary>LDAP</primary><secondary>slave</secondary></indexterm>
526         In <link linkend="happy"/>, you implemented a single LDAP server for the
527         entire network. This may work for smaller networks, but almost
528         certainly fails to meet the needs of large and complex networks. The
529         following section documents how you may implement a single
530         master LDAP server with multiple slave servers.</para>
532         <para>
533         What is the best method for implementing master/slave LDAP
534         servers within the context of a distributed 2,000-user network is a
535         question that remains to be answered.</para>
537         <para>
538         <indexterm><primary>distributed domain</primary></indexterm>
539         <indexterm><primary>wide-area</primary></indexterm>
540         One possibility that has great appeal is to create a single,
541         large distributed domain. The practical implications of this
542         design (see <link linkend="chap7net"/>) demands the placement of
543         sufficient BDCs in each location. Additionally, network
544         administrators must make sure that profiles are not transferred
545         over the wide-area links, except as a totally unavoidable
546         measure. Network design must balance the risk of loss of user
547         productivity against the cost of network management and
548         maintenance.
549         </para>
551         <para>
552         <indexterm><primary>domain name space</primary></indexterm>
553         The network design in <link linkend="chap7net2"/> takes the approach
554         that management of networks that are too remote to be managed
555         effectively from New York ought to be given a certain degree of
556         autonomy. With this rationale, the Los Angeles and London networks,
557         though fully integrated with those on the East Coast, each have their
558         own domain name space and can be independently managed and controlled.
559         One of the key drawbacks of this design is that it flies in the face of
560         the ability for network users to roam globally without some compromise
561         in how they may access global resources.
562         </para>
564         <para>
565         <indexterm><primary>interdomain trusts</primary></indexterm>
566         Desk-bound users need not be negatively affected by this design, since
567         the use of interdomain trusts can be used to satisfy the need for global
568         data sharing.
569         </para>
571         <para>
572         <indexterm><primary>LDAP</primary></indexterm>
573         <indexterm><primary>LDAP</primary><secondary>backend</secondary></indexterm>
574         <indexterm><primary>SID</primary></indexterm>
575         When Samba is configured to use an LDAP backend, it stores the domain
576         account information in a directory entry. This account entry contains the
577         domain SID. An unintended but exploitable side effect is that this makes it
578         possible to operate with more than one PDC on a distributed network.
579         </para>
581         <para>
582         <indexterm><primary>WINS</primary></indexterm>
583         <indexterm><primary>wins.dat</primary></indexterm>
584         <indexterm><primary>SID</primary></indexterm>
585         How might this peculiar feature be exploited? The answer is simple. It is
586         imperative that each network segment have its own WINS server. Major
587         servers on remote network segments can be given a static WINS entry in
588         the <filename>wins.dat</filename> file on each WINS server. This allows
589         all essential data to be visible from all locations. Each location would,
590         however, function as if it is an independent domain, while all sharing the
591         same domain SID. Since all domain account information can be stored in a
592         single LDAP backend, users have unfettered ability to roam.
593         </para>
595         <para>
596         <indexterm><primary>NetBIOS name</primary><secondary>aliases</secondary></indexterm>
597         <indexterm><primary>fail-over</primary></indexterm>
598         This concept has not been exhaustively validated, though we can see no reason
599         why this should not work. The important facets are the following: The name of
600         the domain must be identical in all locations. Each network segment must have
601         its own WINS server. The name of the PDC must be the same in all locations; this
602         necessitates the use of NetBIOS name aliases for each PDC so that they can be
603         accessed globally using the alias and not the PDC's primary name. A single master
604         LDAP server can be based in New York, with multiple LDAP slave servers located
605         on every network segment. Finally, the BDCs should each use failover LDAP servers
606         that are in fact slave LDAP servers on the local segments.
607         </para>
609         <para>
610         <indexterm><primary>LDAP</primary><secondary>updates</secondary></indexterm>
611         <indexterm><primary>domain tree</primary></indexterm>
612         <indexterm><primary>LDAP</primary><secondary>database</secondary></indexterm>
613         <indexterm><primary>LDAP</primary><secondary>directory</secondary></indexterm>
614         With a single master LDAP server, all network updates are effected on a single
615         server. In the event that this should become excessively fragile or network
616         bandwidth limiting, one could implement a delegated LDAP domain. This is also
617         known as a partitioned (or multiple partition) LDAP database and as a distributed
618         LDAP directory.
619         </para>
621         <para>
622         As the LDAP directory grows, it becomes increasingly important
623         that its structure is implemented in a manner that mirrors
624         organizational needs, so as to limit network update and
625         referential traffic. It should be noted that all directory
626         administrators must of necessity follow the same standard
627         procedures for managing the directory, because retroactive correction of
628         inconsistent directory information can be exceedingly difficult.
629         </para>
631         </sect3>
633         </sect2>
636         <sect2>
637                 <title>Political Issues</title>
639         <para>
640         As organizations grow, the number of points of control increases
641         also. In a large distributed organization, it is important that the
642         Identity Management system be capable of being updated from
643         many locations, and it is equally important that changes made should
644         become usable in a reasonable period, typically
645         minutes rather than days (the old limitation of highly manual
646         systems).
647         </para>
649         </sect2>
651 </sect1>
653 <sect1>
654         <title>Implementation</title>
656         <para>
657         <indexterm><primary>winbind</primary></indexterm>
658         <indexterm><primary>LDAP</primary></indexterm>
659         <indexterm><primary>UID</primary></indexterm>
660         <indexterm><primary>GID</primary></indexterm>
661         Samba has the ability to use multiple password (authentication and
662         identity resolution) backends. The diagram in <link linkend="chap7idres"/>
663         demonstrates how Samba uses winbind, LDAP, and NIS, the traditional system
664         password database. The diagram only documents the mechanisms for
665         authentication and identity resolution (obtaining a UNIX UID/GID)
666         using the specific systems shown.
667         </para>
669         <figure id="chap7idres">
670                 <title>Samba and Authentication Backend Search Pathways</title>
671                 <imagefile scale="55">chap7-idresol</imagefile>
672         </figure>
674         <para>
675         <indexterm><primary>smbpasswd</primary></indexterm>
676         <indexterm><primary>xmlsam</primary></indexterm>
677         <indexterm><primary>SMB passwords</primary></indexterm>
678         <indexterm><primary>tdbsam</primary></indexterm>
679         <indexterm><primary>mysqlsam</primary></indexterm>
680         <indexterm><primary>LDAP</primary></indexterm>
681         <indexterm><primary>distributed</primary></indexterm>
682         Samba is capable of using the <constant>smbpasswd</constant> and
683         <constant>tdbsam</constant>. The SMB
684         passwords can, of course, also be stored in an LDAP ldapsam
685         backend. LDAP is the preferred passdb backend for distributed network
686         operations.
687         </para>
689         <para>
690         <indexterm><primary>passdb backend</primary></indexterm>
691         You can specify a failover LDAP backend. The syntax for specifying a
692         single LDAP backend in &smb.conf; is:
693 <screen>
695 passdb backend = ldapsam:ldap://master.abmas.biz
697 </screen>
698         This configuration tells Samba to use a single LDAP server, as shown in <link linkend="ch7singleLDAP"/>.
699         <figure id="ch7singleLDAP">
700                 <title>Samba Configuration to Use a Single LDAP Server</title>
701                 <imagefile scale="65">ch7-singleLDAP</imagefile>
702         </figure>
703         <indexterm><primary>LDAP</primary><secondary>fail-over</secondary></indexterm>
704         <indexterm><primary>fail-over</primary></indexterm>
705         The addition of a failover LDAP server can simply be done by adding a
706         second entry for the failover server to the single <parameter>ldapsam</parameter>
707         entry, as shown here (note the particular use of the double quotes):
708 <screen>
710 passdb backend = ldapsam:"ldap://master.abmas.biz \
711                           ldap://slave.abmas.biz"
713 </screen>
714         This configuration tells Samba to use a master LDAP server, with failover to a slave server if necessary,
715         as shown in <link linkend="ch7dualLDAP"/>.
716         <figure id="ch7dualLDAP">
717                 <title>Samba Configuration to Use a Dual (Fail-over) LDAP Server</title>
718                 <imagefile scale="65">ch7-fail-overLDAP</imagefile>
719         </figure>
720         </para>
722     <para>
723         It is assumed that the network you are working with follows in a
724         pattern similar to what was covered in <link linkend="happy"/>. The following steps
725     permit the operation of a master/slave OpenLDAP arrangement.
726         </para>
728         <procedure>
729         <title>Implementation Steps for an LDAP Slave Server</title>
731                 <step><para>
732             <indexterm><primary>SUSE Linux</primary></indexterm>
733                 <indexterm><primary>Red Hat Linux</primary></indexterm>
734                 Log onto the master LDAP server as <constant>root</constant>.
735                 You are about to change the configuration of the LDAP server, so it
736                 makes sense to temporarily halt it. Stop OpenLDAP from running on 
737                 SUSE Linux by executing:
738 <screen>
739 &rootprompt; rcldap stop
740 </screen>
741                 On Red Hat Linux, you can do this by executing:
742 <screen>
743 &rootprompt; service ldap stop
744 </screen>
745                 </para></step>
747                 <step><para>
748                 <indexterm><primary>/etc/openldap/slapd.conf</primary></indexterm>
749                 Edit the <filename>/etc/openldap/slapd.conf</filename> file so it
750                 matches the content of <link linkend="ch7-LDAP-master"/>.
751                 </para></step>
753                 <step><para>
754                 Create a file called <filename>admin-accts.ldif</filename> with the following contents:
755 <screen>
756 dn: cn=updateuser,dc=abmas,dc=biz
757 objectClass: person
758 cn: updateuser
759 sn: updateuser
760 userPassword: not24get
762 dn: cn=sambaadmin,dc=abmas,dc=biz
763 objectClass: person
764 cn: sambaadmin
765 sn: sambaadmin
766 userPassword: buttercup
767 </screen>
768                 </para></step>
770                 <step><para>
771                 Add an account called <quote>updateuser</quote> to the master LDAP server as shown here:
772 <screen>
773 &rootprompt; slapadd -v -l admin-accts.ldif
774 </screen>
775                 </para></step>
777                 <step><para>
778                 <indexterm><primary>LDIF</primary></indexterm>
779                 <indexterm><primary>LDAP</primary><secondary>preload</secondary></indexterm>
780                 Change directory to a suitable place to dump the contents of the
781                 LDAP server. The dump file (and LDIF file) is used to preload
782                 the slave LDAP server database. You can dump the database by executing:
783 <screen>
784 &rootprompt; slapcat -v -l LDAP-transfer-LDIF.txt
785 </screen>
786                 Each record is written to the file.     
787                 </para></step>
789                 <step><para>
790                 <indexterm><primary>LDAP-transfer-LDIF.txt</primary></indexterm>
791                 Copy the file <filename>LDAP-transfer-LDIF.txt</filename> to the intended
792                 slave LDAP server. A good location could be in the directory 
793                 <filename>/etc/openldap/preload</filename>.
794                 </para></step>
796                 <step><para>
797                 Log onto the slave LDAP server as <constant>root</constant>. You can
798                 now configure this server so the <filename>/etc/openldap/slapd.conf</filename>
799                 file matches the content of <link linkend="ch7-LDAP-slave"/>.
800                 </para></step>
802                 <step><para>
803                 Change directory to the location in which you stored the 
804                 <filename>LDAP-transfer-LDIF.txt</filename> file (<filename>/etc/openldap/preload</filename>).
805                 While in this directory, execute:
806 <screen>
807 &rootprompt; slapadd -v -l LDAP-transfer-LDIF.txt
808 </screen>
809                 If all goes well, the following output confirms that the data is being loaded
810                 as intended:
811 <screen>
812 added: "dc=abmas,dc=biz" (00000001)
813 added: "cn=sambaadmin,dc=abmas,dc=biz" (00000002)
814 added: "cn=updateuser,dc=abmas,dc=biz" (00000003)
815 added: "ou=People,dc=abmas,dc=biz" (00000004)
816 added: "ou=Groups,dc=abmas,dc=biz" (00000005)
817 added: "ou=Computers,dc=abmas,dc=biz" (00000006)
818 added: "uid=Administrator,ou=People,dc=abmas,dc=biz" (00000007)
819 added: "uid=nobody,ou=People,dc=abmas,dc=biz" (00000008)
820 added: "cn=Domain Admins,ou=Groups,dc=abmas,dc=biz" (00000009)
821 added: "cn=Domain Users,ou=Groups,dc=abmas,dc=biz" (0000000a)
822 added: "cn=Domain Guests,ou=Groups,dc=abmas,dc=biz" (0000000b)
823 added: "uid=bobj,ou=People,dc=abmas,dc=biz" (0000000c)
824 added: "sambaDomainName=MEGANET2,dc=abmas,dc=biz" (0000000d)
825 added: "uid=stans,ou=People,dc=abmas,dc=biz" (0000000e)
826 added: "uid=chrisr,ou=People,dc=abmas,dc=biz" (0000000f)
827 added: "uid=maryv,ou=People,dc=abmas,dc=biz" (00000010)
828 added: "cn=Accounts,ou=Groups,dc=abmas,dc=biz" (00000011)
829 added: "cn=Finances,ou=Groups,dc=abmas,dc=biz" (00000012)
830 added: "cn=PIOps,ou=Groups,dc=abmas,dc=biz" (00000013)
831 </screen>
832                 </para></step>
834                 <step><para>
835                 Now start the LDAP server and set it to run automatically on system reboot by executing:
836 <screen>
837 &rootprompt; rcldap start
838 &rootprompt; chkconfig ldap on
839 </screen>
840                 On Red Hat Linux, execute the following:
841 <screen>
842 &rootprompt; service ldap start
843 &rootprompt; chkconfig ldap on
844 </screen>
845                 </para></step>
847                 <step><para>
848             <indexterm><primary>chkconfig</primary></indexterm>
849                 <indexterm><primary>service</primary></indexterm>
850                 <indexterm><primary>rcldap</primary></indexterm>
851                 Go back to the master LDAP server. Execute the following to start LDAP as well
852                 as <command>slurpd</command>, the synchronization daemon, as shown here:
853 <screen>
854 &rootprompt; rcldap start
855 &rootprompt; chkconfig ldap on
856 &rootprompt; rcslurpd start
857 &rootprompt; chkconfig slurpd on
858 </screen>
859             <indexterm><primary>slurpd</primary></indexterm>
860                 On Red Hat Linux, check the equivalent command to start <command>slurpd</command>.
861                 </para></step>
863                 <step><para>
864                 <indexterm><primary>smbldap-useradd</primary></indexterm>
865                 On the master LDAP server you may now add an account to validate that replication
866                 is working. Assuming the configuration shown in <link linkend="happy"/>, execute:
867 <screen>
868 &rootprompt; /var/lib/samba/sbin/smbldap-useradd -a fruitloop
869 </screen>
870                 </para></step>
872                 <step><para>
873                 On the slave LDAP server, change to the directory <filename>/var/lib/ldap</filename>.
874                 There should now be a file called <filename>replogfile</filename>. If replication worked
875                 as expected, the content of this file should be:
876 <screen>
877 time: 1072486403
878 dn: uid=fruitloop,ou=People,dc=abmas,dc=biz
879 changetype: modify
880 replace: sambaProfilePath
881 sambaProfilePath: \\MASSIVE\profiles\fruitloop
883 replace: sambaHomePath
884 sambaHomePath: \\MASSIVE\homes
886 replace: entryCSN
887 entryCSN: 2003122700:43:38Z#0x0005#0#0000
889 replace: modifiersName
890 modifiersName: cn=Manager,dc=abmas,dc=biz
892 replace: modifyTimestamp
893 modifyTimestamp: 20031227004338Z
895 </screen>
896                 </para></step>
898                 <step><para>
899                 Given that this first slave LDAP server is now working correctly, you may now
900                 implement additional slave LDAP servers as required.
901                 </para></step>
903                 <step><para>
904                 On each machine (PDC and BDCs) after the respective &smb.conf; files have been created as shown in
905                 <link linkend="ch7-massmbconfA">Primary Domain Controller &smb.conf; File &smbmdash; Part A + B + C</link> and
906                 on BDCs the <link linkend="ch7-slvsmbocnfA">Backup Domain Controller &smb.conf; File &smbmdash; Part A
907                 + B + C</link> execute the following:
908 <screen>
909 &rootprompt; smbpasswd -w buttercup
910 </screen>
911                 This will install in the <filename>secrets.tdb</filename> file the password that Samba will need to
912                 manage (write to) the LDAP Master server to perform account updates.
913                 </para></step>
915         </procedure>
917 <example id="ch7-LDAP-master">
918 <title>LDAP Master Server Configuration File &smbmdash; <filename>/etc/openldap/slapd.conf</filename></title>
919 <screen>
920 include     /etc/openldap/schema/core.schema
921 include     /etc/openldap/schema/cosine.schema
922 include     /etc/openldap/schema/inetorgperson.schema
923 include     /etc/openldap/schema/nis.schema
924 include     /etc/openldap/schema/samba.schema
926 pidfile     /var/run/slapd/slapd.pid
927 argsfile    /var/run/slapd/slapd.args
929 database    bdb
930 suffix      "dc=abmas,dc=biz"
931 rootdn      "cn=Manager,dc=abmas,dc=biz"
933 # rootpw = not24get
934 rootpw      {SSHA}86kTavd9Dw3FAz6qzWTrCOKX/c0Qe+UV
936 replica     host=lapdc.abmas.biz:389
937             suffix="dc=abmas,dc=biz"
938             binddn="cn=updateuser,dc=abmas,dc=biz"
939             bindmethod=simple credentials=not24get
941 access to attrs=sambaLMPassword,sambaNTPassword
942            by dn="cn=sambaadmin,dc=abmas,dc=biz" write
943            by * none
945 replogfile  /var/lib/ldap/replogfile
947 directory   /var/lib/ldap
949 # Indices to maintain
950 index objectClass           eq
951 index cn                    pres,sub,eq
952 index sn                    pres,sub,eq
953 index uid                   pres,sub,eq
954 index displayName           pres,sub,eq
955 index uidNumber             eq
956 index gidNumber             eq
957 index memberUID             eq
958 index sambaSID              eq
959 index sambaPrimaryGroupSID  eq
960 index sambaDomainName       eq
961 index default               sub
962 </screen>
963 </example>
965 <example id="ch7-LDAP-slave">
966 <title>LDAP Slave Configuration File &smbmdash; <filename>/etc/openldap/slapd.conf</filename></title>
967 <screen>
968 include     /etc/openldap/schema/core.schema
969 include     /etc/openldap/schema/cosine.schema
970 include     /etc/openldap/schema/inetorgperson.schema
971 include     /etc/openldap/schema/nis.schema
972 include     /etc/openldap/schema/samba.schema
974 pidfile     /var/run/slapd/slapd.pid
975 argsfile    /var/run/slapd/slapd.args
977 database    bdb
978 suffix      "dc=abmas,dc=biz"
979 rootdn      "cn=Manager,dc=abmas,dc=biz"
981 # rootpw = not24get
982 rootpw      {SSHA}86kTavd9Dw3FAz6qzWTrCOKX/c0Qe+UV
984 access to *
985             by dn=cn=updateuser,dc=abmas,dc=biz write
986             by * read
988 updatedn    cn=updateuser,dc=abmas,dc=biz
989 updateref   ldap://massive.abmas.biz
991 directory   /var/lib/ldap
993 # Indices to maintain
994 index objectClass           eq
995 index cn                    pres,sub,eq
996 index sn                    pres,sub,eq
997 index uid                   pres,sub,eq
998 index displayName           pres,sub,eq
999 index uidNumber             eq
1000 index gidNumber             eq
1001 index memberUID             eq
1002 index sambaSID              eq
1003 index sambaPrimaryGroupSID  eq
1004 index sambaDomainName       eq
1005 index default               sub
1006 </screen>
1007 </example>
1009 <example id="ch7-massmbconfA">
1010 <title>Primary Domain Controller &smb.conf; File &smbmdash; Part A</title>
1011 <smbconfblock>
1012 <smbconfcomment>Global parameters</smbconfcomment>
1013 <smbconfsection name="[global]"/>
1014 <smbconfoption name="unix charset">LOCALE</smbconfoption>
1015 <smbconfoption name="workgroup">MEGANET2</smbconfoption>
1016 <smbconfoption name="passdb backend">ldapsam:ldap://massive.abmas.biz</smbconfoption>
1017 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
1018 <smbconfoption name="log level">1</smbconfoption>
1019 <smbconfoption name="syslog">0</smbconfoption>
1020 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
1021 <smbconfoption name="max log size">0</smbconfoption>
1022 <smbconfoption name="smb ports">139</smbconfoption>
1023 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
1024 <smbconfoption name="time server">Yes</smbconfoption>
1025 <smbconfoption name="printcap name">CUPS</smbconfoption>
1026 <smbconfoption name="add user script">/opt/IDEALX/sbin/smbldap-useradd -m '%u'</smbconfoption>
1027 <smbconfoption name="delete user script">/opt/IDEALX/sbin/smbldap-userdel '%u'</smbconfoption>
1028 <smbconfoption name="add group script">/opt/IDEALX/sbin/smbldap-groupadd -p '%g'</smbconfoption>
1029 <smbconfoption name="delete group script">/opt/IDEALX/sbin/smbldap-groupdel '%g'</smbconfoption>
1030 <smbconfoption name="add user to group script">/opt/IDEALX/sbin/smbldap-groupmod -m '%g' '%u'</smbconfoption>
1031 <smbconfoption name="delete user from group script">/opt/IDEALX/sbin/smbldap-groupmod -x '%g' '%u'</smbconfoption>
1032 <smbconfoption name="set primary group script">/opt/IDEALX/sbin/smbldap-usermod -g '%g' '%u'</smbconfoption>
1033 <smbconfoption name="add machine script">/opt/IDEALX/sbin/smbldap-useradd -w '%u'</smbconfoption>
1034 <smbconfoption name="shutdown script">/var/lib/samba/scripts/shutdown.sh</smbconfoption>
1035 <smbconfoption name="abort shutdown script">/sbin/shutdown -c</smbconfoption>
1036 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
1037 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>
1038 <smbconfoption name="logon drive">X:</smbconfoption>
1039 <smbconfoption name="domain logons">Yes</smbconfoption>
1040 <smbconfoption name="domain master">Yes</smbconfoption>
1041 <smbconfoption name="wins support">Yes</smbconfoption>
1042 <smbconfoption name="ldap suffix">dc=abmas,dc=biz</smbconfoption>
1043 <smbconfoption name="ldap machine suffix">ou=People</smbconfoption>
1044 <smbconfoption name="ldap user suffix">ou=People</smbconfoption>
1045 <smbconfoption name="ldap group suffix">ou=Groups</smbconfoption>
1046 <smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
1047 <smbconfoption name="ldap admin dn">cn=sambaadmin,dc=abmas,dc=biz</smbconfoption>
1048 <smbconfoption name="idmap backend">ldap://massive.abmas.biz</smbconfoption>
1049 <smbconfoption name="idmap uid">10000-20000</smbconfoption>
1050 <smbconfoption name="idmap gid">10000-20000</smbconfoption>
1051 <smbconfoption name="printing">cups</smbconfoption>
1052 </smbconfblock>
1053 </example>
1055 <example id="ch7-massmbconfB">
1056 <title>Primary Domain Controller &smb.conf; File &smbmdash; Part B</title>
1057 <smbconfblock>
1058 <smbconfsection name="[IPC$]"/>
1059 <smbconfoption name="path">/tmp</smbconfoption>
1061 <smbconfsection name="[accounts]"/>
1062 <smbconfoption name="comment">Accounting Files</smbconfoption>
1063 <smbconfoption name="path">/data/accounts</smbconfoption>
1064 <smbconfoption name="read only">No</smbconfoption>
1066 <smbconfsection name="[service]"/>
1067 <smbconfoption name="comment">Financial Services Files</smbconfoption>
1068 <smbconfoption name="path">/data/service</smbconfoption>
1069 <smbconfoption name="read only">No</smbconfoption>
1071 <smbconfsection name="[pidata]"/>
1072 <smbconfoption name="comment">Property Insurance Files</smbconfoption>
1073 <smbconfoption name="path">/data/pidata</smbconfoption>
1074 <smbconfoption name="read only">No</smbconfoption>
1076 <smbconfsection name="[homes]"/>
1077 <smbconfoption name="comment">Home Directories</smbconfoption>
1078 <smbconfoption name="valid users">%S</smbconfoption>
1079 <smbconfoption name="read only">No</smbconfoption>
1080 <smbconfoption name="browseable">No</smbconfoption>
1082 <smbconfsection name="[printers]"/>
1083 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
1084 <smbconfoption name="path">/var/spool/samba</smbconfoption>
1085 <smbconfoption name="guest ok">Yes</smbconfoption>
1086 <smbconfoption name="printable">Yes</smbconfoption>
1087 <smbconfoption name="browseable">No</smbconfoption>
1088 </smbconfblock>
1089 </example>
1091 <example id="ch7-massmbconfC">
1092 <title>Primary Domain Controller &smb.conf; File &smbmdash; Part C</title>
1093 <smbconfblock>
1094 <smbconfsection name="[apps]"/>
1095 <smbconfoption name="comment">Application Files</smbconfoption>
1096 <smbconfoption name="path">/apps</smbconfoption>
1097 <smbconfoption name="admin users">bjones</smbconfoption>
1098 <smbconfoption name="read only">No</smbconfoption>
1100 <smbconfsection name="[netlogon]"/>
1101 <smbconfoption name="comment">Network Logon Service</smbconfoption>
1102 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
1103 <smbconfoption name="admin users">root, Administrator</smbconfoption>
1104 <smbconfoption name="guest ok">Yes</smbconfoption>
1105 <smbconfoption name="locking">No</smbconfoption>
1107 <smbconfsection name="[profiles]"/>
1108 <smbconfoption name="comment">Profile Share</smbconfoption>
1109 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
1110 <smbconfoption name="read only">No</smbconfoption>
1111 <smbconfoption name="profile acls">Yes</smbconfoption>
1113 <smbconfsection name="[profdata]"/>
1114 <smbconfoption name="comment">Profile Data Share</smbconfoption>
1115 <smbconfoption name="path">/var/lib/samba/profdata</smbconfoption>
1116 <smbconfoption name="read only">No</smbconfoption>
1117 <smbconfoption name="profile acls">Yes</smbconfoption>
1119 <smbconfsection name="[print$]"/>
1120 <smbconfoption name="comment">Printer Drivers</smbconfoption>
1121 <smbconfoption name="path">/var/lib/samba/drivers</smbconfoption>
1122 <smbconfoption name="write list">root</smbconfoption>
1123 <smbconfoption name="admin users">root, Administrator</smbconfoption>
1124 </smbconfblock>
1125 </example>
1127 <example id="ch7-slvsmbocnfA">
1128 <title>Backup Domain Controller &smb.conf; File &smbmdash; Part A</title>
1129 <smbconfblock>
1130 <smbconfcomment># Global parameters</smbconfcomment>
1131 <smbconfsection name="[global]"/>
1132 <smbconfoption name="unix charset">LOCALE</smbconfoption>
1133 <smbconfoption name="workgroup">MEGANET2</smbconfoption>
1134 <smbconfoption name="netbios name">BLDG1</smbconfoption>
1135 <smbconfoption name="passdb backend">ldapsam:ldap://lapdc.abmas.biz</smbconfoption>
1136 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
1137 <smbconfoption name="log level">1</smbconfoption>
1138 <smbconfoption name="syslog">0</smbconfoption>
1139 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
1140 <smbconfoption name="max log size">50</smbconfoption>
1141 <smbconfoption name="smb ports">139</smbconfoption>
1142 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
1143 <smbconfoption name="printcap name">CUPS</smbconfoption>
1144 <smbconfoption name="show add printer wizard">No</smbconfoption>
1145 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
1146 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>
1147 <smbconfoption name="logon drive">X:</smbconfoption>
1148 <smbconfoption name="domain logons">Yes</smbconfoption>
1149 <smbconfoption name="os level">63</smbconfoption>
1150 <smbconfoption name="domain master">No</smbconfoption>
1151 <smbconfoption name="wins server">192.168.2.1</smbconfoption>
1152 <smbconfoption name="ldap suffix">dc=abmas,dc=biz</smbconfoption>
1153 <smbconfoption name="ldap machine suffix">ou=People</smbconfoption>
1154 <smbconfoption name="ldap user suffix">ou=People</smbconfoption>
1155 <smbconfoption name="ldap group suffix">ou=Groups</smbconfoption>
1156 <smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
1157 <smbconfoption name="ldap admin dn">cn=sambaadmin,dc=abmas,dc=biz</smbconfoption>
1158 <smbconfoption name="utmp">Yes</smbconfoption>
1159 <smbconfoption name="idmap backend">ldap://massive.abmas.biz</smbconfoption>
1160 <smbconfoption name="idmap uid">10000-20000</smbconfoption>
1161 <smbconfoption name="idmap gid">10000-20000</smbconfoption>
1162 <smbconfoption name="printing">cups</smbconfoption>
1164 <smbconfsection name="[accounts]"/>
1165 <smbconfoption name="comment">Accounting Files</smbconfoption>
1166 <smbconfoption name="path">/data/accounts</smbconfoption>
1167 <smbconfoption name="read only">No</smbconfoption>
1169 <smbconfsection name="[service]"/>
1170 <smbconfoption name="comment">Financial Services Files</smbconfoption>
1171 <smbconfoption name="path">/data/service</smbconfoption>
1172 <smbconfoption name="read only">No</smbconfoption>
1173 </smbconfblock>
1174 </example>
1176 <example id="ch7-slvsmbocnfB">
1177 <title>Backup Domain Controller &smb.conf; File &smbmdash; Part B</title>
1178 <smbconfblock>
1179 <smbconfsection name="[pidata]"/>
1180 <smbconfoption name="comment">Property Insurance Files</smbconfoption>
1181 <smbconfoption name="path">/data/pidata</smbconfoption>
1182 <smbconfoption name="read only">No</smbconfoption>
1184 <smbconfsection name="[homes]"/>
1185 <smbconfoption name="comment">Home Directories</smbconfoption>
1186 <smbconfoption name="valid users">%S</smbconfoption>
1187 <smbconfoption name="read only">No</smbconfoption>
1188 <smbconfoption name="browseable">No</smbconfoption>
1190 <smbconfsection name="[printers]"/>
1191 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
1192 <smbconfoption name="path">/var/spool/samba</smbconfoption>
1193 <smbconfoption name="guest ok">Yes</smbconfoption>
1194 <smbconfoption name="printable">Yes</smbconfoption>
1195 <smbconfoption name="browseable">No</smbconfoption>
1197 <smbconfsection name="[apps]"/>
1198 <smbconfoption name="comment">Application Files</smbconfoption>
1199 <smbconfoption name="path">/apps</smbconfoption>
1200 <smbconfoption name="admin users">bjones</smbconfoption>
1201 <smbconfoption name="read only">No</smbconfoption>
1203 <smbconfsection name="[netlogon]"/>
1204 <smbconfoption name="comment">Network Logon Service</smbconfoption>
1205 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
1206 <smbconfoption name="guest ok">Yes</smbconfoption>
1207 <smbconfoption name="locking">No</smbconfoption>
1209 <smbconfsection name="[profiles]"/>
1210 <smbconfoption name="comment">Profile Share</smbconfoption>
1211 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
1212 <smbconfoption name="read only">No</smbconfoption>
1213 <smbconfoption name="profile acls">Yes</smbconfoption>
1215 <smbconfsection name="[profdata]"/>
1216 <smbconfoption name="comment">Profile Data Share</smbconfoption>
1217 <smbconfoption name="path">/var/lib/samba/profdata</smbconfoption>
1218 <smbconfoption name="read only">No</smbconfoption>
1219 <smbconfoption name="profile acls">Yes</smbconfoption>
1220 </smbconfblock>
1221 </example>
1223         <sect2>
1224                 <title>Key Points Learned</title>
1226                 <itemizedlist>
1227                         <listitem><para>
1228                         <indexterm><primary>LDAP</primary></indexterm><indexterm><primary>BDC</primary></indexterm>
1229                         Where Samba is used as a domain controller, the use of LDAP is an
1230                         essential component to permit the use of BDCs.
1231                         </para></listitem>
1233                         <listitem><para>
1234                         <indexterm><primary>wide-area</primary></indexterm>
1235                         Replication of the LDAP master server to create a network of BDCs
1236                         is an important mechanism for limiting WAN traffic.
1237                         </para></listitem>
1239                         <listitem><para>
1240                         Network administration presents many complex challenges, most of which
1241                         can be satisfied by good design but that also require sound communication
1242                         and unification of management practices. This can be highly challenging in
1243                         a large, globally distributed network.
1244                         </para></listitem>
1246                         <listitem><para>
1247                         Roaming profiles must be contained to the local network segment. Any
1248                         departure from this may clog wide-area arteries and slow legitimate network
1249                         traffic to a crawl.
1250                         </para></listitem>
1251                 </itemizedlist>
1253         </sect2>
1255         <figure id="chap7net">
1256                 <title>Network Topology &smbmdash; 2000 User Complex Design A</title>
1257                 <imagefile scale="80">chap7-net-Ar</imagefile>
1258         </figure>
1260         <figure id="chap7net2">
1261                 <title>Network Topology &smbmdash; 2000 User Complex Design B</title>
1262                 <imagefile scale="80">chap7-net2-Br</imagefile>
1263         </figure>
1265 </sect1>
1267 <sect1>
1268         <title>Questions and Answers</title>
1270         <para>
1271         There is much rumor and misinformation regarding the use of MS Windows networking protocols.
1272         These questions are just a few of those frequently asked.
1273         </para>
1275         <qandaset defaultlabel="chap07qa" type="number">
1276         <qandaentry>
1277         <question>
1279             <para>
1280                 <indexterm><primary>DHCP</primary></indexterm>
1281                 <indexterm><primary>network</primary><secondary>bandwidth</secondary></indexterm>
1282                 Is it true that DHCP uses lots of WAN bandwidth?
1283                 </para>
1285         </question>
1286         <answer>
1288             <para>
1289                 <indexterm><primary>DHCP</primary><secondary>Relay Agent</secondary></indexterm>
1290                 <indexterm><primary>routers</primary></indexterm>
1291                 <indexterm><primary>DHCP</primary><secondary>servers</secondary></indexterm>
1292                 It is a smart practice to localize DHCP servers on each network segment. As a 
1293                 rule, there should be two DHCP servers per network segment. This means that if
1294                 one server fails, there is always another to service user needs. DHCP requests use
1295                 only UDP broadcast protocols. It is possible to run a DHCP Relay Agent on network
1296                 routers. This makes it possible to run fewer DHCP servers.
1297                 </para>
1299             <para>
1300                 <indexterm><primary>DHCP</primary><secondary>request</secondary></indexterm>
1301                 <indexterm><primary>DHCP</primary><secondary>traffic</secondary></indexterm>
1302                 A DHCP network address request and confirmation usually results in about six UDP packets.
1303                 The packets are from 60 to 568 bytes in length. Let us consider a site that has 300 DHCP
1304                 clients and that uses a 24-hour IP address lease. This means that all clients renew
1305                 their IP address lease every 24 hours. If we assume an average packet length equal to the
1306                 maximum (just to be on the safe side), and we have a 128 Kb/sec wide-area connection, 
1307                 how significant would the DHCP traffic be if all of it were to use DHCP Relay?
1308                 </para>
1310                 <para>
1311                 I must stress that this is a bad design, but here is the calculation:
1312 <screen>
1313 Daily Network Capacity: 128,000 (Kbits/s) / 8 (bits/byte) 
1314                              x 3600 (sec/hr) x 24 (hrs/day)= 2288 Mbytes/day.
1316 DHCP traffic:          300 (clients) x 6 (packets) 
1317                                        x 512 (bytes/packet) = 0.9 Mbytes/day.
1318 </screen>
1319                 From this can be seen that the traffic impact would be minimal.
1320                 </para>
1322             <para>
1323                 <indexterm><primary>DNS</primary><secondary>Dynamic</secondary></indexterm>
1324                 <indexterm><primary>DHCP</primary></indexterm>
1325                 Even when DHCP is configured to do DNS update (dynamic DNS) over a wide-area link,
1326                 the impact of the update is no more than the DHCP IP address renewal traffic and thus
1327                 still insignificant for most practical purposes.
1328                 </para>
1330         </answer>
1331         </qandaentry>
1333         <qandaentry>
1334         <question>
1336             <para>
1337                 <indexterm><primary>background communication</primary></indexterm>
1338                 <indexterm><primary>LDAP</primary><secondary>master/slave</secondary><tertiary>background communication</tertiary></indexterm>
1339                 How much background communication takes place between a master LDAP server and its slave LDAP servers?
1340                 </para>
1342         </question>
1343         <answer>
1345             <para>
1346                 <indexterm><primary>slurpd</primary></indexterm>
1347                 The process that controls the replication of data from the master LDAP server to the slave LDAP
1348                 servers is called <command>slurpd</command>. The <command>slurpd</command> remains nascent (quiet)
1349                 until an update must be propagated. The propagation traffic per LDAP slave to update (add/modify/delete)
1350                 two user accounts requires less than 10KB traffic.
1351                 </para>
1353         </answer>
1354         </qandaentry>
1356         <qandaentry>
1357         <question>
1359                 <para>
1360                 LDAP has a database. Is LDAP not just a fancy database front end?
1361                 </para>
1363         </question>
1364         <answer>
1366             <para>
1367                 <indexterm><primary>database</primary></indexterm>
1368                 <indexterm><primary>LDAP</primary><secondary>database</secondary></indexterm>
1369                 <indexterm><primary>SQL</primary></indexterm>
1370                 <indexterm><primary>transactional</primary></indexterm>
1371                 LDAP does store its data in a database of sorts. In fact, the LDAP backend is an application-specific
1372                 data storage system. This type of database is indexed so that records can be rapidly located, but the
1373                 database is not generic and can be used only in particular pre-programmed ways. General external
1374                 applications do not gain access to the data. This type of database is used also by SQL servers. Both
1375                 an SQL server and an LDAP server provide ways to access the data. An SQL server has a transactional
1376                 orientation and typically allows external programs to perform ad hoc queries, even across data tables.
1377                 An LDAP front end is a purpose-built tool that has a search orientation that is designed around specific
1378                 simple queries. The term <constant>database</constant> is heavily overloaded and thus much misunderstood.
1379                 </para>
1381         </answer>
1382         </qandaentry>
1384         <qandaentry>
1385         <question>
1387             <para>
1388                 <indexterm><primary>OpenLDAP</primary></indexterm>
1389                 Can Active Directory obtain account information from an OpenLDAP server?
1390                 </para>
1392         </question>
1393         <answer>
1395             <para>
1396                 <indexterm><primary>meta-directory</primary></indexterm>
1397                 No, at least not directly. It is possible to provision Active Directory from and/or to an OpenLDAP
1398                 database through use of a metadirectory server. Microsoft MMS (now called MIIS) can interface
1399                 to OpenLDAP using standard LDAP queries and updates. 
1400                 </para>
1402         </answer>
1403         </qandaentry>
1405         <qandaentry>
1406         <question>
1408                 <para>
1409                 What are the parts of a roaming profile? How large is each part?
1410                 </para>
1412         </question>
1413         <answer>
1415             <para><indexterm>
1416                 <primary>roaming profile</primary>
1417               </indexterm>
1418                 A roaming profile consists of
1419                 </para>
1421                 <itemizedlist>
1422                         <listitem><para>
1423                         Desktop folders such as <constant>Desktop</constant>, <constant>My Documents</constant>,
1424                         <constant>My Pictures</constant>, <constant>My Music</constant>, <constant>Internet Files</constant>,
1425                         <constant>Cookies</constant>, <constant>Application Data</constant>,
1426                         <constant>Local Settings,</constant> and more. See <link linkend="happy"/>, <link linkend="XP-screen001"/>.
1427                         </para>
1429                         <para>
1430                         <indexterm><primary>folder redirection</primary></indexterm>
1431                         Each of these can be anywhere from a few bytes to gigabytes in capacity. Fortunately, all
1432                         such folders can be redirected to network drive resources. See <link linkend="redirfold"/>
1433                         for more information regarding folder redirection.
1434                         </para></listitem>
1436                         <listitem><para>
1437                         A static or rewritable portion that is typically only a few files (2-5 KB of information).
1438                         </para></listitem>
1440                         <listitem><para>
1441                         <indexterm><primary>NTUSER.DAT</primary></indexterm>
1442                         <indexterm><primary>HKEY_LOCAL_USER</primary></indexterm>
1443                         The registry load file that modifies the <constant>HKEY_LOCAL_USER</constant> hive. This is
1444                         the <filename>NTUSER.DAT</filename> file. It can be from 0.4 to 1.5 MB.
1445                         </para></listitem>
1446                 </itemizedlist>
1448             <para>
1449                 <indexterm><primary>Microsoft Outlook</primary><secondary>PST files</secondary></indexterm>
1450                 Microsoft Outlook PST files may be stored in the <constant>Local Settings\Application Data</constant>
1451                 folder. It can be up to 2 GB in size per PST file.
1452                 </para>
1454         </answer>
1455         </qandaentry>
1457         <qandaentry>
1458         <question>
1460                 <para>
1461                 Can the <constant>My Documents</constant> folder be stored on a network drive?
1462                 </para>
1464         </question>
1465         <answer>
1467             <para>
1468                 <indexterm><primary>UNC name</primary></indexterm>
1469                 <indexterm><primary>Universal Naming Convention</primary><see>UNC name</see></indexterm>
1470                 Yes. More correctly, such folders can be redirected to network shares. No specific network drive
1471                 connection is required. Registry settings permit this to be redirected directly to a UNC (Universal
1472                 Naming Convention) resource, though it is possible to specify a network drive letter instead of a
1473                 UNC name. See <link linkend="redirfold"/>.
1474                 </para>
1476         </answer>
1477         </qandaentry>
1479         <qandaentry>
1480         <question>
1482             <para>
1483                 <indexterm><primary>wide-area</primary></indexterm>
1484                 <indexterm><primary>network</primary><secondary>bandwidth</secondary></indexterm>
1485                 <indexterm><primary>WINS</primary></indexterm>
1486                 How much WAN bandwidth does WINS consume?
1487                 </para>
1489         </question>
1490         <answer>
1492             <para>
1493                 <indexterm><primary>NetBIOS</primary><secondary>name cache</secondary></indexterm>
1494                 <indexterm><primary>WINS server</primary></indexterm>
1495                 <indexterm><primary>domain replication</primary></indexterm>
1496                 MS Windows clients cache information obtained from WINS lookups in a local NetBIOS name cache.
1497                 This keeps WINS lookups to a minimum. On a network with 3500 MS Windows clients and a central WINS
1498                 server, the total bandwidth demand measured at the WINS server, averaged over an 8-hour working day,
1499                 was less than 30 KB/sec. Analysis of network traffic over a 6-week period showed that the total
1500                 of all background traffic consumed about 11 percent of available bandwidth over 64 Kb/sec links.
1501                 Background traffic consisted of domain replication, WINS queries, DNS lookups, and authentication
1502                 traffic. Each of 11 branch offices had a 64 Kb/sec wide-area link, with a 1.5 Mb/sec main connection
1503                 that aggregated the branch office connections plus an Internet connection.
1504                 </para>
1506                 <para>
1507                 In conclusion, the total load afforded through WINS traffic is again marginal to total operational
1508                 usage &smbmdash; as it should be.
1509                 </para>
1511         </answer>
1512         </qandaentry>
1514         <qandaentry>
1515         <question>
1517                 <para>
1518                 How many BDCs should I have? What is the right number of Windows clients per server?
1519                 </para>
1521         </question>
1522         <answer>
1524                 <para>
1525                 It is recommended to have at least one BDC per network segment, including the segment served
1526                 by the PDC. Actual requirements vary depending on the working load on each of the BDCs and the
1527                 load demand pattern of client usage. I have seen sites that function without problem with 200
1528                 clients served by one BDC, and yet other sites that had one BDC per 20 clients. In one particular
1529                 company, there was a drafting office that had 30 CAD/CAM operators served by one server, a print
1530                 server; and an application server. While all three were BDCs, typically only the print server would
1531                 service network logon requests after the first 10 users had started to use the network. This was
1532                 a reflection of the service load placed on both the application server and the data server.
1533                 </para>
1535                 <para>
1536                 As unsatisfactory as the answer might sound, it all depends on network and server load
1537                 characteristics.
1538                 </para>
1540         </answer>
1541         </qandaentry>
1543         <qandaentry>
1544         <question>
1546             <para>
1547                 <indexterm><primary>NIS server</primary></indexterm><indexterm><primary>LDAP</primary></indexterm>
1548                 I've heard that you can store NIS accounts in LDAP. Is LDAP not just a smarter way to
1549                 run an NIS server?
1550                 </para>
1552         </question>
1553         <answer>
1555                 <para>
1556                 The correct answer to both questions is yes. But do understand that an LDAP server has
1557                 a configurable schema that can store far more information for many more purposes than
1558                 just NIS.
1559                 </para>
1561         </answer>
1562         </qandaentry>
1564         <qandaentry>
1565         <question>
1567                 <para>
1568                 Can I use NIS in place of LDAP?
1569                 </para>
1571         </question>
1572         <answer>
1574             <para>
1575                 <indexterm><primary>NIS</primary></indexterm>
1576                 <indexterm><primary>NIS schema</primary></indexterm>
1577                 No. The NIS database does not have provision to store Microsoft encrypted passwords and does not deal
1578                 with the types of data necessary for interoperability with Microsoft Windows networking. The use
1579                 of LDAP with Samba requires the use of a number of schemas, one of which is the NIS schema, but also
1580                 a Samba-specific schema extension.
1581                 </para>
1583 </answer>
1584         </qandaentry>
1586         </qandaset>
1587 </sect1>
1589 </chapter>