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