More copy edits and content updates.
[import/samba-docs-svnimport.git] / Samba3-HOWTO / TOSHARG-PDC.xml
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="samba-pdc">
4
5 <chapterinfo>
6         &author.jht;
7         &author.jerry;
8         &author.dbannon;
9         <author>&person.gd; <contrib>LDAP updates</contrib></author>
10 </chapterinfo>
11
12 <title>Domain Control</title>
13
14 <para>
15 There are many who approach MS Windows networking with incredible misconceptions.
16 That's okay, because it gives the rest of us plenty of opportunity to be of assistance.
17 Those who really want help are well advised to become familiar with information
18 that is already available.
19 </para>
20
21 <para>
22 <indexterm><primary>domain</primary><secondary>controller</secondary></indexterm>
23 You are advised not to tackle this section without having first understood
24 and mastered some basics. MS Windows networking is not particularly forgiving of
25 misconfiguration. Users of MS Windows networking are likely to complain 
26 of persistent niggles that may be caused by a broken network configuration.
27 To a great many people, however, MS Windows networking starts with a domain controller
28 that in some magical way is expected to solve all network operational ills.
29 </para>
30
31 <para>
32 <link linkend="domain-example">The Example Domain Illustration</link> shows a typical MS Windows domain security
33 network environment. Workstations A, B, and C are representative of many physical MS Windows
34 network clients.
35 </para>
36
37 <figure id="domain-example">
38         <title>An Example Domain.</title>
39         <imagefile scale="50">domain</imagefile>
40 </figure>
41
42 <para>
43 From the Samba mailing list we can readily identify many common networking issues.
44 If you are not clear on the following subjects, then it will do much good to read the 
45 sections of this HOWTO that deal with it. These are the most common causes of MS Windows
46 networking problems:
47 </para>
48
49 <itemizedlist>
50         <listitem><para>Basic TCP/IP configuration.</para></listitem>
51         <listitem><para>NetBIOS name resolution.</para></listitem>
52         <listitem><para>Authentication configuration.</para></listitem>
53         <listitem><para>User and group configuration.</para></listitem>
54         <listitem><para>Basic file and directory permission control in UNIX/Linux.</para></listitem>
55         <listitem><para>Understanding how MS Windows clients interoperate in a network environment.</para></listitem>
56 </itemizedlist>
57
58 <para>
59 Do not be put off; on the surface of it MS Windows networking seems so simple that anyone 
60 can do it. In fact, it is not a good idea to set up an MS Windows network with
61 inadequate training and preparation. But let's get our first indelible principle out of the
62 way: <emphasis>It is perfectly okay to make mistakes!</emphasis> In the right place and at
63 the right time, mistakes are the essence of learning. It is very much not okay to make
64 mistakes that cause loss of productivity and impose an avoidable financial burden on an
65 organization.
66 </para>
67
68 <para>
69 Where is the right place to make mistakes? Only out of harms way. If you are going to
70 make mistakes, then please do it on a test network, away from users, and in such a way as
71 to not inflict pain on others. Do your learning on a test network.
72 </para>
73
74 <sect1>
75 <title>Features and Benefits</title>
76
77 <para>
78 <indexterm><primary>domain security</primary></indexterm>
79 <emphasis>What is the key benefit of Microsoft Domain Security?</emphasis>
80 </para>
81
82 <para>
83 <indexterm>single sign-on<primary></primary><see>SSO</see></indexterm>
84 <indexterm><primary>trust</primary></indexterm>
85 <indexterm><primary>account</primary></indexterm>
86 <indexterm><primary>domain</primary><secondary>security</secondary><tertiary>protocols</tertiary></indexterm>
87 In a word, <emphasis>single sign-on</emphasis>, or SSO for short. To many, this is the Holy Grail of MS
88 Windows NT and beyond networking. SSO allows users in a well-designed network to log onto any workstation that
89 is a member of the domain that contains their user account (or in a domain that has an appropriate trust
90 relationship with the domain they are visiting) and they will be able to log onto the network and access
91 resources (shares, files, and printers) as if they are sitting at their home (personal) workstation. This is a
92 feature of the domain security protocols.
93 </para>
94
95 <para>
96 <indexterm><primary>SID</primary></indexterm>
97 <indexterm><primary>RID</primary></indexterm>
98 <indexterm><primary>relative identifier</primary><see>RID</see></indexterm>
99 <indexterm><primary>security identifier</primary><see>SID</see></indexterm>
100 <indexterm><primary>access control</primary></indexterm>
101 The benefits of domain security are available to those sites that deploy a Samba PDC.  A domain provides a
102 unique network security identifier (SID). Domain user and group security identifiers are comprised of the
103 network SID plus a relative identifier (RID) that is unique to the account. User and group SIDs (the network
104 SID plus the RID) can be used to create access control lists (ACLs) attached to network resources to provide
105 organizational access control. UNIX systems recognize only local security identifiers.
106 </para>
107
108 <note><para>
109 <indexterm><primary>domain</primary><secondary>member</secondary></indexterm>
110 <indexterm><primary>machine account</primary></indexterm>
111 <indexterm><primary>domain</primary><secondary>trust account</secondary></indexterm>
112 Network clients of an MS Windows domain security environment must be domain members to be able to gain access
113 to the advanced features provided. Domain membership involves more than just setting the workgroup name to the
114 domain name. It requires the creation of a domain trust account for the workstation (called a machine
115 account). Refer to <link linkend="domain-member">Domain Membership</link> for more information.
116 </para></note>
117
118 <para>
119 The following functionalities are new to the Samba-3 release:
120 </para>
121
122 <itemizedlist>
123         <listitem><para>
124         <indexterm><primary>account</primary><secondary>backend</secondary></indexterm>
125         Samba-3 supports the use of a choice of backends that may be used in which user, group and machine
126         accounts may be stored. Multiple passwd backends can be used in combination, either as additive backend
127         data sets, or as fail-over data sets.
128         </para>
129
130         <para>
131         <indexterm><primary>LDAP</primary></indexterm>
132         <indexterm><primary>replicated</primary></indexterm>
133         <indexterm><primary>distributed</primary></indexterm>
134         <indexterm><primary>scalability</primary></indexterm>
135         <indexterm><primary>reliability</primary></indexterm>
136         An LDAP passdb backend confers the benefit that the account backend can be distributed and replicated,
137         which is of great value because it confers scalability and provides a high degree of reliability. 
138         </para></listitem>
139
140         <listitem><para>
141         <indexterm><primary>interdomain</primary><secondary>trust</secondary><tertiary>account</tertiary></indexterm>
142         <indexterm><primary>trust account</primary><secondary>interdomain</secondary></indexterm>
143         <indexterm><primary>interoperability</primary></indexterm>
144         Windows NT4 domain trusts. Samba-3 supports workstation and server (machine) trust accounts. It also
145         supports Windows NT4 style interdomain trust accounts, which further assists in network scalability
146         and interoperability.
147         </para></listitem>
148         
149         <listitem><para>
150         <indexterm><primary>NetBIOS</primary></indexterm>
151         <indexterm><primary>raw SMB</primary></indexterm>
152         <indexterm><primary>active directory</primary></indexterm>
153         <indexterm><primary>domain</primary><secondary>member server</secondary></indexterm>
154         <indexterm><primary>domain</primary><secondary>controller</secondary></indexterm>
155         <indexterm><primary>network</primary><secondary>browsing</secondary></indexterm>
156         Operation without NetBIOS over TCP/IP, rather using the raw SMB over TCP/IP. Note, this is feasible
157         only when operating as a Microsoft active directory domain member server. When acting as a Samba domain
158         controller the use of NetBIOS is necessary to provide network browsing support.
159         </para></listitem>
160
161         <listitem><para>
162         <indexterm><primary>WINS</primary></indexterm>
163         <indexterm><primary>TCP port</primary></indexterm>
164         <indexterm><primary>session services</primary></indexterm>
165         Samba-3 provides NetBIOS name services (WINS), NetBIOS over TCP/IP (TCP port 139) session services, SMB over
166         TCP/IP (TCP port 445) session services, and Microsoft compatible ONC DCE RPC services (TCP port 135)
167         services.
168         </para></listitem>
169
170         <listitem><para>
171         <indexterm><primary>Nexus.exe</primary></indexterm>
172         Management of users and groups via the User Manager for Domains. This can be done on any MS Windows client
173         using the <filename>Nexus.exe</filename> toolkit for Windows 9x/Me, or using the SRVTOOLS.EXE package for MS
174         Windows NT4/200x/XP platforms. These packages are available from Microsoft's Web site.
175         </para></listitem>
176
177         <listitem><para>
178         Implements full Unicode support. This simplifies cross-locale internationalization support. It also opens up
179         the use of protocols that Samba-2.2.x had but could not use due to the need to fully support Unicode.
180         </para></listitem>
181 </itemizedlist>
182
183 <para>
184 The following functionalities are not provided by Samba-3:
185 </para>
186
187 <itemizedlist>
188         <listitem><para>
189         <indexterm><primary>SAM</primary></indexterm>
190         <indexterm><primary>replication</primary></indexterm>
191         SAM replication with Windows NT4 domain controllers (i.e., a Samba PDC and a Windows NT BDC, or vice versa).
192         This means Samba cannot operate as a BDC when the PDC is Microsoft-based Windows NT PDC. Samba-3 can not
193         participate in replication of account data to Windows PDCs and BDCs.
194         </para></listitem>
195         
196         <listitem><para>
197         <indexterm><primary>kerberos</primary></indexterm>
198         <indexterm><primary>active directory</primary></indexterm>
199         Acting as a Windows 2000 active directory domain controller (i.e., Kerberos and Active Directory). In point of
200         fact, Samba-3 does have some Active Directory domain control ability that is at this time purely experimental.
201         Active directory domain control is one of the features that is being developed in Samba-4, the next
202         generation Samba release. At this time there are no plans to enable active directory domain control
203         support during the Samba-3 series life-cycle.
204         </para></listitem>
205
206         <listitem><para>
207         <indexterm><primary>MMC</primary></indexterm>
208         <indexterm><primary>SVRTOOLS.EXE</primary></indexterm>
209         <indexterm><primary>Microsoft management console</primary><see>MMC</see></indexterm>
210         The Windows 200x/XP Microsoft Management Console (MMC) cannot be used to manage a Samba-3 server. For this you
211         can use only the MS Windows NT4 Domain Server Manager and the MS Windows NT4 Domain User Manager. Both are
212         part of the SVRTOOLS.EXE package mentioned later.
213         </para></listitem>
214 </itemizedlist>
215
216 <para>
217 <indexterm><primary>Windows XP Home edition</primary></indexterm>
218 <indexterm><primary>LanMan</primary></indexterm>
219 Windows 9x/Me/XP Home clients are not true members of a domain for reasons outlined in this chapter. The
220 protocol for support of Windows 9x/Me-style network (domain) logons is completely different from NT4/Windows
221 200x-type domain logons and has been officially supported for some time. These clients use the old LanMan
222 network logon facilities that are supported in Samba since approximately the Samba-1.9.15 series.
223 </para>
224
225 <para>
226 <indexterm><primary>group</primary><secondary>mapping</secondary></indexterm>
227 Samba-3 implements group mapping between Windows NT groups and UNIX groups (this is really quite complicated
228 to explain in a short space). This is discussed more fully in <link linkend="groupmapping">Group Mapping: MS
229 Windows and UNIX</link>.
230 </para>
231
232 <para>
233 <indexterm><primary>machine trust account</primary></indexterm>
234 <indexterm><primary>trust account</primary><secondary>machine</secondary></indexterm>
235 <indexterm><primary>machine account</primary></indexterm>
236 Samba-3, like an MS Windows NT4 PDC or a Windows 200x Active Directory, needs to store user and Machine Trust
237 Account information in a suitable backend data-store.  Refer to <link linkend="machine-trust-accounts">MS
238 Windows Workstation/Server Machine Trust Accounts</link>. With Samba-3 there can be multiple backends for
239 this. A complete discussion of account database backends can be found in <link linkend="passdb">Account
240 Information Databases</link>.
241 </para>
242
243 </sect1>
244
245 <sect1>
246 <title>Single Sign-On and Domain Security</title>
247
248 <para>
249 <indexterm><primary>single sign-on</primary><see>SSO</see></indexterm>
250 <indexterm><primary>SSO</primary></indexterm>
251 <indexterm><primary>active directory</primary></indexterm>
252 <indexterm><primary>authentication</primary></indexterm>
253 <indexterm><primary>validation</primary></indexterm>
254 <indexterm><primary>password uniqueness</primary></indexterm>
255 <indexterm><primary>password history</primary></indexterm>
256 When network administrators  are asked to describe the benefits of Windows NT4 and active directory networking
257 the most often mentioned feature is that of single sign-on (SSO). Many companies have implemented SSO
258 solutions. The mode of implementation of a single sign-on solution is an important factor in the practice of
259 networking in general, and is critical in respect of Windows networking. A company may have a wide variety of
260 information systems, each of which requires a form of user authentication and validation, thus it is not
261 uncommon that users may need to remember more than ten login IDs and passwords. This problem is compounded
262 when the password for each system must be changed at regular intervals, and particularly so where password
263 uniqueness and history limits are applied.
264 </para>
265
266 <para>
267 <indexterm><primary>management overheads</primary></indexterm>
268 There is a broadly held perception that SSO is the answer to the problem of users having to deal with too many
269 information system access credentials (username/password pairs). Many elaborate schemes have been devised to
270 make it possible to deliver a user-friendly SSO solution. The trouble is that if this implementation is not
271 done correctly, the site may end up paying dearly by way of complexity and management overheads. Simply put,
272 many SSO solutions are an administrative nightmare.
273 </para>
274
275 <para>
276 <indexterm><primary>identity management</primary></indexterm>
277 <indexterm><primary>authentication system</primary></indexterm>
278 <indexterm><primary>SSO</primary></indexterm>
279 SSO implementations utilize centralization of all user account information. Depending on environmental
280 complexity and the age of the systems over which a SSO solution is implemented, it may not be possible to
281 change the solution architecture so as to accomodate a new identity management and user authentication system.
282 Many SSO solutions involving legacy systems consist of a new super-structure that handles authentication on
283 behalf of the user. The software that gets layered over the old system may simply implement a proxy
284 authentication system. This means that the addition of SSO increases over-all information systems complexity.
285 Ideally, the implementation of SSO should reduce complexity and reduce administative overheads.
286 </para>
287
288 <para>
289 <indexterm><primary>centralized identity management</primary></indexterm>
290 <indexterm><primary>identity management</primary><secondary>centralized</secondary></indexterm>
291 <indexterm><primary>centralized</primary><secondary>authentication</secondary></indexterm>
292 <indexterm><primary>legacy systems</primary></indexterm>
293 <indexterm><primary>access control</primary></indexterm>
294 The initial goal of many network administrators is often to create and use a centralized identity management
295 system. It is often assumed that such a centralized system will use a single authentication infrastructure
296 that can be used by all information systems. The Microsoft Windows NT4 security domain architecture and the
297 Micrsoft active directory service are often put forward as the ideal foundation for such a system. It is
298 conceptually simple to install an external authentication agent on each of the disparate infromation systems
299 that can then use the Microsoft (NT4 domain or ads service) for user authentication and access control. The
300 wonderful dream of a single centralized authentication service is commonly broken when realities are realized.
301 The problem with legacy systems is often the inability to externalize the authentication and access control
302 system it uses because its implementation will be excessively invasive from a re-engineering perspective, or
303 because application software has built-in dependencies on particular elements of the way user authentication
304 and access control were designed and built.
305 </para>
306
307 <para>
308 <indexterm><primary>meta-directory</primary></indexterm>
309 <indexterm><primary>credentials</primary></indexterm>
310 <indexterm><primary>disparate information systems</primary></indexterm>
311 <indexterm><primary>management procedures</primary></indexterm>
312 <indexterm><primary>work-flow protocol</primary></indexterm>
313 <indexterm><primary>rights</primary></indexterm>
314 <indexterm><primary>privileges</primary></indexterm>
315 <indexterm><primary>provisioned</primary></indexterm>
316 Over the past decade an industry has been developed around the various methods that have been built to get
317 around the key limitations of legacy information technology systems. One approach that is often used involves
318 the use of a meta-directory. The meta-directory stores user credentials for all disparate information systems
319 in the format that is particular to each system. An elaborate set of management procedures is coupled with a
320 rigidly enforced work-flow protocol for managing user rights and privileges within the maze of systems that
321 are provisioned by the new infrastructure makes possible user access to all systems using a single set of user
322 credentials.
323 </para>
324
325 <para>
326 <indexterm><primary>Organization for the Advancement of Structured Information Standards</primary><see>OASIS</see></indexterm>
327 <indexterm><primary>Security Assertion Markup Language</primary><see>SAML</see></indexterm>
328 <indexterm><primary>Federated Identity Management</primary><see>FIM</see></indexterm>
329 <indexterm><primary>secure access</primary></indexterm>
330 The Organization for the Advancement of Structured Information Standards (OASIS) has developed the Security
331 Assertion Markup Language (SAML), a structured method for communication of authentication information. The
332 over-all umbrella name for the technologies and methods that deploy SAML is called Federated Identity
333 Management (FIM). FIM depends on each system in the complex maze of disparate information systems to
334 authenticate their respective users and vouch for secure access to the services each provides.
335 </para>
336
337 <para>
338 <indexterm><primary>Simple Object Access Protocol</primary><see>SOAP</see></indexterm>
339 <indexterm><primary>federated organizations</primary></indexterm>
340 <indexterm><primary>Liberty Alliance</primary></indexterm>
341 <indexterm><primary>federated-identity</primary></indexterm>
342 <indexterm><primary></primary></indexterm>
343 <indexterm><primary></primary></indexterm>
344 SAML documents can be wrapped in a Simple Object Access Protocol (SOAP) message for the computer-to-computer
345 communications needed for Web services. Or they may be passed between Web servers of federated organizations
346 that share live services. The Liberty Alliance, an industry group formed to promote federated-identity
347 standards, has adopted SAML 1.1 as part of its application framework. Microsoft and IBM have proposed an
348 alternative specification called WS-Security. Some believe that the competing technologies and methods may
349 converge when the SAML 2.0 standard is introduced. A few Web access-management products support SAML today,
350 but implemention of the technology mostly requires customization to integrate applications and develop user
351 interfaces. In a nust-shell, that is why FIM is a big and growing industry.
352 </para>
353
354 <para>
355 <indexterm><primary>interoperability</primary></indexterm>
356 <indexterm><primary>ADS</primary></indexterm>
357 <indexterm><primary>LDAP</primary></indexterm>
358 <indexterm><primary>GSSAPI</primary></indexterm>
359 <indexterm><primary>general security service application programming interface</primary><see>GSSAPI</see></indexterm>
360 Ignoring the bigger picture, which is beyond the scope of this book, the migration of all user and group
361 management to a centralized system is a step in the right direction. It is essential for interoperability
362 reasons to locate the identity management system data in a directory such as Microsoft Active Directory
363 Service (ADS), or any proprietary or open source system that provides a standard protocol for information
364 access (such as LDAP) and that can be coupled with a flexible array of authentication mechanisms (such as
365 kerberos) that use the protocols that are defined by the various general security service application
366 programming interface (GSSAPI) services.
367 </para>
368
369 <para>
370 <indexterm><primary>OpenLDAP</primary></indexterm>
371 <indexterm><primary>ADS</primary></indexterm>
372 <indexterm><primary>authentication agents</primary></indexterm>
373 A growing number of companies provide authentication agents for disparate legacy platforms to permit the use
374 of LDAP systems. Thus the use of OpenLDAP, the dominant open source software implementation of the light
375 weight directory access protocol standard. This fact, means that by providing support in Samba for the use of
376 LDAP and Microsoft ADS make Samba a highly scalable and forward reaching organizational networking technology.
377 </para>
378
379 <para>
380 <indexterm><primary>ADS</primary></indexterm>
381 <indexterm><primary>LDAP</primary></indexterm>
382 <indexterm><primary>authentication architecture</primary></indexterm>
383 <indexterm><primary>ntlm_auth</primary></indexterm>
384 <indexterm><primary>SQUID</primary></indexterm>
385 <indexterm><primary>FIM</primary></indexterm>
386 Microsoft ADS provides purely proprietary services that, with limitation, can be extended to provide a
387 centralized authentication infrastructure. Samba plus LDAP provides a similar opportunity for extension of a
388 centralized authentication architecture, but it is the fact that the Samba Team are pro-active in introducing
389 the extension of authentication services, using LDAP or otherwise, to applications such as SQUID (the open
390 source proxy server) through tools such as the <command>ntlm_auth</command> utility, that does much to create
391 sustainable choice and competition in the FIM market place.
392 </para>
393
394 <para>
395 <indexterm><primary>LDAP</primary></indexterm>
396 <indexterm><primary>OpenLDAP</primary></indexterm>
397 <indexterm><primary>identity information</primary></indexterm>
398 Primary domain control, if it is to be scalable to meet the needs of large sites, must therefore be capable of
399 using LDAP. The rapid adoption of OpenLDAP, and Samba configurations that use it, is ample proof that the era
400 of the directoy has started. Samba-3 does not demand the use of LDAP, but the demand for a mechanism by which
401 user and group identity information can be distributed makes it an an unavoidable option.
402 </para>
403
404 <para>
405 <indexterm><primary>BDC</primary></indexterm>
406 <indexterm><primary>LDAP</primary></indexterm>
407 <indexterm><primary>e-Directory</primary></indexterm>
408 At this time, the use of Samba based BDCs, necessitates the use of LDAP. The most commonly used LDAP
409 implementation used by Samba sites is OpenLDAP. It is possible to use any standards compliant LDAP server.
410 Those known to work includes those manufactured by: IBM, CA, Novell (e-Directory), and others.
411 </para>
412
413 </sect1>
414
415 <sect1>
416 <title>Basics of Domain Control</title>
417
418 <para>
419 <indexterm><primary>domain control</primary></indexterm>
420 Over the years, public perceptions of what domain control really is has taken on an almost mystical nature.
421 Before we branch into a brief overview of domain control, there are three basic types of domain controllers.
422 </para>
423
424 <sect2>
425 <title>Domain Controller Types</title>
426
427 <itemizedlist>
428         <listitem><para>NT4 style Primary Domain Controller</para></listitem>
429         <listitem><para>NT4 style Backup Domain Controller</para></listitem>
430         <listitem><para>ADS Domain Controller</para></listitem>
431 </itemizedlist>
432
433 <para>
434 <indexterm><primary>PDC</primary></indexterm>
435 <indexterm><primary>powerful</primary></indexterm>
436 <indexterm><primary>network</primary><secondary>performance</secondary></indexterm>
437 <indexterm><primary>domain</primary><secondary>member</secondary><secondary>server</secondary></indexterm>
438 The <emphasis>Primary Domain Controller</emphasis> or PDC plays an important role in MS Windows NT4. In
439 Windows 200x domain control architecture, this role is held by domain controllers.  Folklore dictates that
440 because of its role in the MS Windows network, the domain controller should be the most powerful and most
441 capable machine in the network.  As strange as it may seem to say this here, good overall network performance
442 dictates that the entire infrastructure needs to be balanced. It is advisable to invest more in standalone
443 (domain member) servers than in the domain controllers.
444 </para>
445
446 <para>
447 <indexterm><primary>SAM</primary></indexterm>
448 <indexterm><primary>BDC</primary></indexterm>
449 <indexterm><primary>authenticatior</primary></indexterm>
450 <indexterm><primary>synchronization</primary></indexterm>
451 <indexterm><primary>Security Account Manager</primary><see>SAM</see></indexterm>
452 In the case of MS Windows NT4-style domains, it is the PDC that initiates a new domain control database.
453 This forms a part of the Windows registry called the Security Account Manager (SAM). It plays a key
454 part in NT4-type domain user authentication and in synchronization of the domain authentication
455 database with BDCs. 
456 </para>
457
458 <para>
459 <indexterm><primary>domain</primary><secondary>controller</secondary><tertiary>hierarchy</tertiary></indexterm>
460 <indexterm><primary>LDAP</primary></indexterm>
461 <indexterm>account<primary></primary><secondary>backend</secondary></indexterm>
462 <indexterm><primary>machine account</primary></indexterm>
463 With MS Windows 200x Server-based Active Directory domains, one domain controller initiates a potential
464 hierarchy of domain controllers, each with its own area of delegated control. The master domain
465 controller has the ability to override any downstream controller, but a downline controller has
466 control only over its downline. With Samba-3, this functionality can be implemented using an
467 LDAP-based user and machine account backend.
468 </para>
469
470 <para>
471 <indexterm><primary>backend database</primary></indexterm>
472 <indexterm><primary>registry</primary></indexterm>
473 New to Samba-3 is the ability to use a backend database that holds the same type of data as the NT4-style SAM
474 database (one of the registry files)<footnote><para>See also <link linkend="passdb">Account Information
475 Databases</link>.</para>.</footnote>
476 </para>
477
478 <para>
479 <indexterm><primary>BDC</primary></indexterm>
480 <indexterm><primary>PDC</primary></indexterm>
481 <indexterm><primary>WINS</primary></indexterm>
482 <indexterm><primary>authentication</primary></indexterm>
483 <indexterm><primary>netlogon</primary></indexterm>
484 <indexterm><primary>name lookup</primary></indexterm>
485 The <emphasis>Backup Domain Controller</emphasis> or BDC plays a key role in servicing network authentication
486 requests. The BDC is biased to answer logon requests in preference to the PDC.  On a network segment that has
487 a BDC and a PDC, the BDC will most likely service network logon requests. The PDC will answer network logon
488 requests when the BDC is too busy (high load). When a user logs onto a Windows domain member client the
489 workstation will query the network to locate the nearest network logon server. Where a WINS server is used,
490 this is done via a query to the WINS server. If a netlogon server can not be found from the WINS query, or in
491 the absence of a WINS server, the workstation will perform a NetBIOS name lookup via a mailslot broadcast over
492 the UDP broadcast protocol. This means that the netlogon server that the windows client will use is influenced
493 by a number of variables, thus there is no simple determinant of whether a PDC or a BDC will serve a
494 particular logon authentication request.
495 </para>
496
497 <para>
498 <indexterm><primary>promote</primary></indexterm>
499 <indexterm><primary>demote</primary></indexterm>
500 A Windows NT4 BDC can be promoted to a PDC. If the PDC is online at the time that a BDC is promoted to PDC,
501 the previous PDC is automatically demoted to a BDC. With Samba-3, this is not an automatic operation; the PDC
502 and BDC must be manually configured, and other appropriate changes also need to be made.
503 </para>
504
505 <para>
506 <indexterm><primary>domain</primary><secondary>controller</secondary><tertiary>convert</tertiary></indexterm>
507 With MS Windows NT4, a decision is made at installation to determine what type of machine the server will be.
508 It is possible to promote a BDC to a PDC, and vice versa. The only method Microsoft provide to convert a
509 Windows NT4 domain controller to a domain member server or a standalone server is to reinstall it. The install
510 time choices offered are:
511 </para>
512
513 <itemizedlist>
514         <listitem><para><emphasis>Primary Domain Controller</emphasis> &smbmdash; the one that seeds the domain SAM.</para></listitem>
515         <listitem><para><emphasis>Backup Domain Controller</emphasis> &smbmdash; one that obtains a copy of the domain SAM.</para></listitem>
516         <listitem><para><emphasis>Domain Member Server</emphasis> &smbmdash; one that has no copy of the domain SAM; rather
517                 it obtains authentication from a domain controller for all access controls.</para></listitem>
518         <listitem><para><emphasis>Standalone Server</emphasis> &smbmdash; one that plays no part in SAM synchronization,
519                 has its own authentication database, and plays no role in domain security.</para></listitem>
520 </itemizedlist>
521
522 <note><para>
523 <indexterm><primary>promote</primary></indexterm>
524 Algin Technology LLC provide a commercial tool that makes it possible to promote a Windows NT4 standalone
525 server to a PDC or a BDC, and also permits this process to be reversed. Refer the the <ulink
526 url="http://utools.com/UPromote.asp">Algin</ulink> web site for further information.
527 </para></note>
528
529 <para>
530 <indexterm><primary>domain</primary><secondary>control</secondary><tertiary>role</tertiary></indexterm>
531 <indexterm><primary>native member</primary></indexterm>
532 Samba-3 servers can readily be converted to and from domain controller roles through simple changes to the
533 &smb.conf; file. Samba-3 is capable of acting fully as a native member of a Windows 200x server Active
534 Directory domain.
535 </para>
536
537 <para>
538 <indexterm><primary>convert</primary><secondary>domain member server</secondary></indexterm>
539 For the sake of providing a complete picture, MS Windows 2000 domain control configuration is done after the server has been
540 installed. Please refer to Microsoft documentation for the procedures that should be followed to convert a
541 domain member server to or from a domain control, and to install or remove active directory service support.
542 </para>
543
544 <para>
545 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
546 <indexterm><primary>SAM</primary><secondary>replication</secondary></indexterm>
547 New to Samba-3 is the ability to function fully as an MS Windows NT4-style domain controller,
548 excluding the SAM replication components. However, please be aware that Samba-3 also supports the
549 MS Windows 200x domain control protocols.
550 </para>
551
552 <para>
553 <indexterm><primary>ADS</primary></indexterm>
554 At this time any appearance that Samba-3 is capable of acting as a <emphasis>domain controller</emphasis> in
555 native ADS mode is limited and experimental in nature.  This functionality should not be used until the Samba
556 Team offers formal support for it.  At such a time, the documentation will be revised to duly reflect all
557 configuration and management requirements. Samba can act as a NT4-style domain controller in a Windows 2000/XP
558 environment. However, there are certain compromises:
559 </para>
560
561 <itemizedlist>
562         <listitem><para>No machine policy files.</para></listitem>
563         <listitem><para>No Group Policy Objects.</para></listitem>
564         <listitem><para>No synchronously executed Active Directory logon scripts.</para></listitem>
565         <listitem><para>Can't use Active Directory management tools to manage users and machines.</para></listitem>
566         <listitem><para>Registry changes tattoo the main registry, while with Active Directory they do not leave
567                 permanent changes in effect.</para></listitem>
568         <listitem><para>Without Active Directory you cannot perform the function of exporting specific
569                 applications to specific users or groups.</para></listitem>
570 </itemizedlist>
571
572 </sect2>
573
574 <sect2>
575 <title>Preparing for Domain Control</title>
576
577 <para>
578 <indexterm><primary>standalone</primary></indexterm>
579 <indexterm><primary>workgroup</primary></indexterm>
580 <indexterm><primary>member</primary></indexterm>
581 <indexterm><primary>security</primary></indexterm>
582 There are two ways that MS Windows machines may interact with each other, with other servers,
583 and with domain controllers: either as <emphasis>standalone</emphasis> systems, more commonly
584 called <emphasis>workgroup</emphasis> members, or as full participants in a security system,
585 more commonly called <emphasis>domain</emphasis> members.
586 </para>
587
588 <para>
589 <indexterm><primary>workgroup</primary></indexterm>
590 <indexterm><primary>workgroup</primary><secondary>membership</secondary></indexterm>
591 <indexterm><primary>machine trust account</primary></indexterm>
592 It should be noted that workgroup membership involves no special configuration other than the machine being
593 configured so the network configuration has a commonly used name for its workgroup entry. It is not uncommon
594 for the name WORKGROUP to be used for this. With this mode of configuration, there are no Machine Trust
595 Accounts, and any concept of membership as such is limited to the fact that all machines appear in the network
596 neighborhood to be logically grouped together. Again, just to be clear: <emphasis>workgroup mode does not
597 involve security machine accounts</emphasis>.
598 </para>
599
600 <para>
601 <indexterm><primary>domain membership</primary></indexterm>
602 <indexterm><primary>machine trust account</primary><secondary>password</secondary></indexterm>
603 <indexterm><primary>trigger</primary></indexterm>
604 Domain member machines have a machine trust account in the domain accounts database. A special procedure
605 must be followed on each machine to effect domain membership. This procedure, which can be done
606 only by the local machine Administrator account, creates the domain machine account (if it does
607 not exist), and then initializes that account. When the client first logs onto the
608 domain, a machine trust account password change will be automatically triggered.
609 </para>
610
611 <note><para>
612 <indexterm><primary>domain member</primary></indexterm>
613 When Samba is configured as a domain controller, secure network operation demands that
614 all MS Windows NT4/200x/XP Professional clients should be configured as domain members.
615 If a machine is not made a member of the domain, then it will operate like a workgroup
616 (standalone) machine. Please refer to <link linkend="domain-member">Domain Membership</link>, for
617 information regarding domain membership.
618 </para></note>
619
620 <para>
621 The following are necessary for configuring Samba-3 as an MS Windows NT4-style PDC for MS Windows
622 NT4/200x/XP clients:
623 </para>
624
625 <itemizedlist>
626         <listitem><para>Configuration of basic TCP/IP and MS Windows networking.</para></listitem>
627         <listitem><para>Correct designation of the server role (<smbconfoption name="security">user</smbconfoption>).</para></listitem>
628         <listitem><para>Consistent configuration of name resolution.<footnote><para>See <link linkend="NetworkBrowsing">Network Browsing</link>, and 
629                 <link linkend="integrate-ms-networks">Integrating MS Windows Networks with Samba</link>.</para></footnote></para></listitem>
630         <listitem><para>Domain logons for Windows NT4/200x/XP Professional clients.</para></listitem>
631         <listitem><para>Configuration of roaming profiles or explicit configuration to force local profile usage.</para></listitem>
632         <listitem><para>Configuration of network/system policies.</para></listitem>
633         <listitem><para>Adding and managing domain user accounts.</para></listitem>
634         <listitem><para>Configuring MS Windows NT4/2000 Professional and Windows XP Professional client machines to become domain members.</para></listitem>
635 </itemizedlist>
636
637 <para>
638 The following provisions are required to serve MS Windows 9x/Me clients:
639 </para>
640
641 <itemizedlist>
642         <listitem><para>Configuration of basic TCP/IP and MS Windows networking.</para></listitem>
643         <listitem><para>Correct designation of the server role (<smbconfoption name="security">user</smbconfoption>).</para></listitem>
644         <listitem><para>Network logon configuration (since Windows 9x/Me/XP Home are not technically domain
645         members, they do not really participate in  the security aspects of Domain logons as such).</para></listitem>
646         <listitem><para>Roaming profile configuration.</para></listitem>
647         <listitem><para>Configuration of system policy handling.</para></listitem>
648         <listitem><para>Installation of the network driver <quote>Client for MS Windows Networks</quote> and configuration
649         to log onto the domain.</para></listitem>
650         <listitem><para>Placing Windows 9x/Me clients in user-level security &smbmdash; if it is desired to allow
651         all client-share access to be controlled according to domain user/group identities.</para></listitem>
652         <listitem><para>Adding and managing domain user accounts.</para></listitem>
653 </itemizedlist>
654
655 <note><para>
656 <indexterm><primary>roaming profiles</primary></indexterm>
657 <indexterm><primary>account policies</primary></indexterm>
658 Roaming profiles and system/network policies are advanced network administration topics
659 that are covered in <link linkend="ProfileMgmt">Desktop Profile Management</link> and
660 <link linkend="PolicyMgmt">System and Account Policies</link> of this document. However, these are not
661 necessarily specific to a Samba PDC as much as they are related to Windows NT networking concepts.
662 </para></note>
663
664 <para>
665 A domain controller is an SMB/CIFS server that:
666 </para>
667
668 <itemizedlist>
669         <listitem><para>
670         <indexterm><primary>NetBIOS</primary><secondary>brooadcast</secondary></indexterm>
671         <indexterm><primary>WINS</primary></indexterm>
672         <indexterm><primary>UDP</primary></indexterm>
673         <indexterm><primary>DNS</primary></indexterm>
674         <indexterm><primary>active directory</primary></indexterm>
675         Registers and advertises itself as a domain controller (through NetBIOS broadcasts
676         as well as by way of name registrations either by Mailslot Broadcasts over UDP broadcast,
677         to a WINS server over UDP unicast, or via DNS and Active Directory).
678         </para></listitem>
679
680         <listitem><para>
681         <indexterm><primary>NETLOGON</primary></indexterm>
682         <indexterm><primary>LanMan logon service</primary></indexterm>
683         Provides the NETLOGON service. (This is actually a collection of services that runs over
684         multiple protocols. These include the LanMan logon service, the Netlogon service,
685         the Local Security Account service, and variations of them.)
686         </para></listitem>
687
688         <listitem><para>
689         Provides a share called NETLOGON.
690         </para></listitem>
691 </itemizedlist>
692
693 <para>
694 <indexterm><primary>domain</primary><secondary>master</secondary><tertiary>browser</tertiary></indexterm>
695 <indexterm><primary>local</primary><secondary>master</secondary><tertiary>browser</tertiary></indexterm>
696 <indexterm><primary>DMB</primary></indexterm>
697 <indexterm><primary>LMB</primary></indexterm>
698 <indexterm><primary>browse list</primary></indexterm>
699 It is rather easy to configure Samba to provide these. Each Samba domain controller must provide the NETLOGON
700 service that Samba calls the <smbconfoption name="domain logons"/> functionality (after the name of the
701 parameter in the &smb.conf; file). Additionally, one server in a Samba-3 domain must advertise itself as the
702 domain master browser.<footnote><para>See <link linkend="NetworkBrowsing">Network
703 Browsing</link>.</para></footnote> This causes the PDC to claim a domain-specific NetBIOS name that identifies
704 it as a DMB for its given domain or workgroup. Local master browsers (LMBs) in the same domain or workgroup on
705 broadcast-isolated subnets then ask for a complete copy of the browse list for the whole wide-area network.
706 Browser clients then contact their LMB, and will receive the domain-wide browse list instead of just the list
707 for their broadcast-isolated subnet.
708 </para>
709
710 </sect2>
711 </sect1>
712
713 <sect1>
714 <title>Domain Control: Example Configuration</title>
715
716 <para>
717 The first step in creating a working Samba PDC is to understand the parameters necessary
718 in &smb.conf;. An example &smb.conf; for acting as a PDC can be found in <link linkend="pdc-example">the
719 smb.conf file for an example PDC</link>. 
720 </para>
721
722 <example id="pdc-example">
723 <title>smb.conf for being a PDC</title>
724 <smbconfblock>
725 <smbconfsection name="[global]"/>
726 <smbconfoption name="netbios name"><replaceable>BELERIAND</replaceable></smbconfoption>
727 <smbconfoption name="workgroup"><replaceable>&example.workgroup;</replaceable></smbconfoption>
728 <smbconfoption name="passdb backend">tdbsam</smbconfoption>
729 <smbconfoption name="os level">33</smbconfoption>
730 <smbconfoption name="preferred master">auto</smbconfoption>
731 <smbconfoption name="domain master">yes</smbconfoption>
732 <smbconfoption name="local master">yes</smbconfoption>
733 <smbconfoption name="security">user</smbconfoption>
734 <smbconfoption name="domain logons">yes</smbconfoption>
735 <smbconfoption name="logon path">\\%N\profiles\%U</smbconfoption>
736 <smbconfoption name="logon drive">H:</smbconfoption>
737 <smbconfoption name="logon home">\\homeserver\%U\winprofile</smbconfoption>
738 <smbconfoption name="logon script">logon.cmd</smbconfoption>
739
740 <smbconfsection name="[netlogon]"/>
741 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
742 <smbconfoption name="read only">yes</smbconfoption>
743 <smbconfoption name="write list"><replaceable>ntadmin</replaceable></smbconfoption>
744
745 <smbconfsection name="[profiles]"/>
746 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
747 <smbconfoption name="read only">no</smbconfoption>
748 <smbconfoption name="create mask">0600</smbconfoption>
749 <smbconfoption name="directory mask">0700</smbconfoption>
750 </smbconfblock>
751 </example>
752
753 <para>
754 The basic options shown in <link linkend="pdc-example">this example</link> are explained as follows:
755 </para>
756
757 <variablelist>
758         <varlistentry><term>passdb backend </term>
759                 <listitem><para>
760                 <indexterm><primary>group</primary><secondary>account</secondary></indexterm>
761                 <indexterm><primary>smbpasswd</primary></indexterm>
762                 <indexterm><primary>tdbsam</primary></indexterm>
763                 <indexterm><primary>ldapsam</primary></indexterm>
764                 <indexterm><primary>guest</primary></indexterm>
765                 <indexterm><primary>default accounts</primary></indexterm>
766                 This contains all the user and group account information. Acceptable values for a PDC
767                 are: <emphasis>smbpasswd, tdbsam, and ldapsam</emphasis>. The <quote>guest</quote> entry provides
768                 default accounts and is included by default; there is no need to add it explicitly.
769                 </para>
770
771                 <para>
772                 <indexterm><primary>passdb backend</primary></indexterm>
773                 <indexterm><primary>distributed</primary></indexterm>
774                 <indexterm><primary>smbpasswd</primary></indexterm>
775                 <indexterm><primary>tdbsam</primary></indexterm>
776                 Where use of BDCs is intended, the only logical choice is
777                 to use LDAP so the passdb backend can be distributed. The tdbsam and smbpasswd files
778                 cannot effectively be distributed and therefore should not be used.
779                 </para></listitem>
780         </varlistentry>
781
782         <varlistentry><term>Domain Control Parameters </term>
783                 <listitem><para>
784                 <indexterm><primary>os level</primary></indexterm>
785                 <indexterm><primary>preferred master</primary></indexterm>
786                 <indexterm><primary>domain master</primary></indexterm>
787                 <indexterm><primary>network</primary><secondary>logon</secondary></indexterm>
788                 The parameters <emphasis>os level, preferred master, domain master, security, 
789                 encrypt passwords</emphasis>, and <emphasis>domain logons</emphasis> play a central role in assuring domain
790                 control and network logon support.
791                 </para>
792
793                 <para>
794                 <indexterm><primary>DMB</primary></indexterm>
795                 <indexterm><primary>encryped password</primary></indexterm>
796                 The <emphasis>os level</emphasis> must be set at or above a value of 32. A domain controller
797                 must be the DMB, must be set in <emphasis>user</emphasis> mode security,
798                 must support Microsoft-compatible encrypted passwords, and must provide the network logon
799                 service (domain logons). Encrypted passwords must be enabled. For more details on how 
800                 to do this, refer to <link linkend="passdb">Account Information Databases</link>.
801                 </para></listitem>
802         </varlistentry>
803
804         <varlistentry><term>Environment Parameters </term>
805                 <listitem><para>
806                 <indexterm><primary>logon path</primary></indexterm>
807                 <indexterm><primary>logon home</primary></indexterm>
808                 <indexterm><primary>logon drive</primary></indexterm>
809                 <indexterm><primary>logon script</primary></indexterm>
810                 The parameters <emphasis>logon path, logon home, logon drive</emphasis>, and <emphasis>logon script</emphasis> are
811                 environment support settings that help to facilitate client logon operations and that help
812                 to provide automated control facilities to ease network management overheads. Please refer
813                 to the man page information for these parameters.
814                 </para></listitem>
815         </varlistentry>
816
817         <varlistentry><term>NETLOGON Share </term>
818                 <listitem><para>
819                 <indexterm><primary>NETLOGON</primary></indexterm>
820                 <indexterm><primary>logon processing</primary></indexterm>
821                 <indexterm><primary>domain logon</primary></indexterm>
822                 <indexterm><primary>domain membership</primary></indexterm>
823                 <indexterm><primary>group policy</primary></indexterm>
824                 <indexterm><primary>NTConfig.POL</primary></indexterm>
825                 The NETLOGON share plays a central role in domain logon and domain membership support.
826                 This share is provided on all Microsoft domain controllers. It is used to provide logon
827                 scripts, to store group policy files (NTConfig.POL), as well as to locate other common
828                 tools that may be needed for logon processing. This is an essential share on a domain controller.
829                 </para></listitem>
830         </varlistentry>
831
832         <varlistentry><term>PROFILE Share </term>
833                 <listitem><para>
834                 <indexterm><primary>desktop profile</primary></indexterm>
835                 <indexterm><primary>VFS</primary></indexterm>
836                 <indexterm><primary>fake_permissions</primary></indexterm>
837                 <indexterm><primary>profile</primary></indexterm>
838                 <indexterm><primary></primary></indexterm>
839                 This share is used to store user desktop profiles. Each user must have a directory at the root
840                 of this share. This directory must be write-enabled for the user and must be globally read-enabled.
841                 Samba-3 has a VFS module called <quote>fake_permissions</quote> that may be installed on this share. This will
842                 allow a Samba administrator to make the directory read-only to everyone. Of course this is useful
843                 only after the profile has been properly created.
844                 </para></listitem>
845         </varlistentry>
846 </variablelist>
847
848 <note><para>
849 The above parameters make for a full set of functionality that may define the server's mode
850 of operation. The following &smb.conf; parameters are the essentials alone:
851 </para>
852
853 <para>
854 <smbconfblock>
855 <smbconfoption name="netbios name">BELERIAND</smbconfoption>
856 <smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
857 <smbconfoption name="domain logons">Yes</smbconfoption>
858 <smbconfoption name="domain master">Yes</smbconfoption>
859 <smbconfoption name="security">User</smbconfoption>
860 </smbconfblock>
861 </para>
862
863 <para>
864 The additional parameters shown in the longer listing in this section just make for
865 a more complete explanation.
866 </para></note>
867
868 </sect1>
869
870 <sect1>
871 <title>Samba ADS Domain Control</title>
872
873 <para>
874 <indexterm><primary>active directory</primary></indexterm>
875 Samba-3 is not, and cannot act as, an Active Directory server. It cannot truly function as an Active Directory
876 PDC. The protocols for some of the functionality of Active Directory domain controllers has been partially
877 implemented on an experimental only basis. Please do not expect Samba-3 to support these protocols. Do not
878 depend on any such functionality either now or in the future. The Samba Team may remove these experimental
879 features or may change their behavior. This is mentioned for the benefit of those who have discovered secret
880 capabilities in Samba-3 and who have asked when this functionality will be completed. The answer is maybe
881 someday or maybe never!
882 </para>
883
884 <para>
885 <indexterm><primary>domain controllers</primary></indexterm>
886 <indexterm><primary>active directory</primary></indexterm>
887 To be sure, Samba-3 is designed to provide most of the functionality that Microsoft Windows NT4-style
888 domain controllers have. Samba-3 does not have all the capabilities of Windows NT4, but it does have
889 a number of features that Windows NT4 domain controllers do not have. In short, Samba-3 is not NT4 and it
890 is not Windows Server 200x: it is not an Active Directory server. We hope this is plain and simple
891 enough for all to understand.
892 </para>
893
894 </sect1>
895
896 <sect1>
897 <title>Domain and Network Logon Configuration</title>
898
899 <para>
900 <indexterm><primary>domain logon</primary></indexterm>
901 The subject of network or domain logons is discussed here because it forms
902 an integral part of the essential functionality that is provided by a domain controller.
903 </para>
904
905 <sect2>
906 <title>Domain Network Logon Service</title>
907
908 <para>
909 <indexterm><primary>domain logon</primary></indexterm>
910 All domain controllers must run the netlogon service (<emphasis>domain logons</emphasis>
911 in Samba). One domain controller must be configured with <smbconfoption name="domain master">Yes</smbconfoption>
912 (the PDC); on all BDCs set the parameter <smbconfoption name="domain master">No</smbconfoption>.
913 </para>
914
915 <sect3>
916 <title>Example Configuration</title>
917
918 <example id="PDC-config">
919 <title>smb.conf for being a PDC</title>
920 <smbconfblock>
921 <smbconfsection name="[global]"/>
922 <smbconfoption name="domain logons">Yes</smbconfoption>
923 <smbconfoption name="domain master">(Yes on PDC, No on BDCs)</smbconfoption>
924
925 <smbconfsection name="[netlogon]"/>
926 <smbconfoption name="comment">Network Logon Service</smbconfoption>
927 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
928 <smbconfoption name="guest ok">Yes</smbconfoption>
929 <smbconfoption name="browseable">No</smbconfoption>
930 </smbconfblock>
931 </example>
932
933 </sect3>
934 <sect3>
935 <title>The Special Case of MS Windows XP Home Edition</title>
936
937 <para>
938 <indexterm><primary>Windows XP Home edition</primary></indexterm>
939 To be completely clear: If you want MS Windows XP Home Edition to integrate with your
940 MS Windows NT4 or Active Directory domain security, understand it cannot be done.
941 The only option is to purchase the upgrade from MS Windows XP Home Edition to
942 MS Windows XP Professional.
943 </para>
944
945 <note><para>
946 MS Windows XP Home Edition does not have the ability to join any type of domain
947 security facility. Unlike MS Windows 9x/Me, MS Windows XP Home Edition also completely
948 lacks the ability to log onto a network.
949 </para></note>
950
951 <para>
952 Now that this has been said, please do not ask the mailing list or email any of the
953 Samba Team members with your questions asking how to make this work. It can't be done.
954 If it can be done, then to do so would violate your software license agreement with
955 Microsoft, and we recommend that you do not do that.
956 </para>
957
958 </sect3>
959
960 <sect3>
961 <title>The Special Case of Windows 9x/Me</title>
962
963 <para>
964 <indexterm><primary>domain</primary></indexterm>
965 <indexterm><primary>workgroup</primary></indexterm>
966 <indexterm><primary>authentication</primary></indexterm>
967 <indexterm><primary>browsing</primary></indexterm>
968 <indexterm><primary>rights</primary></indexterm>
969 A domain and a workgroup are exactly the same in terms of network
970 browsing. The difference is that a distributable authentication
971 database is associated with a domain, for secure login access to a
972 network. Also, different access rights can be granted to users if they
973 successfully authenticate against a domain logon server. Samba-3 does this
974 now in the same way as MS Windows NT/200x.
975 </para>
976
977 <para>
978 <indexterm><primary>browsing</primary></indexterm>
979 The SMB client logging on to a domain has an expectation that every other
980 server in the domain should accept the same authentication information.
981 Network browsing functionality of domains and workgroups is identical and
982 is explained in this documentation under the browsing discussions.
983 It should be noted that browsing is totally orthogonal to logon support.
984 </para>
985
986 <para>
987 <indexterm><primary>single-logon</primary></indexterm>
988 <indexterm><primary>domain logons</primary></indexterm>
989 <indexterm><primary>network logon</primary></indexterm>
990 Issues related to the single-logon network model are discussed in this
991 section. Samba supports domain logons, network logon scripts, and user
992 profiles for MS Windows for Workgroups and MS Windows 9x/Me clients,
993 which are the focus of this section.
994 </para>
995
996 <para>
997 <indexterm><primary>broadcast request</primary></indexterm>
998 When an SMB client in a domain wishes to log on, it broadcasts requests for a logon server. The first one to
999 reply gets the job and validates its password using whatever mechanism the Samba administrator has installed.
1000 It is possible (but ill advised) to create a domain where the user database is not shared between servers;
1001 that is, they are effectively workgroup servers advertising themselves as participating in a domain. This
1002 demonstrates how authentication is quite different from but closely involved with domains.
1003 </para>
1004
1005 <para>
1006 Using these features, you can make your clients verify their logon via
1007 the Samba server, make clients run a batch file when they log on to
1008 the network and download their preferences, desktop, and start menu.
1009 </para>
1010
1011 <para><emphasis>
1012 MS Windows XP Home edition is not able to join a domain and does not permit the use of domain logons.
1013 </emphasis></para>
1014
1015 <para>
1016 Before launching into the configuration instructions, it is worthwhile to look at how a Windows 9x/Me client
1017 performs a logon:
1018 </para>
1019
1020 <orderedlist>
1021 <listitem>
1022         <para>
1023         <indexterm><primary>DOMAIN&lt;1C&gt;</primary></indexterm>
1024         <indexterm><primary>logon server</primary></indexterm>
1025         The client broadcasts (to the IP broadcast address of the subnet it is in)
1026         a NetLogon request. This is sent to the NetBIOS name DOMAIN&lt;1C&gt; at the
1027         NetBIOS layer. The client chooses the first response it receives, which
1028         contains the NetBIOS name of the logon server to use in the format of 
1029         <filename>\\SERVER</filename>. The <literal>1C</literal> name is the name
1030         type that is registered by domain controllers (SMB/CIFS servers that provide
1031         the netlogon service).
1032         </para>
1033 </listitem>
1034
1035 <listitem>
1036         <para>
1037         <indexterm><primary>IPC$</primary></indexterm>
1038         <indexterm><primary>SMBsessetupX</primary></indexterm>
1039         <indexterm><primary>SMBtconX</primary></indexterm>
1040         The client connects to that server, logs on (does an SMBsessetupX) and
1041         then connects to the IPC$ share (using an SMBtconX).
1042         </para>
1043 </listitem>
1044
1045 <listitem>
1046         <para>
1047         <indexterm><primary>NetWkstaUserLogon</primary></indexterm>
1048         The client does a NetWkstaUserLogon request, which retrieves the name
1049         of the user's logon script. 
1050         </para>
1051 </listitem>
1052
1053 <listitem>
1054         <para>
1055         The client then connects to the NetLogon share and searches for said script.    
1056         If it is found and can be read, it is retrieved and executed by the client.
1057         After this, the client disconnects from the NetLogon share.
1058         </para>
1059 </listitem>
1060
1061 <listitem>
1062         <para>
1063         <indexterm><primary>NetUserGetInfo</primary></indexterm>
1064         <indexterm><primary>profile</primary></indexterm>
1065         The client sends a NetUserGetInfo request to the server to retrieve
1066         the user's home share, which is used to search for profiles. Since the
1067         response to the NetUserGetInfo request does not contain much more than  
1068         the user's home share, profiles for Windows 9x clients must reside in the user
1069         home directory.
1070         </para>
1071 </listitem>
1072
1073 <listitem>
1074         <para>
1075         <indexterm><primary>profiles</primary></indexterm>
1076         The client connects to the user's home share and searches for the 
1077         user's profile. As it turns out, you can specify the user's home share as
1078         a share name and path. For example, <filename>\\server\fred\.winprofile</filename>.
1079         If the profiles are found, they are implemented.
1080         </para>
1081 </listitem>
1082
1083 <listitem>
1084         <para>
1085         <indexterm><primary>CONFIG.POL</primary></indexterm>
1086         The client then disconnects from the user's home share and reconnects to
1087         the NetLogon share and looks for <filename>CONFIG.POL</filename>, the policies file. If this is
1088         found, it is read and implemented.
1089         </para>
1090 </listitem>
1091 </orderedlist>
1092
1093 <para>
1094 The main difference between a PDC and a Windows 9x/Me logon server configuration is:
1095 </para>
1096
1097 <itemizedlist>
1098 <listitem><para>
1099         <indexterm><primary>password</primary><secondary>plaintext</secondary></indexterm>
1100         <indexterm><primary>plaintext password</primary></indexterm>
1101         Password encryption is not required for a Windows 9x/Me logon server. But note
1102         that beginning with MS Windows 98 the default setting is that plaintext
1103         password support is disabled. It can be re-enabled with the registry
1104         changes that are documented in <link linkend="PolicyMgmt">System and Account Policies</link>.
1105         </para></listitem>
1106
1107         <listitem><para>
1108         <indexterm><primary>machine trust account</primary></indexterm>
1109         Windows 9x/Me clients do not require and do not use Machine Trust Accounts.
1110         </para></listitem>
1111 </itemizedlist>
1112
1113 <para>
1114 <indexterm><primary>network logon services</primary></indexterm>
1115 A Samba PDC will act as a Windows 9x/Me logon server; after all, it does provide the
1116 network logon services that MS Windows 9x/Me expect to find.
1117 </para>
1118
1119 <note><para>
1120 <indexterm><primary>sniffer</primary></indexterm>
1121 Use of plaintext passwords is strongly discouraged. Where used they are easily detected
1122 using a sniffer tool to examine network traffic.
1123 </para></note>
1124
1125 </sect3>
1126 </sect2>
1127
1128 <sect2>
1129 <title>Security Mode and Master Browsers</title>
1130
1131 <para>
1132 <indexterm><primary>security mode</primary></indexterm>
1133 <indexterm><primary>user-mode security</primary></indexterm>
1134 <indexterm><primary>share-mode security</primary></indexterm>
1135 There are a few comments to make in order to tie up some loose ends. There has been much debate over the issue
1136 of whether it is okay to configure Samba as a domain controller that operates with security mode other than
1137 user-mode. The only security mode that will not work due to technical reasons is share-mode security. Domain
1138 and server mode security are really just a variation on SMB user-level security.
1139 </para>
1140
1141 <para>
1142 <indexterm><primary>DOMAIN&lt;1C&gt;</primary></indexterm>
1143 <indexterm><primary>DOMAIN&lt;1B&gt;</primary></indexterm>
1144 <indexterm><primary>DMB</primary></indexterm>
1145 <indexterm><primary>PDC</primary></indexterm>
1146 <indexterm><primary>NetBIOS name</primary></indexterm>
1147 <indexterm><primary>domain controller</primary></indexterm>
1148 <indexterm><primary>election</primary></indexterm>
1149 Actually, this issue is also closely tied to the debate on whether Samba must be the DMB for its workgroup
1150 when operating as a domain controller.  In a pure Microsoft Windows NT domain, the PDC wins the election to be
1151 the DMB, and then registers the DOMAIN&lt;1B&gt; NetBIOS name. This is not the name used by Windows clients
1152 to locate the domain controller, all domain controllers register the DOMAIN&lt;1C&gt; name and Windows clients
1153 locate a network logon server by seraching for the DOMAIN&lt;1C&gt; name.  A DMB is a Domain Master Browser
1154 &smbmdash; see <link linkend="NetworkBrowsing">The Network Browsing Chapter</link>, <link
1155 linkend="DMB">Configuring WORKGROUP Browsing</link>; Microsoft PDCs expect to win the election to become the
1156 DMB, if it loses that election it will report a continuous and rapid sequence of warning messages to its
1157 Windows event logger complaining that it has lost the election to become a DMB.  For this reason, in networks
1158 where a Samba server is the PDC it is wise to configure the Samba domain controller as the DMB.
1159 </para>
1160
1161 <note><para>
1162 <indexterm><primary>DOMAIN&lt;1D&gt;</primary></indexterm>
1163 <indexterm><primary>synchronization</primary></indexterm>
1164 <indexterm><primary>domain control</primary></indexterm>
1165 <indexterm><primary>browse list management</primary></indexterm>
1166 <indexterm><primary>network</primary><secondary>logon</secondary><tertiary>service</tertiary></indexterm>
1167 SMB/CIFS servers that register the DOMAIN&lt;1C&gt; name do so because they provide the network logon
1168 service. Server that register the DOMAIN&lt;1B&gt; name are DMBs &smbmdash; meaning that they are responsible
1169 for browse list synchronization across all machines that have registered the DOMAIN&lt;1D&gt; name. The later
1170 are LMBs that have the responsibility to listen to all NetBIOS name registrations that occur locally to their
1171 own network segment. The network logon service (NETLOGON) is germane to domain control and has nothing to do
1172 with network browsing and browse list management. The 1C and 1B/1D name services are orthogonal to each
1173 other.
1174 </para></note>
1175
1176 <para>
1177 Now back to the issue of configuring a Samba domain controller to use a mode other than <smbconfoption
1178 name="security">user</smbconfoption>. If a Samba host is configured to use another SMB server or domain
1179 controller in order to validate user connection requests, it is a fact that some other machine on the network
1180 (the <smbconfoption name="password server"/>) knows more about the user than the Samba host. About 99 percent
1181 of the time, this other host is a domain controller. Now to operate in domain mode security, the
1182 <smbconfoption name="workgroup"/> parameter must be set to the name of the Windows NT domain (which already
1183 has a domain controller).  If the domain does not already have a domain controller, you do not yet have a
1184 domain.
1185 </para>
1186
1187 <para>
1188 Configuring a Samba box as a domain controller for a domain that already by definition has a
1189 PDC is asking for trouble. Therefore, you should always configure the Samba domain controller
1190 to be the DMB for its domain and set <smbconfoption name="security">user</smbconfoption>.
1191 This is the only officially supported mode of operation.
1192 </para>
1193
1194 </sect2>
1195
1196 </sect1>
1197
1198 <sect1>
1199 <title>Common Errors</title>
1200
1201 <sect2>
1202 <title><quote>$</quote> Cannot Be Included in Machine Name</title>
1203
1204 <para>
1205 <indexterm><primary>BSD</primary></indexterm>
1206 <indexterm><primary>FreeBSD</primary></indexterm>
1207 <indexterm><primary>/etc/passwd</primary></indexterm>
1208 A machine account, typically stored in <filename>/etc/passwd</filename>, takes the form of the machine
1209 name with a <quote>$</quote> appended. Some BSD systems will not create a user with a <quote>$</quote> in the name.
1210 Recent versions of FreeBSD have removed this limitation, but older releases are still in common use.
1211 </para>
1212
1213 <para>
1214 <indexterm><primary>vipw</primary></indexterm>
1215 The problem is only in the program used to make the entry. Once made, it works perfectly.  Create a user
1216 without the <quote>$</quote>. Then use <command>vipw</command> to edit the entry, adding the <quote>$</quote>.
1217 Or create the whole entry with vipw if you like; make sure you use a unique user login ID.
1218 </para>
1219
1220 <note><para>The machine account must have the exact name that the workstation has.</para></note>
1221
1222 <note><para>
1223 The UNIX tool <command>vipw</command> is a common tool for directly editing the <filename>/etc/passwd</filename> file.
1224 The use of vipw will ensure that shadow files (where used) will remain current with the passwd file. This is
1225 important for security reasons.
1226 </para></note>
1227
1228 </sect2>
1229
1230 <sect2>
1231 <title>Joining Domain Fails Because of Existing Machine Account</title>
1232                 
1233 <para>
1234 <indexterm><primary>join domain</primary></indexterm>
1235 <quote>I get told, `You already have a connection to the Domain....' or `Cannot join domain, the
1236 credentials supplied conflict with an existing set...' when creating a Machine Trust Account.</quote>
1237 </para>
1238
1239 <para>
1240 This happens if you try to create a Machine Trust Account from the machine itself and already have a
1241 connection (e.g., mapped drive) to a share (or IPC$) on the Samba PDC. The following command will remove all
1242 network drive connections:
1243 <screen>
1244 &dosprompt;<userinput>net use * /d</userinput>
1245 </screen>
1246 This will break all network connections.
1247 </para>
1248
1249 <para>
1250 Further, if the machine is already a <quote>member of a workgroup</quote> that is the same name as the domain
1251 you are joining (bad idea), you will get this message. Change the workgroup name to something else &smbmdash;
1252 it does not matter what &smbmdash; reboot, and try again.
1253 </para>
1254
1255 </sect2>
1256
1257 <sect2>
1258 <title>The System Cannot Log You On (C000019B)</title>
1259
1260 <para><quote>
1261 I joined the domain successfully but after upgrading to a newer version of the Samba code I get the message,
1262 <errorname>`The system cannot log you on (C000019B). Please try again or consult your system
1263 administrator</errorname> when attempting to logon.'</quote>
1264 </para>
1265
1266 <para>
1267 <indexterm><primary>SID</primary></indexterm>
1268 This occurs when the domain SID stored in the secrets.tdb database is changed. The most common cause of a
1269 change in domain SID is when the domain name and/or the server name (NetBIOS name) is changed.  The only way
1270 to correct the problem is to restore the original domain SID or remove the domain client from the domain and
1271 rejoin. The domain SID may be reset using either the net or rpcclient utilities.
1272 </para>
1273
1274 <para>
1275 To reset or change the domain SID you can use the net command as follows:
1276
1277 <screen>
1278 &rootprompt;<userinput>net getlocalsid 'OLDNAME'</userinput>
1279 &rootprompt;<userinput>net setlocalsid 'SID'</userinput>
1280 </screen>
1281 </para>
1282
1283 <para>
1284 Workstation Machine Trust Accounts work only with the domain (or network) SID. If this SID changes,
1285 domain members (workstations) will not be able to log onto the domain. The original domain SID
1286 can be recovered from the secrets.tdb file. The alternative is to visit each workstation to rejoin
1287 it to the domain.
1288 </para>
1289
1290 </sect2>
1291
1292 <sect2>
1293 <title>The Machine Trust Account Is Not Accessible</title>
1294
1295 <para>
1296 <quote>When I try to join the domain I get the message, <errorname>"The machine account 
1297 for this computer either does not exist or is not accessible</errorname>." What's wrong?</quote>
1298 </para>
1299
1300 <para>
1301 This problem is caused by the PDC not having a suitable Machine Trust Account.  If you are using the
1302 <smbconfoption name="add machine script"/> method to create accounts, then this would indicate that it has not
1303 worked. Ensure the domain admin user system is working.
1304 </para>
1305
1306 <para>
1307 Alternately, if you are creating account entries manually, then they have not been created correctly. Make
1308 sure that you have the entry correct for the Machine Trust Account in <filename>smbpasswd</filename> file on
1309 the Samba PDC.  If you added the account using an editor rather than using the smbpasswd utility, make sure
1310 that the account name is the machine NetBIOS name with a <quote>$</quote> appended to it (i.e.,
1311 computer_name$). There must be an entry in both the POSIX UNIX system account backend as well as in the
1312 SambaSAMAccount backend. The default backend for Samba-3 (i.e., the parameter <parameter>passdb
1313 backend</parameter> is not specified in the &smb.conf; file, or if specified is set to
1314 <literal>smbpasswd</literal>, are respectively the <filename>/etc/passwd</filename> and
1315 <filename>/etc/samba/smbpasswd</filename> (or <filename>/usr/local/samba/lib/private/smbpasswd</filename> if
1316 compiled using Samba Team default settings). The use of the <filename>/etc/passwd</filename> can be overridden
1317 by alternative settings in the NSS <filename>/etc/nsswitch.conf</filename> file.
1318 </para>
1319
1320 <para>
1321 Some people have also reported that inconsistent subnet masks between the Samba server and the NT 
1322 client can cause this problem.  Make sure that these are consistent for both client and server.
1323 </para>
1324 </sect2>
1325
1326 <sect2>
1327 <title>Account Disabled</title>
1328
1329 <para><quote>When I attempt to log in to a Samba domain from a NT4/W200x workstation,
1330 I get a message about my account being disabled.</quote></para>
1331
1332 <para>
1333 Enable the user accounts with <userinput>smbpasswd -e <replaceable>username</replaceable>
1334 </userinput>. This is normally done as an account is created.
1335 </para>
1336
1337 </sect2>
1338
1339 <sect2>
1340 <title>Domain Controller Unavailable</title>
1341                 
1342 <para><quote>Until a few minutes after Samba has started, clients get the error `Domain Controller Unavailable'</quote></para>
1343
1344 <para>
1345 A domain controller has to announce its role on the network. This usually takes a while. Be patient for up to 15 minutes,
1346 then try again.
1347 </para>
1348 </sect2>
1349
1350 <sect2>
1351 <title>Cannot Log onto Domain Member Workstation After Joining Domain</title>
1352
1353 <para>
1354 <indexterm><primary>schannel</primary></indexterm>
1355 <indexterm><primary>signing</primary></indexterm>
1356 After successfully joining the domain, user logons fail with one of two messages: one to the
1357 effect that the domain controller cannot be found; the other claims that the account does not
1358 exist in the domain or that the password is incorrect. This may be due to incompatible
1359 settings between the Windows client and the Samba-3 server for <emphasis>schannel</emphasis>
1360 (secure channel) settings or <emphasis>smb signing</emphasis> settings. Check your Samba
1361 settings for <emphasis>client schannel</emphasis>, <emphasis>server schannel</emphasis>,
1362 <emphasis>client signing</emphasis>, <emphasis>server signing</emphasis> by executing:
1363 <screen>
1364 <command>testparm -v | grep channel</command> and looking for the value of these parameters.
1365 </screen>
1366 </para>
1367
1368 <para>
1369 Also use the MMC &smbmdash; Local Security Settings. This tool is available from the
1370 Control Panel. The Policy settings are found in the Local Policies/Security Options area and are prefixed by
1371 <emphasis>Secure Channel:..., and Digitally sign...</emphasis>.
1372 </para>
1373
1374 <para>
1375 It is important that these be set consistently with the Samba-3 server settings.
1376 </para>
1377
1378 </sect2>
1379
1380 </sect1>
1381 </chapter>