31e5468681e02e7090a22343ecc4d2bb23c32b1a
[kamenim/samba-autobuild/.git] / docs / htmldocs / samba-pdc.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Samba as an NT4 or Win2k Primary Domain Controller</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
9 REL="HOME"
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
12 REL="UP"
13 TITLE="Type of installation"
14 HREF="type.html"><LINK
15 REL="PREVIOUS"
16 TITLE="Samba as Stand-Alone Server"
17 HREF="securitylevels.html"><LINK
18 REL="NEXT"
19 TITLE="Samba Backup Domain Controller to Samba Domain Control"
20 HREF="samba-bdc.html"></HEAD
21 ><BODY
22 CLASS="CHAPTER"
23 BGCOLOR="#FFFFFF"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 SUMMARY="Header navigation table"
32 WIDTH="100%"
33 BORDER="0"
34 CELLPADDING="0"
35 CELLSPACING="0"
36 ><TR
37 ><TH
38 COLSPAN="3"
39 ALIGN="center"
40 >SAMBA Project Documentation</TH
41 ></TR
42 ><TR
43 ><TD
44 WIDTH="10%"
45 ALIGN="left"
46 VALIGN="bottom"
47 ><A
48 HREF="securitylevels.html"
49 ACCESSKEY="P"
50 >Prev</A
51 ></TD
52 ><TD
53 WIDTH="80%"
54 ALIGN="center"
55 VALIGN="bottom"
56 ></TD
57 ><TD
58 WIDTH="10%"
59 ALIGN="right"
60 VALIGN="bottom"
61 ><A
62 HREF="samba-bdc.html"
63 ACCESSKEY="N"
64 >Next</A
65 ></TD
66 ></TR
67 ></TABLE
68 ><HR
69 ALIGN="LEFT"
70 WIDTH="100%"></DIV
71 ><DIV
72 CLASS="CHAPTER"
73 ><H1
74 ><A
75 NAME="SAMBA-PDC"
76 ></A
77 >Chapter 7. Samba as an NT4 or Win2k Primary Domain Controller</H1
78 ><DIV
79 CLASS="TOC"
80 ><DL
81 ><DT
82 ><B
83 >Table of Contents</B
84 ></DT
85 ><DT
86 >7.1. <A
87 HREF="samba-pdc.html#AEN1010"
88 >Prerequisite Reading</A
89 ></DT
90 ><DT
91 >7.2. <A
92 HREF="samba-pdc.html#AEN1014"
93 >Background</A
94 ></DT
95 ><DT
96 >7.3. <A
97 HREF="samba-pdc.html#AEN1054"
98 >Configuring the Samba Domain Controller</A
99 ></DT
100 ><DT
101 >7.4. <A
102 HREF="samba-pdc.html#AEN1096"
103 >Creating Machine Trust Accounts and Joining Clients to the Domain</A
104 ></DT
105 ><DD
106 ><DL
107 ><DT
108 >7.4.1. <A
109 HREF="samba-pdc.html#AEN1142"
110 >Manual Creation of Machine Trust Accounts</A
111 ></DT
112 ><DT
113 >7.4.2. <A
114 HREF="samba-pdc.html#AEN1183"
115 >"On-the-Fly" Creation of Machine Trust Accounts</A
116 ></DT
117 ><DT
118 >7.4.3. <A
119 HREF="samba-pdc.html#AEN1192"
120 >Joining the Client to the Domain</A
121 ></DT
122 ></DL
123 ></DD
124 ><DT
125 >7.5. <A
126 HREF="samba-pdc.html#AEN1212"
127 >Common Problems and Errors</A
128 ></DT
129 ><DD
130 ><DL
131 ><DT
132 >7.5.1. <A
133 HREF="samba-pdc.html#AEN1214"
134 >I cannot include a '$' in a machine name</A
135 ></DT
136 ><DT
137 >7.5.2. <A
138 HREF="samba-pdc.html#AEN1220"
139 >I get told "You already have a connection to the Domain...." 
140 or "Cannot join domain, the credentials supplied conflict with an 
141 existing set.." when creating a machine trust account.</A
142 ></DT
143 ><DT
144 >7.5.3. <A
145 HREF="samba-pdc.html#AEN1227"
146 >The system can not log you on (C000019B)....</A
147 ></DT
148 ><DT
149 >7.5.4. <A
150 HREF="samba-pdc.html#AEN1231"
151 >The machine trust account for this computer either does not 
152 exist or is not accessible.</A
153 ></DT
154 ><DT
155 >7.5.5. <A
156 HREF="samba-pdc.html#AEN1237"
157 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
158 I get a message about my account being disabled.</A
159 ></DT
160 ></DL
161 ></DD
162 ><DT
163 >7.6. <A
164 HREF="samba-pdc.html#AEN1241"
165 >Domain Control for Windows 9x/ME</A
166 ></DT
167 ></DL
168 ></DIV
169 ><DIV
170 CLASS="SECT1"
171 ><H1
172 CLASS="SECT1"
173 ><A
174 NAME="AEN1010"
175 >7.1. Prerequisite Reading</A
176 ></H1
177 ><P
178 >Before you continue reading in this chapter, please make sure 
179 that you are comfortable with configuring basic files services
180 in smb.conf and how to enable and administer password 
181 encryption in Samba.  Theses two topics are covered in the
182 <TT
183 CLASS="FILENAME"
184 >smb.conf</TT
185 > manpage.</P
186 ></DIV
187 ><DIV
188 CLASS="SECT1"
189 ><H1
190 CLASS="SECT1"
191 ><A
192 NAME="AEN1014"
193 >7.2. Background</A
194 ></H1
195 ><P
196 >This article outlines the steps necessary for configuring Samba as a PDC.
197 It is necessary to have a working Samba server prior to implementing the
198 PDC functionality.</P
199 ><P
200 ></P
201 ><UL
202 ><LI
203 ><P
204 >       Domain logons for Windows NT 4.0 / 200x / XP Professional clients.
205         </P
206 ></LI
207 ><LI
208 ><P
209 >       Placing Windows 9x / Me clients in user level security
210         </P
211 ></LI
212 ><LI
213 ><P
214 >       Retrieving a list of users and groups from a Samba PDC to
215         Windows 9x / Me / NT / 200x / XP Professional clients
216         </P
217 ></LI
218 ><LI
219 ><P
220 >       Roaming Profiles
221         </P
222 ></LI
223 ><LI
224 ><P
225 >       Network/System Policies
226         </P
227 ></LI
228 ></UL
229 ><DIV
230 CLASS="NOTE"
231 ><P
232 ></P
233 ><TABLE
234 CLASS="NOTE"
235 WIDTH="100%"
236 BORDER="0"
237 ><TR
238 ><TD
239 WIDTH="25"
240 ALIGN="CENTER"
241 VALIGN="TOP"
242 ><IMG
243 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
244 HSPACE="5"
245 ALT="Note"></TD
246 ><TD
247 ALIGN="LEFT"
248 VALIGN="TOP"
249 ><P
250 >Roaming Profiles and System/Network policies are advanced network administration topics
251 that are covered separately in this document.</P
252 ></TD
253 ></TR
254 ></TABLE
255 ></DIV
256 ><P
257 >The following functionalities are new to the Samba 3.0 release:</P
258 ><P
259 ></P
260 ><UL
261 ><LI
262 ><P
263 >       Windows NT 4 domain trusts
264         </P
265 ></LI
266 ><LI
267 ><P
268 >       Adding users via the User Manager for Domains
269         </P
270 ></LI
271 ></UL
272 ><P
273 >The following functionalities are NOT provided by Samba 3.0:</P
274 ><P
275 ></P
276 ><UL
277 ><LI
278 ><P
279 >       SAM replication with Windows NT 4.0 Domain Controllers
280         (i.e. a Samba PDC and a Windows NT BDC or vice versa) 
281         </P
282 ></LI
283 ><LI
284 ><P
285 >       Acting as a Windows 2000 Domain Controller (i.e. Kerberos and 
286         Active Directory)
287         </P
288 ></LI
289 ></UL
290 ><P
291 >Please note that Windows 9x / Me / XP Home clients are not true members of a domain
292 for reasons outlined in this article.  Therefore the protocol for
293 support Windows 9x-style domain logons is completely different
294 from NT4 / Win2k type domain logons and has been officially supported for some 
295 time.</P
296 ><P
297 ><SPAN
298 CLASS="emphasis"
299 ><I
300 CLASS="EMPHASIS"
301 >MS Windows XP Home edition is NOT able to join a domain and does not permit
302 the use of domain logons.</I
303 ></SPAN
304 ></P
305 ><P
306 >Implementing a Samba PDC can basically be divided into 3 broad
307 steps.</P
308 ><P
309 ></P
310 ><OL
311 TYPE="1"
312 ><LI
313 ><P
314 >       Configuring the Samba PDC
315         </P
316 ></LI
317 ><LI
318 ><P
319 >       Creating machine trust accounts and joining clients to the domain
320         </P
321 ></LI
322 ><LI
323 ><P
324 >       Adding and managing domain user accounts
325         </P
326 ></LI
327 ></OL
328 ><P
329 >There are other minor details such as user profiles, system
330 policies, etc...  However, these are not necessarily specific
331 to a Samba PDC as much as they are related to Windows NT networking
332 concepts.</P
333 ></DIV
334 ><DIV
335 CLASS="SECT1"
336 ><H1
337 CLASS="SECT1"
338 ><A
339 NAME="AEN1054"
340 >7.3. Configuring the Samba Domain Controller</A
341 ></H1
342 ><P
343 >The first step in creating a working Samba PDC is to 
344 understand the parameters necessary in smb.conf. Here we
345 attempt to explain the parameters that are covered in
346 the <TT
347 CLASS="FILENAME"
348 >smb.conf</TT
349 > man page.</P
350 ><P
351 >Here is an example <TT
352 CLASS="FILENAME"
353 >smb.conf</TT
354 > for acting as a PDC:</P
355 ><P
356 ><PRE
357 CLASS="PROGRAMLISTING"
358 >[global]
359     ; Basic server settings
360     <A
361 HREF="smb.conf.5.html#NETBIOSNAME"
362 TARGET="_top"
363 >netbios name</A
364 > = <VAR
365 CLASS="REPLACEABLE"
366 >POGO</VAR
367 >
368     <A
369 HREF="smb.conf.5.html#WORKGROUP"
370 TARGET="_top"
371 >workgroup</A
372 > = <VAR
373 CLASS="REPLACEABLE"
374 >NARNIA</VAR
375 >
376
377     ; we should act as the domain and local master browser
378     <A
379 HREF="smb.conf.5.html#OSLEVEL"
380 TARGET="_top"
381 >os level</A
382 > = 64
383     <A
384 HREF="smb.conf.5.html#PERFERREDMASTER"
385 TARGET="_top"
386 >preferred master</A
387 > = yes
388     <A
389 HREF="smb.conf.5.html#DOMAINMASTER"
390 TARGET="_top"
391 >domain master</A
392 > = yes
393     <A
394 HREF="smb.conf.5.html#LOCALMASTER"
395 TARGET="_top"
396 >local master</A
397 > = yes
398     
399     ; security settings (must user security = user)
400     <A
401 HREF="smb.conf.5.html#SECURITYEQUALSUSER"
402 TARGET="_top"
403 >security</A
404 > = user
405     
406     ; encrypted passwords are a requirement for a PDC
407     <A
408 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
409 TARGET="_top"
410 >encrypt passwords</A
411 > = yes
412     
413     ; support domain logons
414     <A
415 HREF="smb.conf.5.html#DOMAINLOGONS"
416 TARGET="_top"
417 >domain logons</A
418 > = yes
419     
420     ; where to store user profiles?
421     <A
422 HREF="smb.conf.5.html#LOGONPATH"
423 TARGET="_top"
424 >logon path</A
425 > = \\%N\profiles\%u
426     
427     ; where is a user's home directory and where should it be mounted at?
428     <A
429 HREF="smb.conf.5.html#LOGONDRIVE"
430 TARGET="_top"
431 >logon drive</A
432 > = H:
433     <A
434 HREF="smb.conf.5.html#LOGONHOME"
435 TARGET="_top"
436 >logon home</A
437 > = \\homeserver\%u
438     
439     ; specify a generic logon script for all users
440     ; this is a relative **DOS** path to the [netlogon] share
441     <A
442 HREF="smb.conf.5.html#LOGONSCRIPT"
443 TARGET="_top"
444 >logon script</A
445 > = logon.cmd
446
447 ; necessary share for domain controller
448 [netlogon]
449     <A
450 HREF="smb.conf.5.html#PATH"
451 TARGET="_top"
452 >path</A
453 > = /usr/local/samba/lib/netlogon
454     <A
455 HREF="smb.conf.5.html#READONLY"
456 TARGET="_top"
457 >read only</A
458 > = yes
459     <A
460 HREF="smb.conf.5.html#WRITELIST"
461 TARGET="_top"
462 >write list</A
463 > = <VAR
464 CLASS="REPLACEABLE"
465 >ntadmin</VAR
466 >
467     
468 ; share for storing user profiles
469 [profiles]
470     <A
471 HREF="smb.conf.5.html#PATH"
472 TARGET="_top"
473 >path</A
474 > = /export/smb/ntprofile
475     <A
476 HREF="smb.conf.5.html#READONLY"
477 TARGET="_top"
478 >read only</A
479 > = no
480     <A
481 HREF="smb.conf.5.html#CREATEMASK"
482 TARGET="_top"
483 >create mask</A
484 > = 0600
485     <A
486 HREF="smb.conf.5.html#DIRECTORYMASK"
487 TARGET="_top"
488 >directory mask</A
489 > = 0700</PRE
490 ></P
491 ><P
492 >There are a couple of points to emphasize in the above configuration.</P
493 ><P
494 ></P
495 ><UL
496 ><LI
497 ><P
498 >       Encrypted passwords must be enabled.  For more details on how 
499         to do this, refer to <A
500 HREF="passdb.html"
501 >the User Database chapter</A
502 >.
503         </P
504 ></LI
505 ><LI
506 ><P
507 >       The server must support domain logons and a
508         <TT
509 CLASS="FILENAME"
510 >[netlogon]</TT
511 > share
512         </P
513 ></LI
514 ><LI
515 ><P
516 >       The server must be the domain master browser in order for Windows 
517         client to locate the server as a DC.  Please refer to the various 
518         Network Browsing documentation included with this distribution for 
519         details.
520         </P
521 ></LI
522 ></UL
523 ><P
524 >Samba 3.0 offers a complete implementation of group mapping
525 between Windows NT groups and Unix groups (this is really quite
526 complicated to explain in a short space).</P
527 ></DIV
528 ><DIV
529 CLASS="SECT1"
530 ><H1
531 CLASS="SECT1"
532 ><A
533 NAME="AEN1096"
534 >7.4. Creating Machine Trust Accounts and Joining Clients to the Domain</A
535 ></H1
536 ><P
537 >A machine trust account is a Samba account that is used to
538 authenticate a client machine (rather than a user) to the Samba
539 server.  In Windows terminology, this is known as a "Computer
540 Account."</P
541 ><P
542 >The password of a machine trust account acts as the shared secret for
543 secure communication with the Domain Controller.  This is a security
544 feature to prevent an unauthorized machine with the same NetBIOS name
545 from joining the domain and gaining access to domain user/group
546 accounts.  Windows NT, 200x, XP Professional clients use machine trust
547 accounts, but Windows 9x / Me / XP Home clients do not.  Hence, a
548 Windows 9x / Me / XP Home  client is never a true member of a domain
549 because it does not possess a machine trust account, and thus has no
550 shared secret with the domain controller.</P
551 ><P
552 >A Windows PDC stores each machine trust account in the Windows
553 Registry. A Samba-3 PDC also has to stoe machine trust account information
554 in a suitable back-end data store. With Samba-3 there can be multiple back-ends
555 for this including:</P
556 ><P
557 ></P
558 ><UL
559 ><LI
560 ><P
561 >       <SPAN
562 CLASS="emphasis"
563 ><I
564 CLASS="EMPHASIS"
565 >smbpaswd</I
566 ></SPAN
567 > - the plain ascii file stored used by
568         earlier versions of Samba. This file configuration option requires
569         a Unix/Linux system account for EVERY entry (ie: both for user and for
570         machine accounts). This file will be located in the <SPAN
571 CLASS="emphasis"
572 ><I
573 CLASS="EMPHASIS"
574 >private</I
575 ></SPAN
576 >
577         directory (default is /usr/local/samba/lib/private or on linux /etc/samba).
578         </P
579 ></LI
580 ><LI
581 ><P
582 >       <SPAN
583 CLASS="emphasis"
584 ><I
585 CLASS="EMPHASIS"
586 >smbpasswd_nua</I
587 ></SPAN
588 > - This file is independant of the
589         system wide user accounts. The use of this back-end option requires
590         specification of the "non unix account range" option also. It is called
591         smbpasswd and will be located in the <TT
592 CLASS="FILENAME"
593 >private</TT
594 > directory.
595         </P
596 ></LI
597 ><LI
598 ><P
599 >       <SPAN
600 CLASS="emphasis"
601 ><I
602 CLASS="EMPHASIS"
603 >tdbsam</I
604 ></SPAN
605 > - a binary database backend that will be
606         stored in the <SPAN
607 CLASS="emphasis"
608 ><I
609 CLASS="EMPHASIS"
610 >private</I
611 ></SPAN
612 > directory in a file called
613         <SPAN
614 CLASS="emphasis"
615 ><I
616 CLASS="EMPHASIS"
617 >passwd.tdb</I
618 ></SPAN
619 >. The key benefit of this binary format
620         file is that it can store binary objects that can not be accomodated
621         in the traditional plain text smbpasswd file.
622         </P
623 ></LI
624 ><LI
625 ><P
626 >       <SPAN
627 CLASS="emphasis"
628 ><I
629 CLASS="EMPHASIS"
630 >tdbsam_nua</I
631 ></SPAN
632 > like the smbpasswd_nua option above, this
633         file allows the creation of arbitrary user and machine accounts without
634         requiring that account to be added to the system (/etc/passwd) file. It
635         too requires the specification of the "non unix account range" option
636         in the [globals] section of the <TT
637 CLASS="FILENAME"
638 >smb.conf</TT
639 > file.
640         </P
641 ></LI
642 ><LI
643 ><P
644 >       <SPAN
645 CLASS="emphasis"
646 ><I
647 CLASS="EMPHASIS"
648 >ldapsam</I
649 ></SPAN
650 > - An LDAP based back-end. Permits the
651         LDAP server to be specified. eg: ldap://localhost or ldap://frodo.murphy.com
652         </P
653 ></LI
654 ><LI
655 ><P
656 >       <SPAN
657 CLASS="emphasis"
658 ><I
659 CLASS="EMPHASIS"
660 >ldapsam_nua</I
661 ></SPAN
662 > - LDAP based back-end with no unix
663         account requirement, like smbpasswd_nua and tdbsam_nua above.
664         </P
665 ></LI
666 ></UL
667 ><P
668 >Read the chapter about the <A
669 HREF="passdb.html"
670 >User Database</A
671
672 for details.</P
673 ><P
674 >A Samba PDC, however, stores each machine trust account in two parts,
675 as follows:
676
677 <P
678 ></P
679 ><UL
680 ><LI
681 ><P
682 >A Samba account, stored in the same location as user
683     LanMan and NT password hashes (currently
684     <TT
685 CLASS="FILENAME"
686 >smbpasswd</TT
687 >). The Samba account 
688     possesses and uses only the NT password hash.</P
689 ></LI
690 ><LI
691 ><P
692 >A corresponding Unix account, typically stored in
693     <TT
694 CLASS="FILENAME"
695 >/etc/passwd</TT
696 >. (Future releases will alleviate the need to
697     create <TT
698 CLASS="FILENAME"
699 >/etc/passwd</TT
700 > entries.) </P
701 ></LI
702 ></UL
703 ></P
704 ><P
705 >There are two ways to create machine trust accounts:</P
706 ><P
707 ></P
708 ><UL
709 ><LI
710 ><P
711 > Manual creation. Both the Samba and corresponding
712         Unix account are created by hand.</P
713 ></LI
714 ><LI
715 ><P
716 > "On-the-fly" creation. The Samba machine trust
717         account is automatically created by Samba at the time the client
718         is joined to the domain. (For security, this is the
719         recommended method.) The corresponding Unix account may be
720         created automatically or manually. </P
721 ></LI
722 ></UL
723 ><DIV
724 CLASS="SECT2"
725 ><H2
726 CLASS="SECT2"
727 ><A
728 NAME="AEN1142"
729 >7.4.1. Manual Creation of Machine Trust Accounts</A
730 ></H2
731 ><P
732 >The first step in manually creating a machine trust account is to
733 manually create the corresponding Unix account in
734 <TT
735 CLASS="FILENAME"
736 >/etc/passwd</TT
737 >.  This can be done using
738 <B
739 CLASS="COMMAND"
740 >vipw</B
741 > or other 'add user' command that is normally
742 used to create new Unix accounts.  The following is an example for a
743 Linux based Samba server:</P
744 ><P
745 >  <SAMP
746 CLASS="PROMPT"
747 >root# </SAMP
748 ><B
749 CLASS="COMMAND"
750 >/usr/sbin/useradd -g 100 -d /dev/null -c <VAR
751 CLASS="REPLACEABLE"
752 >"machine 
753 nickname"</VAR
754 > -s /bin/false <VAR
755 CLASS="REPLACEABLE"
756 >machine_name</VAR
757 >$ </B
758 ></P
759 ><P
760 ><SAMP
761 CLASS="PROMPT"
762 >root# </SAMP
763 ><B
764 CLASS="COMMAND"
765 >passwd -l <VAR
766 CLASS="REPLACEABLE"
767 >machine_name</VAR
768 >$</B
769 ></P
770 ><P
771 >On *BSD systems, this can be done using the 'chpass' utility:</P
772 ><P
773 ><SAMP
774 CLASS="PROMPT"
775 >root# </SAMP
776 ><B
777 CLASS="COMMAND"
778 >chpass -a "<VAR
779 CLASS="REPLACEABLE"
780 >machine_name</VAR
781 >$:*:101:100::0:0:Workstation <VAR
782 CLASS="REPLACEABLE"
783 >machine_name</VAR
784 >:/dev/null:/sbin/nologin"</B
785 ></P
786 ><P
787 >The <TT
788 CLASS="FILENAME"
789 >/etc/passwd</TT
790 > entry will list the machine name 
791 with a "$" appended, won't have a password, will have a null shell and no 
792 home directory. For example a machine named 'doppy' would have an 
793 <TT
794 CLASS="FILENAME"
795 >/etc/passwd</TT
796 > entry like this:</P
797 ><P
798 ><PRE
799 CLASS="PROGRAMLISTING"
800 >doppy$:x:505:501:<VAR
801 CLASS="REPLACEABLE"
802 >machine_nickname</VAR
803 >:/dev/null:/bin/false</PRE
804 ></P
805 ><P
806 >Above, <VAR
807 CLASS="REPLACEABLE"
808 >machine_nickname</VAR
809 > can be any
810 descriptive name for the client, i.e., BasementComputer.
811 <VAR
812 CLASS="REPLACEABLE"
813 >machine_name</VAR
814 > absolutely must be the NetBIOS
815 name of the client to be joined to the domain.  The "$" must be
816 appended to the NetBIOS name of the client or Samba will not recognize
817 this as a machine trust account.</P
818 ><P
819 >Now that the corresponding Unix account has been created, the next step is to create 
820 the Samba account for the client containing the well-known initial 
821 machine trust account password.  This can be done using the <A
822 HREF="smbpasswd.8.html"
823 TARGET="_top"
824 ><B
825 CLASS="COMMAND"
826 >smbpasswd(8)</B
827 ></A
828 > command 
829 as shown here:</P
830 ><P
831 ><SAMP
832 CLASS="PROMPT"
833 >root# </SAMP
834 ><KBD
835 CLASS="USERINPUT"
836 >smbpasswd -a -m <VAR
837 CLASS="REPLACEABLE"
838 >machine_name</VAR
839 ></KBD
840 ></P
841 ><P
842 >where <VAR
843 CLASS="REPLACEABLE"
844 >machine_name</VAR
845 > is the machine's NetBIOS
846 name.  The RID of the new machine account is generated from the UID of 
847 the corresponding Unix account.</P
848 ><DIV
849 CLASS="WARNING"
850 ><P
851 ></P
852 ><TABLE
853 CLASS="WARNING"
854 WIDTH="100%"
855 BORDER="0"
856 ><TR
857 ><TD
858 WIDTH="25"
859 ALIGN="CENTER"
860 VALIGN="TOP"
861 ><IMG
862 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
863 HSPACE="5"
864 ALT="Warning"></TD
865 ><TH
866 ALIGN="LEFT"
867 VALIGN="CENTER"
868 ><B
869 >Join the client to the domain immediately</B
870 ></TH
871 ></TR
872 ><TR
873 ><TD
874 >&nbsp;</TD
875 ><TD
876 ALIGN="LEFT"
877 VALIGN="TOP"
878 ><P
879 >       Manually creating a machine trust account using this method is the 
880         equivalent of creating a machine trust account on a Windows NT PDC using 
881         the "Server Manager".  From the time at which the account is created
882         to the time which the client joins the domain and changes the password,
883         your domain is vulnerable to an intruder joining your domain using a
884         a machine with the same NetBIOS name.  A PDC inherently trusts
885         members of the domain and will serve out a large degree of user 
886         information to such clients.  You have been warned!
887         </P
888 ></TD
889 ></TR
890 ></TABLE
891 ></DIV
892 ></DIV
893 ><DIV
894 CLASS="SECT2"
895 ><H2
896 CLASS="SECT2"
897 ><A
898 NAME="AEN1183"
899 >7.4.2. "On-the-Fly" Creation of Machine Trust Accounts</A
900 ></H2
901 ><P
902 >The second (and recommended) way of creating machine trust accounts is
903 simply to allow the Samba server to create them as needed when the client
904 is joined to the domain. </P
905 ><P
906 >Since each Samba machine trust account requires a corresponding
907 Unix account, a method for automatically creating the
908 Unix account is usually supplied; this requires configuration of the
909 <A
910 HREF="smb.conf.5.html#ADDUSERSCRIPT"
911 TARGET="_top"
912 >add user script</A
913
914 option in <TT
915 CLASS="FILENAME"
916 >smb.conf</TT
917 >.  This
918 method is not required, however; corresponding Unix accounts may also
919 be created manually.</P
920 ><P
921 >Below is an example for a RedHat 6.2 Linux system.</P
922 ><P
923 ><PRE
924 CLASS="PROGRAMLISTING"
925 >[global]
926    # &#60;...remainder of parameters...&#62;
927    add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u </PRE
928 ></P
929 ></DIV
930 ><DIV
931 CLASS="SECT2"
932 ><H2
933 CLASS="SECT2"
934 ><A
935 NAME="AEN1192"
936 >7.4.3. Joining the Client to the Domain</A
937 ></H2
938 ><P
939 >The procedure for joining a client to the domain varies with the
940 version of Windows.</P
941 ><P
942 ></P
943 ><UL
944 ><LI
945 ><P
946 ><SPAN
947 CLASS="emphasis"
948 ><I
949 CLASS="EMPHASIS"
950 >Windows 2000</I
951 ></SPAN
952 ></P
953 ><P
954 > When the user elects to join the client to a domain, Windows prompts for
955         an account and password that is privileged to join the domain.  A
956         Samba administrative account (i.e., a Samba account that has root
957         privileges on the Samba server) must be entered here; the
958         operation will fail if an ordinary user account is given. 
959         The password for this account should be
960         set to a different password than the associated
961         <TT
962 CLASS="FILENAME"
963 >/etc/passwd</TT
964 > entry, for security
965         reasons. </P
966 ><P
967 >The session key of the Samba administrative account acts as an
968         encryption key for setting the password of the machine trust
969         account. The machine trust account will be created on-the-fly, or
970         updated if it already exists.</P
971 ></LI
972 ><LI
973 ><P
974 ><SPAN
975 CLASS="emphasis"
976 ><I
977 CLASS="EMPHASIS"
978 >Windows NT</I
979 ></SPAN
980 ></P
981 ><P
982 > If the machine trust account was created manually, on the
983         Identification Changes menu enter the domain name, but do not
984         check the box "Create a Computer Account in the Domain."  In this case,
985         the existing machine trust account is used to join the machine to
986         the domain.</P
987 ><P
988 > If the machine trust account is to be created
989         on-the-fly, on the Identification Changes menu enter the domain
990         name, and check the box "Create a Computer Account in the Domain."  In
991         this case, joining the domain proceeds as above for Windows 2000
992         (i.e., you must supply a Samba administrative account when
993         prompted).</P
994 ></LI
995 ><LI
996 ><P
997 ><SPAN
998 CLASS="emphasis"
999 ><I
1000 CLASS="EMPHASIS"
1001 >Samba</I
1002 ></SPAN
1003 ></P
1004 ><P
1005 >Joining a samba client to a domain is documented in 
1006         the <A
1007 HREF="domain-member.html"
1008 >Domain Member</A
1009 > chapter.</P
1010 ></LI
1011 ></UL
1012 ></DIV
1013 ></DIV
1014 ><DIV
1015 CLASS="SECT1"
1016 ><H1
1017 CLASS="SECT1"
1018 ><A
1019 NAME="AEN1212"
1020 >7.5. Common Problems and Errors</A
1021 ></H1
1022 ><DIV
1023 CLASS="SECT2"
1024 ><H2
1025 CLASS="SECT2"
1026 ><A
1027 NAME="AEN1214"
1028 >7.5.1. I cannot include a '$' in a machine name</A
1029 ></H2
1030 ><P
1031 >A 'machine name' in (typically) <TT
1032 CLASS="FILENAME"
1033 >/etc/passwd</TT
1034 >       
1035 of the machine name with a '$' appended. FreeBSD (and other BSD 
1036 systems?) won't create a user with a '$' in their name.</P
1037 ><P
1038 >The problem is only in the program used to make the entry, once 
1039 made, it works perfectly. So create a user without the '$' and 
1040 use <B
1041 CLASS="COMMAND"
1042 >vipw</B
1043 > to edit the entry, adding the '$'. Or create 
1044 the whole entry with vipw if you like, make sure you use a 
1045 unique User ID !</P
1046 ></DIV
1047 ><DIV
1048 CLASS="SECT2"
1049 ><H2
1050 CLASS="SECT2"
1051 ><A
1052 NAME="AEN1220"
1053 >7.5.2. I get told "You already have a connection to the Domain...." 
1054 or "Cannot join domain, the credentials supplied conflict with an 
1055 existing set.." when creating a machine trust account.</A
1056 ></H2
1057 ><P
1058 >This happens if you try to create a machine trust account from the 
1059 machine itself and already have a connection (e.g. mapped drive) 
1060 to a share (or IPC$) on the Samba PDC.  The following command
1061 will remove all network drive connections:</P
1062 ><P
1063 ><SAMP
1064 CLASS="PROMPT"
1065 >C:\WINNT\&#62;</SAMP
1066 > <B
1067 CLASS="COMMAND"
1068 >net use * /d</B
1069 ></P
1070 ><P
1071 >Further, if the machine is a already a 'member of a workgroup' that 
1072 is the same name as the domain you are joining (bad idea) you will 
1073 get this message.  Change the workgroup name to something else, it 
1074 does not matter what, reboot, and try again.</P
1075 ></DIV
1076 ><DIV
1077 CLASS="SECT2"
1078 ><H2
1079 CLASS="SECT2"
1080 ><A
1081 NAME="AEN1227"
1082 >7.5.3. The system can not log you on (C000019B)....</A
1083 ></H2
1084 ><P
1085 >I joined the domain successfully but after upgrading 
1086 to a newer version of the Samba code I get the message, "The system 
1087 can not log you on (C000019B), Please try again or consult your 
1088 system administrator" when attempting to logon.</P
1089 ><P
1090 >This occurs when the domain SID stored in the secrets.tdb database
1091 is changed. The most common cause of a change in domain SID is when
1092 the domain name and/or the server name (netbios name) is changed.
1093 The only way to correct the problem is to restore the original domain 
1094 SID or remove the domain client from the domain and rejoin. The domain
1095 SID may be reset using either the smbpasswd or rpcclient utilities.</P
1096 ></DIV
1097 ><DIV
1098 CLASS="SECT2"
1099 ><H2
1100 CLASS="SECT2"
1101 ><A
1102 NAME="AEN1231"
1103 >7.5.4. The machine trust account for this computer either does not 
1104 exist or is not accessible.</A
1105 ></H2
1106 ><P
1107 >When I try to join the domain I get the message "The machine account 
1108 for this computer either does not exist or is not accessible". What's 
1109 wrong?</P
1110 ><P
1111 >This problem is caused by the PDC not having a suitable machine trust account. 
1112 If you are using the <VAR
1113 CLASS="PARAMETER"
1114 >add user script</VAR
1115 > method to create 
1116 accounts then this would indicate that it has not worked. Ensure the domain 
1117 admin user system is working.</P
1118 ><P
1119 >Alternatively if you are creating account entries manually then they 
1120 have not been created correctly. Make sure that you have the entry 
1121 correct for the machine trust account in smbpasswd file on the Samba PDC. 
1122 If you added the account using an editor rather than using the smbpasswd 
1123 utility, make sure that the account name is the machine NetBIOS name 
1124 with a '$' appended to it ( i.e. computer_name$ ). There must be an entry 
1125 in both /etc/passwd and the smbpasswd file. Some people have reported 
1126 that inconsistent subnet masks between the Samba server and the NT 
1127 client have caused this problem.   Make sure that these are consistent 
1128 for both client and server.</P
1129 ></DIV
1130 ><DIV
1131 CLASS="SECT2"
1132 ><H2
1133 CLASS="SECT2"
1134 ><A
1135 NAME="AEN1237"
1136 >7.5.5. When I attempt to login to a Samba Domain from a NT4/W2K workstation,
1137 I get a message about my account being disabled.</A
1138 ></H2
1139 ><P
1140 >At first be ensure to enable the useraccounts with <B
1141 CLASS="COMMAND"
1142 >smbpasswd -e 
1143 %user%</B
1144 >, this is normally done, when you create an account.</P
1145 ></DIV
1146 ></DIV
1147 ><DIV
1148 CLASS="SECT1"
1149 ><H1
1150 CLASS="SECT1"
1151 ><A
1152 NAME="AEN1241"
1153 >7.6. Domain Control for Windows 9x/ME</A
1154 ></H1
1155 ><P
1156 >A domain and a workgroup are exactly the same thing in terms of network
1157 browsing.  The difference is that a distributable authentication
1158 database is associated with a domain, for secure login access to a
1159 network.  Also, different access rights can be granted to users if they
1160 successfully authenticate against a domain logon server. Samba-3 does this
1161 now in the same way that MS Windows NT/2K.</P
1162 ><P
1163 >The SMB client logging on to a domain has an expectation that every other
1164 server in the domain should accept the same authentication information.
1165 Network browsing functionality of domains and workgroups is identical and
1166 is explained in this documentation under the browsing discussions.
1167 It should be noted, that browsing is totally orthogonal to logon support.</P
1168 ><P
1169 >Issues related to the single-logon network model are discussed in this
1170 section.  Samba supports domain logons, network logon scripts, and user
1171 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
1172 which are the focus of this section.</P
1173 ><P
1174 >When an SMB client in a domain wishes to logon it broadcast requests for a
1175 logon server.  The first one to reply gets the job, and validates its
1176 password using whatever mechanism the Samba administrator has installed.
1177 It is possible (but very stupid) to create a domain where the user
1178 database is not shared between servers, i.e. they are effectively workgroup
1179 servers advertising themselves as participating in a domain.  This
1180 demonstrates how authentication is quite different from but closely
1181 involved with domains.</P
1182 ><P
1183 >Using these features you can make your clients verify their logon via
1184 the Samba server; make clients run a batch file when they logon to
1185 the network and download their preferences, desktop and start menu.</P
1186 ><P
1187 >Before launching into the configuration instructions, it is 
1188 worthwhile lookingat how a Windows 9x/ME client performs a logon:</P
1189 ><P
1190 ></P
1191 ><OL
1192 TYPE="1"
1193 ><LI
1194 ><P
1195 >       The client broadcasts (to the IP broadcast address of the subnet it is in)
1196         a NetLogon request. This is sent to the NetBIOS name DOMAIN&#60;1c&#62; at the
1197         NetBIOS layer.  The client chooses the first response it receives, which
1198         contains the NetBIOS name of the logon server to use in the format of 
1199         \\SERVER.
1200         </P
1201 ></LI
1202 ><LI
1203 ><P
1204 >       The client then connects to that server, logs on (does an SMBsessetupX) and
1205         then connects to the IPC$ share (using an SMBtconX).
1206         </P
1207 ></LI
1208 ><LI
1209 ><P
1210 >       The client then does a NetWkstaUserLogon request, which retrieves the name
1211         of the user's logon script. 
1212         </P
1213 ></LI
1214 ><LI
1215 ><P
1216 >       The client then connects to the NetLogon share and searches for this    
1217         and if it is found and can be read, is retrieved and executed by the client.
1218         After this, the client disconnects from the NetLogon share.
1219         </P
1220 ></LI
1221 ><LI
1222 ><P
1223 >       The client then sends a NetUserGetInfo request to the server, to retrieve
1224         the user's home share, which is used to search for profiles. Since the
1225         response to the NetUserGetInfo request does not contain much more       
1226         the user's home share, profiles for Win9X clients MUST reside in the user
1227         home directory.
1228         </P
1229 ></LI
1230 ><LI
1231 ><P
1232 >       The client then connects to the user's home share and searches for the 
1233         user's profile. As it turns out, you can specify the user's home share as
1234         a sharename and path. For example, \\server\fred\.profile.
1235         If the profiles are found, they are implemented.
1236         </P
1237 ></LI
1238 ><LI
1239 ><P
1240 >       The client then disconnects from the user's home share, and reconnects to
1241         the NetLogon share and looks for CONFIG.POL, the policies file. If this is
1242         found, it is read and implemented.
1243         </P
1244 ></LI
1245 ></OL
1246 ><DIV
1247 CLASS="SECT2"
1248 ><H2
1249 CLASS="SECT2"
1250 ><A
1251 NAME="AEN1264"
1252 >7.6.1. Configuration Instructions:     Network Logons</A
1253 ></H2
1254 ><P
1255 >The main difference between a PDC and a Windows 9x logon 
1256 server configuration is that</P
1257 ><P
1258 ></P
1259 ><UL
1260 ><LI
1261 ><P
1262 >Password encryption is not required for a Windows 9x logon server.</P
1263 ></LI
1264 ><LI
1265 ><P
1266 >Windows 9x/ME clients do not possess machine trust accounts.</P
1267 ></LI
1268 ></UL
1269 ><P
1270 >Therefore, a Samba PDC will also act as a Windows 9x logon 
1271 server.</P
1272 ><DIV
1273 CLASS="WARNING"
1274 ><P
1275 ></P
1276 ><TABLE
1277 CLASS="WARNING"
1278 WIDTH="100%"
1279 BORDER="0"
1280 ><TR
1281 ><TD
1282 WIDTH="25"
1283 ALIGN="CENTER"
1284 VALIGN="TOP"
1285 ><IMG
1286 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
1287 HSPACE="5"
1288 ALT="Warning"></TD
1289 ><TH
1290 ALIGN="LEFT"
1291 VALIGN="CENTER"
1292 ><B
1293 >security mode and master browsers</B
1294 ></TH
1295 ></TR
1296 ><TR
1297 ><TD
1298 >&nbsp;</TD
1299 ><TD
1300 ALIGN="LEFT"
1301 VALIGN="TOP"
1302 ><P
1303 >There are a few comments to make in order to tie up some 
1304 loose ends.  There has been much debate over the issue of whether
1305 or not it is ok to configure Samba as a Domain Controller in security
1306 modes other than <CODE
1307 CLASS="CONSTANT"
1308 >USER</CODE
1309 >.  The only security mode 
1310 which  will not work due to technical reasons is <CODE
1311 CLASS="CONSTANT"
1312 >SHARE</CODE
1313 >
1314 mode security.  <CODE
1315 CLASS="CONSTANT"
1316 >DOMAIN</CODE
1317 > and <CODE
1318 CLASS="CONSTANT"
1319 >SERVER</CODE
1320 >
1321 mode security is really just a variation on SMB user level security.</P
1322 ><P
1323 >Actually, this issue is also closely tied to the debate on whether 
1324 or not Samba must be the domain master browser for its workgroup
1325 when operating as a DC.  While it may technically be possible
1326 to configure a server as such (after all, browsing and domain logons
1327 are two distinctly different functions), it is not a good idea to
1328 so.  You should remember that the DC must register the DOMAIN#1b NetBIOS 
1329 name.  This is the name used by Windows clients to locate the DC.
1330 Windows clients do not distinguish between the DC and the DMB.
1331 For this reason, it is very wise to configure the Samba DC as the DMB.</P
1332 ><P
1333 >Now back to the issue of configuring a Samba DC to use a mode other
1334 than "security = user".  If a Samba host is configured to use 
1335 another SMB server or DC in order to validate user connection 
1336 requests, then it is a fact that some other machine on the network 
1337 (the "password server") knows more about user than the Samba host.
1338 99% of the time, this other host is a domain controller.  Now 
1339 in order to operate in domain mode security, the "workgroup" parameter
1340 must be set to the name of the Windows NT domain (which already 
1341 has a domain controller, right?)</P
1342 ><P
1343 >Therefore configuring a Samba box as a DC for a domain that 
1344 already by definition has a PDC is asking for trouble.
1345 Therefore, you should always configure the Samba DC to be the DMB
1346 for its domain.</P
1347 ></TD
1348 ></TR
1349 ></TABLE
1350 ></DIV
1351 ></DIV
1352 ></DIV
1353 ></DIV
1354 ><DIV
1355 CLASS="NAVFOOTER"
1356 ><HR
1357 ALIGN="LEFT"
1358 WIDTH="100%"><TABLE
1359 SUMMARY="Footer navigation table"
1360 WIDTH="100%"
1361 BORDER="0"
1362 CELLPADDING="0"
1363 CELLSPACING="0"
1364 ><TR
1365 ><TD
1366 WIDTH="33%"
1367 ALIGN="left"
1368 VALIGN="top"
1369 ><A
1370 HREF="securitylevels.html"
1371 ACCESSKEY="P"
1372 >Prev</A
1373 ></TD
1374 ><TD
1375 WIDTH="34%"
1376 ALIGN="center"
1377 VALIGN="top"
1378 ><A
1379 HREF="samba-howto-collection.html"
1380 ACCESSKEY="H"
1381 >Home</A
1382 ></TD
1383 ><TD
1384 WIDTH="33%"
1385 ALIGN="right"
1386 VALIGN="top"
1387 ><A
1388 HREF="samba-bdc.html"
1389 ACCESSKEY="N"
1390 >Next</A
1391 ></TD
1392 ></TR
1393 ><TR
1394 ><TD
1395 WIDTH="33%"
1396 ALIGN="left"
1397 VALIGN="top"
1398 >Samba as Stand-Alone Server</TD
1399 ><TD
1400 WIDTH="34%"
1401 ALIGN="center"
1402 VALIGN="top"
1403 ><A
1404 HREF="type.html"
1405 ACCESSKEY="U"
1406 >Up</A
1407 ></TD
1408 ><TD
1409 WIDTH="33%"
1410 ALIGN="right"
1411 VALIGN="top"
1412 >Samba Backup Domain Controller to Samba Domain Control</TD
1413 ></TR
1414 ></TABLE
1415 ></DIV
1416 ></BODY
1417 ></HTML
1418 >