s3:lib: make use of samba_tevent_context_init()
[Samba/gebeck_regimport.git] / docs-xml / Samba3-HOWTO / TOSHARG-PDC.xml
blob2b12e11f19b6eb188fc79f886e98cb13997b1b49
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">
5 <chapterinfo>
6         &author.jht;
7         &author.jerry;
8         &author.dbannon;
9         <author>&person.gd; <contrib>LDAP updates</contrib></author>
10 </chapterinfo>
12 <title>Domain Control</title>
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>
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>
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>
37 <figure id="domain-example">
38         <title>An Example Domain.</title>
39         <imagefile scale="40">domain</imagefile>
40 </figure>
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>
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>
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>
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>
74 <sect1>
75 <title>Features and Benefits</title>
77 <para>
78 <indexterm><primary>domain security</primary></indexterm>
79 <emphasis>What is the key benefit of Microsoft Domain Security?</emphasis>
80 </para>
82 <para>
83 <indexterm><primary>single sign-on</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>
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>
108 <para>
109 <indexterm><primary>SID</primary></indexterm>
110 A SID represents a security context. For example, every Windows machine has local accounts within the security
111 context of the local machine which has a unique SID. Every domain (NT4, ADS, Samba) contains accounts that
112 exist within the domain security context which is defined by the domain SID.
113 </para>
115 <para>
116 <indexterm><primary>SID</primary></indexterm>
117 <indexterm><primary>RID</primary></indexterm>
118 A domain member server will have a SID that differs from the domain SID.  The domain member server can be
119 configured to regard all domain users as local users. It can also be configured to recognize domain users and
120 groups as non-local. SIDs are persistent. A typical domain of user SID looks like this:
121 <screen>
122 S-1-5-21-726309263-4128913605-1168186429
123 </screen>
124 Every account (user, group, machine, trust, etc.) is assigned a RID. This is done automatically as an account
125 is created. Samba produces the RID algorithmically. The UNIX operating system uses a separate name space for
126 user and group identifiers (the UID and GID) but Windows allocates the RID from a single name space. A Windows
127 user and a Windows group can not have the same RID. Just as the UNIX user <literal>root</literal> has the
128 UID=0, the Windows Administrator has the well-known RID=500. The RID is catenated to the Windows domain SID,
129 so Administrator account for a domain that has the above SID will have the user SID
130 <screen>
131 S-1-5-21-726309263-4128913605-1168186429-500
132 </screen>
133 The result is that every account in the Windows networking world has a globally unique security identifier.
134 </para>
136 <note><para>
137 <indexterm><primary>domain</primary><secondary>member</secondary></indexterm>
138 <indexterm><primary>machine account</primary></indexterm>
139 <indexterm><primary>domain</primary><secondary>trust account</secondary></indexterm>
140 Network clients of an MS Windows domain security environment must be domain members to be able to gain access
141 to the advanced features provided. Domain membership involves more than just setting the workgroup name to the
142 domain name. It requires the creation of a domain trust account for the workstation (called a machine
143 account). Refer to <link linkend="domain-member">Domain Membership</link> for more information.
144 </para></note>
146 <para>
147 The following functionalities are an overview of some of the features
148 in the Samba-4 release:
149 </para>
151 <itemizedlist>
152         <listitem><para>
153         <indexterm><primary>account</primary><secondary>backend</secondary></indexterm>
154         Samba-4 supports the use of a choice of backends that may be used in which user, group and machine
155         accounts may be stored, but only when acting as a classic
156         (NT4) domain controller,
157         but not when it is acting as an Active Directory Domain Controller.
158         </para>
160         <para>
161         <indexterm><primary>LDAP</primary></indexterm>
162         <indexterm><primary>replicated</primary></indexterm>
163         <indexterm><primary>distributed</primary></indexterm>
164         <indexterm><primary>scalability</primary></indexterm>
165         <indexterm><primary>reliability</primary></indexterm>
166         An LDAP passdb backend confers the benefit that the account backend can be distributed and replicated,
167         which is of great value because it confers scalability and
168         provides a high degree of reliability.  This may be used when
169         Samba-4 is acting as an classic (NT4-like) domain controller,
170         but not when it is acting as an Active Directory Domain Controller.
171         </para></listitem>
173         <listitem><para>
174         <indexterm><primary>interdomain</primary><secondary>trust</secondary><tertiary>account</tertiary></indexterm>
175         <indexterm><primary>trust account</primary><secondary>interdomain</secondary></indexterm>
176         <indexterm><primary>interoperability</primary></indexterm>
177         Windows NT4 domain trusts. Samba-4 supports workstation and server (machine) trust accounts. It also
178         supports Windows NT4 style interdomain trust accounts, which further assists in network scalability
179         and interoperability, but only when itself is an classic
180         (NT4-like) domain controller.
181         </para></listitem>
182         
183         <listitem><para>
184         <indexterm><primary>NetBIOS</primary></indexterm>
185         <indexterm><primary>raw SMB</primary></indexterm>
186         <indexterm><primary>active directory</primary></indexterm>
187         <indexterm><primary>domain</primary><secondary>member server</secondary></indexterm>
188         <indexterm><primary>domain</primary><secondary>controller</secondary></indexterm>
189         <indexterm><primary>network</primary><secondary>browsing</secondary></indexterm>
190         Operation without NetBIOS over TCP/IP, rather using the raw SMB over TCP/IP. Note, this is feasible
191         only when operating as a Microsoft active directory domain
192         member server. When acting as a Samba classic (NT4-like) domain
193         controller the use of NetBIOS is necessary to provide network browsing support.
194         </para></listitem>
196         <listitem><para>
197         <indexterm><primary>WINS</primary></indexterm>
198         <indexterm><primary>TCP port</primary></indexterm>
199         <indexterm><primary>session services</primary></indexterm>
200         Samba-4 provides NetBIOS name services (WINS), NetBIOS over TCP/IP (TCP port 139) session services, SMB over
201         TCP/IP (TCP port 445) session services, and Microsoft compatible ONC DCE RPC services (TCP port 135)
202         services.
203         </para></listitem>
206         <listitem><para>
207         <indexterm><primary>kerberos</primary></indexterm>
208         <indexterm><primary>active directory</primary></indexterm>
209         Acting as a Windows 2000 active directory domain controller
210         (i.e., Kerberos and Active Directory).
211         </para></listitem>
213         <listitem><para>
214         <indexterm><primary>MMC</primary></indexterm>
215         <indexterm><primary>SVRTOOLS.EXE</primary></indexterm>
216         <indexterm><primary>Microsoft management console</primary><see>MMC</see></indexterm>
217         The Windows 200x/XP Microsoft Management Console (MMC) can be
218         used to manage a Samba-4 server, when it is an Active
219         Directory Domain Controller.  When acting as a classic (NT4)
220         domain controller, you
221         can use only the MS Windows NT4 Domain Server Manager and the MS Windows NT4 Domain User Manager. Both are
222         part of the SVRTOOLS.EXE package mentioned later.
223         </para></listitem>
224 </itemizedlist>
226 <para>
227 The following functionalities are not provided by Samba-4:
228 </para>
230 <itemizedlist>
231         <listitem><para>
232         <indexterm><primary>SAM</primary></indexterm>
233         <indexterm><primary>replication</primary></indexterm>
234         SAM replication with Windows NT4 domain controllers (i.e., a Samba PDC and a Windows NT BDC, or vice versa).
235         This means Samba cannot operate as a BDC when the PDC is Microsoft-based Windows NT PDC. Samba-4 can not
236         participate in replication of account data to Windows PDCs and BDCs.
237         </para></listitem>
238         
239 </itemizedlist>
241 <para>
242 <indexterm><primary>group</primary><secondary>mapping</secondary></indexterm>
243 Samba-3 implements group mapping between Windows NT groups and UNIX groups (this is really quite complicated
244 to explain in a short space). This is discussed more fully in <link linkend="groupmapping">Group Mapping: MS
245 Windows and UNIX</link>.
246 </para>
248 <para>
249 <indexterm><primary>machine trust account</primary></indexterm>
250 <indexterm><primary>trust account</primary><secondary>machine</secondary></indexterm>
251 <indexterm><primary>machine account</primary></indexterm>
252 Samba-4, like an MS Windows NT4 PDC or a Windows 200x Active Directory, needs to store user and Machine Trust
253 Account information in a suitable backend data-store.  Refer to <link linkend="machine-trust-accounts">MS
254 Windows Workstation/Server Machine Trust Accounts</link>. A complete discussion of account database backends can be found in <link linkend="passdb">Account
255 Information Databases</link>.
256 </para>
258 </sect1>
260 <sect1>
261 <title>Single Sign-On and Domain Security</title>
263 <para>
264 <indexterm><primary>single sign-on</primary><see>SSO</see></indexterm>
265 <indexterm><primary>SSO</primary></indexterm>
266 <indexterm><primary>active directory</primary></indexterm>
267 <indexterm><primary>authentication</primary></indexterm>
268 <indexterm><primary>validation</primary></indexterm>
269 <indexterm><primary>password uniqueness</primary></indexterm>
270 <indexterm><primary>password history</primary></indexterm>
271 When network administrators  are asked to describe the benefits of Windows NT4 and active directory networking
272 the most often mentioned feature is that of single sign-on (SSO). Many companies have implemented SSO
273 solutions. The mode of implementation of a single sign-on solution is an important factor in the practice of
274 networking in general, and is critical in respect of Windows networking. A company may have a wide variety of
275 information systems, each of which requires a form of user authentication and validation, thus it is not
276 uncommon that users may need to remember more than ten login IDs and passwords. This problem is compounded
277 when the password for each system must be changed at regular intervals, and particularly so where password
278 uniqueness and history limits are applied.
279 </para>
281 <para>
282 <indexterm><primary>management overheads</primary></indexterm>
283 There is a broadly held perception that SSO is the answer to the problem of users having to deal with too many
284 information system access credentials (username/password pairs). Many elaborate schemes have been devised to
285 make it possible to deliver a user-friendly SSO solution. The trouble is that if this implementation is not
286 done correctly, the site may end up paying dearly by way of complexity and management overheads. Simply put,
287 many SSO solutions are an administrative nightmare.
288 </para>
290 <para>
291 <indexterm><primary>identity management</primary></indexterm>
292 <indexterm><primary>authentication system</primary></indexterm>
293 <indexterm><primary>SSO</primary></indexterm>
294 SSO implementations utilize centralization of all user account information. Depending on environmental
295 complexity and the age of the systems over which a SSO solution is implemented, it may not be possible to
296 change the solution architecture so as to accommodate a new identity management and user authentication system.
297 Many SSO solutions involving legacy systems consist of a new super-structure that handles authentication on
298 behalf of the user. The software that gets layered over the old system may simply implement a proxy
299 authentication system. This means that the addition of SSO increases over-all information systems complexity.
300 Ideally, the implementation of SSO should reduce complexity and reduce administative overheads.
301 </para>
303 <para>
304 <indexterm><primary>centralized identity management</primary></indexterm>
305 <indexterm><primary>identity management</primary><secondary>centralized</secondary></indexterm>
306 <indexterm><primary>centralized</primary><secondary>authentication</secondary></indexterm>
307 <indexterm><primary>legacy systems</primary></indexterm>
308 <indexterm><primary>access control</primary></indexterm>
309 The initial goal of many network administrators is often to create and use a centralized identity management
310 system. It is often assumed that such a centralized system will use a single authentication infrastructure
311 that can be used by all information systems. The Microsoft Windows NT4 security domain architecture and the
312 Microsoft active directory service are often put forward as the ideal foundation for such a system. It is
313 conceptually simple to install an external authentication agent on each of the disparate infromation systems
314 that can then use the Microsoft (NT4 domain or ads service) for user authentication and access control. The
315 wonderful dream of a single centralized authentication service is commonly broken when realities are realized.
316 The problem with legacy systems is often the inability to externalize the authentication and access control
317 system it uses because its implementation will be excessively invasive from a re-engineering perspective, or
318 because application software has built-in dependencies on particular elements of the way user authentication
319 and access control were designed and built.
320 </para>
322 <para>
323 <indexterm><primary>meta-directory</primary></indexterm>
324 <indexterm><primary>credentials</primary></indexterm>
325 <indexterm><primary>disparate information systems</primary></indexterm>
326 <indexterm><primary>management procedures</primary></indexterm>
327 <indexterm><primary>work-flow protocol</primary></indexterm>
328 <indexterm><primary>rights</primary></indexterm>
329 <indexterm><primary>privileges</primary></indexterm>
330 <indexterm><primary>provisioned</primary></indexterm>
331 Over the past decade an industry has been developed around the various methods that have been built to get
332 around the key limitations of legacy information technology systems. One approach that is often used involves
333 the use of a meta-directory. The meta-directory stores user credentials for all disparate information systems
334 in the format that is particular to each system. An elaborate set of management procedures is coupled with a
335 rigidly enforced work-flow protocol for managing user rights and privileges within the maze of systems that
336 are provisioned by the new infrastructure makes possible user access to all systems using a single set of user
337 credentials.
338 </para>
340 <para>
341 <indexterm><primary>Organization for the Advancement of Structured Information Standards</primary><see>OASIS</see></indexterm>
342 <indexterm><primary>Security Assertion Markup Language</primary><see>SAML</see></indexterm>
343 <indexterm><primary>Federated Identity Management</primary><see>FIM</see></indexterm>
344 <indexterm><primary>secure access</primary></indexterm>
345 The Organization for the Advancement of Structured Information Standards (OASIS) has developed the Security
346 Assertion Markup Language (SAML), a structured method for communication of authentication information. The
347 over-all umbrella name for the technologies and methods that deploy SAML is called Federated Identity
348 Management (FIM). FIM depends on each system in the complex maze of disparate information systems to
349 authenticate their respective users and vouch for secure access to the services each provides.
350 </para>
352 <para>
353 <indexterm><primary>Simple Object Access Protocol</primary><see>SOAP</see></indexterm>
354 <indexterm><primary>federated organizations</primary></indexterm>
355 <indexterm><primary>Liberty Alliance</primary></indexterm>
356 <indexterm><primary>federated-identity</primary></indexterm>
357 <indexterm><primary></primary></indexterm>
358 <indexterm><primary></primary></indexterm>
359 SAML documents can be wrapped in a Simple Object Access Protocol (SOAP) message for the computer-to-computer
360 communications needed for Web services. Or they may be passed between Web servers of federated organizations
361 that share live services. The Liberty Alliance, an industry group formed to promote federated-identity
362 standards, has adopted SAML 1.1 as part of its application framework. Microsoft and IBM have proposed an
363 alternative specification called WS-Security. Some believe that the competing technologies and methods may
364 converge when the SAML 2.0 standard is introduced. A few Web access-management products support SAML today,
365 but implementation of the technology mostly requires customization to integrate applications and develop user
366 interfaces. In a nutshell, that is why FIM is a big and growing industry.
367 </para>
369 <para>
370 <indexterm><primary>interoperability</primary></indexterm>
371 <indexterm><primary>ADS</primary></indexterm>
372 <indexterm><primary>LDAP</primary></indexterm>
373 <indexterm><primary>GSSAPI</primary></indexterm>
374 <indexterm><primary>general security service application programming interface</primary><see>GSSAPI</see></indexterm>
375 Ignoring the bigger picture, which is beyond the scope of this book, the migration of all user and group
376 management to a centralized system is a step in the right direction. It is essential for interoperability
377 reasons to locate the identity management system data in a directory such as Microsoft Active Directory
378 Service (ADS), or any proprietary or open source system that provides a standard protocol for information
379 access (such as LDAP) and that can be coupled with a flexible array of authentication mechanisms (such as
380 kerberos) that use the protocols that are defined by the various general security service application
381 programming interface (GSSAPI) services.
382 </para>
384 <para>
385 <indexterm><primary>OpenLDAP</primary></indexterm>
386 <indexterm><primary>ADS</primary></indexterm>
387 <indexterm><primary>authentication agents</primary></indexterm>
388 A growing number of companies provide authentication agents for disparate legacy platforms to permit the use
389 of LDAP systems. Thus the use of OpenLDAP, the dominant open source software implementation of the light
390 weight directory access protocol standard. This fact, means that by providing support in Samba for the use of
391 LDAP and Microsoft ADS make Samba a highly scalable and forward reaching organizational networking technology.
392 </para>
394 <para>
395 <indexterm><primary>ADS</primary></indexterm>
396 <indexterm><primary>LDAP</primary></indexterm>
397 <indexterm><primary>authentication architecture</primary></indexterm>
398 <indexterm><primary>ntlm_auth</primary></indexterm>
399 <indexterm><primary>SQUID</primary></indexterm>
400 <indexterm><primary>FIM</primary></indexterm>
401 Microsoft ADS provides purely proprietary services that, with limitation, can be extended to provide a
402 centralized authentication infrastructure. Samba plus LDAP provides a similar opportunity for extension of a
403 centralized authentication architecture, but it is the fact that the Samba Team are pro-active in introducing
404 the extension of authentication services, using LDAP or otherwise, to applications such as SQUID (the open
405 source proxy server) through tools such as the <command>ntlm_auth</command> utility, that does much to create
406 sustainable choice and competition in the FIM market place.
407 </para>
409 <para>
410 <indexterm><primary>LDAP</primary></indexterm>
411 <indexterm><primary>OpenLDAP</primary></indexterm>
412 <indexterm><primary>identity information</primary></indexterm>
413 Primary domain control, if it is to be scalable to meet the needs of large sites, must therefore be capable of
414 using LDAP. The rapid adoption of OpenLDAP, and Samba configurations that use it, is ample proof that the era
415 of the directory has started. Samba-3 does not demand the use of LDAP, but the demand for a mechanism by which
416 user and group identity information can be distributed makes it an an unavoidable option.
417 </para>
419 <para>
420 <indexterm><primary>BDC</primary></indexterm>
421 <indexterm><primary>LDAP</primary></indexterm>
422 <indexterm><primary>e-Directory</primary></indexterm>
423 At this time, the use of Samba based BDCs, necessitates the use of
424 either the Samba-4 Active Directory Domain controller or, for classic
425 (NT4-like)domains an LDAP backend. The most commonly used LDAP
426 implementation used by Samba sites is OpenLDAP. It is possible to use any standards compliant LDAP server.
427 Those known to work includes those manufactured by: IBM, CA, Novell (e-Directory), and others.
428 </para>
430 </sect1>
432 <sect1>
433 <title>Basics of Domain Control</title>
435 <para>
436 <indexterm><primary>domain control</primary></indexterm>
437 Over the years, public perceptions of what domain control really is has taken on an almost mystical nature.
438 Before we branch into a brief overview of domain control, there are three basic types of domain controllers.
439 </para>
441 <sect2>
442 <title>Domain Controller Types</title>
444 <itemizedlist>
445         <listitem><para>NT4 style Primary Domain Controller</para></listitem>
446         <listitem><para>NT4 style Backup Domain Controller</para></listitem>
447         <listitem><para>ADS Domain Controller</para></listitem>
448 </itemizedlist>
450 <para>
451 <indexterm><primary>PDC</primary></indexterm>
452 <indexterm><primary>powerful</primary></indexterm>
453 <indexterm><primary>network</primary><secondary>performance</secondary></indexterm>
454 <indexterm><primary>domain</primary><secondary>member</secondary><tertiary>server</tertiary></indexterm>
455 The <emphasis>Primary Domain Controller</emphasis> or PDC plays an important role in MS Windows NT4. In
456 Windows 200x domain control architecture, this role is held by domain controllers.  Folklore dictates that
457 because of its role in the MS Windows network, the domain controller should be the most powerful and most
458 capable machine in the network.  As strange as it may seem to say this here, good overall network performance
459 dictates that the entire infrastructure needs to be balanced. It is advisable to invest more in standalone
460 (domain member) servers than in the domain controllers.
461 </para>
463 <para>
464 <indexterm><primary>SAM</primary></indexterm>
465 <indexterm><primary>BDC</primary></indexterm>
466 <indexterm><primary>authenticatior</primary></indexterm>
467 <indexterm><primary>synchronization</primary></indexterm>
468 <indexterm><primary>FSMO</primary></indexterm>
469 <indexterm><primary>Flexible Single Master Operator</primary><see>FSMO</see></indexterm>
470 <indexterm><primary>Security Account Manager</primary><see>SAM</see></indexterm>
471 In the case of MS Windows NT4-style domains, it is the PDC that initiates a new domain control database.
472 This forms a part of the Windows registry called the Security Account Manager (SAM). It plays a key
473 part in NT4-type domain user authentication and in synchronization of the domain authentication
474 database with BDCs.  With Active Directory domains, while some servers
475 may be a Flexible Single Master Operator (FSMO) role owner (and
476 therefore hold the monopoly for certain operations), it is in general
477 a distributed, multi-master replicated directory.
478 </para>
480 <para>
481 <indexterm><primary>backend database</primary></indexterm>
482 <indexterm><primary>registry</primary></indexterm>
483 Samba-4 can use a backend database that holds the same type of data as the NT4-style SAM
484 database (one of the registry files).  For BDC/BDC operations in a
485 classic domain, this functionality can be implemented using an
486 LDAP-based user and machine account backend.  The Samba-4 Active
487 Directory Domain controller implements the required storage internally.<footnote><para>See also <link linkend="passdb">Account Information
488 Databases</link>.</para></footnote>
489 </para>
491 <para>
492 <indexterm><primary>BDC</primary></indexterm>
493 <indexterm><primary>PDC</primary></indexterm>
494 <indexterm><primary>WINS</primary></indexterm>
495 <indexterm><primary>authentication</primary></indexterm>
496 <indexterm><primary>netlogon</primary></indexterm>
497 <indexterm><primary>name lookup</primary></indexterm>
498 The <emphasis>Backup Domain Controller</emphasis> or BDC plays a key role in servicing network authentication
499 requests. The BDC is biased to answer logon requests in preference to the PDC.  On a network segment that has
500 a BDC and a PDC, the BDC will most likely service network logon requests. The PDC will answer network logon
501 requests when the BDC is too busy (high load). When a user logs onto a Windows domain member client the
502 workstation will query the network to locate the nearest network logon server. Where a WINS server is used,
503 this is done via a query to the WINS server. If a netlogon server can not be found from the WINS query, or in
504 the absence of a WINS server, the workstation will perform a NetBIOS name lookup via a mailslot broadcast over
505 the UDP broadcast protocol. This means that the netlogon server that the windows client will use is influenced
506 by a number of variables, thus there is no simple determinant of whether a PDC or a BDC will serve a
507 particular logon authentication request.
508 </para>
510 <para>
511 <indexterm><primary>promote</primary></indexterm>
512 <indexterm><primary>demote</primary></indexterm>
513 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,
514 the previous PDC is automatically demoted to a BDC. With Samba-3, this is not an automatic operation; the PDC
515 and BDC must be manually configured, and other appropriate changes also need to be made.
516 </para>
518 <para>
519 <indexterm><primary>domain</primary><secondary>controller</secondary><tertiary>convert</tertiary></indexterm>
520 With MS Windows NT4, a decision is made at installation to determine what type of machine the server will be.
521 It is possible to promote a BDC to a PDC, and vice versa. The only method Microsoft provide to convert a
522 Windows NT4 domain controller to a domain member server or a standalone server is to reinstall it. The install
523 time choices offered are:
524 </para>
526 <itemizedlist>
527         <listitem><para><emphasis>Primary Domain Controller</emphasis> &smbmdash; the one that seeds the domain SAM.</para></listitem>
528         <listitem><para><emphasis>Backup Domain Controller</emphasis> &smbmdash; one that obtains a copy of the domain SAM.</para></listitem>
529         <listitem><para><emphasis>Domain Member Server</emphasis> &smbmdash; one that has no copy of the domain SAM; rather
530                 it obtains authentication from a domain controller for all access controls.</para></listitem>
531         <listitem><para><emphasis>Standalone Server</emphasis> &smbmdash; one that plays no part in SAM synchronization,
532                 has its own authentication database, and plays no role in domain security.</para></listitem>
533 </itemizedlist>
535 <para>
536 <indexterm><primary>domain</primary><secondary>control</secondary><tertiary>role</tertiary></indexterm>
537 <indexterm><primary>native member</primary></indexterm>
538 Samba-3 servers can readily be converted to and from domain controller roles through simple changes to the
539 &smb.conf; file. Samba-3 is capable of acting fully as a native member of a Windows 200x server Active
540 Directory domain.
541 </para>
543 <para>
544 <indexterm><primary>convert</primary><secondary>domain member server</secondary></indexterm>
545 For the sake of providing a complete picture, MS Windows 2000 domain control configuration is done after the server has been
546 installed. Please refer to Microsoft documentation for the procedures that should be followed to convert a
547 domain member server to or from a domain control, and to install or remove active directory service support.
548 </para>
550 <para>
551 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
552 <indexterm><primary>SAM</primary><secondary>replication</secondary></indexterm>
553 New to Samba-3 is the ability to function fully as an MS Windows NT4-style domain controller,
554 excluding the SAM replication components. However, please be aware that Samba-3 also supports the
555 MS Windows 200x domain control protocols.
556 </para>
558 </sect2>
560 <sect2>
561 <title>Preparing for Domain Control</title>
563 <para>
564 <indexterm><primary>standalone</primary></indexterm>
565 <indexterm><primary>workgroup</primary></indexterm>
566 <indexterm><primary>member</primary></indexterm>
567 <indexterm><primary>security</primary></indexterm>
568 There are two ways that MS Windows machines may interact with each other, with other servers,
569 and with domain controllers: either as <emphasis>standalone</emphasis> systems, more commonly
570 called <emphasis>workgroup</emphasis> members, or as full participants in a security system,
571 more commonly called <emphasis>domain</emphasis> members.
572 </para>
574 <para>
575 <indexterm><primary>workgroup</primary></indexterm>
576 <indexterm><primary>workgroup</primary><secondary>membership</secondary></indexterm>
577 <indexterm><primary>machine trust account</primary></indexterm>
578 It should be noted that workgroup membership involves no special configuration other than the machine being
579 configured so the network configuration has a commonly used name for its workgroup entry. It is not uncommon
580 for the name WORKGROUP to be used for this. With this mode of configuration, there are no Machine Trust
581 Accounts, and any concept of membership as such is limited to the fact that all machines appear in the network
582 neighborhood to be logically grouped together. Again, just to be clear: <emphasis>workgroup mode does not
583 involve security machine accounts</emphasis>.
584 </para>
586 <para>
587 <indexterm><primary>domain membership</primary></indexterm>
588 <indexterm><primary>machine trust account</primary><secondary>password</secondary></indexterm>
589 <indexterm><primary>trigger</primary></indexterm>
590 Domain member machines have a machine trust account in the domain accounts database. A special procedure
591 must be followed on each machine to effect domain membership. This procedure, which can be done
592 only by the local machine Administrator account, creates the domain machine account (if it does
593 not exist), and then initializes that account. When the client first logs onto the
594 domain, a machine trust account password change will be automatically triggered.
595 </para>
597 <note><para>
598 <indexterm><primary>domain member</primary></indexterm>
599 When Samba is configured as a domain controller, secure network operation demands that
600 all MS Windows NT4/200x/XP Professional clients should be configured as domain members.
601 If a machine is not made a member of the domain, then it will operate like a workgroup
602 (standalone) machine. Please refer to <link linkend="domain-member">Domain Membership</link>, for
603 information regarding domain membership.
604 </para></note>
606 <para>
607 The following are necessary for configuring Samba-3 as an MS Windows NT4-style PDC for MS Windows
608 NT4/200x/XP clients:
609 </para>
611 <itemizedlist>
612         <listitem><para>Configuration of basic TCP/IP and MS Windows networking.</para></listitem>
613         <listitem><para>Correct designation of the server role (<smbconfoption name="security">user</smbconfoption>).</para></listitem>
614         <listitem><para>Consistent configuration of name resolution.<footnote><para>See <link linkend="NetworkBrowsing">Network Browsing</link>, and 
615                 <link linkend="integrate-ms-networks">Integrating MS Windows Networks with Samba</link>.</para></footnote></para></listitem>
616         <listitem><para>Domain logons for Windows NT4/200x/XP Professional clients.</para></listitem>
617         <listitem><para>Configuration of roaming profiles or explicit configuration to force local profile usage.</para></listitem>
618         <listitem><para>Configuration of network/system policies.</para></listitem>
619         <listitem><para>Adding and managing domain user accounts.</para></listitem>
620         <listitem><para>Configuring MS Windows NT4/2000 Professional and Windows XP Professional client machines to become domain members.</para></listitem>
621 </itemizedlist>
623 <note><para>
624 <indexterm><primary>roaming profiles</primary></indexterm>
625 <indexterm><primary>account policies</primary></indexterm>
626 Roaming profiles and system/network policies are advanced network administration topics
627 that are covered in <link linkend="ProfileMgmt">Desktop Profile Management</link> and
628 <link linkend="PolicyMgmt">System and Account Policies</link> of this document. However, these are not
629 necessarily specific to a Samba PDC as much as they are related to Windows NT networking concepts.
630 </para></note>
632 <para>
633 A domain controller is an SMB/CIFS server that:
634 </para>
636 <itemizedlist>
637         <listitem><para>
638         <indexterm><primary>NetBIOS</primary><secondary>brooadcast</secondary></indexterm>
639         <indexterm><primary>WINS</primary></indexterm>
640         <indexterm><primary>UDP</primary></indexterm>
641         <indexterm><primary>DNS</primary></indexterm>
642         <indexterm><primary>active directory</primary></indexterm>
643         Registers and advertises itself as a domain controller (through NetBIOS broadcasts
644         as well as by way of name registrations either by Mailslot Broadcasts over UDP broadcast,
645         to a WINS server over UDP unicast, or via DNS and Active Directory).
646         </para></listitem>
648         <listitem><para>
649         <indexterm><primary>NETLOGON</primary></indexterm>
650         <indexterm><primary>LanMan logon service</primary></indexterm>
651         Provides the NETLOGON service. (This is actually a collection of services that runs over
652         multiple protocols. These include the LanMan logon service, the Netlogon service,
653         the Local Security Account service, and variations of them.)
654         </para></listitem>
656         <listitem><para>
657         Provides a share called NETLOGON.
658         </para></listitem>
659 </itemizedlist>
661 <para>
662 <indexterm><primary>domain</primary><secondary>master</secondary><tertiary>browser</tertiary></indexterm>
663 <indexterm><primary>local</primary><secondary>master</secondary><tertiary>browser</tertiary></indexterm>
664 <indexterm><primary>DMB</primary></indexterm>
665 <indexterm><primary>LMB</primary></indexterm>
666 <indexterm><primary>browse list</primary></indexterm>
667 It is rather easy to configure Samba to provide these. Each Samba domain controller must provide the NETLOGON
668 service that Samba calls the <smbconfoption name="domain logons"/> functionality (after the name of the
669 parameter in the &smb.conf; file). Additionally, one server in a Samba-3 domain must advertise itself as the
670 domain master browser.<footnote><para>See <link linkend="NetworkBrowsing">Network
671 Browsing</link>.</para></footnote> This causes the PDC to claim a domain-specific NetBIOS name that identifies
672 it as a DMB for its given domain or workgroup. Local master browsers (LMBs) in the same domain or workgroup on
673 broadcast-isolated subnets then ask for a complete copy of the browse list for the whole wide-area network.
674 Browser clients then contact their LMB, and will receive the domain-wide browse list instead of just the list
675 for their broadcast-isolated subnet.
676 </para>
678 </sect2>
679 </sect1>
681 <sect1>
682 <title>Domain Control: Example Configuration</title>
684 <para>
685 The first step in creating a working Samba PDC is to understand the parameters necessary
686 in &smb.conf;. An example &smb.conf; for acting as a PDC can be found in <link linkend="pdc-example">the
687 smb.conf file for an example PDC</link>. 
688 </para>
690 <example id="pdc-example">
691 <title>smb.conf for being a PDC</title>
692 <smbconfblock>
693 <smbconfsection name="[global]"/>
694 <smbconfoption name="netbios name"><replaceable>BELERIAND</replaceable></smbconfoption>
695 <smbconfoption name="workgroup"><replaceable>&example.workgroup;</replaceable></smbconfoption>
696 <smbconfoption name="passdb backend">tdbsam</smbconfoption>
697 <smbconfoption name="security">user</smbconfoption>
698 <smbconfoption name="domain logons">yes</smbconfoption>
699 <smbconfoption name="logon path">\\%N\profiles\%U</smbconfoption>
700 <smbconfoption name="logon drive">H:</smbconfoption>
701 <smbconfoption name="logon home">\\homeserver\%U\winprofile</smbconfoption>
702 <smbconfoption name="logon script">logon.cmd</smbconfoption>
704 <smbconfsection name="[netlogon]"/>
705 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
706 <smbconfoption name="read only">yes</smbconfoption>
707 <smbconfoption name="write list"><replaceable>ntadmin</replaceable></smbconfoption>
709 <smbconfsection name="[profiles]"/>
710 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
711 <smbconfoption name="read only">no</smbconfoption>
712 <smbconfoption name="create mask">0600</smbconfoption>
713 <smbconfoption name="directory mask">0700</smbconfoption>
714 </smbconfblock>
715 </example>
717 <para>
718 The basic options shown in <link linkend="pdc-example">this example</link> are explained as follows:
719 </para>
721 <variablelist>
722         <varlistentry><term>passdb backend </term>
723                 <listitem><para>
724                 <indexterm><primary>group</primary><secondary>account</secondary></indexterm>
725                 <indexterm><primary>smbpasswd</primary></indexterm>
726                 <indexterm><primary>tdbsam</primary></indexterm>
727                 <indexterm><primary>ldapsam</primary></indexterm>
728                 <indexterm><primary>guest</primary></indexterm>
729                 <indexterm><primary>default accounts</primary></indexterm>
730                 This contains all the user and group account information. Acceptable values for a PDC
731                 are: <emphasis>smbpasswd, tdbsam, and ldapsam</emphasis>. The <quote>guest</quote> entry provides
732                 default accounts and is included by default; there is no need to add it explicitly.
733                 </para>
735                 <para>
736                 <indexterm><primary>passdb backend</primary></indexterm>
737                 <indexterm><primary>distributed</primary></indexterm>
738                 <indexterm><primary>smbpasswd</primary></indexterm>
739                 <indexterm><primary>tdbsam</primary></indexterm>
740                 Where use of BDCs is intended, the only logical choice is
741                 to use LDAP so the passdb backend can be distributed. The tdbsam and smbpasswd files
742                 cannot effectively be distributed and therefore should not be used.
743                 </para></listitem>
744         </varlistentry>
746         <varlistentry><term>Domain Control Parameters </term>
747                 <listitem><para>
748                 <indexterm><primary>network</primary><secondary>logon</secondary></indexterm>
749                 The parameters <emphasis>domain logons</emphasis>
750                 parameter is the key parameter indicating domain
751                 control and network logon support.
752                 </para></listitem>
753         </varlistentry>
755         <varlistentry><term>Environment Parameters </term>
756                 <listitem><para>
757                 <indexterm><primary>logon path</primary></indexterm>
758                 <indexterm><primary>logon home</primary></indexterm>
759                 <indexterm><primary>logon drive</primary></indexterm>
760                 <indexterm><primary>logon script</primary></indexterm>
761                 The parameters <emphasis>logon path, logon home, logon drive</emphasis>, and <emphasis>logon script</emphasis> are
762                 environment support settings that help to facilitate client logon operations and that help
763                 to provide automated control facilities to ease network management overheads. Please refer
764                 to the man page information for these parameters.
765                 </para></listitem>
766         </varlistentry>
768         <varlistentry><term>NETLOGON Share </term>
769                 <listitem><para>
770                 <indexterm><primary>NETLOGON</primary></indexterm>
771                 <indexterm><primary>logon processing</primary></indexterm>
772                 <indexterm><primary>domain logon</primary></indexterm>
773                 <indexterm><primary>domain membership</primary></indexterm>
774                 <indexterm><primary>group policy</primary></indexterm>
775                 <indexterm><primary>NTConfig.POL</primary></indexterm>
776                 The NETLOGON share plays a central role in domain logon and domain membership support.
777                 This share is provided on all Microsoft domain controllers. It is used to provide logon
778                 scripts, to store group policy files (NTConfig.POL), as well as to locate other common
779                 tools that may be needed for logon processing. This is an essential share on a domain controller.
780                 </para></listitem>
781         </varlistentry>
783         <varlistentry><term>PROFILE Share </term>
784                 <listitem><para>
785                 <indexterm><primary>desktop profile</primary></indexterm>
786                 <indexterm><primary>VFS</primary></indexterm>
787                 <indexterm><primary>fake_permissions</primary></indexterm>
788                 <indexterm><primary>profile</primary></indexterm>
789                 <indexterm><primary></primary></indexterm>
790                 This share is used to store user desktop profiles. Each user must have a directory at the root
791                 of this share. This directory must be write-enabled for the user and must be globally read-enabled.
792                 Samba-3 has a VFS module called <quote>fake_permissions</quote> that may be installed on this share. This will
793                 allow a Samba administrator to make the directory read-only to everyone. Of course this is useful
794                 only after the profile has been properly created.
795                 </para></listitem>
796         </varlistentry>
797 </variablelist>
799 <note><para>
800 The above parameters make for a full set of functionality that may define the server's mode
801 of operation. The following &smb.conf; parameters are the essentials alone:
802 </para>
804 <para>
805 <smbconfblock>
806 <smbconfoption name="netbios name">BELERIAND</smbconfoption>
807 <smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
808 <smbconfoption name="domain logons">Yes</smbconfoption>
809 <smbconfoption name="security">User</smbconfoption>
810 </smbconfblock>
811 </para>
813 <para>
814 The additional parameters shown in the longer listing in this section just make for
815 a more complete explanation.
816 </para></note>
818 </sect1>
820 <sect1>
821 <title>Samba ADS Domain Control</title>
823 <para>
824 <indexterm><primary>active directory</primary></indexterm>
825 Samba-4 is also available as an Active Directory server. It can truly function as an Active Directory
826 PDC. The protocols for some of the functionality of Active Directory
827 domain controllers has been implemented.
828 </para>
830 <para>
831 <indexterm><primary>domain controllers</primary></indexterm>
832 <indexterm><primary>active directory</primary></indexterm>
833 <indexterm><primary>classic domain support</primary></indexterm>
834 To be sure, Samba-4 is also designed to provide most of the functionality that Microsoft Windows NT4-style
835 domain controllers have. Samba-4 does not have all the capabilities of Windows NT4, but it does have
836 a number of features that Windows NT4 domain controllers do not
837 have. We call it a <emphasis>classic domain</emphasis> controller for
838 this reason, as in short, Samba-4 when acting in this mode is not NT4,
839 and the Active Directory Domain Control aspect is a distinct capability.
840 </para>
842 </sect1>
844 <sect1>
845 <title>Domain and Network Logon Configuration</title>
847 <para>
848 <indexterm><primary>domain logon</primary></indexterm>
849 The subject of network or domain logons is discussed here because it forms
850 an integral part of the essential functionality that is provided by a domain controller.
851 </para>
853 <sect2>
854 <title>Domain Network Logon Service</title>
856 <para>
857 <indexterm><primary>domain logon</primary></indexterm>
858 All domain controllers must run the netlogon service (<emphasis>domain logons</emphasis>
859 in Samba). One domain controller must be configured without the
860 <smbconfoption name="domain master"></smbconfoption> parameter
861 (the PDC); on all BDCs set the parameter <smbconfoption name="domain master">No</smbconfoption>.
862 </para>
864 <sect3>
865 <title>Example Configuration</title>
867 <example id="PDC-config">
868 <title>smb.conf for being a PDC</title>
869 <smbconfblock>
870 <smbconfsection name="[global]"/>
871 <smbconfoption name="domain logons">Yes</smbconfoption>
872 <smbconfoption name="domain master">(omit on PDC, No on BDCs)</smbconfoption>
874 <smbconfsection name="[netlogon]"/>
875 <smbconfoption name="comment">Network Logon Service</smbconfoption>
876 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
877 <smbconfoption name="guest ok">Yes</smbconfoption>
878 <smbconfoption name="browseable">No</smbconfoption>
879 </smbconfblock>
880 </example>
882 </sect3>
883 <sect3>
884 <title>The Special Case of MS Windows Home Editions</title>
886 <para>
887 <indexterm><primary>Windows Home editions</primary></indexterm>
888 To be completely clear: If you want MS Windows Home Editions to integrate with your
889 MS Windows NT4 or Active Directory domain security, understand it cannot be done.
890 The only option is to purchase the upgrade from MS Windows Home Edition to
891 a MS Windows Professional edition.
892 </para>
894 <note><para>
895 MS Windows Home Editions do not have the ability to join any type of domain
896 security facility. Unlike MS Windows 9x/Me, MS Windows Home Edition
897 deliberatly lacks the ability to log onto a network.
898 </para></note>
900 <para>
901 Now that this has been said, please do not ask the mailing list or email any of the
902 Samba Team members with your questions asking how to make this work. It can't be done.
903 If it can be done, then to do so would violate your software license agreement with
904 Microsoft, and we recommend that you do not do that.
905 </para>
907 </sect3>
909 </sect2>
911 <sect2>
912 <title>Security Mode and Master Browsers</title>
914 <para>
915 <indexterm><primary>security mode</primary></indexterm>
916 <indexterm><primary>user-mode security</primary></indexterm>
917 <indexterm><primary>share-mode security</primary></indexterm>
918 There are a few comments to make in order to tie up some loose ends. There has been much debate over the issue
919 of whether it is okay to configure Samba as a domain controller that operates with security mode other than
920 user-mode. The only security mode that will not work due to technical reasons is share-mode security. Domain
921 and server mode security are really just a variation on SMB user-level security.
922 </para>
924 <para>
925 <indexterm><primary>DOMAIN&lt;1C&gt;</primary></indexterm>
926 <indexterm><primary>DOMAIN&lt;1B&gt;</primary></indexterm>
927 <indexterm><primary>DMB</primary></indexterm>
928 <indexterm><primary>PDC</primary></indexterm>
929 <indexterm><primary>NetBIOS name</primary></indexterm>
930 <indexterm><primary>domain controller</primary></indexterm>
931 <indexterm><primary>election</primary></indexterm>
932 Actually, this issue is also closely tied to the debate on whether Samba must be the DMB for its workgroup
933 when operating as a domain controller.  In a pure Microsoft Windows NT domain, the PDC wins the election to be
934 the DMB, and then registers the DOMAIN&lt;1B&gt; NetBIOS name. This is not the name used by Windows clients
935 to locate the domain controller, all domain controllers register the DOMAIN&lt;1C&gt; name and Windows clients
936 locate a network logon server by seraching for the DOMAIN&lt;1C&gt; name.  A DMB is a Domain Master Browser
937 &smbmdash; see <link linkend="NetworkBrowsing">The Network Browsing Chapter</link>, <link
938 linkend="DMB">Configuring WORKGROUP Browsing</link>; Microsoft PDCs expect to win the election to become the
939 DMB, if it loses that election it will report a continuous and rapid sequence of warning messages to its
940 Windows event logger complaining that it has lost the election to become a DMB.  For this reason, in networks
941 where a Samba server is the PDC it is wise to configure the Samba domain controller as the DMB.
942 </para>
944 <note><para>
945 <indexterm><primary>DOMAIN&lt;1D&gt;</primary></indexterm>
946 <indexterm><primary>synchronization</primary></indexterm>
947 <indexterm><primary>domain control</primary></indexterm>
948 <indexterm><primary>browse list management</primary></indexterm>
949 <indexterm><primary>network</primary><secondary>logon</secondary><tertiary>service</tertiary></indexterm>
950 SMB/CIFS servers that register the DOMAIN&lt;1C&gt; name do so because they provide the network logon
951 service. Server that register the DOMAIN&lt;1B&gt; name are DMBs &smbmdash; meaning that they are responsible
952 for browse list synchronization across all machines that have registered the DOMAIN&lt;1D&gt; name. The later
953 are LMBs that have the responsibility to listen to all NetBIOS name registrations that occur locally to their
954 own network segment. The network logon service (NETLOGON) is germane to domain control and has nothing to do
955 with network browsing and browse list management. The 1C and 1B/1D name services are orthogonal to each
956 other.
957 </para></note>
959 <para>
960 Now back to the issue of configuring a Samba domain controller to use a mode other than <smbconfoption
961 name="security">user</smbconfoption>. If a Samba host is configured to use another SMB server or domain
962 controller in order to validate user connection requests, it is a fact that some other machine on the network
963 (the <smbconfoption name="password server"/>) knows more about the user than the Samba host. About 99 percent
964 of the time, this other host is a domain controller. Now to operate in domain mode security, the
965 <smbconfoption name="workgroup"/> parameter must be set to the name of the Windows NT domain (which already
966 has a domain controller).  If the domain does not already have a domain controller, you do not yet have a
967 domain.
968 </para>
970 <para>
971 Configuring a Samba box as a domain controller for a domain that already by definition has a
972 PDC is asking for trouble. Therefore, you should always configure the Samba domain controller
973 to be the DMB for its domain and set <smbconfoption name="security">user</smbconfoption>.
974 This is the only officially supported mode of operation.
975 </para>
977 </sect2>
979 </sect1>
981 <sect1>
982 <title>Common Errors</title>
984 <sect2>
985 <title><quote>$</quote> Cannot Be Included in Machine Name</title>
987 <para>
988 <indexterm><primary>BSD</primary></indexterm>
989 <indexterm><primary>FreeBSD</primary></indexterm>
990 <indexterm><primary>/etc/passwd</primary></indexterm>
991 A machine account, typically stored in <filename>/etc/passwd</filename>, takes the form of the machine
992 name with a <quote>$</quote> appended. Some BSD systems will not create a user with a <quote>$</quote> in the name.
993 Recent versions of FreeBSD have removed this limitation, but older releases are still in common use.
994 </para>
996 <para>
997 <indexterm><primary>vipw</primary></indexterm>
998 The problem is only in the program used to make the entry. Once made, it works perfectly.  Create a user
999 without the <quote>$</quote>. Then use <command>vipw</command> to edit the entry, adding the <quote>$</quote>.
1000 Or create the whole entry with vipw if you like; make sure you use a unique user login ID.
1001 </para>
1003 <note><para>The machine account must have the exact name that the workstation has.</para></note>
1005 <note><para>
1006 The UNIX tool <command>vipw</command> is a common tool for directly editing the <filename>/etc/passwd</filename> file.
1007 The use of vipw will ensure that shadow files (where used) will remain current with the passwd file. This is
1008 important for security reasons.
1009 </para></note>
1011 </sect2>
1013 <sect2>
1014 <title>Joining Domain Fails Because of Existing Machine Account</title>
1015                 
1016 <para>
1017 <indexterm><primary>join domain</primary></indexterm>
1018 <quote>I get told, `You already have a connection to the Domain....' or `Cannot join domain, the
1019 credentials supplied conflict with an existing set...' when creating a Machine Trust Account.</quote>
1020 </para>
1022 <para>
1023 This happens if you try to create a Machine Trust Account from the machine itself and already have a
1024 connection (e.g., mapped drive) to a share (or IPC$) on the Samba PDC. The following command will remove all
1025 network drive connections:
1026 <screen>
1027 &dosprompt;<userinput>net use * /d</userinput>
1028 </screen>
1029 This will break all network connections.
1030 </para>
1032 <para>
1033 Further, if the machine is already a <quote>member of a workgroup</quote> that is the same name as the domain
1034 you are joining (bad idea), you will get this message. Change the workgroup name to something else &smbmdash;
1035 it does not matter what &smbmdash; reboot, and try again.
1036 </para>
1038 </sect2>
1040 <sect2>
1041 <title>The System Cannot Log You On (C000019B)</title>
1043 <para><quote>
1044 I joined the domain successfully but after upgrading to a newer version of the Samba code I get the message,
1045 <errorname>`The system cannot log you on (C000019B). Please try again or consult your system
1046 administrator</errorname> when attempting to logon.'</quote>
1047 </para>
1049 <para>
1050 <indexterm><primary>SID</primary></indexterm>
1051 This occurs when the domain SID stored in the secrets.tdb database is changed. The most common cause of a
1052 change in domain SID is when the domain name and/or the server name (NetBIOS name) is changed.  The only way
1053 to correct the problem is to restore the original domain SID or remove the domain client from the domain and
1054 rejoin. The domain SID may be reset using either the net or rpcclient utilities.
1055 </para>
1057 <para>
1058 To reset or change the domain SID you can use the net command as follows:
1060 <screen>
1061 &rootprompt;<userinput>net getlocalsid 'OLDNAME'</userinput>
1062 &rootprompt;<userinput>net setlocalsid 'SID'</userinput>
1063 </screen>
1064 </para>
1066 <para>
1067 Workstation Machine Trust Accounts work only with the domain (or network) SID. If this SID changes,
1068 domain members (workstations) will not be able to log onto the domain. The original domain SID
1069 can be recovered from the secrets.tdb file. The alternative is to visit each workstation to rejoin
1070 it to the domain.
1071 </para>
1073 </sect2>
1075 <sect2>
1076 <title>The Machine Trust Account Is Not Accessible</title>
1078 <para>
1079 <quote>When I try to join the domain I get the message, <errorname>"The machine account 
1080 for this computer either does not exist or is not accessible</errorname>." What's wrong?</quote>
1081 </para>
1083 <para>
1084 This problem is caused by the PDC not having a suitable Machine Trust Account.  If you are using the
1085 <smbconfoption name="add machine script"/> method to create accounts, then this would indicate that it has not
1086 worked. Ensure the domain admin user system is working.
1087 </para>
1089 <para>
1090 Alternately, if you are creating account entries manually, then they have not been created correctly. Make
1091 sure that you have the entry correct for the Machine Trust Account in <filename>smbpasswd</filename> file on
1092 the Samba PDC.  If you added the account using an editor rather than using the smbpasswd utility, make sure
1093 that the account name is the machine NetBIOS name with a <quote>$</quote> appended to it (i.e.,
1094 computer_name$). There must be an entry in both the POSIX UNIX system account backend as well as in the
1095 SambaSAMAccount backend. The default backend for Samba-3 (i.e., the parameter <parameter>passdb
1096 backend</parameter> is not specified in the &smb.conf; file, or if specified is set to
1097 <literal>smbpasswd</literal>, are respectively the <filename>/etc/passwd</filename> and
1098 <filename>/etc/samba/smbpasswd</filename> (or <filename>/usr/local/samba/lib/private/smbpasswd</filename> if
1099 compiled using Samba Team default settings). The use of the <filename>/etc/passwd</filename> can be overridden
1100 by alternative settings in the NSS <filename>/etc/nsswitch.conf</filename> file.
1101 </para>
1103 <para>
1104 Some people have also reported that inconsistent subnet masks between the Samba server and the NT 
1105 client can cause this problem.  Make sure that these are consistent for both client and server.
1106 </para>
1107 </sect2>
1109 <sect2>
1110 <title>Account Disabled</title>
1112 <para><quote>When I attempt to log in to a Samba domain from a NT4/W200x workstation,
1113 I get a message about my account being disabled.</quote></para>
1115 <para>
1116 Enable the user accounts with <userinput>smbpasswd -e <replaceable>username</replaceable>
1117 </userinput>. This is normally done as an account is created.
1118 </para>
1120 </sect2>
1122 <sect2>
1123 <title>Domain Controller Unavailable</title>
1124                 
1125 <para><quote>Until a few minutes after Samba has started, clients get the error `Domain Controller Unavailable'</quote></para>
1127 <para>
1128 A domain controller has to announce its role on the network. This usually takes a while. Be patient for up to 15 minutes,
1129 then try again.
1130 </para>
1131 </sect2>
1133 <sect2>
1134 <title>Cannot Log onto Domain Member Workstation After Joining Domain</title>
1136 <para>
1137 <indexterm><primary>schannel</primary></indexterm>
1138 <indexterm><primary>signing</primary></indexterm>
1139 After successfully joining the domain, user logons fail with one of two messages: one to the
1140 effect that the domain controller cannot be found; the other claims that the account does not
1141 exist in the domain or that the password is incorrect. This may be due to incompatible
1142 settings between the Windows client and the Samba-3 server for <emphasis>schannel</emphasis>
1143 (secure channel) settings or <emphasis>smb signing</emphasis> settings. Check your Samba
1144 settings for <emphasis>client schannel</emphasis>, <emphasis>server schannel</emphasis>,
1145 <emphasis>client signing</emphasis>, <emphasis>server signing</emphasis> by executing:
1146 <screen>
1147 <command>testparm -v | grep channel</command> and looking for the value of these parameters.
1148 </screen>
1149 </para>
1151 <para>
1152 Also use the MMC &smbmdash; Local Security Settings. This tool is available from the
1153 Control Panel. The Policy settings are found in the Local Policies/Security Options area and are prefixed by
1154 <emphasis>Secure Channel:..., and Digitally sign...</emphasis>.
1155 </para>
1157 <para>
1158 It is important that these be set consistently with the Samba-3 server settings.
1159 </para>
1161 </sect2>
1163 </sect1>
1164 </chapter>