merge from 2.2
[gd/samba-autobuild/.git] / docs / htmldocs / Samba-HOWTO-Collection.html
1 <HTML
2 ><HEAD
3 ><TITLE
4 >SAMBA Project Documentation</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD
8 ><BODY
9 CLASS="BOOK"
10 BGCOLOR="#FFFFFF"
11 TEXT="#000000"
12 LINK="#0000FF"
13 VLINK="#840084"
14 ALINK="#0000FF"
15 ><DIV
16 CLASS="BOOK"
17 ><A
18 NAME="SAMBA-PROJECT-DOCUMENTATION"
19 ></A
20 ><DIV
21 CLASS="TITLEPAGE"
22 ><H1
23 CLASS="TITLE"
24 ><A
25 NAME="SAMBA-PROJECT-DOCUMENTATION"
26 >SAMBA Project Documentation</A
27 ></H1
28 ><H3
29 CLASS="AUTHOR"
30 ><A
31 NAME="AEN4"
32 >SAMBA Team</A
33 ></H3
34 ><HR></DIV
35 ><HR><H1
36 ><A
37 NAME="AEN8"
38 >Abstract</A
39 ></H1
40 ><P
41 ><EM
42 >Last Update</EM
43 > : Tue Jul 31 15:58:03 CDT 2001</P
44 ><P
45 >This book is a collection of HOWTOs added to Samba documentation over the years.
46 I try to ensure that all are current, but sometimes the is a larger job
47 than one person can maintain.  The most recent version of this document
48 can be found at <A
49 HREF="http://www.samba.org/"
50 TARGET="_top"
51 >http://www.samba.org/</A
52 >
53 on the "Documentation" page.  Please send updates to <A
54 HREF="mailto:jerry@samba.org"
55 TARGET="_top"
56 >jerry@samba.org</A
57 >.</P
58 ><P
59 >Cheers, jerry</P
60 ><DIV
61 CLASS="TOC"
62 ><DL
63 ><DT
64 ><B
65 >Table of Contents</B
66 ></DT
67 ><DT
68 >1. <A
69 HREF="#INSTALL"
70 >How to Install and Test SAMBA</A
71 ></DT
72 ><DD
73 ><DL
74 ><DT
75 >1.1. <A
76 HREF="#AEN18"
77 >Step 0: Read the man pages</A
78 ></DT
79 ><DT
80 >1.2. <A
81 HREF="#AEN26"
82 >Step 1: Building the Binaries</A
83 ></DT
84 ><DT
85 >1.3. <A
86 HREF="#AEN54"
87 >Step 2: The all important step</A
88 ></DT
89 ><DT
90 >1.4. <A
91 HREF="#AEN58"
92 >Step 3: Create the smb configuration file.</A
93 ></DT
94 ><DT
95 >1.5. <A
96 HREF="#AEN72"
97 >Step 4: Test your config file with 
98         <B
99 CLASS="COMMAND"
100 >testparm</B
101 ></A
102 ></DT
103 ><DT
104 >1.6. <A
105 HREF="#AEN78"
106 >Step 5: Starting the smbd and nmbd</A
107 ></DT
108 ><DD
109 ><DL
110 ><DT
111 >1.6.1. <A
112 HREF="#AEN88"
113 >Step 5a: Starting from inetd.conf</A
114 ></DT
115 ><DT
116 >1.6.2. <A
117 HREF="#AEN117"
118 >Step 5b. Alternative: starting it as a daemon</A
119 ></DT
120 ></DL
121 ></DD
122 ><DT
123 >1.7. <A
124 HREF="#AEN133"
125 >Step 6: Try listing the shares available on your 
126         server</A
127 ></DT
128 ><DT
129 >1.8. <A
130 HREF="#AEN142"
131 >Step 7: Try connecting with the unix client</A
132 ></DT
133 ><DT
134 >1.9. <A
135 HREF="#AEN158"
136 >Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT, 
137         Win2k, OS/2, etc... client</A
138 ></DT
139 ><DT
140 >1.10. <A
141 HREF="#AEN172"
142 >What If Things Don't Work?</A
143 ></DT
144 ><DD
145 ><DL
146 ><DT
147 >1.10.1. <A
148 HREF="#AEN177"
149 >Diagnosing Problems</A
150 ></DT
151 ><DT
152 >1.10.2. <A
153 HREF="#AEN181"
154 >Scope IDs</A
155 ></DT
156 ><DT
157 >1.10.3. <A
158 HREF="#AEN184"
159 >Choosing the Protocol Level</A
160 ></DT
161 ><DT
162 >1.10.4. <A
163 HREF="#AEN193"
164 >Printing from UNIX to a Client PC</A
165 ></DT
166 ><DT
167 >1.10.5. <A
168 HREF="#AEN197"
169 >Locking</A
170 ></DT
171 ><DT
172 >1.10.6. <A
173 HREF="#AEN207"
174 >Mapping Usernames</A
175 ></DT
176 ><DT
177 >1.10.7. <A
178 HREF="#AEN210"
179 >Other Character Sets</A
180 ></DT
181 ></DL
182 ></DD
183 ></DL
184 ></DD
185 ><DT
186 >2. <A
187 HREF="#INTEGRATE-MS-NETWORKS"
188 >Integrating MS Windows networks with Samba</A
189 ></DT
190 ><DD
191 ><DL
192 ><DT
193 >2.1. <A
194 HREF="#AEN224"
195 >Agenda</A
196 ></DT
197 ><DT
198 >2.2. <A
199 HREF="#AEN246"
200 >Name Resolution in a pure Unix/Linux world</A
201 ></DT
202 ><DD
203 ><DL
204 ><DT
205 >2.2.1. <A
206 HREF="#AEN262"
207 ><TT
208 CLASS="FILENAME"
209 >/etc/hosts</TT
210 ></A
211 ></DT
212 ><DT
213 >2.2.2. <A
214 HREF="#AEN278"
215 ><TT
216 CLASS="FILENAME"
217 >/etc/resolv.conf</TT
218 ></A
219 ></DT
220 ><DT
221 >2.2.3. <A
222 HREF="#AEN289"
223 ><TT
224 CLASS="FILENAME"
225 >/etc/host.conf</TT
226 ></A
227 ></DT
228 ><DT
229 >2.2.4. <A
230 HREF="#AEN297"
231 ><TT
232 CLASS="FILENAME"
233 >/etc/nsswitch.conf</TT
234 ></A
235 ></DT
236 ></DL
237 ></DD
238 ><DT
239 >2.3. <A
240 HREF="#AEN309"
241 >Name resolution as used within MS Windows networking</A
242 ></DT
243 ><DD
244 ><DL
245 ><DT
246 >2.3.1. <A
247 HREF="#AEN321"
248 >The NetBIOS Name Cache</A
249 ></DT
250 ><DT
251 >2.3.2. <A
252 HREF="#AEN326"
253 >The LMHOSTS file</A
254 ></DT
255 ><DT
256 >2.3.3. <A
257 HREF="#AEN334"
258 >HOSTS file</A
259 ></DT
260 ><DT
261 >2.3.4. <A
262 HREF="#AEN339"
263 >DNS Lookup</A
264 ></DT
265 ><DT
266 >2.3.5. <A
267 HREF="#AEN342"
268 >WINS Lookup</A
269 ></DT
270 ></DL
271 ></DD
272 ><DT
273 >2.4. <A
274 HREF="#AEN354"
275 >How browsing functions and how to deploy stable and 
276 dependable browsing using Samba</A
277 ></DT
278 ><DT
279 >2.5. <A
280 HREF="#AEN364"
281 >MS Windows security options and how to configure 
282 Samba for seemless integration</A
283 ></DT
284 ><DD
285 ><DL
286 ><DT
287 >2.5.1. <A
288 HREF="#AEN392"
289 >Use MS Windows NT as an authentication server</A
290 ></DT
291 ><DT
292 >2.5.2. <A
293 HREF="#AEN400"
294 >Make Samba a member of an MS Windows NT security domain</A
295 ></DT
296 ><DT
297 >2.5.3. <A
298 HREF="#AEN417"
299 >Configure Samba as an authentication server</A
300 ></DT
301 ><DD
302 ><DL
303 ><DT
304 >2.5.3.1. <A
305 HREF="#AEN424"
306 >Users</A
307 ></DT
308 ><DT
309 >2.5.3.2. <A
310 HREF="#AEN429"
311 >MS Windows NT Machine Accounts</A
312 ></DT
313 ></DL
314 ></DD
315 ></DL
316 ></DD
317 ><DT
318 >2.6. <A
319 HREF="#AEN434"
320 >Conclusions</A
321 ></DT
322 ></DL
323 ></DD
324 ><DT
325 >3. <A
326 HREF="#PAM"
327 >Configuring PAM for distributed but centrally 
328 managed authentication</A
329 ></DT
330 ><DD
331 ><DL
332 ><DT
333 >3.1. <A
334 HREF="#AEN455"
335 >Samba and PAM</A
336 ></DT
337 ><DT
338 >3.2. <A
339 HREF="#AEN499"
340 >Distributed Authentication</A
341 ></DT
342 ><DT
343 >3.3. <A
344 HREF="#AEN506"
345 >PAM Configuration in smb.conf</A
346 ></DT
347 ></DL
348 ></DD
349 ><DT
350 >4. <A
351 HREF="#MSDFS"
352 >Hosting a Microsoft Distributed File System tree on Samba</A
353 ></DT
354 ><DD
355 ><DL
356 ><DT
357 >4.1. <A
358 HREF="#AEN526"
359 >Instructions</A
360 ></DT
361 ><DD
362 ><DL
363 ><DT
364 >4.1.1. <A
365 HREF="#AEN561"
366 >Notes</A
367 ></DT
368 ></DL
369 ></DD
370 ></DL
371 ></DD
372 ><DT
373 >5. <A
374 HREF="#UNIX-PERMISSIONS"
375 >UNIX Permission Bits and Windows NT Access Control Lists</A
376 ></DT
377 ><DD
378 ><DL
379 ><DT
380 >5.1. <A
381 HREF="#AEN581"
382 >Viewing and changing UNIX permissions using the NT 
383         security dialogs</A
384 ></DT
385 ><DT
386 >5.2. <A
387 HREF="#AEN590"
388 >How to view file security on a Samba share</A
389 ></DT
390 ><DT
391 >5.3. <A
392 HREF="#AEN601"
393 >Viewing file ownership</A
394 ></DT
395 ><DT
396 >5.4. <A
397 HREF="#AEN621"
398 >Viewing file or directory permissions</A
399 ></DT
400 ><DD
401 ><DL
402 ><DT
403 >5.4.1. <A
404 HREF="#AEN636"
405 >File Permissions</A
406 ></DT
407 ><DT
408 >5.4.2. <A
409 HREF="#AEN650"
410 >Directory Permissions</A
411 ></DT
412 ></DL
413 ></DD
414 ><DT
415 >5.5. <A
416 HREF="#AEN657"
417 >Modifying file or directory permissions</A
418 ></DT
419 ><DT
420 >5.6. <A
421 HREF="#AEN679"
422 >Interaction with the standard Samba create mask 
423         parameters</A
424 ></DT
425 ><DT
426 >5.7. <A
427 HREF="#AEN743"
428 >Interaction with the standard Samba file attribute 
429         mapping</A
430 ></DT
431 ></DL
432 ></DD
433 ><DT
434 >6. <A
435 HREF="#PRINTING"
436 >Printing Support in Samba 2.2.x</A
437 ></DT
438 ><DD
439 ><DL
440 ><DT
441 >6.1. <A
442 HREF="#AEN764"
443 >Introduction</A
444 ></DT
445 ><DT
446 >6.2. <A
447 HREF="#AEN786"
448 >Configuration</A
449 ></DT
450 ><DD
451 ><DL
452 ><DT
453 >6.2.1. <A
454 HREF="#AEN797"
455 >Creating [print$]</A
456 ></DT
457 ><DT
458 >6.2.2. <A
459 HREF="#AEN832"
460 >Setting Drivers for Existing Printers</A
461 ></DT
462 ><DT
463 >6.2.3. <A
464 HREF="#AEN849"
465 >Support a large number of printers</A
466 ></DT
467 ><DT
468 >6.2.4. <A
469 HREF="#AEN860"
470 >Adding New Printers via the Windows NT APW</A
471 ></DT
472 ><DT
473 >6.2.5. <A
474 HREF="#AEN885"
475 >Samba and Printer Ports</A
476 ></DT
477 ></DL
478 ></DD
479 ><DT
480 >6.3. <A
481 HREF="#AEN893"
482 >The Imprints Toolset</A
483 ></DT
484 ><DD
485 ><DL
486 ><DT
487 >6.3.1. <A
488 HREF="#AEN897"
489 >What is Imprints?</A
490 ></DT
491 ><DT
492 >6.3.2. <A
493 HREF="#AEN907"
494 >Creating Printer Driver Packages</A
495 ></DT
496 ><DT
497 >6.3.3. <A
498 HREF="#AEN910"
499 >The Imprints server</A
500 ></DT
501 ><DT
502 >6.3.4. <A
503 HREF="#AEN914"
504 >The Installation Client</A
505 ></DT
506 ></DL
507 ></DD
508 ><DT
509 >6.4. <A
510 HREF="#AEN936"
511 ><A
512 NAME="MIGRATION"
513 ></A
514 >Migration to from Samba 2.0.x to 2.2.x</A
515 ></DT
516 ></DL
517 ></DD
518 ><DT
519 >7. <A
520 HREF="#DOMAIN-SECURITY"
521 >security = domain in Samba 2.x</A
522 ></DT
523 ><DD
524 ><DL
525 ><DT
526 >7.1. <A
527 HREF="#AEN990"
528 >Joining an NT Domain with Samba 2.2</A
529 ></DT
530 ><DT
531 >7.2. <A
532 HREF="#AEN1054"
533 >Samba and Windows 2000 Domains</A
534 ></DT
535 ><DT
536 >7.3. <A
537 HREF="#AEN1059"
538 >Why is this better than security = server?</A
539 ></DT
540 ></DL
541 ></DD
542 ><DT
543 >8. <A
544 HREF="#SAMBA-PDC"
545 >How to Configure Samba 2.2 as a Primary Domain Controller</A
546 ></DT
547 ><DD
548 ><DL
549 ><DT
550 >8.1. <A
551 HREF="#AEN1092"
552 >Prerequisite Reading</A
553 ></DT
554 ><DT
555 >8.2. <A
556 HREF="#AEN1098"
557 >Background</A
558 ></DT
559 ><DT
560 >8.3. <A
561 HREF="#AEN1137"
562 >Configuring the Samba Domain Controller</A
563 ></DT
564 ><DT
565 >8.4. <A
566 HREF="#AEN1180"
567 >Creating Machine Trust Accounts and Joining Clients to the
568 Domain</A
569 ></DT
570 ><DD
571 ><DL
572 ><DT
573 >8.4.1. <A
574 HREF="#AEN1199"
575 >Manual Creation of Machine Trust Accounts</A
576 ></DT
577 ><DT
578 >8.4.2. <A
579 HREF="#AEN1234"
580 >"On-the-Fly" Creation of Machine Trust Accounts</A
581 ></DT
582 ><DT
583 >8.4.3. <A
584 HREF="#AEN1243"
585 >Joining the Client to the Domain</A
586 ></DT
587 ></DL
588 ></DD
589 ><DT
590 >8.5. <A
591 HREF="#AEN1258"
592 >Common Problems and Errors</A
593 ></DT
594 ><DT
595 >8.6. <A
596 HREF="#AEN1306"
597 >System Policies and Profiles</A
598 ></DT
599 ><DT
600 >8.7. <A
601 HREF="#AEN1350"
602 >What other help can I get?</A
603 ></DT
604 ><DT
605 >8.8. <A
606 HREF="#AEN1464"
607 >Domain Control for Windows 9x/ME</A
608 ></DT
609 ><DD
610 ><DL
611 ><DT
612 >8.8.1. <A
613 HREF="#AEN1490"
614 >Configuration Instructions:    Network Logons</A
615 ></DT
616 ><DT
617 >8.8.2. <A
618 HREF="#AEN1509"
619 >Configuration Instructions:    Setting up Roaming User Profiles</A
620 ></DT
621 ><DD
622 ><DL
623 ><DT
624 >8.8.2.1. <A
625 HREF="#AEN1517"
626 >Windows NT Configuration</A
627 ></DT
628 ><DT
629 >8.8.2.2. <A
630 HREF="#AEN1525"
631 >Windows 9X Configuration</A
632 ></DT
633 ><DT
634 >8.8.2.3. <A
635 HREF="#AEN1533"
636 >Win9X and WinNT Configuration</A
637 ></DT
638 ><DT
639 >8.8.2.4. <A
640 HREF="#AEN1540"
641 >Windows 9X Profile Setup</A
642 ></DT
643 ><DT
644 >8.8.2.5. <A
645 HREF="#AEN1576"
646 >Windows NT Workstation 4.0</A
647 ></DT
648 ><DT
649 >8.8.2.6. <A
650 HREF="#AEN1589"
651 >Windows NT Server</A
652 ></DT
653 ><DT
654 >8.8.2.7. <A
655 HREF="#AEN1592"
656 >Sharing Profiles between W95 and NT Workstation 4.0</A
657 ></DT
658 ></DL
659 ></DD
660 ></DL
661 ></DD
662 ><DT
663 >8.9. <A
664 HREF="#AEN1602"
665 >DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
666 ></DT
667 ></DL
668 ></DD
669 ><DT
670 >9. <A
671 HREF="#SAMBA-LDAP-HOWTO"
672 >Storing Samba's User/Machine Account information in an LDAP Directory</A
673 ></DT
674 ><DD
675 ><DL
676 ><DT
677 >9.1. <A
678 HREF="#AEN1638"
679 >Purpose</A
680 ></DT
681 ><DT
682 >9.2. <A
683 HREF="#AEN1652"
684 >Introduction</A
685 ></DT
686 ><DT
687 >9.3. <A
688 HREF="#AEN1677"
689 >Supported LDAP Servers</A
690 ></DT
691 ><DT
692 >9.4. <A
693 HREF="#AEN1682"
694 >Schema and Relationship to the RFC 2307 posixAccount</A
695 ></DT
696 ><DT
697 >9.5. <A
698 HREF="#AEN1706"
699 >smb.conf LDAP parameters</A
700 ></DT
701 ><DT
702 >9.6. <A
703 HREF="#AEN1734"
704 >Security and sambaAccount</A
705 ></DT
706 ><DT
707 >9.7. <A
708 HREF="#AEN1753"
709 ></A
710 ></DT
711 ><DT
712 >9.8. <A
713 HREF="#AEN1773"
714 >Example LDIF Entries for a sambaAccount</A
715 ></DT
716 ><DT
717 >9.9. <A
718 HREF="#AEN1781"
719 >Comments</A
720 ></DT
721 ></DL
722 ></DD
723 ><DT
724 >10. <A
725 HREF="#WINBIND"
726 >Unified Logons between Windows NT and UNIX using Winbind</A
727 ></DT
728 ><DD
729 ><DL
730 ><DT
731 >10.1. <A
732 HREF="#AEN1810"
733 >Abstract</A
734 ></DT
735 ><DT
736 >10.2. <A
737 HREF="#AEN1814"
738 >Introduction</A
739 ></DT
740 ><DT
741 >10.3. <A
742 HREF="#AEN1827"
743 >What Winbind Provides</A
744 ></DT
745 ><DD
746 ><DL
747 ><DT
748 >10.3.1. <A
749 HREF="#AEN1834"
750 >Target Uses</A
751 ></DT
752 ></DL
753 ></DD
754 ><DT
755 >10.4. <A
756 HREF="#AEN1838"
757 >How Winbind Works</A
758 ></DT
759 ><DD
760 ><DL
761 ><DT
762 >10.4.1. <A
763 HREF="#AEN1843"
764 >Microsoft Remote Procedure Calls</A
765 ></DT
766 ><DT
767 >10.4.2. <A
768 HREF="#AEN1847"
769 >Name Service Switch</A
770 ></DT
771 ><DT
772 >10.4.3. <A
773 HREF="#AEN1863"
774 >Pluggable Authentication Modules</A
775 ></DT
776 ><DT
777 >10.4.4. <A
778 HREF="#AEN1871"
779 >User and Group ID Allocation</A
780 ></DT
781 ><DT
782 >10.4.5. <A
783 HREF="#AEN1875"
784 >Result Caching</A
785 ></DT
786 ></DL
787 ></DD
788 ><DT
789 >10.5. <A
790 HREF="#AEN1878"
791 >Installation and Configuration</A
792 ></DT
793 ><DD
794 ><DL
795 ><DT
796 >10.5.1. <A
797 HREF="#AEN1883"
798 >Introduction</A
799 ></DT
800 ><DT
801 >10.5.2. <A
802 HREF="#AEN1896"
803 >Requirements</A
804 ></DT
805 ><DT
806 >10.5.3. <A
807 HREF="#AEN1910"
808 >Testing Things Out</A
809 ></DT
810 ><DD
811 ><DL
812 ><DT
813 >10.5.3.1. <A
814 HREF="#AEN1921"
815 >Configure and compile SAMBA</A
816 ></DT
817 ><DT
818 >10.5.3.2. <A
819 HREF="#AEN1940"
820 >Configure <TT
821 CLASS="FILENAME"
822 >nsswitch.conf</TT
823 > and the 
824 winbind libraries</A
825 ></DT
826 ><DT
827 >10.5.3.3. <A
828 HREF="#AEN1965"
829 >Configure smb.conf</A
830 ></DT
831 ><DT
832 >10.5.3.4. <A
833 HREF="#AEN1981"
834 >Join the SAMBA server to the PDC domain</A
835 ></DT
836 ><DT
837 >10.5.3.5. <A
838 HREF="#AEN1992"
839 >Start up the winbindd daemon and test it!</A
840 ></DT
841 ><DT
842 >10.5.3.6. <A
843 HREF="#AEN2028"
844 >Fix the <TT
845 CLASS="FILENAME"
846 >/etc/rc.d/init.d/smb</TT
847 > startup files</A
848 ></DT
849 ><DT
850 >10.5.3.7. <A
851 HREF="#AEN2050"
852 >Configure Winbind and PAM</A
853 ></DT
854 ></DL
855 ></DD
856 ></DL
857 ></DD
858 ><DT
859 >10.6. <A
860 HREF="#AEN2097"
861 >Limitations</A
862 ></DT
863 ><DT
864 >10.7. <A
865 HREF="#AEN2107"
866 >Conclusion</A
867 ></DT
868 ></DL
869 ></DD
870 ><DT
871 >11. <A
872 HREF="#OS2"
873 >OS2 Client HOWTO</A
874 ></DT
875 ><DD
876 ><DL
877 ><DT
878 >11.1. <A
879 HREF="#AEN2121"
880 >FAQs</A
881 ></DT
882 ><DD
883 ><DL
884 ><DT
885 >11.1.1. <A
886 HREF="#AEN2123"
887 >How can I configure OS/2 Warp Connect or 
888                 OS/2 Warp 4 as a client for Samba?</A
889 ></DT
890 ><DT
891 >11.1.2. <A
892 HREF="#AEN2138"
893 >How can I configure OS/2 Warp 3 (not Connect), 
894                 OS/2 1.2, 1.3 or 2.x for Samba?</A
895 ></DT
896 ><DT
897 >11.1.3. <A
898 HREF="#AEN2147"
899 >Are there any other issues when OS/2 (any version) 
900                 is used as a client?</A
901 ></DT
902 ><DT
903 >11.1.4. <A
904 HREF="#AEN2151"
905 >How do I get printer driver download working 
906                 for OS/2 clients?</A
907 ></DT
908 ></DL
909 ></DD
910 ></DL
911 ></DD
912 ><DT
913 >12. <A
914 HREF="#CVS-ACCESS"
915 >HOWTO Access Samba source code via CVS</A
916 ></DT
917 ><DD
918 ><DL
919 ><DT
920 >12.1. <A
921 HREF="#AEN2167"
922 >Introduction</A
923 ></DT
924 ><DT
925 >12.2. <A
926 HREF="#AEN2172"
927 >CVS Access to samba.org</A
928 ></DT
929 ><DD
930 ><DL
931 ><DT
932 >12.2.1. <A
933 HREF="#AEN2175"
934 >Access via CVSweb</A
935 ></DT
936 ><DT
937 >12.2.2. <A
938 HREF="#AEN2180"
939 >Access via cvs</A
940 ></DT
941 ></DL
942 ></DD
943 ></DL
944 ></DD
945 ><DT
946 ><A
947 HREF="#AEN2208"
948 >Index</A
949 ></DT
950 ></DL
951 ></DIV
952 ><DIV
953 CLASS="CHAPTER"
954 ><HR><H1
955 ><A
956 NAME="INSTALL"
957 >Chapter 1. How to Install and Test SAMBA</A
958 ></H1
959 ><DIV
960 CLASS="SECT1"
961 ><H1
962 CLASS="SECT1"
963 ><A
964 NAME="AEN18"
965 >1.1. Step 0: Read the man pages</A
966 ></H1
967 ><P
968 >The man pages distributed with SAMBA contain 
969         lots of useful info that will help to get you started. 
970         If you don't know how to read man pages then try 
971         something like:</P
972 ><P
973 ><TT
974 CLASS="PROMPT"
975 >$ </TT
976 ><TT
977 CLASS="USERINPUT"
978 ><B
979 >nroff -man smbd.8 | more
980         </B
981 ></TT
982 ></P
983 ><P
984 >Other sources of information are pointed to 
985         by the Samba web site,<A
986 HREF="http://www.samba.org/"
987 TARGET="_top"
988 >       http://www.samba.org</A
989 ></P
990 ></DIV
991 ><DIV
992 CLASS="SECT1"
993 ><HR><H1
994 CLASS="SECT1"
995 ><A
996 NAME="AEN26"
997 >1.2. Step 1: Building the Binaries</A
998 ></H1
999 ><P
1000 >To do this, first run the program <B
1001 CLASS="COMMAND"
1002 >./configure
1003         </B
1004 > in the source directory. This should automatically 
1005         configure Samba for your operating system. If you have unusual 
1006         needs then you may wish to run</P
1007 ><P
1008 ><TT
1009 CLASS="PROMPT"
1010 >root# </TT
1011 ><TT
1012 CLASS="USERINPUT"
1013 ><B
1014 >./configure --help
1015         </B
1016 ></TT
1017 ></P
1018 ><P
1019 >first to see what special options you can enable.
1020         Then executing</P
1021 ><P
1022 ><TT
1023 CLASS="PROMPT"
1024 >root# </TT
1025 ><TT
1026 CLASS="USERINPUT"
1027 ><B
1028 >make</B
1029 ></TT
1030 ></P
1031 ><P
1032 >will create the binaries. Once it's successfully 
1033         compiled you can use </P
1034 ><P
1035 ><TT
1036 CLASS="PROMPT"
1037 >root# </TT
1038 ><TT
1039 CLASS="USERINPUT"
1040 ><B
1041 >make install</B
1042 ></TT
1043 ></P
1044 ><P
1045 >to install the binaries and manual pages. You can 
1046         separately install the binaries and/or man pages using</P
1047 ><P
1048 ><TT
1049 CLASS="PROMPT"
1050 >root# </TT
1051 ><TT
1052 CLASS="USERINPUT"
1053 ><B
1054 >make installbin
1055         </B
1056 ></TT
1057 ></P
1058 ><P
1059 >and</P
1060 ><P
1061 ><TT
1062 CLASS="PROMPT"
1063 >root# </TT
1064 ><TT
1065 CLASS="USERINPUT"
1066 ><B
1067 >make installman
1068         </B
1069 ></TT
1070 ></P
1071 ><P
1072 >Note that if you are upgrading for a previous version 
1073         of Samba you might like to know that the old versions of 
1074         the binaries will be renamed with a ".old" extension. You 
1075         can go back to the previous version with</P
1076 ><P
1077 ><TT
1078 CLASS="PROMPT"
1079 >root# </TT
1080 ><TT
1081 CLASS="USERINPUT"
1082 ><B
1083 >make revert
1084         </B
1085 ></TT
1086 ></P
1087 ><P
1088 >if you find this version a disaster!</P
1089 ></DIV
1090 ><DIV
1091 CLASS="SECT1"
1092 ><HR><H1
1093 CLASS="SECT1"
1094 ><A
1095 NAME="AEN54"
1096 >1.3. Step 2: The all important step</A
1097 ></H1
1098 ><P
1099 >At this stage you must fetch yourself a 
1100         coffee or other drink you find stimulating. Getting the rest 
1101         of the install right can sometimes be tricky, so you will 
1102         probably need it.</P
1103 ><P
1104 >If you have installed samba before then you can skip 
1105         this step.</P
1106 ></DIV
1107 ><DIV
1108 CLASS="SECT1"
1109 ><HR><H1
1110 CLASS="SECT1"
1111 ><A
1112 NAME="AEN58"
1113 >1.4. Step 3: Create the smb configuration file.</A
1114 ></H1
1115 ><P
1116 >There are sample configuration files in the examples 
1117         subdirectory in the distribution. I suggest you read them 
1118         carefully so you can see how the options go together in 
1119         practice. See the man page for all the options.</P
1120 ><P
1121 >The simplest useful configuration file would be 
1122         something like this:</P
1123 ><P
1124 ><TABLE
1125 BORDER="0"
1126 BGCOLOR="#E0E0E0"
1127 WIDTH="100%"
1128 ><TR
1129 ><TD
1130 ><PRE
1131 CLASS="PROGRAMLISTING"
1132 >       [global]
1133            workgroup = MYGROUP
1134
1135            [homes]
1136               guest ok = no
1137               read only = no
1138         </PRE
1139 ></TD
1140 ></TR
1141 ></TABLE
1142 ></P
1143 ><P
1144 >which would allow connections by anyone with an 
1145         account on the server, using either their login name or 
1146         "homes" as the service name. (Note that I also set the 
1147         workgroup that Samba is part of. See BROWSING.txt for details)</P
1148 ><P
1149 >Note that <B
1150 CLASS="COMMAND"
1151 >make install</B
1152 > will not install 
1153         a <TT
1154 CLASS="FILENAME"
1155 >smb.conf</TT
1156 > file. You need to create it 
1157         yourself. </P
1158 ><P
1159 >Make sure you put the smb.conf file in the same place 
1160         you specified in the<TT
1161 CLASS="FILENAME"
1162 >Makefile</TT
1163 > (the default is to 
1164         look for it in <TT
1165 CLASS="FILENAME"
1166 >/usr/local/samba/lib/</TT
1167 >).</P
1168 ><P
1169 >For more information about security settings for the 
1170         [homes] share please refer to the document UNIX_SECURITY.txt.</P
1171 ></DIV
1172 ><DIV
1173 CLASS="SECT1"
1174 ><HR><H1
1175 CLASS="SECT1"
1176 ><A
1177 NAME="AEN72"
1178 >1.5. Step 4: Test your config file with 
1179         <B
1180 CLASS="COMMAND"
1181 >testparm</B
1182 ></A
1183 ></H1
1184 ><P
1185 >It's important that you test the validity of your
1186         <TT
1187 CLASS="FILENAME"
1188 >smb.conf</TT
1189 > file using the testparm program. 
1190         If testparm runs OK then it will list the loaded services. If 
1191         not it will give an error message.</P
1192 ><P
1193 >Make sure it runs OK and that the services look 
1194         reasonable before proceeding. </P
1195 ></DIV
1196 ><DIV
1197 CLASS="SECT1"
1198 ><HR><H1
1199 CLASS="SECT1"
1200 ><A
1201 NAME="AEN78"
1202 >1.6. Step 5: Starting the smbd and nmbd</A
1203 ></H1
1204 ><P
1205 >You must choose to start smbd and nmbd either 
1206         as daemons or from <B
1207 CLASS="COMMAND"
1208 >inetd</B
1209 >. Don't try 
1210         to do both!  Either you can put them in <TT
1211 CLASS="FILENAME"
1212 >       inetd.conf</TT
1213 > and have them started on demand 
1214         by <B
1215 CLASS="COMMAND"
1216 >inetd</B
1217 >, or you can start them as
1218         daemons either from the command line or in <TT
1219 CLASS="FILENAME"
1220 >       /etc/rc.local</TT
1221 >. See the man pages for details 
1222         on the command line options. Take particular care to read 
1223         the bit about what user you need to be in order to start 
1224         Samba.  In many cases you must be root.</P
1225 ><P
1226 >The main advantage of starting <B
1227 CLASS="COMMAND"
1228 >smbd</B
1229 >
1230         and <B
1231 CLASS="COMMAND"
1232 >nmbd</B
1233 > as a daemon is that they will 
1234         respond slightly more quickly to an initial connection
1235         request. This is, however, unlikely to be a problem.</P
1236 ><DIV
1237 CLASS="SECT2"
1238 ><HR><H2
1239 CLASS="SECT2"
1240 ><A
1241 NAME="AEN88"
1242 >1.6.1. Step 5a: Starting from inetd.conf</A
1243 ></H2
1244 ><P
1245 >NOTE; The following will be different if 
1246                 you use NIS or NIS+ to distributed services maps.</P
1247 ><P
1248 >Look at your <TT
1249 CLASS="FILENAME"
1250 >/etc/services</TT
1251 >. 
1252                 What is defined at port 139/tcp. If nothing is defined 
1253                 then add a line like this:</P
1254 ><P
1255 ><TT
1256 CLASS="USERINPUT"
1257 ><B
1258 >netbios-ssn     139/tcp</B
1259 ></TT
1260 ></P
1261 ><P
1262 >similarly for 137/udp you should have an entry like:</P
1263 ><P
1264 ><TT
1265 CLASS="USERINPUT"
1266 ><B
1267 >netbios-ns     137/udp</B
1268 ></TT
1269 ></P
1270 ><P
1271 >Next edit your <TT
1272 CLASS="FILENAME"
1273 >/etc/inetd.conf</TT
1274
1275                 and add two lines something like this:</P
1276 ><P
1277 ><TABLE
1278 BORDER="0"
1279 BGCOLOR="#E0E0E0"
1280 WIDTH="100%"
1281 ><TR
1282 ><TD
1283 ><PRE
1284 CLASS="PROGRAMLISTING"
1285 >               netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd 
1286                 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd 
1287                 </PRE
1288 ></TD
1289 ></TR
1290 ></TABLE
1291 ></P
1292 ><P
1293 >The exact syntax of <TT
1294 CLASS="FILENAME"
1295 >/etc/inetd.conf</TT
1296
1297                 varies between unixes. Look at the other entries in inetd.conf 
1298                 for a guide.</P
1299 ><P
1300 >NOTE: Some unixes already have entries like netbios_ns 
1301                 (note the underscore) in <TT
1302 CLASS="FILENAME"
1303 >/etc/services</TT
1304 >. 
1305                 You must either edit <TT
1306 CLASS="FILENAME"
1307 >/etc/services</TT
1308 > or
1309                 <TT
1310 CLASS="FILENAME"
1311 >/etc/inetd.conf</TT
1312 > to make them consistent.</P
1313 ><P
1314 >NOTE: On many systems you may need to use the 
1315                 "interfaces" option in smb.conf to specify the IP address 
1316                 and netmask of your interfaces. Run <B
1317 CLASS="COMMAND"
1318 >ifconfig</B
1319
1320                 as root if you don't know what the broadcast is for your
1321                 net. <B
1322 CLASS="COMMAND"
1323 >nmbd</B
1324 > tries to determine it at run 
1325                 time, but fails on some unixes. See the section on "testing nmbd" 
1326                 for a method of finding if you need to do this.</P
1327 ><P
1328 >!!!WARNING!!! Many unixes only accept around 5 
1329                 parameters on the command line in <TT
1330 CLASS="FILENAME"
1331 >inetd.conf</TT
1332 >. 
1333                 This means you shouldn't use spaces between the options and 
1334                 arguments, or you should use a script, and start the script 
1335                 from <B
1336 CLASS="COMMAND"
1337 >inetd</B
1338 >.</P
1339 ><P
1340 >Restart <B
1341 CLASS="COMMAND"
1342 >inetd</B
1343 >, perhaps just send 
1344                 it a HUP. If you have installed an earlier version of <B
1345 CLASS="COMMAND"
1346 >               nmbd</B
1347 > then you may need to kill nmbd as well.</P
1348 ></DIV
1349 ><DIV
1350 CLASS="SECT2"
1351 ><HR><H2
1352 CLASS="SECT2"
1353 ><A
1354 NAME="AEN117"
1355 >1.6.2. Step 5b. Alternative: starting it as a daemon</A
1356 ></H2
1357 ><P
1358 >To start the server as a daemon you should create 
1359                 a script something like this one, perhaps calling 
1360                 it <TT
1361 CLASS="FILENAME"
1362 >startsmb</TT
1363 >.</P
1364 ><P
1365 ><TABLE
1366 BORDER="0"
1367 BGCOLOR="#E0E0E0"
1368 WIDTH="100%"
1369 ><TR
1370 ><TD
1371 ><PRE
1372 CLASS="PROGRAMLISTING"
1373 >               #!/bin/sh
1374                 /usr/local/samba/bin/smbd -D 
1375                 /usr/local/samba/bin/nmbd -D 
1376                 </PRE
1377 ></TD
1378 ></TR
1379 ></TABLE
1380 ></P
1381 ><P
1382 >then make it executable with <B
1383 CLASS="COMMAND"
1384 >chmod 
1385                 +x startsmb</B
1386 ></P
1387 ><P
1388 >You can then run <B
1389 CLASS="COMMAND"
1390 >startsmb</B
1391 > by 
1392                 hand or execute it from <TT
1393 CLASS="FILENAME"
1394 >/etc/rc.local</TT
1395 >
1396                 </P
1397 ><P
1398 >To kill it send a kill signal to the processes 
1399                 <B
1400 CLASS="COMMAND"
1401 >nmbd</B
1402 > and <B
1403 CLASS="COMMAND"
1404 >smbd</B
1405 >.</P
1406 ><P
1407 >NOTE: If you use the SVR4 style init system then 
1408                 you may like to look at the <TT
1409 CLASS="FILENAME"
1410 >examples/svr4-startup</TT
1411 >
1412                 script to make Samba fit into that system.</P
1413 ></DIV
1414 ></DIV
1415 ><DIV
1416 CLASS="SECT1"
1417 ><HR><H1
1418 CLASS="SECT1"
1419 ><A
1420 NAME="AEN133"
1421 >1.7. Step 6: Try listing the shares available on your 
1422         server</A
1423 ></H1
1424 ><P
1425 ><TT
1426 CLASS="PROMPT"
1427 >$ </TT
1428 ><TT
1429 CLASS="USERINPUT"
1430 ><B
1431 >smbclient -L 
1432         <TT
1433 CLASS="REPLACEABLE"
1434 ><I
1435 >yourhostname</I
1436 ></TT
1437 ></B
1438 ></TT
1439 ></P
1440 ><P
1441 >Your should get back a list of shares available on 
1442         your server. If you don't then something is incorrectly setup. 
1443         Note that this method can also be used to see what shares 
1444         are available on other LanManager clients (such as WfWg).</P
1445 ><P
1446 >If you choose user level security then you may find 
1447         that Samba requests a password before it will list the shares. 
1448         See the <B
1449 CLASS="COMMAND"
1450 >smbclient</B
1451 > man page for details. (you 
1452         can force it to list the shares without a password by
1453         adding the option -U% to the command line. This will not work 
1454         with non-Samba servers)</P
1455 ></DIV
1456 ><DIV
1457 CLASS="SECT1"
1458 ><HR><H1
1459 CLASS="SECT1"
1460 ><A
1461 NAME="AEN142"
1462 >1.8. Step 7: Try connecting with the unix client</A
1463 ></H1
1464 ><P
1465 ><TT
1466 CLASS="PROMPT"
1467 >$ </TT
1468 ><TT
1469 CLASS="USERINPUT"
1470 ><B
1471 >smbclient <TT
1472 CLASS="REPLACEABLE"
1473 ><I
1474 >       //yourhostname/aservice</I
1475 ></TT
1476 ></B
1477 ></TT
1478 ></P
1479 ><P
1480 >Typically the <TT
1481 CLASS="REPLACEABLE"
1482 ><I
1483 >yourhostname</I
1484 ></TT
1485
1486         would be the name of the host where you installed <B
1487 CLASS="COMMAND"
1488 >       smbd</B
1489 >. The <TT
1490 CLASS="REPLACEABLE"
1491 ><I
1492 >aservice</I
1493 ></TT
1494 > is 
1495         any service you have defined in the <TT
1496 CLASS="FILENAME"
1497 >smb.conf</TT
1498
1499         file. Try your user name if you just have a [homes] section
1500         in <TT
1501 CLASS="FILENAME"
1502 >smb.conf</TT
1503 >.</P
1504 ><P
1505 >For example if your unix host is bambi and your login 
1506         name is fred you would type:</P
1507 ><P
1508 ><TT
1509 CLASS="PROMPT"
1510 >$ </TT
1511 ><TT
1512 CLASS="USERINPUT"
1513 ><B
1514 >smbclient //bambi/fred
1515         </B
1516 ></TT
1517 ></P
1518 ></DIV
1519 ><DIV
1520 CLASS="SECT1"
1521 ><HR><H1
1522 CLASS="SECT1"
1523 ><A
1524 NAME="AEN158"
1525 >1.9. Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT, 
1526         Win2k, OS/2, etc... client</A
1527 ></H1
1528 ><P
1529 >Try mounting disks. eg:</P
1530 ><P
1531 ><TT
1532 CLASS="PROMPT"
1533 >C:\WINDOWS\&#62; </TT
1534 ><TT
1535 CLASS="USERINPUT"
1536 ><B
1537 >net use d: \\servername\service
1538         </B
1539 ></TT
1540 ></P
1541 ><P
1542 >Try printing. eg:</P
1543 ><P
1544 ><TT
1545 CLASS="PROMPT"
1546 >C:\WINDOWS\&#62; </TT
1547 ><TT
1548 CLASS="USERINPUT"
1549 ><B
1550 >net use lpt1:
1551         \\servername\spoolservice</B
1552 ></TT
1553 ></P
1554 ><P
1555 ><TT
1556 CLASS="PROMPT"
1557 >C:\WINDOWS\&#62; </TT
1558 ><TT
1559 CLASS="USERINPUT"
1560 ><B
1561 >print filename
1562         </B
1563 ></TT
1564 ></P
1565 ><P
1566 >Celebrate, or send me a bug report!</P
1567 ></DIV
1568 ><DIV
1569 CLASS="SECT1"
1570 ><HR><H1
1571 CLASS="SECT1"
1572 ><A
1573 NAME="AEN172"
1574 >1.10. What If Things Don't Work?</A
1575 ></H1
1576 ><P
1577 >If nothing works and you start to think "who wrote 
1578         this pile of trash" then I suggest you do step 2 again (and 
1579         again) till you calm down.</P
1580 ><P
1581 >Then you might read the file DIAGNOSIS.txt and the 
1582         FAQ. If you are still stuck then try the mailing list or 
1583         newsgroup (look in the README for details). Samba has been 
1584         successfully installed at thousands of sites worldwide, so maybe 
1585         someone else has hit your problem and has overcome it. You could 
1586         also use the WWW site to scan back issues of the samba-digest.</P
1587 ><P
1588 >When you fix the problem PLEASE send me some updates to the
1589         documentation (or source code) so that the next person will find it
1590         easier. </P
1591 ><DIV
1592 CLASS="SECT2"
1593 ><HR><H2
1594 CLASS="SECT2"
1595 ><A
1596 NAME="AEN177"
1597 >1.10.1. Diagnosing Problems</A
1598 ></H2
1599 ><P
1600 >If you have installation problems then go to 
1601                 <TT
1602 CLASS="FILENAME"
1603 >DIAGNOSIS.txt</TT
1604 > to try to find the 
1605                 problem.</P
1606 ></DIV
1607 ><DIV
1608 CLASS="SECT2"
1609 ><HR><H2
1610 CLASS="SECT2"
1611 ><A
1612 NAME="AEN181"
1613 >1.10.2. Scope IDs</A
1614 ></H2
1615 ><P
1616 >By default Samba uses a blank scope ID. This means 
1617                 all your windows boxes must also have a blank scope ID. 
1618                 If you really want to use a non-blank scope ID then you will 
1619                 need to use the -i &#60;scope&#62; option to nmbd, smbd, and 
1620                 smbclient. All your PCs will need to have the same setting for 
1621                 this to work. I do not recommend scope IDs.</P
1622 ></DIV
1623 ><DIV
1624 CLASS="SECT2"
1625 ><HR><H2
1626 CLASS="SECT2"
1627 ><A
1628 NAME="AEN184"
1629 >1.10.3. Choosing the Protocol Level</A
1630 ></H2
1631 ><P
1632 >The SMB protocol has many dialects. Currently 
1633                 Samba supports 5, called CORE, COREPLUS, LANMAN1, 
1634                 LANMAN2 and NT1.</P
1635 ><P
1636 >You can choose what maximum protocol to support 
1637                 in the <TT
1638 CLASS="FILENAME"
1639 >smb.conf</TT
1640 > file. The default is 
1641                 NT1 and that is the best for the vast majority of sites.</P
1642 ><P
1643 >In older versions of Samba you may have found it 
1644                 necessary to use COREPLUS. The limitations that led to 
1645                 this have mostly been fixed. It is now less likely that you 
1646                 will want to use less than LANMAN1. The only remaining advantage 
1647                 of COREPLUS is that for some obscure reason WfWg preserves 
1648                 the case of passwords in this protocol, whereas under LANMAN1, 
1649                 LANMAN2 or NT1 it uppercases all passwords before sending them,
1650                 forcing you to use the "password level=" option in some cases.</P
1651 ><P
1652 >The main advantage of LANMAN2 and NT1 is support for 
1653                 long filenames with some clients (eg: smbclient, Windows NT 
1654                 or Win95). </P
1655 ><P
1656 >See the smb.conf(5) manual page for more details.</P
1657 ><P
1658 >Note: To support print queue reporting you may find 
1659                 that you have to use TCP/IP as the default protocol under 
1660                 WfWg. For some reason if you leave Netbeui as the default 
1661                 it may break the print queue reporting on some systems. 
1662                 It is presumably a WfWg bug.</P
1663 ></DIV
1664 ><DIV
1665 CLASS="SECT2"
1666 ><HR><H2
1667 CLASS="SECT2"
1668 ><A
1669 NAME="AEN193"
1670 >1.10.4. Printing from UNIX to a Client PC</A
1671 ></H2
1672 ><P
1673 >To use a printer that is available via a smb-based 
1674                 server from a unix host you will need to compile the 
1675                 smbclient program. You then need to install the script 
1676                 "smbprint". Read the instruction in smbprint for more details.
1677                 </P
1678 ><P
1679 >There is also a SYSV style script that does much 
1680                 the same thing called smbprint.sysv. It contains instructions.</P
1681 ></DIV
1682 ><DIV
1683 CLASS="SECT2"
1684 ><HR><H2
1685 CLASS="SECT2"
1686 ><A
1687 NAME="AEN197"
1688 >1.10.5. Locking</A
1689 ></H2
1690 ><P
1691 >One area which sometimes causes trouble is locking.</P
1692 ><P
1693 >There are two types of locking which need to be 
1694                 performed by a SMB server. The first is "record locking" 
1695                 which allows a client to lock a range of bytes in a open file. 
1696                 The second is the "deny modes" that are specified when a file 
1697                 is open.</P
1698 ><P
1699 >Record locking semantics under Unix is very
1700                 different from record locking under Windows. Versions
1701                 of Samba before 2.2 have tried to use the native
1702                 fcntl() unix system call to implement proper record
1703                 locking between different Samba clients. This can not
1704                 be fully correct due to several reasons. The simplest
1705                 is the fact that a Windows client is allowed to lock a
1706                 byte range up to 2^32 or 2^64, depending on the client
1707                 OS. The unix locking only supports byte ranges up to
1708                 2^31. So it is not possible to correctly satisfy a
1709                 lock request above 2^31. There are many more
1710                 differences, too many to be listed here.</P
1711 ><P
1712 >Samba 2.2 and above implements record locking
1713                 completely independent of the underlying unix
1714                 system. If a byte range lock that the client requests
1715                 happens to fall into the range 0-2^31, Samba hands
1716                 this request down to the Unix system. All other locks
1717                 can not be seen by unix anyway.</P
1718 ><P
1719 >Strictly a SMB server should check for locks before 
1720                 every read and write call on a file. Unfortunately with the 
1721                 way fcntl() works this can be slow and may overstress the 
1722                 rpc.lockd. It is also almost always unnecessary as clients 
1723                 are supposed to independently make locking calls before reads 
1724                 and writes anyway if locking is important to them. By default 
1725                 Samba only makes locking calls when explicitly asked
1726                 to by a client, but if you set "strict locking = yes" then it will
1727                 make lock checking calls on every read and write. </P
1728 ><P
1729 >You can also disable by range locking completely 
1730                 using "locking = no". This is useful for those shares that 
1731                 don't support locking or don't need it (such as cdroms). In 
1732                 this case Samba fakes the return codes of locking calls to 
1733                 tell clients that everything is OK.</P
1734 ><P
1735 >The second class of locking is the "deny modes". These 
1736                 are set by an application when it opens a file to determine 
1737                 what types of access should be allowed simultaneously with 
1738                 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE 
1739                 or DENY_ALL. There are also special compatibility modes called 
1740                 DENY_FCB and  DENY_DOS.</P
1741 ><P
1742 >You can disable share modes using "share modes = no". 
1743                 This may be useful on a heavily loaded server as the share 
1744                 modes code is very slow. See also the FAST_SHARE_MODES 
1745                 option in the Makefile for a way to do full share modes 
1746                 very fast using shared memory (if your OS supports it).</P
1747 ></DIV
1748 ><DIV
1749 CLASS="SECT2"
1750 ><HR><H2
1751 CLASS="SECT2"
1752 ><A
1753 NAME="AEN207"
1754 >1.10.6. Mapping Usernames</A
1755 ></H2
1756 ><P
1757 >If you have different usernames on the PCs and 
1758                 the unix server then take a look at the "username map" option. 
1759                 See the smb.conf man page for details.</P
1760 ></DIV
1761 ><DIV
1762 CLASS="SECT2"
1763 ><HR><H2
1764 CLASS="SECT2"
1765 ><A
1766 NAME="AEN210"
1767 >1.10.7. Other Character Sets</A
1768 ></H2
1769 ><P
1770 >If you have problems using filenames with accented 
1771                 characters in them (like the German, French or Scandinavian 
1772                 character sets) then I recommend you look at the "valid chars" 
1773                 option in smb.conf and also take a look at the validchars 
1774                 package in the examples directory.</P
1775 ></DIV
1776 ></DIV
1777 ></DIV
1778 ><DIV
1779 CLASS="CHAPTER"
1780 ><HR><H1
1781 ><A
1782 NAME="INTEGRATE-MS-NETWORKS"
1783 >Chapter 2. Integrating MS Windows networks with Samba</A
1784 ></H1
1785 ><DIV
1786 CLASS="SECT1"
1787 ><H1
1788 CLASS="SECT1"
1789 ><A
1790 NAME="AEN224"
1791 >2.1. Agenda</A
1792 ></H1
1793 ><P
1794 >To identify the key functional mechanisms of MS Windows networking 
1795 to enable the deployment of Samba as a means of extending and/or 
1796 replacing MS Windows NT/2000 technology.</P
1797 ><P
1798 >We will examine:</P
1799 ><P
1800 ></P
1801 ><OL
1802 TYPE="1"
1803 ><LI
1804 ><P
1805 >Name resolution in a pure Unix/Linux TCP/IP 
1806         environment
1807         </P
1808 ></LI
1809 ><LI
1810 ><P
1811 >Name resolution as used within MS Windows 
1812         networking
1813         </P
1814 ></LI
1815 ><LI
1816 ><P
1817 >How browsing functions and how to deploy stable 
1818         and dependable browsing using Samba
1819         </P
1820 ></LI
1821 ><LI
1822 ><P
1823 >MS Windows security options and how to 
1824         configure Samba for seemless integration
1825         </P
1826 ></LI
1827 ><LI
1828 ><P
1829 >Configuration of Samba as:</P
1830 ><P
1831 ></P
1832 ><OL
1833 TYPE="a"
1834 ><LI
1835 ><P
1836 >A stand-alone server</P
1837 ></LI
1838 ><LI
1839 ><P
1840 >An MS Windows NT 3.x/4.0 security domain member
1841                 </P
1842 ></LI
1843 ><LI
1844 ><P
1845 >An alternative to an MS Windows NT 3.x/4.0 Domain Controller
1846                 </P
1847 ></LI
1848 ></OL
1849 ></LI
1850 ></OL
1851 ></DIV
1852 ><DIV
1853 CLASS="SECT1"
1854 ><HR><H1
1855 CLASS="SECT1"
1856 ><A
1857 NAME="AEN246"
1858 >2.2. Name Resolution in a pure Unix/Linux world</A
1859 ></H1
1860 ><P
1861 >The key configuration files covered in this section are:</P
1862 ><P
1863 ></P
1864 ><UL
1865 ><LI
1866 ><P
1867 ><TT
1868 CLASS="FILENAME"
1869 >/etc/hosts</TT
1870 ></P
1871 ></LI
1872 ><LI
1873 ><P
1874 ><TT
1875 CLASS="FILENAME"
1876 >/etc/resolv.conf</TT
1877 ></P
1878 ></LI
1879 ><LI
1880 ><P
1881 ><TT
1882 CLASS="FILENAME"
1883 >/etc/host.conf</TT
1884 ></P
1885 ></LI
1886 ><LI
1887 ><P
1888 ><TT
1889 CLASS="FILENAME"
1890 >/etc/nsswitch.conf</TT
1891 ></P
1892 ></LI
1893 ></UL
1894 ><DIV
1895 CLASS="SECT2"
1896 ><HR><H2
1897 CLASS="SECT2"
1898 ><A
1899 NAME="AEN262"
1900 >2.2.1. <TT
1901 CLASS="FILENAME"
1902 >/etc/hosts</TT
1903 ></A
1904 ></H2
1905 ><P
1906 >Contains a static list of IP Addresses and names.
1907 eg:</P
1908 ><P
1909 ><TABLE
1910 BORDER="0"
1911 BGCOLOR="#E0E0E0"
1912 WIDTH="100%"
1913 ><TR
1914 ><TD
1915 ><PRE
1916 CLASS="PROGRAMLISTING"
1917 >       127.0.0.1       localhost localhost.localdomain
1918         192.168.1.1     bigbox.caldera.com      bigbox  alias4box</PRE
1919 ></TD
1920 ></TR
1921 ></TABLE
1922 ></P
1923 ><P
1924 >The purpose of <TT
1925 CLASS="FILENAME"
1926 >/etc/hosts</TT
1927 > is to provide a 
1928 name resolution mechanism so that uses do not need to remember 
1929 IP addresses.</P
1930 ><P
1931 >Network packets that are sent over the physical network transport 
1932 layer communicate not via IP addresses but rather using the Media 
1933 Access Control address, or MAC address. IP Addresses are currently 
1934 32 bits in length and are typically presented as four (4) decimal 
1935 numbers that are separated by a dot (or period). eg: 168.192.1.1</P
1936 ><P
1937 >MAC Addresses use 48 bits (or 6 bytes) and are typically represented 
1938 as two digit hexadecimal numbers separated by colons. eg: 
1939 40:8e:0a:12:34:56</P
1940 ><P
1941 >Every network interfrace must have an MAC address. Associated with 
1942 a MAC address there may be one or more IP addresses. There is NO 
1943 relationship between an IP address and a MAC address, all such assignments 
1944 are arbitary or discretionary in nature. At the most basic level all 
1945 network communications takes place using MAC addressing. Since MAC 
1946 addresses must be globally unique, and generally remains fixed for 
1947 any particular interface, the assignment of an IP address makes sense 
1948 from a network management perspective. More than one IP address can 
1949 be assigned per MAC address. One address must be the primary IP address, 
1950 this is the address that will be returned in the ARP reply.</P
1951 ><P
1952 >When a user or a process wants to communicate with another machine 
1953 the protocol implementation ensures that the "machine name" or "host 
1954 name" is resolved to an IP address in a manner that is controlled 
1955 by the TCP/IP configuration control files. The file 
1956 <TT
1957 CLASS="FILENAME"
1958 >/etc/hosts</TT
1959 > is one such file.</P
1960 ><P
1961 >When the IP address of the destination interface has been 
1962 determined a protocol called ARP/RARP isused to identify 
1963 the MAC address of the target interface. ARP stands for Address 
1964 Resolution Protocol, and is a broadcast oriented method that 
1965 uses UDP (User Datagram Protocol) to send a request to all 
1966 interfaces on the local network segment using the all 1's MAC 
1967 address. Network interfaces are programmed to respond to two 
1968 MAC addresses only; their own unique address and the address 
1969 ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will 
1970 contain the MAC address and the primary IP address for each 
1971 interface.</P
1972 ><P
1973 >The <TT
1974 CLASS="FILENAME"
1975 >/etc/hosts</TT
1976 > file is foundational to all 
1977 Unix/Linux TCP/IP installations and as a minumum will contain 
1978 the localhost and local network interface IP addresses and the 
1979 primary names by which they are known within the local machine. 
1980 This file helps to prime the pump so that a basic level of name 
1981 resolution can exist before any other method of name resolution 
1982 becomes available.</P
1983 ></DIV
1984 ><DIV
1985 CLASS="SECT2"
1986 ><HR><H2
1987 CLASS="SECT2"
1988 ><A
1989 NAME="AEN278"
1990 >2.2.2. <TT
1991 CLASS="FILENAME"
1992 >/etc/resolv.conf</TT
1993 ></A
1994 ></H2
1995 ><P
1996 >This file tells the name resolution libraries:</P
1997 ><P
1998 ></P
1999 ><UL
2000 ><LI
2001 ><P
2002 >The name of the domain to which the machine 
2003         belongs
2004         </P
2005 ></LI
2006 ><LI
2007 ><P
2008 >The name(s) of any domains that should be 
2009         automatically searched when trying to resolve unqualified 
2010         host names to their IP address
2011         </P
2012 ></LI
2013 ><LI
2014 ><P
2015 >The name or IP address of available Domain 
2016         Name Servers that may be asked to perform name to address 
2017         translation lookups
2018         </P
2019 ></LI
2020 ></UL
2021 ></DIV
2022 ><DIV
2023 CLASS="SECT2"
2024 ><HR><H2
2025 CLASS="SECT2"
2026 ><A
2027 NAME="AEN289"
2028 >2.2.3. <TT
2029 CLASS="FILENAME"
2030 >/etc/host.conf</TT
2031 ></A
2032 ></H2
2033 ><P
2034 ><TT
2035 CLASS="FILENAME"
2036 >/etc/host.conf</TT
2037 > is the primary means by 
2038 which the setting in /etc/resolv.conf may be affected. It is a 
2039 critical configuration file.  This file controls the order by 
2040 which name resolution may procede. The typical structure is:</P
2041 ><P
2042 ><TABLE
2043 BORDER="0"
2044 BGCOLOR="#E0E0E0"
2045 WIDTH="100%"
2046 ><TR
2047 ><TD
2048 ><PRE
2049 CLASS="PROGRAMLISTING"
2050 >       order hosts,bind
2051         multi on</PRE
2052 ></TD
2053 ></TR
2054 ></TABLE
2055 ></P
2056 ><P
2057 >then both addresses should be returned. Please refer to the 
2058 man page for host.conf for further details.</P
2059 ></DIV
2060 ><DIV
2061 CLASS="SECT2"
2062 ><HR><H2
2063 CLASS="SECT2"
2064 ><A
2065 NAME="AEN297"
2066 >2.2.4. <TT
2067 CLASS="FILENAME"
2068 >/etc/nsswitch.conf</TT
2069 ></A
2070 ></H2
2071 ><P
2072 >This file controls the actual name resolution targets. The 
2073 file typically has resolver object specifications as follows:</P
2074 ><P
2075 ><TABLE
2076 BORDER="0"
2077 BGCOLOR="#E0E0E0"
2078 WIDTH="100%"
2079 ><TR
2080 ><TD
2081 ><PRE
2082 CLASS="PROGRAMLISTING"
2083 >       # /etc/nsswitch.conf
2084         #
2085         # Name Service Switch configuration file.
2086         #
2087
2088         passwd:         compat
2089         # Alternative entries for password authentication are:
2090         # passwd:       compat files nis ldap winbind
2091         shadow:         compat
2092         group:          compat
2093
2094         hosts:          files nis dns
2095         # Alternative entries for host name resolution are:
2096         # hosts:        files dns nis nis+ hesoid db compat ldap wins
2097         networks:       nis files dns
2098
2099         ethers:         nis files
2100         protocols:      nis files
2101         rpc:            nis files
2102         services:       nis files</PRE
2103 ></TD
2104 ></TR
2105 ></TABLE
2106 ></P
2107 ><P
2108 >Of course, each of these mechanisms requires that the appropriate 
2109 facilities and/or services are correctly configured.</P
2110 ><P
2111 >It should be noted that unless a network request/message must be 
2112 sent, TCP/IP networks are silent. All TCP/IP communications assumes a 
2113 principal of speaking only when necessary.</P
2114 ><P
2115 >Samba version 2.2.0 will add Linux support for extensions to 
2116 the name service switch infrastructure so that linux clients will 
2117 be able to obtain resolution of MS Windows NetBIOS names to IP 
2118 Addresses. To gain this functionality Samba needs to be compiled 
2119 with appropriate arguments to the make command (ie: <B
2120 CLASS="COMMAND"
2121 >make 
2122 nsswitch/libnss_wins.so</B
2123 >). The resulting library should 
2124 then be installed in the <TT
2125 CLASS="FILENAME"
2126 >/lib</TT
2127 > directory and 
2128 the "wins" parameter needs to be added to the "hosts:" line in 
2129 the <TT
2130 CLASS="FILENAME"
2131 >/etc/nsswitch.conf</TT
2132 > file. At this point it 
2133 will be possible to ping any MS Windows machine by it's NetBIOS 
2134 machine name, so long as that machine is within the workgroup to 
2135 which both the samba machine and the MS Windows machine belong.</P
2136 ></DIV
2137 ></DIV
2138 ><DIV
2139 CLASS="SECT1"
2140 ><HR><H1
2141 CLASS="SECT1"
2142 ><A
2143 NAME="AEN309"
2144 >2.3. Name resolution as used within MS Windows networking</A
2145 ></H1
2146 ><P
2147 >MS Windows networking is predicated about the name each machine 
2148 is given. This name is known variously (and inconsistently) as 
2149 the "computer name", "machine name", "networking name", "netbios name", 
2150 "SMB name". All terms mean the same thing with the exception of 
2151 "netbios name" which can apply also to the name of the workgroup or the 
2152 domain name. The terms "workgroup" and "domain" are really just a 
2153 simply name with which the machine is associated. All NetBIOS names 
2154 are exactly 16 characters in length. The 16th character is reserved. 
2155 It is used to store a one byte value that indicates service level 
2156 information for the NetBIOS name that is registered. A NetBIOS machine 
2157 name is therefore registered for each service type that is provided by 
2158 the client/server.</P
2159 ><P
2160 >The following are typical NetBIOS name/service type registrations:</P
2161 ><P
2162 ><TABLE
2163 BORDER="0"
2164 BGCOLOR="#E0E0E0"
2165 WIDTH="100%"
2166 ><TR
2167 ><TD
2168 ><PRE
2169 CLASS="PROGRAMLISTING"
2170 >       Unique NetBIOS Names:
2171                 MACHINENAME&#60;00&#62; = Server Service is running on MACHINENAME
2172                 MACHINENAME&#60;03&#62; = Generic Machine Name (NetBIOS name)
2173                 MACHINENAME&#60;20&#62; = LanMan Server service is running on MACHINENAME
2174                 WORKGROUP&#60;1b&#62; = Domain Master Browser
2175
2176         Group Names:
2177                 WORKGROUP&#60;03&#62; = Generic Name registered by all members of WORKGROUP
2178                 WORKGROUP&#60;1c&#62; = Domain Controllers / Netlogon Servers
2179                 WORKGROUP&#60;1d&#62; = Local Master Browsers
2180                 WORKGROUP&#60;1e&#62; = Internet Name Resolvers</PRE
2181 ></TD
2182 ></TR
2183 ></TABLE
2184 ></P
2185 ><P
2186 >It should be noted that all NetBIOS machines register their own 
2187 names as per the above. This is in vast contrast to TCP/IP 
2188 installations where traditionally the system administrator will 
2189 determine in the /etc/hosts or in the DNS database what names 
2190 are associated with each IP address.</P
2191 ><P
2192 >One further point of clarification should be noted, the <TT
2193 CLASS="FILENAME"
2194 >/etc/hosts</TT
2195
2196 file and the DNS records do not provide the NetBIOS name type information 
2197 that MS Windows clients depend on to locate the type of service that may 
2198 be needed. An example of this is what happens when an MS Windows client 
2199 wants to locate a domain logon server. It find this service and the IP 
2200 address of a server that provides it by performing a lookup (via a 
2201 NetBIOS broadcast) for enumeration of all machines that have 
2202 registered the name type *&#60;1c&#62;. A logon request is then sent to each 
2203 IP address that is returned in the enumerated list of IP addresses. Which 
2204 ever machine first replies then ends up providing the logon services.</P
2205 ><P
2206 >The name "workgroup" or "domain" really can be confusing since these 
2207 have the added significance of indicating what is the security 
2208 architecture of the MS Windows network. The term "workgroup" indicates 
2209 that the primary nature of the network environment is that of a 
2210 peer-to-peer design. In a WORKGROUP all machines are responsible for 
2211 their own security, and generally such security is limited to use of 
2212 just a password (known as SHARE MORE security). In most situations 
2213 with peer-to-peer networking the users who control their own machines 
2214 will simply opt to have no security at all. It is possible to have 
2215 USER MODE security in a WORKGROUP environment, thus requiring use 
2216 of a user name and a matching password.</P
2217 ><P
2218 >MS Windows networking is thus predetermined to use machine names 
2219 for all local and remote machine message passing. The protocol used is 
2220 called Server Message Block (SMB) and this is implemented using 
2221 the NetBIOS protocol (Network Basic Input Output System). NetBIOS can 
2222 be encapsulated using LLC (Logical Link Control) protocol - in which case 
2223 the resulting protocol is called NetBEUI (Network Basic Extended User 
2224 Interface). NetBIOS can also be run over IPX (Internetworking Packet 
2225 Exchange) protocol as used by Novell NetWare, and it can be run 
2226 over TCP/IP protocols - in which case the resulting protocol is called 
2227 NBT or NetBT, the NetBIOS over TCP/IP.</P
2228 ><P
2229 >MS Windows machines use a complex array of name resolution mechanisms. 
2230 Since we are primarily concerned with TCP/IP this demonstration is 
2231 limited to this area.</P
2232 ><DIV
2233 CLASS="SECT2"
2234 ><HR><H2
2235 CLASS="SECT2"
2236 ><A
2237 NAME="AEN321"
2238 >2.3.1. The NetBIOS Name Cache</A
2239 ></H2
2240 ><P
2241 >All MS Windows machines employ an in memory buffer in which is 
2242 stored the NetBIOS names and their IP addresses for all external 
2243 machines that that the local machine has communicated with over the 
2244 past 10-15 minutes. It is more efficient to obtain an IP address 
2245 for a machine from the local cache than it is to go through all the 
2246 configured name resolution mechanisms.</P
2247 ><P
2248 >If a machine whose name is in the local name cache has been shut 
2249 down before the name had been expired and flushed from the cache, then 
2250 an attempt to exchange a message with that machine will be subject 
2251 to time-out delays. ie: It's name is in the cache, so a name resolution 
2252 lookup will succeed, but the machine can not respond. This can be 
2253 frustrating for users - but it is a characteristic of the protocol.</P
2254 ><P
2255 >The MS Windows utility that allows examination of the NetBIOS 
2256 name cache is called "nbtstat". The Samba equivalent of this 
2257 is called "nmblookup".</P
2258 ></DIV
2259 ><DIV
2260 CLASS="SECT2"
2261 ><HR><H2
2262 CLASS="SECT2"
2263 ><A
2264 NAME="AEN326"
2265 >2.3.2. The LMHOSTS file</A
2266 ></H2
2267 ><P
2268 >This file is usually located in MS Windows NT 4.0 or 
2269 2000 in <TT
2270 CLASS="FILENAME"
2271 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2272 > and contains 
2273 the IP Address and the machine name in matched pairs. The 
2274 <TT
2275 CLASS="FILENAME"
2276 >LMHOSTS</TT
2277 > file performs NetBIOS name 
2278 to IP address mapping oriented.</P
2279 ><P
2280 >It typically looks like:</P
2281 ><P
2282 ><TABLE
2283 BORDER="0"
2284 BGCOLOR="#E0E0E0"
2285 WIDTH="100%"
2286 ><TR
2287 ><TD
2288 ><PRE
2289 CLASS="PROGRAMLISTING"
2290 >       # Copyright (c) 1998 Microsoft Corp.
2291         #
2292         # This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
2293         # over TCP/IP) stack for Windows98
2294         #
2295         # This file contains the mappings of IP addresses to NT computernames
2296         # (NetBIOS) names.  Each entry should be kept on an individual line.
2297         # The IP address should be placed in the first column followed by the
2298         # corresponding computername. The address and the comptername
2299         # should be separated by at least one space or tab. The "#" character
2300         # is generally used to denote the start of a comment (see the exceptions
2301         # below).
2302         #
2303         # This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
2304         # files and offers the following extensions:
2305         #
2306         #      #PRE
2307         #      #DOM:&#60;domain&#62;
2308         #      #INCLUDE &#60;filename&#62;
2309         #      #BEGIN_ALTERNATE
2310         #      #END_ALTERNATE
2311         #      \0xnn (non-printing character support)
2312         #
2313         # Following any entry in the file with the characters "#PRE" will cause
2314         # the entry to be preloaded into the name cache. By default, entries are
2315         # not preloaded, but are parsed only after dynamic name resolution fails.
2316         #
2317         # Following an entry with the "#DOM:&#60;domain&#62;" tag will associate the
2318         # entry with the domain specified by &#60;domain&#62;. This affects how the
2319         # browser and logon services behave in TCP/IP environments. To preload
2320         # the host name associated with #DOM entry, it is necessary to also add a
2321         # #PRE to the line. The &#60;domain&#62; is always preloaded although it will not
2322         # be shown when the name cache is viewed.
2323         #
2324         # Specifying "#INCLUDE &#60;filename&#62;" will force the RFC NetBIOS (NBT)
2325         # software to seek the specified &#60;filename&#62; and parse it as if it were
2326         # local. &#60;filename&#62; is generally a UNC-based name, allowing a
2327         # centralized lmhosts file to be maintained on a server.
2328         # It is ALWAYS necessary to provide a mapping for the IP address of the
2329         # server prior to the #INCLUDE. This mapping must use the #PRE directive.
2330         # In addtion the share "public" in the example below must be in the
2331         # LanManServer list of "NullSessionShares" in order for client machines to
2332         # be able to read the lmhosts file successfully. This key is under
2333         # \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
2334         # in the registry. Simply add "public" to the list found there.
2335         #
2336         # The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
2337         # statements to be grouped together. Any single successful include
2338         # will cause the group to succeed.
2339         #
2340         # Finally, non-printing characters can be embedded in mappings by
2341         # first surrounding the NetBIOS name in quotations, then using the
2342         # \0xnn notation to specify a hex value for a non-printing character.
2343         #
2344         # The following example illustrates all of these extensions:
2345         #
2346         # 102.54.94.97     rhino         #PRE #DOM:networking  #net group's DC
2347         # 102.54.94.102    "appname  \0x14"                    #special app server
2348         # 102.54.94.123    popular            #PRE             #source server
2349         # 102.54.94.117    localsrv           #PRE             #needed for the include
2350         #
2351         # #BEGIN_ALTERNATE
2352         # #INCLUDE \\localsrv\public\lmhosts
2353         # #INCLUDE \\rhino\public\lmhosts
2354         # #END_ALTERNATE
2355         #
2356         # In the above example, the "appname" server contains a special
2357         # character in its name, the "popular" and "localsrv" server names are
2358         # preloaded, and the "rhino" server name is specified so it can be used
2359         # to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
2360         # system is unavailable.
2361         #
2362         # Note that the whole file is parsed including comments on each lookup,
2363         # so keeping the number of comments to a minimum will improve performance.
2364         # Therefore it is not advisable to simply add lmhosts file entries onto the
2365         # end of this file.</PRE
2366 ></TD
2367 ></TR
2368 ></TABLE
2369 ></P
2370 ></DIV
2371 ><DIV
2372 CLASS="SECT2"
2373 ><HR><H2
2374 CLASS="SECT2"
2375 ><A
2376 NAME="AEN334"
2377 >2.3.3. HOSTS file</A
2378 ></H2
2379 ><P
2380 >This file is usually located in MS Windows NT 4.0 or 2000 in 
2381 <TT
2382 CLASS="FILENAME"
2383 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2384 > and contains 
2385 the IP Address and the IP hostname in matched pairs. It can be 
2386 used by the name resolution infrastructure in MS Windows, depending 
2387 on how the TCP/IP environment is configured. This file is in 
2388 every way the equivalent of the Unix/Linux <TT
2389 CLASS="FILENAME"
2390 >/etc/hosts</TT
2391 > file.</P
2392 ></DIV
2393 ><DIV
2394 CLASS="SECT2"
2395 ><HR><H2
2396 CLASS="SECT2"
2397 ><A
2398 NAME="AEN339"
2399 >2.3.4. DNS Lookup</A
2400 ></H2
2401 ><P
2402 >This capability is configured in the TCP/IP setup area in the network 
2403 configuration facility. If enabled an elaborate name resolution sequence 
2404 is followed the precise nature of which isdependant on what the NetBIOS 
2405 Node Type parameter is configured to. A Node Type of 0 means use 
2406 NetBIOS broadcast (over UDP broadcast) is first used if the name 
2407 that is the subject of a name lookup is not found in the NetBIOS name 
2408 cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to 
2409 Node Type 8, then a NetBIOS Unicast (over UDP Unicast) is sent to the 
2410 WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast 
2411 lookup is used.</P
2412 ></DIV
2413 ><DIV
2414 CLASS="SECT2"
2415 ><HR><H2
2416 CLASS="SECT2"
2417 ><A
2418 NAME="AEN342"
2419 >2.3.5. WINS Lookup</A
2420 ></H2
2421 ><P
2422 >A WINS (Windows Internet Name Server) service is the equivaent of the 
2423 rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores 
2424 the names and IP addresses that are registered by a Windows client 
2425 if the TCP/IP setup has been given at least one WINS Server IP Address.</P
2426 ><P
2427 >To configure Samba to be a WINS server the following parameter needs 
2428 to be added to the <TT
2429 CLASS="FILENAME"
2430 >smb.conf</TT
2431 > file:</P
2432 ><P
2433 ><TABLE
2434 BORDER="0"
2435 BGCOLOR="#E0E0E0"
2436 WIDTH="100%"
2437 ><TR
2438 ><TD
2439 ><PRE
2440 CLASS="PROGRAMLISTING"
2441 >       wins support = Yes</PRE
2442 ></TD
2443 ></TR
2444 ></TABLE
2445 ></P
2446 ><P
2447 >To configure Samba to use a WINS server the following parameters are 
2448 needed in the smb.conf file:</P
2449 ><P
2450 ><TABLE
2451 BORDER="0"
2452 BGCOLOR="#E0E0E0"
2453 WIDTH="100%"
2454 ><TR
2455 ><TD
2456 ><PRE
2457 CLASS="PROGRAMLISTING"
2458 >       wins support = No
2459         wins server = xxx.xxx.xxx.xxx</PRE
2460 ></TD
2461 ></TR
2462 ></TABLE
2463 ></P
2464 ><P
2465 >where <TT
2466 CLASS="REPLACEABLE"
2467 ><I
2468 >xxx.xxx.xxx.xxx</I
2469 ></TT
2470 > is the IP address 
2471 of the WINS server.</P
2472 ></DIV
2473 ></DIV
2474 ><DIV
2475 CLASS="SECT1"
2476 ><HR><H1
2477 CLASS="SECT1"
2478 ><A
2479 NAME="AEN354"
2480 >2.4. How browsing functions and how to deploy stable and 
2481 dependable browsing using Samba</A
2482 ></H1
2483 ><P
2484 >As stated above, MS Windows machines register their NetBIOS names 
2485 (ie: the machine name for each service type in operation) on start 
2486 up. Also, as stated above, the exact method by which this name registration 
2487 takes place is determined by whether or not the MS Windows client/server 
2488 has been given a WINS server address, whether or not LMHOSTS lookup 
2489 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.</P
2490 ><P
2491 >In the case where there is no WINS server all name registrations as 
2492 well as name lookups are done by UDP broadcast. This isolates name 
2493 resolution to the local subnet, unless LMHOSTS is used to list all 
2494 names and IP addresses. In such situations Samba provides a means by 
2495 which the samba server name may be forcibly injected into the browse 
2496 list of a remote MS Windows network (using the "remote announce" parameter).</P
2497 ><P
2498 >Where a WINS server is used, the MS Windows client will use UDP 
2499 unicast to register with the WINS server. Such packets can be routed 
2500 and thus WINS allows name resolution to function across routed networks.</P
2501 ><P
2502 >During the startup process an election will take place to create a 
2503 local master browser if one does not already exist. On each NetBIOS network 
2504 one machine will be elected to function as the domain master browser. This 
2505 domain browsing has nothing to do with MS security domain control. 
2506 Instead, the domain master browser serves the role of contacting each local 
2507 master browser (found by asking WINS or from LMHOSTS) and exchanging browse 
2508 list contents. This way every master browser will eventually obtain a complete 
2509 list of all machines that are on the network. Every 11-15 minutes an election 
2510 is held to determine which machine will be the master browser. By nature of 
2511 the election criteria used, the machine with the highest uptime, or the 
2512 most senior protocol version, or other criteria, will win the election 
2513 as domain master browser.</P
2514 ><P
2515 >Clients wishing to browse the network make use of this list, but also depend 
2516 on the availability of correct name resolution to the respective IP 
2517 address/addresses. </P
2518 ><P
2519 >Any configuration that breaks name resolution and/or browsing intrinsics 
2520 will annoy users because they will have to put up with protracted 
2521 inability to use the network services.</P
2522 ><P
2523 >Samba supports a feature that allows forced synchonisation 
2524 of browse lists across routed networks using the "remote 
2525 browse sync" parameter in the smb.conf file. This causes Samba 
2526 to contact the local master browser on a remote network and 
2527 to request browse list synchronisation. This effectively bridges 
2528 two networks that are separated by routers. The two remote 
2529 networks may use either broadcast based name resolution or WINS 
2530 based name resolution, but it should be noted that the "remote 
2531 browse sync" parameter provides browse list synchronisation - and 
2532 that is distinct from name to address resolution, in other 
2533 words, for cross subnet browsing to function correctly it is 
2534 essential that a name to address resolution mechanism be provided. 
2535 This mechanism could be via DNS, <TT
2536 CLASS="FILENAME"
2537 >/etc/hosts</TT
2538 >, 
2539 and so on.</P
2540 ></DIV
2541 ><DIV
2542 CLASS="SECT1"
2543 ><HR><H1
2544 CLASS="SECT1"
2545 ><A
2546 NAME="AEN364"
2547 >2.5. MS Windows security options and how to configure 
2548 Samba for seemless integration</A
2549 ></H1
2550 ><P
2551 >MS Windows clients may use encrypted passwords as part of a 
2552 challenege/response authentication model (a.k.a. NTLMv1) or 
2553 alone, or clear text strings for simple password based 
2554 authentication. It should be realized that with the SMB 
2555 protocol the password is passed over the network either 
2556 in plain text or encrypted, but not both in the same 
2557 authentication requets.</P
2558 ><P
2559 >When encrypted passwords are used a password that has been 
2560 entered by the user is encrypted in two ways:</P
2561 ><P
2562 ></P
2563 ><UL
2564 ><LI
2565 ><P
2566 >An MD4 hash of the UNICODE of the password
2567         string.  This is known as the NT hash.
2568         </P
2569 ></LI
2570 ><LI
2571 ><P
2572 >The password is converted to upper case,
2573         and then padded or trucated to 14 bytes.  This string is 
2574         then appended with 5 bytes of NULL characters and split to
2575         form two 56 bit DES keys to encrypt a "magic" 8 byte value.
2576         The resulting 16 bytes for the LanMan hash.
2577         </P
2578 ></LI
2579 ></UL
2580 ><P
2581 >You should refer to the <A
2582 HREF="ENCRYPTION.html"
2583 TARGET="_top"
2584 >Password Encryption</A
2585 > chapter in this HOWTO collection
2586 for more details on the inner workings</P
2587 ><P
2588 >MS Windows 95 pre-service pack 1, MS Windows NT versions 3.x 
2589 and version 4.0 pre-service pack 3 will use either mode of 
2590 password authentication. All versions of MS Windows that follow 
2591 these versions no longer support plain text passwords by default.</P
2592 ><P
2593 >MS Windows clients have a habit of dropping network mappings that 
2594 have been idle for 10 minutes or longer. When the user attempts to 
2595 use the mapped drive connection that has been dropped the SMB protocol 
2596 has a mechanism by which the connection can be re-established using 
2597 a cached copy of the password.</P
2598 ><P
2599 >When Microsoft changed the default password mode, they dropped support for 
2600 caching of the plain text password. This means that when the registry 
2601 parameter is changed to re-enable use of plain text passwords it appears to 
2602 work, but when a dropped mapping attempts to revalidate it will fail if 
2603 the remote authentication server does not support encrypted passwords. 
2604 This means that it is definitely not a good idea to re-enable plain text 
2605 password support in such clients.</P
2606 ><P
2607 >The following parameters can be used to work around the 
2608 issue of Windows 9x client upper casing usernames and
2609 password before transmitting them to the SMB server
2610 when using clear text authentication.</P
2611 ><P
2612 ><TABLE
2613 BORDER="0"
2614 BGCOLOR="#E0E0E0"
2615 WIDTH="100%"
2616 ><TR
2617 ><TD
2618 ><PRE
2619 CLASS="PROGRAMLISTING"
2620 >       <A
2621 HREF="smb.conf.5.html#PASSWORDLEVEL"
2622 TARGET="_top"
2623 >passsword level</A
2624 > = <TT
2625 CLASS="REPLACEABLE"
2626 ><I
2627 >integer</I
2628 ></TT
2629 >
2630         <A
2631 HREF="smb.conf.5.html#USERNAMELEVEL"
2632 TARGET="_top"
2633 >username level</A
2634 > = <TT
2635 CLASS="REPLACEABLE"
2636 ><I
2637 >integer</I
2638 ></TT
2639 ></PRE
2640 ></TD
2641 ></TR
2642 ></TABLE
2643 ></P
2644 ><P
2645 >By default Samba will lower case the username before attempting
2646 to lookup the user in the database of local system accounts.
2647 Because UNIX usernames conventionally only contain lower case
2648 character, the <TT
2649 CLASS="PARAMETER"
2650 ><I
2651 >username level</I
2652 ></TT
2653 > parameter
2654 is rarely even needed.</P
2655 ><P
2656 >However, password on UNIX systems often make use of mixed case
2657 characters.  This means that in order for a user on a Windows 9x
2658 client to connect to a Samba server using clear text authentication,
2659 the <TT
2660 CLASS="PARAMETER"
2661 ><I
2662 >password level</I
2663 ></TT
2664 > must be set to the maximum
2665 number of upper case letter which <EM
2666 >could</EM
2667 > appear
2668 is a password.  Note that is the server OS uses the traditional
2669 DES version of crypt(), then a <TT
2670 CLASS="PARAMETER"
2671 ><I
2672 >password level</I
2673 ></TT
2674 >
2675 of 8 will result in case insensitive passwords as seen from Windows
2676 users.  This will also result in longer login times as Samba
2677 hash to compute the permutations of the password string and 
2678 try them one by one until a match is located (or all combinations fail).</P
2679 ><P
2680 >The best option to adopt is to enable support for encrypted passwords 
2681 where ever Samba is used. There are three configuration possibilities 
2682 for support of encrypted passwords:</P
2683 ><DIV
2684 CLASS="SECT2"
2685 ><HR><H2
2686 CLASS="SECT2"
2687 ><A
2688 NAME="AEN392"
2689 >2.5.1. Use MS Windows NT as an authentication server</A
2690 ></H2
2691 ><P
2692 >This method involves the additions of the following parameters 
2693 in the smb.conf file:</P
2694 ><P
2695 ><TABLE
2696 BORDER="0"
2697 BGCOLOR="#E0E0E0"
2698 WIDTH="100%"
2699 ><TR
2700 ><TD
2701 ><PRE
2702 CLASS="PROGRAMLISTING"
2703 >       encrypt passwords = Yes
2704         security = server
2705         password server = "NetBIOS_name_of_PDC"</PRE
2706 ></TD
2707 ></TR
2708 ></TABLE
2709 ></P
2710 ><P
2711 >There are two ways of identifying whether or not a username and 
2712 password pair was valid or not. One uses the reply information provided 
2713 as part of the authentication messaging process, the other uses 
2714 just and error code.</P
2715 ><P
2716 >The down-side of this mode of configuration is the fact that 
2717 for security reasons Samba will send the password server a bogus 
2718 username and a bogus password and if the remote server fails to 
2719 reject the username and password pair then an alternative mode 
2720 of identification of validation is used. Where a site uses password 
2721 lock out after a certain number of failed authentication attempts 
2722 this will result in user lockouts.</P
2723 ><P
2724 >Use of this mode of authentication does require there to be 
2725 a standard Unix account for the user, this account can be blocked 
2726 to prevent logons by other than MS Windows clients.</P
2727 ></DIV
2728 ><DIV
2729 CLASS="SECT2"
2730 ><HR><H2
2731 CLASS="SECT2"
2732 ><A
2733 NAME="AEN400"
2734 >2.5.2. Make Samba a member of an MS Windows NT security domain</A
2735 ></H2
2736 ><P
2737 >This method involves additon of the following paramters in the smb.conf file:</P
2738 ><P
2739 ><TABLE
2740 BORDER="0"
2741 BGCOLOR="#E0E0E0"
2742 WIDTH="100%"
2743 ><TR
2744 ><TD
2745 ><PRE
2746 CLASS="PROGRAMLISTING"
2747 >       encrypt passwords = Yes
2748         security = domain
2749         workgroup = "name of NT domain"
2750         password server = *</PRE
2751 ></TD
2752 ></TR
2753 ></TABLE
2754 ></P
2755 ><P
2756 >The use of the "*" argument to "password server" will cause samba 
2757 to locate the domain controller in a way analogous to the way 
2758 this is done within MS Windows NT.</P
2759 ><P
2760 >In order for this method to work the Samba server needs to join the 
2761 MS Windows NT security domain. This is done as follows:</P
2762 ><P
2763 ></P
2764 ><UL
2765 ><LI
2766 ><P
2767 >On the MS Windows NT domain controller using 
2768         the Server Manager add a machine account for the Samba server.
2769         </P
2770 ></LI
2771 ><LI
2772 ><P
2773 >Next, on the Linux system execute: 
2774         <B
2775 CLASS="COMMAND"
2776 >smbpasswd -r PDC_NAME -j DOMAIN_NAME</B
2777 >
2778         </P
2779 ></LI
2780 ></UL
2781 ><P
2782 >Use of this mode of authentication does require there to be 
2783 a standard Unix account for the user in order to assign
2784 a uid once the account has been authenticated by the remote
2785 Windows DC.  This account can be blocked to prevent logons by 
2786 other than MS Windows clients by things such as setting an invalid
2787 shell in the <TT
2788 CLASS="FILENAME"
2789 >/etc/passwd</TT
2790 > entry.</P
2791 ><P
2792 >An alternative to assigning UIDs to Windows users on a 
2793 Samba member server is presented in the <A
2794 HREF="winbind.html"
2795 TARGET="_top"
2796 >Winbind Overview</A
2797 > chapter in
2798 this HOWTO collection.</P
2799 ></DIV
2800 ><DIV
2801 CLASS="SECT2"
2802 ><HR><H2
2803 CLASS="SECT2"
2804 ><A
2805 NAME="AEN417"
2806 >2.5.3. Configure Samba as an authentication server</A
2807 ></H2
2808 ><P
2809 >This mode of authentication demands that there be on the 
2810 Unix/Linux system both a Unix style account as well as and 
2811 smbpasswd entry for the user. The Unix system account can be 
2812 locked if required as only the encrypted password will be 
2813 used for SMB client authentication.</P
2814 ><P
2815 >This method involves addition of the following parameters to 
2816 the smb.conf file:</P
2817 ><P
2818 ><TABLE
2819 BORDER="0"
2820 BGCOLOR="#E0E0E0"
2821 WIDTH="100%"
2822 ><TR
2823 ><TD
2824 ><PRE
2825 CLASS="PROGRAMLISTING"
2826 >## please refer to the Samba PDC HOWTO chapter later in 
2827 ## this collection for more details
2828 [global]
2829         encrypt passwords = Yes
2830         security = user
2831         domain logons = Yes
2832         ; an OS level of 33 or more is recommended
2833         os level = 33
2834
2835 [NETLOGON]
2836         path = /somewhare/in/file/system
2837         read only = yes</PRE
2838 ></TD
2839 ></TR
2840 ></TABLE
2841 ></P
2842 ><P
2843 >in order for this method to work a Unix system account needs 
2844 to be created for each user, as well as for each MS Windows NT/2000 
2845 machine. The following structure is required.</P
2846 ><DIV
2847 CLASS="SECT3"
2848 ><HR><H3
2849 CLASS="SECT3"
2850 ><A
2851 NAME="AEN424"
2852 >2.5.3.1. Users</A
2853 ></H3
2854 ><P
2855 >A user account that may provide a home directory should be 
2856 created. The following Linux system commands are typical of 
2857 the procedure for creating an account.</P
2858 ><P
2859 ><TABLE
2860 BORDER="0"
2861 BGCOLOR="#E0E0E0"
2862 WIDTH="100%"
2863 ><TR
2864 ><TD
2865 ><PRE
2866 CLASS="PROGRAMLISTING"
2867 >       # useradd -s /bin/bash -d /home/"userid" -m "userid"
2868         # passwd "userid"
2869           Enter Password: &#60;pw&#62;
2870           
2871         # smbpasswd -a "userid"
2872           Enter Password: &#60;pw&#62;</PRE
2873 ></TD
2874 ></TR
2875 ></TABLE
2876 ></P
2877 ></DIV
2878 ><DIV
2879 CLASS="SECT3"
2880 ><HR><H3
2881 CLASS="SECT3"
2882 ><A
2883 NAME="AEN429"
2884 >2.5.3.2. MS Windows NT Machine Accounts</A
2885 ></H3
2886 ><P
2887 >These are required only when Samba is used as a domain 
2888 controller.  Refer to the Samba-PDC-HOWTO for more details.</P
2889 ><P
2890 ><TABLE
2891 BORDER="0"
2892 BGCOLOR="#E0E0E0"
2893 WIDTH="100%"
2894 ><TR
2895 ><TD
2896 ><PRE
2897 CLASS="PROGRAMLISTING"
2898 >       # useradd -s /bin/false -d /dev/null "machine_name"\$
2899         # passwd -l "machine_name"\$
2900         # smbpasswd -a -m "machine_name"</PRE
2901 ></TD
2902 ></TR
2903 ></TABLE
2904 ></P
2905 ></DIV
2906 ></DIV
2907 ></DIV
2908 ><DIV
2909 CLASS="SECT1"
2910 ><HR><H1
2911 CLASS="SECT1"
2912 ><A
2913 NAME="AEN434"
2914 >2.6. Conclusions</A
2915 ></H1
2916 ><P
2917 >Samba provides a flexible means to operate as...</P
2918 ><P
2919 ></P
2920 ><UL
2921 ><LI
2922 ><P
2923 >A Stand-alone server - No special action is needed 
2924         other than to create user accounts. Stand-alone servers do NOT 
2925         provide network logon services, meaning that machines that use this 
2926         server do NOT perform a domain logon but instead make use only of 
2927         the MS Windows logon which is local to the MS Windows 
2928         workstation/server.
2929         </P
2930 ></LI
2931 ><LI
2932 ><P
2933 >An MS Windows NT 3.x/4.0 security domain member.
2934         </P
2935 ></LI
2936 ><LI
2937 ><P
2938 >An alternative to an MS Windows NT 3.x/4.0 
2939         Domain Controller.
2940         </P
2941 ></LI
2942 ></UL
2943 ></DIV
2944 ></DIV
2945 ><DIV
2946 CLASS="CHAPTER"
2947 ><HR><H1
2948 ><A
2949 NAME="PAM"
2950 >Chapter 3. Configuring PAM for distributed but centrally 
2951 managed authentication</A
2952 ></H1
2953 ><DIV
2954 CLASS="SECT1"
2955 ><H1
2956 CLASS="SECT1"
2957 ><A
2958 NAME="AEN455"
2959 >3.1. Samba and PAM</A
2960 ></H1
2961 ><P
2962 >A number of Unix systems (eg: Sun Solaris), as well as the 
2963 xxxxBSD family and Linux, now utilize the Pluggable Authentication 
2964 Modules (PAM) facility to provide all authentication, 
2965 authorization and resource control services. Prior to the 
2966 introduction of PAM, a decision to use an alternative to 
2967 the system password database (<TT
2968 CLASS="FILENAME"
2969 >/etc/passwd</TT
2970 >) 
2971 would require the provision of alternatives for all programs that provide 
2972 security services. Such a choice would involve provision of 
2973 alternatives to such programs as: <B
2974 CLASS="COMMAND"
2975 >login</B
2976 >, 
2977 <B
2978 CLASS="COMMAND"
2979 >passwd</B
2980 >, <B
2981 CLASS="COMMAND"
2982 >chown</B
2983 >, etc.</P
2984 ><P
2985 >PAM provides a mechanism that disconnects these security programs 
2986 from the underlying authentication/authorization infrastructure.
2987 PAM is configured either through one file <TT
2988 CLASS="FILENAME"
2989 >/etc/pam.conf</TT
2990 > (Solaris), 
2991 or by editing individual files that are located in <TT
2992 CLASS="FILENAME"
2993 >/etc/pam.d</TT
2994 >.</P
2995 ><P
2996 >The following is an example <TT
2997 CLASS="FILENAME"
2998 >/etc/pam.d/login</TT
2999 > configuration file. 
3000 This example had all options been uncommented is probably not usable 
3001 as it stacks many conditions before allowing successful completion 
3002 of the login process. Essentially all conditions can be disabled 
3003 by commenting them out except the calls to <TT
3004 CLASS="FILENAME"
3005 >pam_pwdb.so</TT
3006 >.</P
3007 ><P
3008 ><TABLE
3009 BORDER="0"
3010 BGCOLOR="#E0E0E0"
3011 WIDTH="100%"
3012 ><TR
3013 ><TD
3014 ><PRE
3015 CLASS="PROGRAMLISTING"
3016 >#%PAM-1.0
3017 # The PAM configuration file for the `login' service
3018 #
3019 auth            required        pam_securetty.so
3020 auth            required        pam_nologin.so
3021 # auth          required        pam_dialup.so
3022 # auth          optional        pam_mail.so
3023 auth            required        pam_pwdb.so shadow md5
3024 # account       requisite       pam_time.so
3025 account         required        pam_pwdb.so
3026 session         required        pam_pwdb.so
3027 # session       optional        pam_lastlog.so
3028 # password      required        pam_cracklib.so retry=3
3029 password        required        pam_pwdb.so shadow md5</PRE
3030 ></TD
3031 ></TR
3032 ></TABLE
3033 ></P
3034 ><P
3035 >PAM allows use of replacable modules. Those available on a 
3036 sample system include:</P
3037 ><P
3038 ><TABLE
3039 BORDER="0"
3040 BGCOLOR="#E0E0E0"
3041 WIDTH="100%"
3042 ><TR
3043 ><TD
3044 ><PRE
3045 CLASS="PROGRAMLISTING"
3046 >$ /bin/ls /lib/security
3047 pam_access.so    pam_ftp.so          pam_limits.so     
3048 pam_ncp_auth.so  pam_rhosts_auth.so  pam_stress.so     
3049 pam_cracklib.so  pam_group.so        pam_listfile.so   
3050 pam_nologin.so   pam_rootok.so       pam_tally.so      
3051 pam_deny.so      pam_issue.so        pam_mail.so       
3052 pam_permit.so    pam_securetty.so    pam_time.so       
3053 pam_dialup.so    pam_lastlog.so      pam_mkhomedir.so  
3054 pam_pwdb.so      pam_shells.so       pam_unix.so       
3055 pam_env.so       pam_ldap.so         pam_motd.so       
3056 pam_radius.so    pam_smbpass.so      pam_unix_acct.so  
3057 pam_wheel.so     pam_unix_auth.so    pam_unix_passwd.so
3058 pam_userdb.so    pam_warn.so         pam_unix_session.so</PRE
3059 ></TD
3060 ></TR
3061 ></TABLE
3062 ></P
3063 ><P
3064 >The following example for the login program replaces the use of 
3065 the <TT
3066 CLASS="FILENAME"
3067 >pam_pwdb.so</TT
3068 > module which uses the system 
3069 password database (<TT
3070 CLASS="FILENAME"
3071 >/etc/passwd</TT
3072 >,
3073 <TT
3074 CLASS="FILENAME"
3075 >/etc/shadow</TT
3076 >, <TT
3077 CLASS="FILENAME"
3078 >/etc/group</TT
3079 >) with 
3080 the module <TT
3081 CLASS="FILENAME"
3082 >pam_smbpass.so</TT
3083 > which uses the Samba 
3084 database which contains the Microsoft MD4 encrypted password 
3085 hashes. This database is stored in either 
3086 <TT
3087 CLASS="FILENAME"
3088 >/usr/local/samba/private/smbpasswd</TT
3089 >, 
3090 <TT
3091 CLASS="FILENAME"
3092 >/etc/samba/smbpasswd</TT
3093 >, or in 
3094 <TT
3095 CLASS="FILENAME"
3096 >/etc/samba.d/smbpasswd</TT
3097 >, depending on the 
3098 Samba implementation for your Unix/Linux system. The 
3099 <TT
3100 CLASS="FILENAME"
3101 >pam_smbpass.so</TT
3102 > module is provided by 
3103 Samba version 2.2.1 or later. It can be compiled by specifying the 
3104 <B
3105 CLASS="COMMAND"
3106 >--with-pam_smbpass</B
3107 > options when running Samba's
3108 <TT
3109 CLASS="FILENAME"
3110 >configure</TT
3111 > script.  For more information
3112 on the <TT
3113 CLASS="FILENAME"
3114 >pam_smbpass</TT
3115 > module, see the documentation
3116 in the <TT
3117 CLASS="FILENAME"
3118 >source/pam_smbpass</TT
3119 > directory of the Samba 
3120 source distribution.</P
3121 ><P
3122 ><TABLE
3123 BORDER="0"
3124 BGCOLOR="#E0E0E0"
3125 WIDTH="100%"
3126 ><TR
3127 ><TD
3128 ><PRE
3129 CLASS="PROGRAMLISTING"
3130 >#%PAM-1.0
3131 # The PAM configuration file for the `login' service
3132 #
3133 auth            required        pam_smbpass.so nodelay
3134 account         required        pam_smbpass.so nodelay
3135 session         required        pam_smbpass.so nodelay
3136 password        required        pam_smbpass.so nodelay</PRE
3137 ></TD
3138 ></TR
3139 ></TABLE
3140 ></P
3141 ><P
3142 >The following is the PAM configuration file for a particular 
3143 Linux system. The default condition uses <TT
3144 CLASS="FILENAME"
3145 >pam_pwdb.so</TT
3146 >.</P
3147 ><P
3148 ><TABLE
3149 BORDER="0"
3150 BGCOLOR="#E0E0E0"
3151 WIDTH="100%"
3152 ><TR
3153 ><TD
3154 ><PRE
3155 CLASS="PROGRAMLISTING"
3156 >#%PAM-1.0
3157 # The PAM configuration file for the `samba' service
3158 #
3159 auth       required     /lib/security/pam_pwdb.so nullok nodelay shadow audit
3160 account    required     /lib/security/pam_pwdb.so audit nodelay
3161 session    required     /lib/security/pam_pwdb.so nodelay
3162 password   required     /lib/security/pam_pwdb.so shadow md5</PRE
3163 ></TD
3164 ></TR
3165 ></TABLE
3166 ></P
3167 ><P
3168 >In the following example the decision has been made to use the 
3169 smbpasswd database even for basic samba authentication. Such a 
3170 decision could also be made for the passwd program and would 
3171 thus allow the smbpasswd passwords to be changed using the passwd 
3172 program.</P
3173 ><P
3174 ><TABLE
3175 BORDER="0"
3176 BGCOLOR="#E0E0E0"
3177 WIDTH="100%"
3178 ><TR
3179 ><TD
3180 ><PRE
3181 CLASS="PROGRAMLISTING"
3182 >#%PAM-1.0
3183 # The PAM configuration file for the `samba' service
3184 #
3185 auth       required     /lib/security/pam_smbpass.so nodelay
3186 account    required     /lib/security/pam_pwdb.so audit nodelay
3187 session    required     /lib/security/pam_pwdb.so nodelay
3188 password   required     /lib/security/pam_smbpass.so nodelay smbconf=/etc/samba.d/smb.conf</PRE
3189 ></TD
3190 ></TR
3191 ></TABLE
3192 ></P
3193 ><P
3194 >Note: PAM allows stacking of authentication mechanisms. It is 
3195 also possible to pass information obtained within on PAM module through 
3196 to the next module in the PAM stack. Please refer to the documentation for 
3197 your particular system implementation for details regarding the specific 
3198 capabilities of PAM in this environment. Some Linux implmentations also 
3199 provide the <TT
3200 CLASS="FILENAME"
3201 >pam_stack.so</TT
3202 > module that allows all 
3203 authentication to be configured in a single central file. The 
3204 <TT
3205 CLASS="FILENAME"
3206 >pam_stack.so</TT
3207 > method has some very devoted followers 
3208 on the basis that it allows for easier administration. As with all issues in 
3209 life though, every decision makes trade-offs, so you may want examine the 
3210 PAM documentation for further helpful information.</P
3211 ></DIV
3212 ><DIV
3213 CLASS="SECT1"
3214 ><HR><H1
3215 CLASS="SECT1"
3216 ><A
3217 NAME="AEN499"
3218 >3.2. Distributed Authentication</A
3219 ></H1
3220 ><P
3221 >The astute administrator will realize from this that the 
3222 combination of <TT
3223 CLASS="FILENAME"
3224 >pam_smbpass.so</TT
3225 >, 
3226 <B
3227 CLASS="COMMAND"
3228 >winbindd</B
3229 >, and <B
3230 CLASS="COMMAND"
3231 >rsync</B
3232 > (see
3233 <A
3234 HREF="http://rsync.samba.org/"
3235 TARGET="_top"
3236 >http://rsync.samba.org/</A
3237 >)
3238 will allow the establishment of a centrally managed, distributed 
3239 user/password database that can also be used by all 
3240 PAM (eg: Linux) aware programs and applications. This arrangement 
3241 can have particularly potent advantages compared with the 
3242 use of Microsoft Active Directory Service (ADS) in so far as 
3243 reduction of wide area network authentication traffic.</P
3244 ></DIV
3245 ><DIV
3246 CLASS="SECT1"
3247 ><HR><H1
3248 CLASS="SECT1"
3249 ><A
3250 NAME="AEN506"
3251 >3.3. PAM Configuration in smb.conf</A
3252 ></H1
3253 ><P
3254 >There is an option in smb.conf called <A
3255 HREF="smb.conf.5.html#OBEYPAMRESTRICTIONS"
3256 TARGET="_top"
3257 >obey pam restrictions</A
3258 >. 
3259 The following is from the on-line help for this option in SWAT;</P
3260 ><P
3261 >When Samba 2.2 is configure to enable PAM support (i.e. 
3262 <TT
3263 CLASS="CONSTANT"
3264 >--with-pam</TT
3265 >), this parameter will 
3266 control whether or not Samba should obey PAM's account 
3267 and session management directives. The default behavior 
3268 is to use PAM for clear text authentication only and to 
3269 ignore any account or session management. Note that Samba always 
3270 ignores PAM for authentication in the case of 
3271 <A
3272 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
3273 TARGET="_top"
3274 >encrypt passwords = yes</A
3275 >. 
3276 The reason is that PAM modules cannot support the challenge/response 
3277 authentication mechanism needed in the presence of SMB 
3278 password encryption. </P
3279 ><P
3280 >Default: <B
3281 CLASS="COMMAND"
3282 >obey pam restrictions = no</B
3283 ></P
3284 ></DIV
3285 ></DIV
3286 ><DIV
3287 CLASS="CHAPTER"
3288 ><HR><H1
3289 ><A
3290 NAME="MSDFS"
3291 >Chapter 4. Hosting a Microsoft Distributed File System tree on Samba</A
3292 ></H1
3293 ><DIV
3294 CLASS="SECT1"
3295 ><H1
3296 CLASS="SECT1"
3297 ><A
3298 NAME="AEN526"
3299 >4.1. Instructions</A
3300 ></H1
3301 ><P
3302 >The Distributed File System (or Dfs) provides a means of 
3303         separating the logical view of files and directories that users 
3304         see from the actual physical locations of these resources on the 
3305         network. It allows for higher availability, smoother storage expansion, 
3306         load balancing etc. For more information about Dfs, refer to  <A
3307 HREF="http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp"
3308 TARGET="_top"
3309 >       Microsoft documentation</A
3310 >. </P
3311 ><P
3312 >This document explains how to host a Dfs tree on a Unix 
3313         machine (for Dfs-aware clients to browse) using Samba.</P
3314 ><P
3315 >To enable SMB-based DFS for Samba, configure it with the 
3316         <TT
3317 CLASS="PARAMETER"
3318 ><I
3319 >--with-msdfs</I
3320 ></TT
3321 > option. Once built, a 
3322         Samba server can be made a Dfs server by setting the global 
3323         boolean <A
3324 HREF="smb.conf.5.html#HOSTMSDFS"
3325 TARGET="_top"
3326 ><TT
3327 CLASS="PARAMETER"
3328 ><I
3329 >       host msdfs</I
3330 ></TT
3331 ></A
3332 > parameter in the <TT
3333 CLASS="FILENAME"
3334 >smb.conf
3335         </TT
3336 > file. You designate a share as a Dfs root using the share 
3337         level boolean <A
3338 HREF="smb.conf.5.html#MSDFSROOT"
3339 TARGET="_top"
3340 ><TT
3341 CLASS="PARAMETER"
3342 ><I
3343 >       msdfs root</I
3344 ></TT
3345 ></A
3346 > parameter. A Dfs root directory on 
3347         Samba hosts Dfs links in the form of symbolic links that point 
3348         to other servers. For example, a symbolic link
3349         <TT
3350 CLASS="FILENAME"
3351 >junction-&#62;msdfs:storage1\share1</TT
3352 > in 
3353         the share directory acts as the Dfs junction. When Dfs-aware 
3354         clients attempt to access the junction link, they are redirected 
3355         to the storage location (in this case, \\storage1\share1).</P
3356 ><P
3357 >Dfs trees on Samba work with all Dfs-aware clients ranging 
3358         from Windows 95 to 2000.</P
3359 ><P
3360 >Here's an example of setting up a Dfs tree on a Samba 
3361         server.</P
3362 ><P
3363 ><TABLE
3364 BORDER="0"
3365 BGCOLOR="#E0E0E0"
3366 WIDTH="100%"
3367 ><TR
3368 ><TD
3369 ><PRE
3370 CLASS="PROGRAMLISTING"
3371 ># The smb.conf file:
3372 [global]
3373         netbios name = SAMBA
3374         host msdfs   = yes
3375
3376 [dfs]
3377         path = /export/dfsroot
3378         msdfs root = yes
3379         </PRE
3380 ></TD
3381 ></TR
3382 ></TABLE
3383 ></P
3384 ><P
3385 >In the /export/dfsroot directory we set up our dfs links to 
3386         other servers on the network.</P
3387 ><P
3388 ><TT
3389 CLASS="PROMPT"
3390 >root# </TT
3391 ><TT
3392 CLASS="USERINPUT"
3393 ><B
3394 >cd /export/dfsroot</B
3395 ></TT
3396 ></P
3397 ><P
3398 ><TT
3399 CLASS="PROMPT"
3400 >root# </TT
3401 ><TT
3402 CLASS="USERINPUT"
3403 ><B
3404 >chown root /export/dfsroot</B
3405 ></TT
3406 ></P
3407 ><P
3408 ><TT
3409 CLASS="PROMPT"
3410 >root# </TT
3411 ><TT
3412 CLASS="USERINPUT"
3413 ><B
3414 >chmod 755 /export/dfsroot</B
3415 ></TT
3416 ></P
3417 ><P
3418 ><TT
3419 CLASS="PROMPT"
3420 >root# </TT
3421 ><TT
3422 CLASS="USERINPUT"
3423 ><B
3424 >ln -s msdfs:storageA\\shareA linka</B
3425 ></TT
3426 ></P
3427 ><P
3428 ><TT
3429 CLASS="PROMPT"
3430 >root# </TT
3431 ><TT
3432 CLASS="USERINPUT"
3433 ><B
3434 >ln -s msdfs:serverB\\share,serverC\\share linkb</B
3435 ></TT
3436 ></P
3437 ><P
3438 >You should set up the permissions and ownership of 
3439         the directory acting as the Dfs root such that only designated 
3440         users can create, delete or modify the msdfs links. Also note 
3441         that symlink names should be all lowercase. This limitation exists 
3442         to have Samba avoid trying all the case combinations to get at 
3443         the link name. Finally set up the symbolic links to point to the 
3444         network shares you want, and start Samba.</P
3445 ><P
3446 >Users on Dfs-aware clients can now browse the Dfs tree 
3447         on the Samba server at \\samba\dfs. Accessing 
3448         links linka or linkb (which appear as directories to the client) 
3449         takes users directly to the appropriate shares on the network.</P
3450 ><DIV
3451 CLASS="SECT2"
3452 ><HR><H2
3453 CLASS="SECT2"
3454 ><A
3455 NAME="AEN561"
3456 >4.1.1. Notes</A
3457 ></H2
3458 ><P
3459 ></P
3460 ><UL
3461 ><LI
3462 ><P
3463 >Windows clients need to be rebooted 
3464                         if a previously mounted non-dfs share is made a dfs 
3465                         root or vice versa. A better way is to introduce a 
3466                         new share and make it the dfs root.</P
3467 ></LI
3468 ><LI
3469 ><P
3470 >Currently there's a restriction that msdfs 
3471                         symlink names should all be lowercase.</P
3472 ></LI
3473 ><LI
3474 ><P
3475 >For security purposes, the directory 
3476                         acting as the root of the Dfs tree should have ownership 
3477                         and permissions set so that only designated users can 
3478                         modify the symbolic links in the directory.</P
3479 ></LI
3480 ></UL
3481 ></DIV
3482 ></DIV
3483 ></DIV
3484 ><DIV
3485 CLASS="CHAPTER"
3486 ><HR><H1
3487 ><A
3488 NAME="UNIX-PERMISSIONS"
3489 >Chapter 5. UNIX Permission Bits and Windows NT Access Control Lists</A
3490 ></H1
3491 ><DIV
3492 CLASS="SECT1"
3493 ><H1
3494 CLASS="SECT1"
3495 ><A
3496 NAME="AEN581"
3497 >5.1. Viewing and changing UNIX permissions using the NT 
3498         security dialogs</A
3499 ></H1
3500 ><P
3501 >New in the Samba 2.0.4 release is the ability for Windows 
3502         NT clients to use their native security settings dialog box to 
3503         view and modify the underlying UNIX permissions.</P
3504 ><P
3505 >Note that this ability is careful not to compromise 
3506         the security of the UNIX host Samba is running on, and 
3507         still obeys all the file permission rules that a Samba 
3508         administrator can set.</P
3509 ><P
3510 >In Samba 2.0.4 and above the default value of the 
3511         parameter <A
3512 HREF="smb.conf.5.html#NTACLSUPPORT"
3513 TARGET="_top"
3514 ><TT
3515 CLASS="PARAMETER"
3516 ><I
3517 >       nt acl support</I
3518 ></TT
3519 ></A
3520 > has been changed from 
3521         <TT
3522 CLASS="CONSTANT"
3523 >false</TT
3524 > to <TT
3525 CLASS="CONSTANT"
3526 >true</TT
3527 >, so 
3528         manipulation of permissions is turned on by default.</P
3529 ></DIV
3530 ><DIV
3531 CLASS="SECT1"
3532 ><HR><H1
3533 CLASS="SECT1"
3534 ><A
3535 NAME="AEN590"
3536 >5.2. How to view file security on a Samba share</A
3537 ></H1
3538 ><P
3539 >From an NT 4.0 client, single-click with the right 
3540         mouse button on any file or directory in a Samba mounted 
3541         drive letter or UNC path. When the menu pops-up, click 
3542         on the <EM
3543 >Properties</EM
3544 > entry at the bottom of 
3545         the menu. This brings up the normal file properties dialog
3546         box, but with Samba 2.0.4 this will have a new tab along the top
3547         marked <EM
3548 >Security</EM
3549 >. Click on this tab and you 
3550         will see three buttons, <EM
3551 >Permissions</EM
3552 >,      
3553         <EM
3554 >Auditing</EM
3555 >, and <EM
3556 >Ownership</EM
3557 >. 
3558         The <EM
3559 >Auditing</EM
3560 > button will cause either 
3561         an error message <SPAN
3562 CLASS="ERRORNAME"
3563 >A requested privilege is not held 
3564         by the client</SPAN
3565 > to appear if the user is not the 
3566         NT Administrator, or a dialog which is intended to allow an 
3567         Administrator to add auditing requirements to a file if the 
3568         user is logged on as the NT Administrator. This dialog is 
3569         non-functional with a Samba share at this time, as the only 
3570         useful button, the <B
3571 CLASS="COMMAND"
3572 >Add</B
3573 > button will not currently 
3574         allow a list of users to be seen.</P
3575 ></DIV
3576 ><DIV
3577 CLASS="SECT1"
3578 ><HR><H1
3579 CLASS="SECT1"
3580 ><A
3581 NAME="AEN601"
3582 >5.3. Viewing file ownership</A
3583 ></H1
3584 ><P
3585 >Clicking on the <B
3586 CLASS="COMMAND"
3587 >"Ownership"</B
3588 > button 
3589         brings up a dialog box telling you who owns the given file. The 
3590         owner name will be of the form :</P
3591 ><P
3592 ><B
3593 CLASS="COMMAND"
3594 >"SERVER\user (Long name)"</B
3595 ></P
3596 ><P
3597 >Where <TT
3598 CLASS="REPLACEABLE"
3599 ><I
3600 >SERVER</I
3601 ></TT
3602 > is the NetBIOS name of 
3603         the Samba server, <TT
3604 CLASS="REPLACEABLE"
3605 ><I
3606 >user</I
3607 ></TT
3608 > is the user name of 
3609         the UNIX user who owns the file, and <TT
3610 CLASS="REPLACEABLE"
3611 ><I
3612 >(Long name)</I
3613 ></TT
3614 >
3615         is the descriptive string identifying the user (normally found in the
3616         GECOS field of the UNIX password database). Click on the <B
3617 CLASS="COMMAND"
3618 >Close
3619         </B
3620 > button to remove this dialog.</P
3621 ><P
3622 >If the parameter <TT
3623 CLASS="PARAMETER"
3624 ><I
3625 >nt acl support</I
3626 ></TT
3627 >
3628         is set to <TT
3629 CLASS="CONSTANT"
3630 >false</TT
3631 > then the file owner will 
3632         be shown as the NT user <B
3633 CLASS="COMMAND"
3634 >"Everyone"</B
3635 >.</P
3636 ><P
3637 >The <B
3638 CLASS="COMMAND"
3639 >Take Ownership</B
3640 > button will not allow 
3641         you to change the ownership of this file to yourself (clicking on 
3642         it will display a dialog box complaining that the user you are 
3643         currently logged onto the NT client cannot be found). The reason 
3644         for this is that changing the ownership of a file is a privileged 
3645         operation in UNIX, available only to the <EM
3646 >root</EM
3647
3648         user. As clicking on this button causes NT to attempt to change 
3649         the ownership of a file to the current user logged into the NT 
3650         client this will not work with Samba at this time.</P
3651 ><P
3652 >There is an NT chown command that will work with Samba 
3653         and allow a user with Administrator privilege connected 
3654         to a Samba 2.0.4 server as root to change the ownership of 
3655         files on both a local NTFS filesystem or remote mounted NTFS 
3656         or Samba drive. This is available as part of the <EM
3657 >Seclib
3658         </EM
3659 > NT security library written by Jeremy Allison of 
3660         the Samba Team, available from the main Samba ftp site.</P
3661 ></DIV
3662 ><DIV
3663 CLASS="SECT1"
3664 ><HR><H1
3665 CLASS="SECT1"
3666 ><A
3667 NAME="AEN621"
3668 >5.4. Viewing file or directory permissions</A
3669 ></H1
3670 ><P
3671 >The third button is the <B
3672 CLASS="COMMAND"
3673 >"Permissions"</B
3674
3675         button. Clicking on this brings up a dialog box that shows both 
3676         the permissions and the UNIX owner of the file or directory. 
3677         The owner is displayed in the form :</P
3678 ><P
3679 ><B
3680 CLASS="COMMAND"
3681 >"SERVER\user (Long name)"</B
3682 ></P
3683 ><P
3684 >Where <TT
3685 CLASS="REPLACEABLE"
3686 ><I
3687 >SERVER</I
3688 ></TT
3689 > is the NetBIOS name of 
3690         the Samba server, <TT
3691 CLASS="REPLACEABLE"
3692 ><I
3693 >user</I
3694 ></TT
3695 > is the user name of 
3696         the UNIX user who owns the file, and <TT
3697 CLASS="REPLACEABLE"
3698 ><I
3699 >(Long name)</I
3700 ></TT
3701 >
3702         is the descriptive string identifying the user (normally found in the
3703         GECOS field of the UNIX password database).</P
3704 ><P
3705 >If the parameter <TT
3706 CLASS="PARAMETER"
3707 ><I
3708 >nt acl support</I
3709 ></TT
3710 >
3711         is set to <TT
3712 CLASS="CONSTANT"
3713 >false</TT
3714 > then the file owner will 
3715         be shown as the NT user <B
3716 CLASS="COMMAND"
3717 >"Everyone"</B
3718 > and the 
3719         permissions will be shown as NT "Full Control".</P
3720 ><P
3721 >The permissions field is displayed differently for files 
3722         and directories, so I'll describe the way file permissions 
3723         are displayed first.</P
3724 ><DIV
3725 CLASS="SECT2"
3726 ><HR><H2
3727 CLASS="SECT2"
3728 ><A
3729 NAME="AEN636"
3730 >5.4.1. File Permissions</A
3731 ></H2
3732 ><P
3733 >The standard UNIX user/group/world triple and 
3734                 the corresponding "read", "write", "execute" permissions 
3735                 triples are mapped by Samba into a three element NT ACL 
3736                 with the 'r', 'w', and 'x' bits mapped into the corresponding 
3737                 NT permissions. The UNIX world permissions are mapped into 
3738                 the global NT group <B
3739 CLASS="COMMAND"
3740 >Everyone</B
3741 >, followed 
3742                 by the list of permissions allowed for UNIX world. The UNIX 
3743                 owner and group permissions are displayed as an NT 
3744                 <B
3745 CLASS="COMMAND"
3746 >user</B
3747 > icon and an NT <B
3748 CLASS="COMMAND"
3749 >local 
3750                 group</B
3751 > icon respectively followed by the list 
3752                 of permissions allowed for the UNIX user and group.</P
3753 ><P
3754 >As many UNIX permission sets don't map into common 
3755                 NT names such as <B
3756 CLASS="COMMAND"
3757 >"read"</B
3758 >, <B
3759 CLASS="COMMAND"
3760 >               "change"</B
3761 > or <B
3762 CLASS="COMMAND"
3763 >"full control"</B
3764 > then 
3765                 usually the permissions will be prefixed by the words <B
3766 CLASS="COMMAND"
3767 >               "Special Access"</B
3768 > in the NT display list.</P
3769 ><P
3770 >But what happens if the file has no permissions allowed 
3771                 for a particular UNIX user group or world component ? In order 
3772                 to  allow "no permissions" to be seen and modified then Samba 
3773                 overloads the NT <B
3774 CLASS="COMMAND"
3775 >"Take Ownership"</B
3776 > ACL attribute 
3777                 (which has no meaning in UNIX) and reports a component with 
3778                 no permissions as having the NT <B
3779 CLASS="COMMAND"
3780 >"O"</B
3781 > bit set. 
3782                 This was chosen of course to make it look like a zero, meaning 
3783                 zero permissions. More details on the decision behind this will 
3784                 be given below.</P
3785 ></DIV
3786 ><DIV
3787 CLASS="SECT2"
3788 ><HR><H2
3789 CLASS="SECT2"
3790 ><A
3791 NAME="AEN650"
3792 >5.4.2. Directory Permissions</A
3793 ></H2
3794 ><P
3795 >Directories on an NT NTFS file system have two 
3796                 different sets of permissions. The first set of permissions 
3797                 is the ACL set on the directory itself, this is usually displayed 
3798                 in the first set of parentheses in the normal <B
3799 CLASS="COMMAND"
3800 >"RW"</B
3801
3802                 NT style. This first set of permissions is created by Samba in 
3803                 exactly the same way as normal file permissions are, described 
3804                 above, and is displayed in the same way.</P
3805 ><P
3806 >The second set of directory permissions has no real meaning 
3807                 in the UNIX permissions world and represents the <B
3808 CLASS="COMMAND"
3809 >               "inherited"</B
3810 > permissions that any file created within 
3811                 this directory would inherit.</P
3812 ><P
3813 >Samba synthesises these inherited permissions for NT by 
3814                 returning as an NT ACL the UNIX permission mode that a new file 
3815                 created by Samba on this share would receive.</P
3816 ></DIV
3817 ></DIV
3818 ><DIV
3819 CLASS="SECT1"
3820 ><HR><H1
3821 CLASS="SECT1"
3822 ><A
3823 NAME="AEN657"
3824 >5.5. Modifying file or directory permissions</A
3825 ></H1
3826 ><P
3827 >Modifying file and directory permissions is as simple 
3828         as changing the displayed permissions in the dialog box, and 
3829         clicking the <B
3830 CLASS="COMMAND"
3831 >OK</B
3832 > button. However, there are 
3833         limitations that a user needs to be aware of, and also interactions 
3834         with the standard Samba permission masks and mapping of DOS 
3835         attributes that need to also be taken into account.</P
3836 ><P
3837 >If the parameter <TT
3838 CLASS="PARAMETER"
3839 ><I
3840 >nt acl support</I
3841 ></TT
3842 >
3843         is set to <TT
3844 CLASS="CONSTANT"
3845 >false</TT
3846 > then any attempt to set 
3847         security permissions will fail with an <B
3848 CLASS="COMMAND"
3849 >"Access Denied"
3850         </B
3851 > message.</P
3852 ><P
3853 >The first thing to note is that the <B
3854 CLASS="COMMAND"
3855 >"Add"</B
3856
3857         button will not return a list of users in Samba 2.0.4 (it will give 
3858         an error message of <B
3859 CLASS="COMMAND"
3860 >"The remote procedure call failed 
3861         and did not execute"</B
3862 >). This means that you can only 
3863         manipulate the current user/group/world permissions listed in 
3864         the dialog box. This actually works quite well as these are the 
3865         only permissions that UNIX actually has.</P
3866 ><P
3867 >If a permission triple (either user, group, or world) 
3868         is removed from the list of permissions in the NT dialog box, 
3869         then when the <B
3870 CLASS="COMMAND"
3871 >"OK"</B
3872 > button is pressed it will 
3873         be applied as "no permissions" on the UNIX side. If you then 
3874         view the permissions again the "no permissions" entry will appear 
3875         as the NT <B
3876 CLASS="COMMAND"
3877 >"O"</B
3878 > flag, as described above. This 
3879         allows you to add permissions back to a file or directory once 
3880         you have removed them from a triple component.</P
3881 ><P
3882 >As UNIX supports only the "r", "w" and "x" bits of 
3883         an NT ACL then if other NT security attributes such as "Delete 
3884         access" are selected then they will be ignored when applied on 
3885         the Samba server.</P
3886 ><P
3887 >When setting permissions on a directory the second 
3888         set of permissions (in the second set of parentheses) is 
3889         by default applied to all files within that directory. If this 
3890         is not what you want you must uncheck the <B
3891 CLASS="COMMAND"
3892 >"Replace 
3893         permissions on existing files"</B
3894 > checkbox in the NT 
3895         dialog before clicking <B
3896 CLASS="COMMAND"
3897 >"OK"</B
3898 >.</P
3899 ><P
3900 >If you wish to remove all permissions from a 
3901         user/group/world  component then you may either highlight the 
3902         component and click the <B
3903 CLASS="COMMAND"
3904 >"Remove"</B
3905 > button, 
3906         or set the component to only have the special <B
3907 CLASS="COMMAND"
3908 >"Take
3909         Ownership"</B
3910 > permission (displayed as <B
3911 CLASS="COMMAND"
3912 >"O"
3913         </B
3914 >) highlighted.</P
3915 ></DIV
3916 ><DIV
3917 CLASS="SECT1"
3918 ><HR><H1
3919 CLASS="SECT1"
3920 ><A
3921 NAME="AEN679"
3922 >5.6. Interaction with the standard Samba create mask 
3923         parameters</A
3924 ></H1
3925 ><P
3926 >Note that with Samba 2.0.5 there are four new parameters 
3927         to control this interaction.  These are :</P
3928 ><P
3929 ><TT
3930 CLASS="PARAMETER"
3931 ><I
3932 >security mask</I
3933 ></TT
3934 ></P
3935 ><P
3936 ><TT
3937 CLASS="PARAMETER"
3938 ><I
3939 >force security mode</I
3940 ></TT
3941 ></P
3942 ><P
3943 ><TT
3944 CLASS="PARAMETER"
3945 ><I
3946 >directory security mask</I
3947 ></TT
3948 ></P
3949 ><P
3950 ><TT
3951 CLASS="PARAMETER"
3952 ><I
3953 >force directory security mode</I
3954 ></TT
3955 ></P
3956 ><P
3957 >Once a user clicks <B
3958 CLASS="COMMAND"
3959 >"OK"</B
3960 > to apply the 
3961         permissions Samba maps the given permissions into a user/group/world 
3962         r/w/x triple set, and then will check the changed permissions for a 
3963         file against the bits set in the <A
3964 HREF="smb.conf.5.html#SECURITYMASK"
3965 TARGET="_top"
3966
3967         <TT
3968 CLASS="PARAMETER"
3969 ><I
3970 >security mask</I
3971 ></TT
3972 ></A
3973 > parameter. Any bits that 
3974         were changed that are not set to '1' in this parameter are left alone 
3975         in the file permissions.</P
3976 ><P
3977 >Essentially, zero bits in the <TT
3978 CLASS="PARAMETER"
3979 ><I
3980 >security mask</I
3981 ></TT
3982 >
3983         mask may be treated as a set of bits the user is <EM
3984 >not</EM
3985
3986         allowed to change, and one bits are those the user is allowed to change.
3987         </P
3988 ><P
3989 >If not set explicitly this parameter is set to the same value as 
3990         the <A
3991 HREF="smb.conf.5.html#CREATEMASK"
3992 TARGET="_top"
3993 ><TT
3994 CLASS="PARAMETER"
3995 ><I
3996 >create mask
3997         </I
3998 ></TT
3999 ></A
4000 > parameter to provide compatibility with Samba 2.0.4 
4001         where this permission change facility was introduced. To allow a user to 
4002         modify all the user/group/world permissions on a file, set this parameter 
4003         to 0777.</P
4004 ><P
4005 >Next Samba checks the changed permissions for a file against 
4006         the bits set in the <A
4007 HREF="smb.conf.5.html#FORCESECURITYMODE"
4008 TARGET="_top"
4009 >       <TT
4010 CLASS="PARAMETER"
4011 ><I
4012 >force security mode</I
4013 ></TT
4014 ></A
4015 > parameter. Any bits 
4016         that were changed that correspond to bits set to '1' in this parameter 
4017         are forced to be set.</P
4018 ><P
4019 >Essentially, bits set in the <TT
4020 CLASS="PARAMETER"
4021 ><I
4022 >force security mode
4023         </I
4024 ></TT
4025 > parameter may be treated as a set of bits that, when 
4026         modifying security on a file, the user has always set to be 'on'.</P
4027 ><P
4028 >If not set explicitly this parameter is set to the same value 
4029         as the <A
4030 HREF="smb.conf.5.html#FORCECREATEMODE"
4031 TARGET="_top"
4032 ><TT
4033 CLASS="PARAMETER"
4034 ><I
4035 >force 
4036         create mode</I
4037 ></TT
4038 ></A
4039 > parameter to provide compatibility
4040         with Samba 2.0.4 where the permission change facility was introduced.
4041         To allow a user to modify all the user/group/world permissions on a file
4042         with no restrictions set this parameter to 000.</P
4043 ><P
4044 >The <TT
4045 CLASS="PARAMETER"
4046 ><I
4047 >security mask</I
4048 ></TT
4049 > and <TT
4050 CLASS="PARAMETER"
4051 ><I
4052 >force 
4053         security mode</I
4054 ></TT
4055 > parameters are applied to the change 
4056         request in that order.</P
4057 ><P
4058 >For a directory Samba will perform the same operations as 
4059         described above for a file except using the parameter <TT
4060 CLASS="PARAMETER"
4061 ><I
4062 >       directory security mask</I
4063 ></TT
4064 > instead of <TT
4065 CLASS="PARAMETER"
4066 ><I
4067 >security 
4068         mask</I
4069 ></TT
4070 >, and <TT
4071 CLASS="PARAMETER"
4072 ><I
4073 >force directory security mode
4074         </I
4075 ></TT
4076 > parameter instead of <TT
4077 CLASS="PARAMETER"
4078 ><I
4079 >force security mode
4080         </I
4081 ></TT
4082 >.</P
4083 ><P
4084 >The <TT
4085 CLASS="PARAMETER"
4086 ><I
4087 >directory security mask</I
4088 ></TT
4089 > parameter 
4090         by default is set to the same value as the <TT
4091 CLASS="PARAMETER"
4092 ><I
4093 >directory mask
4094         </I
4095 ></TT
4096 > parameter and the <TT
4097 CLASS="PARAMETER"
4098 ><I
4099 >force directory security 
4100         mode</I
4101 ></TT
4102 > parameter by default is set to the same value as 
4103         the <TT
4104 CLASS="PARAMETER"
4105 ><I
4106 >force directory mode</I
4107 ></TT
4108 > parameter to provide 
4109         compatibility with Samba 2.0.4 where the permission change facility 
4110         was introduced.</P
4111 ><P
4112 >In this way Samba enforces the permission restrictions that 
4113         an administrator can set on a Samba share, whilst still allowing users 
4114         to modify the permission bits within that restriction.</P
4115 ><P
4116 >If you want to set up a share that allows users full control
4117         in modifying the permission bits on their files and directories and
4118         doesn't force any particular bits to be set 'on', then set the following
4119         parameters in the <A
4120 HREF="smb.conf.5.html"
4121 TARGET="_top"
4122 ><TT
4123 CLASS="FILENAME"
4124 >smb.conf(5)
4125         </TT
4126 ></A
4127 > file in that share specific section :</P
4128 ><P
4129 ><TT
4130 CLASS="PARAMETER"
4131 ><I
4132 >security mask = 0777</I
4133 ></TT
4134 ></P
4135 ><P
4136 ><TT
4137 CLASS="PARAMETER"
4138 ><I
4139 >force security mode = 0</I
4140 ></TT
4141 ></P
4142 ><P
4143 ><TT
4144 CLASS="PARAMETER"
4145 ><I
4146 >directory security mask = 0777</I
4147 ></TT
4148 ></P
4149 ><P
4150 ><TT
4151 CLASS="PARAMETER"
4152 ><I
4153 >force directory security mode = 0</I
4154 ></TT
4155 ></P
4156 ><P
4157 >As described, in Samba 2.0.4 the parameters :</P
4158 ><P
4159 ><TT
4160 CLASS="PARAMETER"
4161 ><I
4162 >create mask</I
4163 ></TT
4164 ></P
4165 ><P
4166 ><TT
4167 CLASS="PARAMETER"
4168 ><I
4169 >force create mode</I
4170 ></TT
4171 ></P
4172 ><P
4173 ><TT
4174 CLASS="PARAMETER"
4175 ><I
4176 >directory mask</I
4177 ></TT
4178 ></P
4179 ><P
4180 ><TT
4181 CLASS="PARAMETER"
4182 ><I
4183 >force directory mode</I
4184 ></TT
4185 ></P
4186 ><P
4187 >were used instead of the parameters discussed here.</P
4188 ></DIV
4189 ><DIV
4190 CLASS="SECT1"
4191 ><HR><H1
4192 CLASS="SECT1"
4193 ><A
4194 NAME="AEN743"
4195 >5.7. Interaction with the standard Samba file attribute 
4196         mapping</A
4197 ></H1
4198 ><P
4199 >Samba maps some of the DOS attribute bits (such as "read 
4200         only") into the UNIX permissions of a file. This means there can 
4201         be a conflict between the permission bits set via the security 
4202         dialog and the permission bits set by the file attribute mapping.
4203         </P
4204 ><P
4205 >One way this can show up is if a file has no UNIX read access
4206         for the owner it will show up as "read only" in the standard 
4207         file attributes tabbed dialog. Unfortunately this dialog is
4208         the same one that contains the security info in another tab.</P
4209 ><P
4210 >What this can mean is that if the owner changes the permissions
4211         to allow themselves read access using the security dialog, clicks
4212         <B
4213 CLASS="COMMAND"
4214 >"OK"</B
4215 > to get back to the standard attributes tab 
4216         dialog, and then clicks <B
4217 CLASS="COMMAND"
4218 >"OK"</B
4219 > on that dialog, then 
4220         NT will set the file permissions back to read-only (as that is what 
4221         the attributes still say in the dialog). This means that after setting 
4222         permissions and clicking <B
4223 CLASS="COMMAND"
4224 >"OK"</B
4225 > to get back to the 
4226         attributes dialog you should always hit <B
4227 CLASS="COMMAND"
4228 >"Cancel"</B
4229
4230         rather than <B
4231 CLASS="COMMAND"
4232 >"OK"</B
4233 > to ensure that your changes 
4234         are not overridden.</P
4235 ></DIV
4236 ></DIV
4237 ><DIV
4238 CLASS="CHAPTER"
4239 ><HR><H1
4240 ><A
4241 NAME="PRINTING"
4242 >Chapter 6. Printing Support in Samba 2.2.x</A
4243 ></H1
4244 ><DIV
4245 CLASS="SECT1"
4246 ><H1
4247 CLASS="SECT1"
4248 ><A
4249 NAME="AEN764"
4250 >6.1. Introduction</A
4251 ></H1
4252 ><P
4253 >Beginning with the 2.2.0 release, Samba supports 
4254 the native Windows NT printing mechanisms implemented via 
4255 MS-RPC (i.e. the SPOOLSS named pipe).  Previous versions of 
4256 Samba only supported LanMan printing calls.</P
4257 ><P
4258 >The additional functionality provided by the new 
4259 SPOOLSS support includes:</P
4260 ><P
4261 ></P
4262 ><UL
4263 ><LI
4264 ><P
4265 >Support for downloading printer driver 
4266         files to Windows 95/98/NT/2000 clients upon demand.
4267         </P
4268 ></LI
4269 ><LI
4270 ><P
4271 >Uploading of printer drivers via the 
4272         Windows NT Add Printer Wizard (APW) or the 
4273         Imprints tool set (refer to <A
4274 HREF="http://imprints.sourceforge.net"
4275 TARGET="_top"
4276 >http://imprints.sourceforge.net</A
4277 >). 
4278         </P
4279 ></LI
4280 ><LI
4281 ><P
4282 >Support for the native MS-RPC printing 
4283         calls such as StartDocPrinter, EnumJobs(), etc...  (See 
4284         the MSDN documentation at <A
4285 HREF="http://msdn.microsoft.com/"
4286 TARGET="_top"
4287 >http://msdn.microsoft.com/</A
4288
4289         for more information on the Win32 printing API)
4290         </P
4291 ></LI
4292 ><LI
4293 ><P
4294 >Support for NT Access Control Lists (ACL) 
4295         on printer objects</P
4296 ></LI
4297 ><LI
4298 ><P
4299 >Improved support for printer queue manipulation 
4300         through the use of an internal databases for spooled job 
4301         information</P
4302 ></LI
4303 ></UL
4304 ><P
4305 >There has been some initial confusion about what all this means
4306 and whether or not it is a requirement for printer drivers to be 
4307 installed on a Samba host in order to support printing from Windows 
4308 clients.  A bug existed in Samba 2.2.0 which made Windows NT/2000 clients 
4309 require that the Samba server possess a valid driver for the printer.  
4310 This is fixed in Samba 2.2.1 and once again, Windows NT/2000 clients
4311 can use the local APW for installing drivers to be used with a Samba 
4312 served printer.  This is the same behavior exhibited by Windows 9x clients.
4313 As a side note, Samba does not use these drivers in any way to process 
4314 spooled files.  They are utilized entirely by the clients.</P
4315 ><P
4316 >The following MS KB article, may be of some help if you are dealing with
4317 Windows 2000 clients:  <EM
4318 >How to Add Printers with No User 
4319 Interaction in Windows 2000</EM
4320 ></P
4321 ><P
4322 ><A
4323 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
4324 TARGET="_top"
4325 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
4326 ></P
4327 ></DIV
4328 ><DIV
4329 CLASS="SECT1"
4330 ><HR><H1
4331 CLASS="SECT1"
4332 ><A
4333 NAME="AEN786"
4334 >6.2. Configuration</A
4335 ></H1
4336 ><DIV
4337 CLASS="WARNING"
4338 ><P
4339 ></P
4340 ><TABLE
4341 CLASS="WARNING"
4342 BORDER="1"
4343 WIDTH="100%"
4344 ><TR
4345 ><TD
4346 ALIGN="CENTER"
4347 ><B
4348 >[print$] vs. [printer$]</B
4349 ></TD
4350 ></TR
4351 ><TR
4352 ><TD
4353 ALIGN="LEFT"
4354 ><P
4355 >Previous versions of Samba recommended using a share named [printer$].  
4356 This name was taken from the printer$ service created by Windows 9x 
4357 clients when a printer was shared.  Windows 9x printer servers always have 
4358 a printer$ service which provides read-only access via no 
4359 password in order to support printer driver downloads.</P
4360 ><P
4361 >However, the initial implementation allowed for a 
4362 parameter named <TT
4363 CLASS="PARAMETER"
4364 ><I
4365 >printer driver location</I
4366 ></TT
4367
4368 to be used on a per share basis to specify the location of 
4369 the driver files associated with that printer.  Another 
4370 parameter named <TT
4371 CLASS="PARAMETER"
4372 ><I
4373 >printer driver</I
4374 ></TT
4375 > provided 
4376 a means of defining the printer driver name to be sent to 
4377 the client.</P
4378 ><P
4379 >These parameters, including <TT
4380 CLASS="PARAMETER"
4381 ><I
4382 >printer driver
4383 file</I
4384 ></TT
4385 > parameter, are being depreciated and should not 
4386 be used in new installations.  For more information on this change, 
4387 you should refer to the <A
4388 HREF="#MIGRATION"
4389 >Migration section</A
4390 >
4391 of this document.</P
4392 ></TD
4393 ></TR
4394 ></TABLE
4395 ></DIV
4396 ><DIV
4397 CLASS="SECT2"
4398 ><HR><H2
4399 CLASS="SECT2"
4400 ><A
4401 NAME="AEN797"
4402 >6.2.1. Creating [print$]</A
4403 ></H2
4404 ><P
4405 >In order to support the uploading of printer driver 
4406 files, you must first configure a file share named [print$].  
4407 The name of this share is hard coded in Samba's internals so 
4408 the name is very important (print$ is the service used by 
4409 Windows NT print servers to provide support for printer driver 
4410 download).</P
4411 ><P
4412 >You should modify the server's smb.conf file to add the global
4413 parameters and to create the 
4414 following file share (of course, some of the parameter values,
4415 such as 'path' are arbitrary and should be replaced with
4416 appropriate values for your site):</P
4417 ><P
4418 ><TABLE
4419 BORDER="0"
4420 BGCOLOR="#E0E0E0"
4421 WIDTH="100%"
4422 ><TR
4423 ><TD
4424 ><PRE
4425 CLASS="PROGRAMLISTING"
4426 >[global]
4427     ; members of the ntadmin group should be able
4428     ; to add drivers and set printer properties
4429     ; root is implicitly a 'printer admin'
4430     printer admin = @ntadmin
4431
4432 [print$]
4433     path = /usr/local/samba/printers
4434     guest ok = yes
4435     browseable = yes
4436     read only = yes
4437     ; since this share is configured as read only, then we need
4438     ; a 'write list'.  Check the file system permissions to make
4439     ; sure this account can copy files to the share.  If this
4440     ; is setup to a non-root account, then it should also exist
4441     ; as a 'printer admin'
4442     write list = @ntadmin,root</PRE
4443 ></TD
4444 ></TR
4445 ></TABLE
4446 ></P
4447 ><P
4448 >The <A
4449 HREF="smb.conf.5.html#WRITELIST"
4450 TARGET="_top"
4451 ><TT
4452 CLASS="PARAMETER"
4453 ><I
4454 >write list</I
4455 ></TT
4456 ></A
4457 > is used to allow administrative 
4458 level user accounts to have write access in order to update files 
4459 on the share.  See the <A
4460 HREF="smb.conf.5.html"
4461 TARGET="_top"
4462 >smb.conf(5) 
4463 man page</A
4464 > for more information on configuring file shares.</P
4465 ><P
4466 >The requirement for <A
4467 HREF="smb.conf.5.html#GUESTOK"
4468 TARGET="_top"
4469 ><B
4470 CLASS="COMMAND"
4471 >guest 
4472 ok = yes</B
4473 ></A
4474 > depends upon how your
4475 site is configured.  If users will be guaranteed to have 
4476 an account on the Samba host, then this is a non-issue.</P
4477 ><DIV
4478 CLASS="NOTE"
4479 ><BLOCKQUOTE
4480 CLASS="NOTE"
4481 ><P
4482 ><B
4483 >Author's Note: </B
4484 >The non-issue is that if all your Windows NT users are guaranteed to be 
4485 authenticated by the Samba server (such as a domain member server and the NT 
4486 user has already been validated by the Domain Controller in 
4487 order to logon to the Windows NT console), then guest access 
4488 is not necessary.  Of course, in a workgroup environment where 
4489 you just want to be able to print without worrying about 
4490 silly accounts and security, then configure the share for 
4491 guest access.  You'll probably want to add <A
4492 HREF="smb.conf.5.html#MAPTOGUEST"
4493 TARGET="_top"
4494 ><B
4495 CLASS="COMMAND"
4496 >map to guest = Bad User</B
4497 ></A
4498 > in the [global] section as well.  Make sure 
4499 you understand what this parameter does before using it 
4500 though. --jerry</P
4501 ></BLOCKQUOTE
4502 ></DIV
4503 ><P
4504 >In order for a Windows NT print server to support 
4505 the downloading of driver files by multiple client architectures,
4506 it must create subdirectories within the [print$] service
4507 which correspond to each of the supported client architectures.
4508 Samba follows this model as well.</P
4509 ><P
4510 >Next create the directory tree below the [print$] share 
4511 for each architecture you wish to support.</P
4512 ><P
4513 ><TABLE
4514 BORDER="0"
4515 BGCOLOR="#E0E0E0"
4516 WIDTH="100%"
4517 ><TR
4518 ><TD
4519 ><PRE
4520 CLASS="PROGRAMLISTING"
4521 >[print$]-----
4522         |-W32X86           ; "Windows NT x86"
4523         |-WIN40            ; "Windows 95/98"
4524         |-W32ALPHA         ; "Windows NT Alpha_AXP"
4525         |-W32MIPS          ; "Windows NT R4000"
4526         |-W32PPC           ; "Windows NT PowerPC"</PRE
4527 ></TD
4528 ></TR
4529 ></TABLE
4530 ></P
4531 ><DIV
4532 CLASS="WARNING"
4533 ><P
4534 ></P
4535 ><TABLE
4536 CLASS="WARNING"
4537 BORDER="1"
4538 WIDTH="100%"
4539 ><TR
4540 ><TD
4541 ALIGN="CENTER"
4542 ><B
4543 >ATTENTION!  REQUIRED PERMISSIONS</B
4544 ></TD
4545 ></TR
4546 ><TR
4547 ><TD
4548 ALIGN="LEFT"
4549 ><P
4550 >In order to currently add a new driver to you Samba host, 
4551 one of two conditions must hold true:</P
4552 ><P
4553 ></P
4554 ><UL
4555 ><LI
4556 ><P
4557 >The account used to connect to the Samba host 
4558         must have a uid of 0 (i.e. a root account)</P
4559 ></LI
4560 ><LI
4561 ><P
4562 >The account used to connect to the Samba host
4563         must be a member of the <A
4564 HREF="smb.conf.5.html#PRINTERADMIN"
4565 TARGET="_top"
4566 ><TT
4567 CLASS="PARAMETER"
4568 ><I
4569 >printer 
4570         admin</I
4571 ></TT
4572 ></A
4573 > list.</P
4574 ></LI
4575 ></UL
4576 ><P
4577 >Of course, the connected account must still possess access
4578 to add files to the subdirectories beneath [print$]. Remember
4579 that all file shares are set to 'read only' by default.</P
4580 ></TD
4581 ></TR
4582 ></TABLE
4583 ></DIV
4584 ><P
4585 >Once you have created the required [print$] service and 
4586 associated subdirectories, simply log onto the Samba server using 
4587 a root (or <TT
4588 CLASS="PARAMETER"
4589 ><I
4590 >printer admin</I
4591 ></TT
4592 >) account
4593 from a Windows NT 4.0 client.  Navigate to the "Printers" folder
4594 on the Samba server.  You should see an initial listing of printers
4595 that matches the printer shares defined on your Samba host.</P
4596 ></DIV
4597 ><DIV
4598 CLASS="SECT2"
4599 ><HR><H2
4600 CLASS="SECT2"
4601 ><A
4602 NAME="AEN832"
4603 >6.2.2. Setting Drivers for Existing Printers</A
4604 ></H2
4605 ><P
4606 >The initial listing of printers in the Samba host's 
4607 Printers folder will have no real printer driver assigned 
4608 to them.  By default, in Samba 2.2.0 this driver name was set to 
4609 <EM
4610 >NO PRINTER DRIVER AVAILABLE FOR THIS PRINTER</EM
4611 >.
4612 Later versions changed this to a NULL string to allow the use
4613 tof the local Add Printer Wizard on NT/2000 clients.
4614 Attempting to view the printer properties for a printer
4615 which has this default driver assigned will result in 
4616 the error message:</P
4617 ><P
4618 ><EM
4619 >Device settings cannot be displayed.  The driver 
4620 for the specified printer is not installed, only spooler 
4621 properties will be displayed.  Do you want to install the 
4622 driver now?</EM
4623 ></P
4624 ><P
4625 >Click "No" in the error dialog and you will be presented with
4626 the printer properties window.  The way assign a driver to a 
4627 printer is to either</P
4628 ><P
4629 ></P
4630 ><UL
4631 ><LI
4632 ><P
4633 >Use the "New Driver..." button to install 
4634         a new printer driver, or</P
4635 ></LI
4636 ><LI
4637 ><P
4638 >Select a driver from the popup list of 
4639         installed drivers.  Initially this list will be empty.</P
4640 ></LI
4641 ></UL
4642 ><P
4643 >If you wish to install printer drivers for client 
4644 operating systems other than "Windows NT x86", you will need 
4645 to use the "Sharing" tab of the printer properties dialog.</P
4646 ><P
4647 >Assuming you have connected with a root account, you 
4648 will also be able modify other printer properties such as 
4649 ACLs and device settings using this dialog box.</P
4650 ><P
4651 >A few closing comments for this section, it is possible 
4652 on a Windows NT print server to have printers
4653 listed in the Printers folder which are not shared.  Samba does
4654 not make this distinction.  By definition, the only printers of
4655 which Samba is aware are those which are specified as shares in
4656 <TT
4657 CLASS="FILENAME"
4658 >smb.conf</TT
4659 >.</P
4660 ><P
4661 >Another interesting side note is that Windows NT clients do
4662 not use the SMB printer share, but rather can print directly 
4663 to any printer on another Windows NT host using MS-RPC.  This
4664 of course assumes that the printing client has the necessary
4665 privileges on the remote host serving the printer.  The default
4666 permissions assigned by Windows NT to a printer gives the "Print"
4667 permissions to the "Everyone" well-known group.</P
4668 ></DIV
4669 ><DIV
4670 CLASS="SECT2"
4671 ><HR><H2
4672 CLASS="SECT2"
4673 ><A
4674 NAME="AEN849"
4675 >6.2.3. Support a large number of printers</A
4676 ></H2
4677 ><P
4678 >One issue that has arisen during the development
4679 phase of Samba 2.2 is the need to support driver downloads for
4680 100's of printers.  Using the Windows NT APW is somewhat 
4681 awkward to say the list.  If more than one printer are using the 
4682 same driver, the <A
4683 HREF="rpcclient.1.html"
4684 TARGET="_top"
4685 ><B
4686 CLASS="COMMAND"
4687 >rpcclient's
4688 setdriver command</B
4689 ></A
4690 > can be used to set the driver
4691 associated with an installed driver.  The following is example
4692 of how this could be accomplished:</P
4693 ><P
4694 ><TABLE
4695 BORDER="0"
4696 BGCOLOR="#E0E0E0"
4697 WIDTH="100%"
4698 ><TR
4699 ><TD
4700 ><PRE
4701 CLASS="PROGRAMLISTING"
4702
4703 <TT
4704 CLASS="PROMPT"
4705 >$ </TT
4706 >rpcclient pogo -U root%secret -c "enumdrivers"
4707 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4708  
4709 [Windows NT x86]
4710 Printer Driver Info 1:
4711      Driver Name: [HP LaserJet 4000 Series PS]
4712  
4713 Printer Driver Info 1:
4714      Driver Name: [HP LaserJet 2100 Series PS]
4715  
4716 Printer Driver Info 1:
4717      Driver Name: [HP LaserJet 4Si/4SiMX PS]
4718                                   
4719 <TT
4720 CLASS="PROMPT"
4721 >$ </TT
4722 >rpcclient pogo -U root%secret -c "enumprinters"
4723 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4724      flags:[0x800000]
4725      name:[\\POGO\hp-print]
4726      description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
4727      comment:[]
4728                                   
4729 <TT
4730 CLASS="PROMPT"
4731 >$ </TT
4732 >rpcclient pogo -U root%secret \
4733 <TT
4734 CLASS="PROMPT"
4735 >&#62; </TT
4736 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
4737 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4738 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
4739 ></TD
4740 ></TR
4741 ></TABLE
4742 ></P
4743 ></DIV
4744 ><DIV
4745 CLASS="SECT2"
4746 ><HR><H2
4747 CLASS="SECT2"
4748 ><A
4749 NAME="AEN860"
4750 >6.2.4. Adding New Printers via the Windows NT APW</A
4751 ></H2
4752 ><P
4753 >By default, Samba offers all printer shares defined in <TT
4754 CLASS="FILENAME"
4755 >smb.conf</TT
4756 >
4757 in the "Printers..." folder.  Also existing in this folder is the Windows NT 
4758 Add Printer Wizard icon.  The APW will be show only if</P
4759 ><P
4760 ></P
4761 ><UL
4762 ><LI
4763 ><P
4764 >The connected user is able to successfully
4765         execute an OpenPrinterEx(\\server) with administrative
4766         privileges (i.e. root or <TT
4767 CLASS="PARAMETER"
4768 ><I
4769 >printer admin</I
4770 ></TT
4771 >).
4772         </P
4773 ></LI
4774 ><LI
4775 ><P
4776 ><A
4777 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
4778 TARGET="_top"
4779 ><TT
4780 CLASS="PARAMETER"
4781 ><I
4782 >show 
4783         add printer wizard = yes</I
4784 ></TT
4785 ></A
4786 > (the default).
4787         </P
4788 ></LI
4789 ></UL
4790 ><P
4791 >In order to be able to use the APW to successfully add a printer to a Samba 
4792 server, the <A
4793 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
4794 TARGET="_top"
4795 ><TT
4796 CLASS="PARAMETER"
4797 ><I
4798 >add 
4799 printer command</I
4800 ></TT
4801 ></A
4802 > must have a defined value.  The program
4803 hook must successfully add the printer to the system (i.e. 
4804 <TT
4805 CLASS="FILENAME"
4806 >/etc/printcap</TT
4807 > or appropriate files) and 
4808 <TT
4809 CLASS="FILENAME"
4810 >smb.conf</TT
4811 > if necessary.</P
4812 ><P
4813 >When using the APW from a client, if the named printer share does 
4814 not exist, <B
4815 CLASS="COMMAND"
4816 >smbd</B
4817 > will execute the <TT
4818 CLASS="PARAMETER"
4819 ><I
4820 >add printer 
4821 command</I
4822 ></TT
4823 > and reparse to the <TT
4824 CLASS="FILENAME"
4825 >smb.conf</TT
4826 >
4827 to attempt to locate the new printer share.  If the share is still not defined,
4828 an error of "Access Denied" is returned to the client.  Note that the 
4829 <TT
4830 CLASS="PARAMETER"
4831 ><I
4832 >add printer program</I
4833 ></TT
4834 > is executed under the context
4835 of the connected user, not necessarily a root account.</P
4836 ><P
4837 >There is a complementing <A
4838 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
4839 TARGET="_top"
4840 ><TT
4841 CLASS="PARAMETER"
4842 ><I
4843 >delete
4844 printer command</I
4845 ></TT
4846 ></A
4847 > for removing entries from the "Printers..."
4848 folder.</P
4849 ></DIV
4850 ><DIV
4851 CLASS="SECT2"
4852 ><HR><H2
4853 CLASS="SECT2"
4854 ><A
4855 NAME="AEN885"
4856 >6.2.5. Samba and Printer Ports</A
4857 ></H2
4858 ><P
4859 >Windows NT/2000 print servers associate a port with each printer.  These normally
4860 take the form of LPT1:, COM1:, FILE:, etc...  Samba must also support the
4861 concept of ports associated with a printer.  By default, only one printer port,
4862 named "Samba Printer Port", exists on a system.  Samba does not really a port in
4863 order to print, rather it is a requirement of Windows clients.  </P
4864 ><P
4865 >Note that Samba does not support the concept of "Printer Pooling" internally 
4866 either.  This is when a logical printer is assigned to multiple ports as 
4867 a form of load balancing or fail over.</P
4868 ><P
4869 >If you require that multiple ports be defined for some reason,
4870 <TT
4871 CLASS="FILENAME"
4872 >smb.conf</TT
4873 > possesses a <A
4874 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
4875 TARGET="_top"
4876 ><TT
4877 CLASS="PARAMETER"
4878 ><I
4879 >enumports 
4880 command</I
4881 ></TT
4882 ></A
4883 > which can be used to define an external program 
4884 that generates a listing of ports on a system.</P
4885 ></DIV
4886 ></DIV
4887 ><DIV
4888 CLASS="SECT1"
4889 ><HR><H1
4890 CLASS="SECT1"
4891 ><A
4892 NAME="AEN893"
4893 >6.3. The Imprints Toolset</A
4894 ></H1
4895 ><P
4896 >The Imprints tool set provides a UNIX equivalent of the 
4897         Windows NT Add Printer Wizard.  For complete information, please 
4898         refer to the Imprints web site at <A
4899 HREF="http://imprints.sourceforge.net/"
4900 TARGET="_top"
4901 >       http://imprints.sourceforge.net/</A
4902 > as well as the documentation 
4903         included with the imprints source distribution.  This section will 
4904         only provide a brief introduction to the features of Imprints.</P
4905 ><DIV
4906 CLASS="SECT2"
4907 ><HR><H2
4908 CLASS="SECT2"
4909 ><A
4910 NAME="AEN897"
4911 >6.3.1. What is Imprints?</A
4912 ></H2
4913 ><P
4914 >Imprints is a collection of tools for supporting the goals 
4915                 of</P
4916 ><P
4917 ></P
4918 ><UL
4919 ><LI
4920 ><P
4921 >Providing a central repository information 
4922                         regarding Windows NT and 95/98 printer driver packages</P
4923 ></LI
4924 ><LI
4925 ><P
4926 >Providing the tools necessary for creating 
4927                         the Imprints printer driver packages.</P
4928 ></LI
4929 ><LI
4930 ><P
4931 >Providing an installation client which 
4932                         will obtain and install printer drivers on remote Samba 
4933                         and Windows NT 4 print servers.</P
4934 ></LI
4935 ></UL
4936 ></DIV
4937 ><DIV
4938 CLASS="SECT2"
4939 ><HR><H2
4940 CLASS="SECT2"
4941 ><A
4942 NAME="AEN907"
4943 >6.3.2. Creating Printer Driver Packages</A
4944 ></H2
4945 ><P
4946 >The process of creating printer driver packages is beyond
4947                 the scope of this document (refer to Imprints.txt also included
4948                 with the Samba distribution for more information).  In short,
4949                 an Imprints driver package is a gzipped tarball containing the
4950                 driver files, related INF files, and a control file needed by the
4951                 installation client.</P
4952 ></DIV
4953 ><DIV
4954 CLASS="SECT2"
4955 ><HR><H2
4956 CLASS="SECT2"
4957 ><A
4958 NAME="AEN910"
4959 >6.3.3. The Imprints server</A
4960 ></H2
4961 ><P
4962 >The Imprints server is really a database server that 
4963                 may be queried via standard HTTP mechanisms.  Each printer 
4964                 entry in the database has an associated URL for the actual
4965                 downloading of the package.  Each package is digitally signed
4966                 via GnuPG which can be used to verify that package downloaded
4967                 is actually the one referred in the Imprints database.  It is 
4968                 <EM
4969 >not</EM
4970 > recommended that this security check 
4971                 be disabled.</P
4972 ></DIV
4973 ><DIV
4974 CLASS="SECT2"
4975 ><HR><H2
4976 CLASS="SECT2"
4977 ><A
4978 NAME="AEN914"
4979 >6.3.4. The Installation Client</A
4980 ></H2
4981 ><P
4982 >More information regarding the Imprints installation client 
4983                 is available in the <TT
4984 CLASS="FILENAME"
4985 >Imprints-Client-HOWTO.ps</TT
4986
4987                 file included with the imprints source package.</P
4988 ><P
4989 >The Imprints installation client comes in two forms.</P
4990 ><P
4991 ></P
4992 ><UL
4993 ><LI
4994 ><P
4995 >a set of command line Perl scripts</P
4996 ></LI
4997 ><LI
4998 ><P
4999 >a GTK+ based graphical interface to 
5000                         the command line perl scripts</P
5001 ></LI
5002 ></UL
5003 ><P
5004 >The installation client (in both forms) provides a means
5005                 of querying the Imprints database server for a matching
5006                 list of known printer model names as well as a means to 
5007                 download and install the drivers on remote Samba and Windows
5008                 NT print servers.</P
5009 ><P
5010 >The basic installation process is in four steps and 
5011                 perl code is wrapped around <B
5012 CLASS="COMMAND"
5013 >smbclient</B
5014
5015                 and <B
5016 CLASS="COMMAND"
5017 >rpcclient</B
5018 >.</P
5019 ><P
5020 ><TABLE
5021 BORDER="0"
5022 BGCOLOR="#E0E0E0"
5023 WIDTH="100%"
5024 ><TR
5025 ><TD
5026 ><PRE
5027 CLASS="PROGRAMLISTING"
5028 >       
5029 foreach (supported architecture for a given driver)
5030 {
5031      1.  rpcclient: Get the appropriate upload directory 
5032          on the remote server
5033      2.  smbclient: Upload the driver files
5034      3.  rpcclient: Issues an AddPrinterDriver() MS-RPC
5035 }
5036         
5037 4.  rpcclient: Issue an AddPrinterEx() MS-RPC to actually
5038     create the printer</PRE
5039 ></TD
5040 ></TR
5041 ></TABLE
5042 ></P
5043 ><P
5044 >One of the problems encountered when implementing 
5045                 the Imprints tool set was the name space issues between 
5046                 various supported client architectures.  For example, Windows 
5047                 NT includes a driver named "Apple LaserWriter II NTX v51.8" 
5048                 and Windows 95 calls its version of this driver "Apple 
5049                 LaserWriter II NTX"</P
5050 ><P
5051 >The problem is how to know what client drivers have 
5052                 been uploaded for a printer.  As astute reader will remember 
5053                 that the Windows NT Printer Properties dialog only includes 
5054                 space for one printer driver name.  A quick look in the 
5055                 Windows NT 4.0 system registry at</P
5056 ><P
5057 ><TT
5058 CLASS="FILENAME"
5059 >HKLM\System\CurrentControlSet\Control\Print\Environment
5060                 </TT
5061 ></P
5062 ><P
5063 >will reveal that Windows NT always uses the NT driver 
5064                 name.  This is ok as Windows NT always requires that at least 
5065                 the Windows NT version of the printer driver is present.  
5066                 However, Samba does not have the requirement internally.  
5067                 Therefore, how can you use the NT driver name if is has not 
5068                 already been installed?</P
5069 ><P
5070 >The way of sidestepping this limitation is to require 
5071                 that all Imprints printer driver packages include both the Intel 
5072                 Windows NT and 95/98 printer drivers and that NT driver is 
5073                 installed first.</P
5074 ></DIV
5075 ></DIV
5076 ><DIV
5077 CLASS="SECT1"
5078 ><HR><H1
5079 CLASS="SECT1"
5080 ><A
5081 NAME="AEN936"
5082 >6.4. <A
5083 NAME="MIGRATION"
5084 ></A
5085 >Migration to from Samba 2.0.x to 2.2.x</A
5086 ></H1
5087 ><P
5088 >Given that printer driver management has changed (we hope improved) in 
5089 2.2 over prior releases, migration from an existing setup to 2.2 can 
5090 follow several paths. Here are the possible scenarios for 
5091 migration:</P
5092 ><P
5093 ></P
5094 ><UL
5095 ><LI
5096 ><P
5097 >If you do not desire the new Windows NT 
5098         print driver support, nothing needs to be done.  
5099         All existing parameters work the same.</P
5100 ></LI
5101 ><LI
5102 ><P
5103 >If you want to take advantage of NT printer 
5104         driver support but do not want to migrate the 
5105         9x drivers to the new setup, the leave the existing 
5106         <TT
5107 CLASS="FILENAME"
5108 >printers.def</TT
5109 > file.  When smbd attempts 
5110         to locate a 
5111         9x driver for the printer in the TDB and fails it 
5112         will drop down to using the printers.def (and all 
5113         associated parameters).  The <B
5114 CLASS="COMMAND"
5115 >make_printerdef</B
5116
5117         tool will also remain for backwards compatibility but will 
5118         be removed in the next major release.</P
5119 ></LI
5120 ><LI
5121 ><P
5122 >If you install a Windows 9x driver for a printer 
5123         on your Samba host (in the printing TDB), this information will 
5124         take precedence and the three old printing parameters
5125         will be ignored (including print driver location).</P
5126 ></LI
5127 ><LI
5128 ><P
5129 >If you want to migrate an existing <TT
5130 CLASS="FILENAME"
5131 >printers.def</TT
5132
5133         file into the new setup, the current only solution is to use the Windows 
5134         NT APW to install the NT drivers and the 9x  drivers.  This can be scripted 
5135         using <B
5136 CLASS="COMMAND"
5137 >smbclient</B
5138 > and <B
5139 CLASS="COMMAND"
5140 >rpcclient</B
5141 >.  See the 
5142         Imprints installation client at <A
5143 HREF="http://imprints.sourceforge.net/"
5144 TARGET="_top"
5145 >http://imprints.sourceforge.net/</A
5146
5147         for an example.
5148         </P
5149 ></LI
5150 ></UL
5151 ><DIV
5152 CLASS="WARNING"
5153 ><P
5154 ></P
5155 ><TABLE
5156 CLASS="WARNING"
5157 BORDER="1"
5158 WIDTH="100%"
5159 ><TR
5160 ><TD
5161 ALIGN="CENTER"
5162 ><B
5163 >Achtung!</B
5164 ></TD
5165 ></TR
5166 ><TR
5167 ><TD
5168 ALIGN="LEFT"
5169 ><P
5170 >The following <TT
5171 CLASS="FILENAME"
5172 >smb.conf</TT
5173 > parameters are considered to 
5174 be deprecated and will be removed soon.  Do not use them in new 
5175 installations</P
5176 ><P
5177 ></P
5178 ><UL
5179 ><LI
5180 ><P
5181 ><TT
5182 CLASS="PARAMETER"
5183 ><I
5184 >printer driver file (G)</I
5185 ></TT
5186 >
5187         </P
5188 ></LI
5189 ><LI
5190 ><P
5191 ><TT
5192 CLASS="PARAMETER"
5193 ><I
5194 >printer driver (S)</I
5195 ></TT
5196 >
5197         </P
5198 ></LI
5199 ><LI
5200 ><P
5201 ><TT
5202 CLASS="PARAMETER"
5203 ><I
5204 >printer driver location (S)</I
5205 ></TT
5206 >
5207         </P
5208 ></LI
5209 ></UL
5210 ></TD
5211 ></TR
5212 ></TABLE
5213 ></DIV
5214 ><P
5215 >The have been two new parameters add in Samba 2.2.2 to for 
5216 better support of Samba 2.0.x backwards capability (<TT
5217 CLASS="PARAMETER"
5218 ><I
5219 >disable
5220 spoolss</I
5221 ></TT
5222 >) and for using local printers drivers on Windows 
5223 NT/2000 clients (<TT
5224 CLASS="PARAMETER"
5225 ><I
5226 >use client driver</I
5227 ></TT
5228 >). Both of 
5229 these options are described in the smb.coinf(5) man page and are 
5230 disabled by default.</P
5231 ></DIV
5232 ></DIV
5233 ><DIV
5234 CLASS="CHAPTER"
5235 ><HR><H1
5236 ><A
5237 NAME="DOMAIN-SECURITY"
5238 >Chapter 7. security = domain in Samba 2.x</A
5239 ></H1
5240 ><DIV
5241 CLASS="SECT1"
5242 ><H1
5243 CLASS="SECT1"
5244 ><A
5245 NAME="AEN990"
5246 >7.1. Joining an NT Domain with Samba 2.2</A
5247 ></H1
5248 ><P
5249 >Assume you have a Samba 2.x server with a NetBIOS name of 
5250         <TT
5251 CLASS="CONSTANT"
5252 >SERV1</TT
5253 > and are joining an NT domain called
5254         <TT
5255 CLASS="CONSTANT"
5256 >DOM</TT
5257 >, which has a PDC with a NetBIOS name
5258         of <TT
5259 CLASS="CONSTANT"
5260 >DOMPDC</TT
5261 > and two backup domain controllers 
5262         with NetBIOS names <TT
5263 CLASS="CONSTANT"
5264 >DOMBDC1</TT
5265 > and <TT
5266 CLASS="CONSTANT"
5267 >DOMBDC2
5268         </TT
5269 >.</P
5270 ><P
5271 >In order to join the domain, first stop all Samba daemons 
5272         and run the command:</P
5273 ><P
5274 ><TT
5275 CLASS="PROMPT"
5276 >root# </TT
5277 ><TT
5278 CLASS="USERINPUT"
5279 ><B
5280 >smbpasswd -j DOM -r DOMPDC
5281         -U<TT
5282 CLASS="REPLACEABLE"
5283 ><I
5284 >Administrator%password</I
5285 ></TT
5286 ></B
5287 ></TT
5288 ></P
5289 ><P
5290 >as we are joining the domain DOM and the PDC for that domain 
5291         (the only machine that has write access to the domain SAM database) 
5292         is DOMPDC. The <TT
5293 CLASS="REPLACEABLE"
5294 ><I
5295 >Administrator%password</I
5296 ></TT
5297 > is 
5298         the login name and password for an account which has the necessary 
5299         privilege to add machines to the domain.  If this is successful 
5300         you will see the message:</P
5301 ><P
5302 ><TT
5303 CLASS="COMPUTEROUTPUT"
5304 >smbpasswd: Joined domain DOM.</TT
5305 >
5306         </P
5307 ><P
5308 >in your terminal window. See the <A
5309 HREF="smbpasswd.8.html"
5310 TARGET="_top"
5311 >       smbpasswd(8)</A
5312 > man page for more details.</P
5313 ><P
5314 >There is existing development code to join a domain
5315         without having to create the machine trust account on the PDC
5316         beforehand.  This code will hopefully be available soon
5317         in release branches as well.</P
5318 ><P
5319 >This command goes through the machine account password 
5320         change protocol, then writes the new (random) machine account 
5321         password for this Samba server into a file in the same directory 
5322         in which an smbpasswd file would be stored - normally :</P
5323 ><P
5324 ><TT
5325 CLASS="FILENAME"
5326 >/usr/local/samba/private</TT
5327 ></P
5328 ><P
5329 >In Samba 2.0.x, the filename looks like this:</P
5330 ><P
5331 ><TT
5332 CLASS="FILENAME"
5333 ><TT
5334 CLASS="REPLACEABLE"
5335 ><I
5336 >&#60;NT DOMAIN NAME&#62;</I
5337 ></TT
5338 >.<TT
5339 CLASS="REPLACEABLE"
5340 ><I
5341 >&#60;Samba 
5342         Server Name&#62;</I
5343 ></TT
5344 >.mac</TT
5345 ></P
5346 ><P
5347 >The <TT
5348 CLASS="FILENAME"
5349 >.mac</TT
5350 > suffix stands for machine account 
5351         password file. So in our example above, the file would be called:</P
5352 ><P
5353 ><TT
5354 CLASS="FILENAME"
5355 >DOM.SERV1.mac</TT
5356 ></P
5357 ><P
5358 >In Samba 2.2, this file has been replaced with a TDB 
5359         (Trivial Database) file named <TT
5360 CLASS="FILENAME"
5361 >secrets.tdb</TT
5362 >.
5363         </P
5364 ><P
5365 >This file is created and owned by root and is not 
5366         readable by any other user. It is the key to the domain-level 
5367         security for your system, and should be treated as carefully 
5368         as a shadow password file.</P
5369 ><P
5370 >Now, before restarting the Samba daemons you must 
5371         edit your <A
5372 HREF="smb.conf.5.html"
5373 TARGET="_top"
5374 ><TT
5375 CLASS="FILENAME"
5376 >smb.conf(5)</TT
5377 >
5378         </A
5379 > file to tell Samba it should now use domain security.</P
5380 ><P
5381 >Change (or add) your <A
5382 HREF="smb.conf.5.html#SECURITY"
5383 TARGET="_top"
5384 >       <TT
5385 CLASS="PARAMETER"
5386 ><I
5387 >security =</I
5388 ></TT
5389 ></A
5390 > line in the [global] section 
5391         of your smb.conf to read:</P
5392 ><P
5393 ><B
5394 CLASS="COMMAND"
5395 >security = domain</B
5396 ></P
5397 ><P
5398 >Next change the <A
5399 HREF="smb.conf.5.html#WORKGROUP"
5400 TARGET="_top"
5401 ><TT
5402 CLASS="PARAMETER"
5403 ><I
5404 >       workgroup =</I
5405 ></TT
5406 ></A
5407 > line in the [global] section to read: </P
5408 ><P
5409 ><B
5410 CLASS="COMMAND"
5411 >workgroup = DOM</B
5412 ></P
5413 ><P
5414 >as this is the name of the domain we are joining. </P
5415 ><P
5416 >You must also have the parameter <A
5417 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
5418 TARGET="_top"
5419 >       <TT
5420 CLASS="PARAMETER"
5421 ><I
5422 >encrypt passwords</I
5423 ></TT
5424 ></A
5425 > set to <TT
5426 CLASS="CONSTANT"
5427 >yes
5428         </TT
5429 > in order for your users to authenticate to the NT PDC.</P
5430 ><P
5431 >Finally, add (or modify) a <A
5432 HREF="smb.conf.5.html#PASSWORDSERVER"
5433 TARGET="_top"
5434 >       <TT
5435 CLASS="PARAMETER"
5436 ><I
5437 >password server =</I
5438 ></TT
5439 ></A
5440 > line in the [global]
5441         section to read: </P
5442 ><P
5443 ><B
5444 CLASS="COMMAND"
5445 >password server = DOMPDC DOMBDC1 DOMBDC2</B
5446 ></P
5447 ><P
5448 >These are the primary and backup domain controllers Samba 
5449         will attempt to contact in order to authenticate users. Samba will 
5450         try to contact each of these servers in order, so you may want to 
5451         rearrange this list in order to spread out the authentication load 
5452         among domain controllers.</P
5453 ><P
5454 >Alternatively, if you want smbd to automatically determine 
5455         the list of Domain controllers to use for authentication, you may 
5456         set this line to be :</P
5457 ><P
5458 ><B
5459 CLASS="COMMAND"
5460 >password server = *</B
5461 ></P
5462 ><P
5463 >This method, which was introduced in Samba 2.0.6, 
5464         allows Samba to use exactly the same mechanism that NT does. This 
5465         method either broadcasts or uses a WINS database in order to
5466         find domain controllers to authenticate against.</P
5467 ><P
5468 >Finally, restart your Samba daemons and get ready for 
5469         clients to begin using domain security!</P
5470 ></DIV
5471 ><DIV
5472 CLASS="SECT1"
5473 ><HR><H1
5474 CLASS="SECT1"
5475 ><A
5476 NAME="AEN1054"
5477 >7.2. Samba and Windows 2000 Domains</A
5478 ></H1
5479 ><P
5480 >Many people have asked regarding the state of Samba's ability to participate in
5481 a Windows 2000 Domain.  Samba 2.2 is able to act as a member server of a Windows
5482 2000 domain operating in mixed or native mode.</P
5483 ><P
5484 >There is much confusion between the circumstances that require a "mixed" mode
5485 Win2k DC and a when this host can be switched to "native" mode.  A "mixed" mode
5486 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
5487 domain.  By default, a Win2k DC in "native" mode will still support
5488 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and 
5489 NT 4.0.  Samba has the same requirements as a Windows NT 4.0 member server.</P
5490 ><P
5491 >The steps for adding a Samba 2.2 host to a Win2k domain are the same as those
5492 for adding a Samba server to a Windows NT 4.0 domain. The only exception is that 
5493 the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and 
5494 Computers" MMC (Microsoft Management Console) plugin.</P
5495 ></DIV
5496 ><DIV
5497 CLASS="SECT1"
5498 ><HR><H1
5499 CLASS="SECT1"
5500 ><A
5501 NAME="AEN1059"
5502 >7.3. Why is this better than security = server?</A
5503 ></H1
5504 ><P
5505 >Currently, domain security in Samba doesn't free you from 
5506         having to create local Unix users to represent the users attaching 
5507         to your server. This means that if domain user <TT
5508 CLASS="CONSTANT"
5509 >DOM\fred
5510         </TT
5511 > attaches to your domain security Samba server, there needs 
5512         to be a local Unix user fred to represent that user in the Unix 
5513         filesystem. This is very similar to the older Samba security mode 
5514         <A
5515 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
5516 TARGET="_top"
5517 >security = server</A
5518 >, 
5519         where Samba would pass through the authentication request to a Windows 
5520         NT server in the same way as a Windows 95 or Windows 98 server would.
5521         </P
5522 ><P
5523 >Please refer to the <A
5524 HREF="winbind.html"
5525 TARGET="_top"
5526 >Winbind 
5527         paper</A
5528 > for information on a system to automatically
5529         assign UNIX uids and gids to Windows NT Domain users and groups.
5530         This code is available in development branches only at the moment,
5531         but will be moved to release branches soon.</P
5532 ><P
5533 >The advantage to domain-level security is that the 
5534         authentication in domain-level security is passed down the authenticated 
5535         RPC channel in exactly the same way that an NT server would do it. This 
5536         means Samba servers now participate in domain trust relationships in 
5537         exactly the same way NT servers do (i.e., you can add Samba servers into 
5538         a resource domain and have the authentication passed on from a resource
5539         domain PDC to an account domain PDC.</P
5540 ><P
5541 >In addition, with <B
5542 CLASS="COMMAND"
5543 >security = server</B
5544 > every Samba 
5545         daemon on a server has to keep a connection open to the 
5546         authenticating server for as long as that daemon lasts. This can drain 
5547         the connection resources on a Microsoft NT server and cause it to run 
5548         out of available connections. With <B
5549 CLASS="COMMAND"
5550 >security = domain</B
5551 >, 
5552         however, the Samba daemons connect to the PDC/BDC only for as long 
5553         as is necessary to authenticate the user, and then drop the connection, 
5554         thus conserving PDC connection resources.</P
5555 ><P
5556 >And finally, acting in the same manner as an NT server 
5557         authenticating to a PDC means that as part of the authentication 
5558         reply, the Samba server gets the user identification information such 
5559         as the user SID, the list of NT groups the user belongs to, etc. All 
5560         this information will allow Samba to be extended in the future into 
5561         a mode the developers currently call appliance mode. In this mode, 
5562         no local Unix users will be necessary, and Samba will generate Unix 
5563         uids and gids from the information passed back from the PDC when a 
5564         user is authenticated, making a Samba server truly plug and play 
5565         in an NT domain environment. Watch for this code soon.</P
5566 ><P
5567 ><EM
5568 >NOTE:</EM
5569 > Much of the text of this document 
5570         was first published in the Web magazine <A
5571 HREF="http://www.linuxworld.com"
5572 TARGET="_top"
5573 >       
5574         LinuxWorld</A
5575 > as the article <A
5576 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
5577 TARGET="_top"
5578 >Doing 
5579         the NIS/NT Samba</A
5580 >.</P
5581 ></DIV
5582 ></DIV
5583 ><DIV
5584 CLASS="CHAPTER"
5585 ><HR><H1
5586 ><A
5587 NAME="SAMBA-PDC"
5588 >Chapter 8. How to Configure Samba 2.2 as a Primary Domain Controller</A
5589 ></H1
5590 ><DIV
5591 CLASS="SECT1"
5592 ><H1
5593 CLASS="SECT1"
5594 ><A
5595 NAME="AEN1092"
5596 >8.1. Prerequisite Reading</A
5597 ></H1
5598 ><P
5599 >Before you continue reading in this chapter, please make sure 
5600 that you are comfortable with configuring basic files services
5601 in smb.conf and how to enable and administer password 
5602 encryption in Samba.  Theses two topics are covered in the
5603 <A
5604 HREF="smb.conf.5.html"
5605 TARGET="_top"
5606 ><TT
5607 CLASS="FILENAME"
5608 >smb.conf(5)</TT
5609 ></A
5610
5611 manpage and the <A
5612 HREF="ENCRYPTION.html"
5613 TARGET="_top"
5614 >Encryption chapter</A
5615
5616 of this HOWTO Collection.</P
5617 ></DIV
5618 ><DIV
5619 CLASS="SECT1"
5620 ><HR><H1
5621 CLASS="SECT1"
5622 ><A
5623 NAME="AEN1098"
5624 >8.2. Background</A
5625 ></H1
5626 ><DIV
5627 CLASS="NOTE"
5628 ><BLOCKQUOTE
5629 CLASS="NOTE"
5630 ><P
5631 ><B
5632 >Note: </B
5633 ><EM
5634 >Author's Note:</EM
5635 > This document is a combination 
5636 of David Bannon's "Samba 2.2 PDC HOWTO" and "Samba NT Domain FAQ". 
5637 Both documents are superseded by this one.</P
5638 ></BLOCKQUOTE
5639 ></DIV
5640 ><P
5641 >Versions of Samba prior to release 2.2 had marginal capabilities to act
5642 as a Windows NT 4.0 Primary Domain Controller
5643
5644 (PDC).  With Samba 2.2.0, we are proud to announce official support for
5645 Windows NT 4.0-style domain logons from Windows NT 4.0 and Windows 
5646 2000 clients.  This article outlines the steps
5647 necessary for configuring Samba as a PDC.  It is necessary to have a
5648 working Samba server prior to implementing the PDC functionality.  If
5649 you have not followed the steps outlined in <A
5650 HREF="UNIX_INSTALL.html"
5651 TARGET="_top"
5652 > UNIX_INSTALL.html</A
5653 >, please make sure
5654 that your server is configured correctly before proceeding.  Another
5655 good resource in the <A
5656 HREF="smb.conf.5.html"
5657 TARGET="_top"
5658 >smb.conf(5) man
5659 page</A
5660 >. The following functionality should work in 2.2:</P
5661 ><P
5662 ></P
5663 ><UL
5664 ><LI
5665 ><P
5666 >       domain logons for Windows NT 4.0/2000 clients.
5667         </P
5668 ></LI
5669 ><LI
5670 ><P
5671 >       placing a Windows 9x client in user level security
5672         </P
5673 ></LI
5674 ><LI
5675 ><P
5676 >       retrieving a list of users and groups from a Samba PDC to
5677         Windows 9x/NT/2000 clients
5678         </P
5679 ></LI
5680 ><LI
5681 ><P
5682 >       roving (roaming) user profiles
5683         </P
5684 ></LI
5685 ><LI
5686 ><P
5687 >       Windows NT 4.0-style system policies
5688         </P
5689 ></LI
5690 ></UL
5691 ><P
5692 >The following pieces of functionality are not included in the 2.2 release:</P
5693 ><P
5694 ></P
5695 ><UL
5696 ><LI
5697 ><P
5698 >       Windows NT 4 domain trusts
5699         </P
5700 ></LI
5701 ><LI
5702 ><P
5703 >       SAM replication with Windows NT 4.0 Domain Controllers
5704         (i.e. a Samba PDC and a Windows NT BDC or vice versa) 
5705         </P
5706 ></LI
5707 ><LI
5708 ><P
5709 >       Adding users via the User Manager for Domains
5710         </P
5711 ></LI
5712 ><LI
5713 ><P
5714 >       Acting as a Windows 2000 Domain Controller (i.e. Kerberos and 
5715         Active Directory)
5716         </P
5717 ></LI
5718 ></UL
5719 ><P
5720 >Please note that Windows 9x clients are not true members of a domain
5721 for reasons outlined in this article.  Therefore the protocol for
5722 support Windows 9x-style domain logons is completely different
5723 from NT4 domain logons and has been officially supported for some 
5724 time.</P
5725 ><P
5726 >Implementing a Samba PDC can basically be divided into 2 broad
5727 steps.</P
5728 ><P
5729 ></P
5730 ><OL
5731 TYPE="1"
5732 ><LI
5733 ><P
5734 >       Configuring the Samba PDC
5735         </P
5736 ></LI
5737 ><LI
5738 ><P
5739 >       Creating machine trust accounts and joining clients 
5740         to the domain
5741         </P
5742 ></LI
5743 ></OL
5744 ><P
5745 >There are other minor details such as user profiles, system
5746 policies, etc...  However, these are not necessarily specific
5747 to a Samba PDC as much as they are related to Windows NT networking
5748 concepts.  They will be mentioned only briefly here.</P
5749 ></DIV
5750 ><DIV
5751 CLASS="SECT1"
5752 ><HR><H1
5753 CLASS="SECT1"
5754 ><A
5755 NAME="AEN1137"
5756 >8.3. Configuring the Samba Domain Controller</A
5757 ></H1
5758 ><P
5759 >The first step in creating a working Samba PDC is to 
5760 understand the parameters necessary in smb.conf.  I will not
5761 attempt to re-explain the parameters here as they are more that
5762 adequately covered in <A
5763 HREF="smb.conf.5.html"
5764 TARGET="_top"
5765 > the smb.conf
5766 man page</A
5767 >.  For convenience, the parameters have been
5768 linked with the actual smb.conf description.</P
5769 ><P
5770 >Here is an example <TT
5771 CLASS="FILENAME"
5772 >smb.conf</TT
5773 > for acting as a PDC:</P
5774 ><P
5775 ><TABLE
5776 BORDER="0"
5777 BGCOLOR="#E0E0E0"
5778 WIDTH="100%"
5779 ><TR
5780 ><TD
5781 ><PRE
5782 CLASS="PROGRAMLISTING"
5783 >[global]
5784     ; Basic server settings
5785     <A
5786 HREF="smb.conf.5.html#NETBIOSNAME"
5787 TARGET="_top"
5788 >netbios name</A
5789 > = <TT
5790 CLASS="REPLACEABLE"
5791 ><I
5792 >POGO</I
5793 ></TT
5794 >
5795     <A
5796 HREF="smb.conf.5.html#WORKGROUP"
5797 TARGET="_top"
5798 >workgroup</A
5799 > = <TT
5800 CLASS="REPLACEABLE"
5801 ><I
5802 >NARNIA</I
5803 ></TT
5804 >
5805
5806     ; we should act as the domain and local master browser
5807     <A
5808 HREF="smb.conf.5.html#OSLEVEL"
5809 TARGET="_top"
5810 >os level</A
5811 > = 64
5812     <A
5813 HREF="smb.conf.5.html#PERFERREDMASTER"
5814 TARGET="_top"
5815 >preferred master</A
5816 > = yes
5817     <A
5818 HREF="smb.conf.5.html#DOMAINMASTER"
5819 TARGET="_top"
5820 >domain master</A
5821 > = yes
5822     <A
5823 HREF="smb.conf.5.html#LOCALMASTER"
5824 TARGET="_top"
5825 >local master</A
5826 > = yes
5827     
5828     ; security settings (must user security = user)
5829     <A
5830 HREF="smb.conf.5.html#SECURITYEQUALSUSER"
5831 TARGET="_top"
5832 >security</A
5833 > = user
5834     
5835     ; encrypted passwords are a requirement for a PDC
5836     <A
5837 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
5838 TARGET="_top"
5839 >encrypt passwords</A
5840 > = yes
5841     
5842     ; support domain logons
5843     <A
5844 HREF="smb.conf.5.html#DOMAINLOGONS"
5845 TARGET="_top"
5846 >domain logons</A
5847 > = yes
5848     
5849     ; where to store user profiles?
5850     <A
5851 HREF="smb.conf.5.html#LOGONPATH"
5852 TARGET="_top"
5853 >logon path</A
5854 > = \\%N\profiles\%u
5855     
5856     ; where is a user's home directory and where should it
5857     ; be mounted at?
5858     <A
5859 HREF="smb.conf.5.html#LOGONDRIVE"
5860 TARGET="_top"
5861 >logon drive</A
5862 > = H:
5863     <A
5864 HREF="smb.conf.5.html#LOGONHOME"
5865 TARGET="_top"
5866 >logon home</A
5867 > = \\homeserver\%u
5868     
5869     ; specify a generic logon script for all users
5870     ; this is a relative **DOS** path to the [netlogon] share
5871     <A
5872 HREF="smb.conf.5.html#LOGONSCRIPT"
5873 TARGET="_top"
5874 >logon script</A
5875 > = logon.cmd
5876
5877 ; necessary share for domain controller
5878 [netlogon]
5879     <A
5880 HREF="smb.conf.5.html#PATH"
5881 TARGET="_top"
5882 >path</A
5883 > = /usr/local/samba/lib/netlogon
5884     <A
5885 HREF="smb.conf.5.html#READONLY"
5886 TARGET="_top"
5887 >read only</A
5888 > = yes
5889     <A
5890 HREF="smb.conf.5.html#WRITELIST"
5891 TARGET="_top"
5892 >write list</A
5893 > = <TT
5894 CLASS="REPLACEABLE"
5895 ><I
5896 >ntadmin</I
5897 ></TT
5898 >
5899     
5900 ; share for storing user profiles
5901 [profiles]
5902     <A
5903 HREF="smb.conf.5.html#PATH"
5904 TARGET="_top"
5905 >path</A
5906 > = /export/smb/ntprofile
5907     <A
5908 HREF="smb.conf.5.html#READONLY"
5909 TARGET="_top"
5910 >read only</A
5911 > = no
5912     <A
5913 HREF="smb.conf.5.html#CREATEMASK"
5914 TARGET="_top"
5915 >create mask</A
5916 > = 0600
5917     <A
5918 HREF="smb.conf.5.html#DIRECTORYMASK"
5919 TARGET="_top"
5920 >directory mask</A
5921 > = 0700</PRE
5922 ></TD
5923 ></TR
5924 ></TABLE
5925 ></P
5926 ><P
5927 >There are a couple of points to emphasize in the above configuration.</P
5928 ><P
5929 ></P
5930 ><UL
5931 ><LI
5932 ><P
5933 >       Encrypted passwords must be enabled.  For more details on how 
5934         to do this, refer to <A
5935 HREF="ENCRYPTION.html"
5936 TARGET="_top"
5937 >ENCRYPTION.html</A
5938 >.
5939         </P
5940 ></LI
5941 ><LI
5942 ><P
5943 >       The server must support domain logons and a
5944         <TT
5945 CLASS="FILENAME"
5946 >[netlogon]</TT
5947 > share
5948         </P
5949 ></LI
5950 ><LI
5951 ><P
5952 >       The server must be the domain master browser in order for Windows 
5953         client to locate the server as a DC.  Please refer to the various 
5954         Network Browsing documentation included with this distribution for 
5955         details.
5956         </P
5957 ></LI
5958 ></UL
5959 ><P
5960 >As Samba 2.2 does not offer a complete implementation of group mapping
5961 between Windows NT groups and Unix groups (this is really quite
5962 complicated to explain in a short space), you should refer to the
5963 <A
5964 HREF="smb.conf.5.html#DOMAINADMINGROUP"
5965 TARGET="_top"
5966 >domain admin
5967 group</A
5968 > smb.conf parameter for information of creating "Domain
5969 Admins" style accounts.</P
5970 ></DIV
5971 ><DIV
5972 CLASS="SECT1"
5973 ><HR><H1
5974 CLASS="SECT1"
5975 ><A
5976 NAME="AEN1180"
5977 >8.4. Creating Machine Trust Accounts and Joining Clients to the
5978 Domain</A
5979 ></H1
5980 ><P
5981 >A machine trust account is a Samba account that is used to
5982 authenticate a client machine (rather than a user) to the Samba
5983 server.  In Windows terminology, this is known as a "Computer
5984 Account."</P
5985 ><P
5986 >The password of a machine trust account acts as the shared secret for
5987 secure communication with the Domain Controller.  This is a security
5988 feature to prevent an unauthorized machine with the same NetBIOS name
5989 from joining the domain and gaining access to domain user/group
5990 accounts.  Windows NT and 2000 clients use machine trust accounts, but
5991 Windows 9x clients do not.  Hence, a Windows 9x client is never a true
5992 member of a domain because it does not possess a machine trust
5993 account, and thus has no shared secret with the domain controller.</P
5994 ><P
5995 >A Windows PDC stores each machine trust account in the Windows
5996 Registry.  A Samba PDC, however, stores each machine trust account 
5997 in two parts, as follows:
5998
5999 <P
6000 ></P
6001 ><UL
6002 ><LI
6003 ><P
6004 >A Samba account, stored in the same location as user
6005     LanMan and NT password hashes (currently
6006     <TT
6007 CLASS="FILENAME"
6008 >smbpasswd</TT
6009 >). The Samba account 
6010     possesses and uses only the NT password hash.</P
6011 ></LI
6012 ><LI
6013 ><P
6014 >A corresponding Unix account, typically stored in
6015     <TT
6016 CLASS="FILENAME"
6017 >/etc/passwd</TT
6018 >. (Future releases will alleviate the need to
6019     create <TT
6020 CLASS="FILENAME"
6021 >/etc/passwd</TT
6022 > entries.) </P
6023 ></LI
6024 ></UL
6025 ></P
6026 ><P
6027 >There are two ways to create machine trust accounts:</P
6028 ><P
6029 ></P
6030 ><UL
6031 ><LI
6032 ><P
6033 > Manual creation. Both the Samba and corresponding
6034         Unix account are created by hand.</P
6035 ></LI
6036 ><LI
6037 ><P
6038 > "On-the-fly" creation. The Samba machine trust
6039         account is automatically created by Samba at the time the client
6040         is joined to the domain. (For security, this is the
6041         recommended method.) The corresponding Unix account may be
6042         created automatically or manually. </P
6043 ></LI
6044 ></UL
6045 ><DIV
6046 CLASS="SECT2"
6047 ><HR><H2
6048 CLASS="SECT2"
6049 ><A
6050 NAME="AEN1199"
6051 >8.4.1. Manual Creation of Machine Trust Accounts</A
6052 ></H2
6053 ><P
6054 >The first step in manually creating a machine trust account is to
6055 manually create the corresponding Unix account in
6056 <TT
6057 CLASS="FILENAME"
6058 >/etc/passwd</TT
6059 >.  This can be done using
6060 <B
6061 CLASS="COMMAND"
6062 >vipw</B
6063 > or other 'add user' command that is normally
6064 used to create new Unix accounts.  The following is an example for a
6065 Linux based Samba server:</P
6066 ><P
6067 >  <TT
6068 CLASS="PROMPT"
6069 >root# </TT
6070 ><B
6071 CLASS="COMMAND"
6072 >/usr/sbin/useradd -g 100 -d /dev/null -c <TT
6073 CLASS="REPLACEABLE"
6074 ><I
6075 >"machine 
6076 nickname"</I
6077 ></TT
6078 > -s /bin/false <TT
6079 CLASS="REPLACEABLE"
6080 ><I
6081 >machine_name</I
6082 ></TT
6083 >$ </B
6084 ></P
6085 ><P
6086 ><TT
6087 CLASS="PROMPT"
6088 >root# </TT
6089 ><B
6090 CLASS="COMMAND"
6091 >passwd -l <TT
6092 CLASS="REPLACEABLE"
6093 ><I
6094 >machine_name</I
6095 ></TT
6096 >$</B
6097 ></P
6098 ><P
6099 >The <TT
6100 CLASS="FILENAME"
6101 >/etc/passwd</TT
6102 > entry will list the machine name 
6103 with a "$" appended, won't have a password, will have a null shell and no 
6104 home directory. For example a machine named 'doppy' would have an 
6105 <TT
6106 CLASS="FILENAME"
6107 >/etc/passwd</TT
6108 > entry like this:</P
6109 ><P
6110 ><TABLE
6111 BORDER="0"
6112 BGCOLOR="#E0E0E0"
6113 WIDTH="100%"
6114 ><TR
6115 ><TD
6116 ><PRE
6117 CLASS="PROGRAMLISTING"
6118 >doppy$:x:505:501:<TT
6119 CLASS="REPLACEABLE"
6120 ><I
6121 >machine_nickname</I
6122 ></TT
6123 >:/dev/null:/bin/false</PRE
6124 ></TD
6125 ></TR
6126 ></TABLE
6127 ></P
6128 ><P
6129 >Above, <TT
6130 CLASS="REPLACEABLE"
6131 ><I
6132 >machine_nickname</I
6133 ></TT
6134 > can be any
6135 descriptive name for the client, i.e., BasementComputer.
6136 <TT
6137 CLASS="REPLACEABLE"
6138 ><I
6139 >machine_name</I
6140 ></TT
6141 > absolutely must be the NetBIOS
6142 name of the client to be joined to the domain.  The "$" must be
6143 appended to the NetBIOS name of the client or Samba will not recognize
6144 this as a machine trust account.</P
6145 ><P
6146 >Now that the corresponding Unix account has been created, the next step is to create 
6147 the Samba account for the client containing the well-known initial 
6148 machine trust account password.  This can be done using the <A
6149 HREF="smbpasswd.8.html"
6150 TARGET="_top"
6151 ><B
6152 CLASS="COMMAND"
6153 >smbpasswd(8)</B
6154 ></A
6155 > command 
6156 as shown here:</P
6157 ><P
6158 ><TT
6159 CLASS="PROMPT"
6160 >root# </TT
6161 ><B
6162 CLASS="COMMAND"
6163 >smbpasswd -a -m <TT
6164 CLASS="REPLACEABLE"
6165 ><I
6166 >machine_name</I
6167 ></TT
6168 ></B
6169 ></P
6170 ><P
6171 >where <TT
6172 CLASS="REPLACEABLE"
6173 ><I
6174 >machine_name</I
6175 ></TT
6176 > is the machine's NetBIOS
6177 name.  The RID of the new machine account is generated from the UID of 
6178 the corresponding Unix account.</P
6179 ><DIV
6180 CLASS="WARNING"
6181 ><P
6182 ></P
6183 ><TABLE
6184 CLASS="WARNING"
6185 BORDER="1"
6186 WIDTH="100%"
6187 ><TR
6188 ><TD
6189 ALIGN="CENTER"
6190 ><B
6191 >Join the client to the domain immediately</B
6192 ></TD
6193 ></TR
6194 ><TR
6195 ><TD
6196 ALIGN="LEFT"
6197 ><P
6198 >       Manually creating a machine trust account using this method is the 
6199         equivalent of creating a machine trust account on a Windows NT PDC using 
6200         the "Server Manager".  From the time at which the account is created
6201         to the time which the client joins the domain and changes the password,
6202         your domain is vulnerable to an intruder joining your domain using a
6203         a machine with the same NetBIOS name.  A PDC inherently trusts
6204         members of the domain and will serve out a large degree of user 
6205         information to such clients.  You have been warned!
6206         </P
6207 ></TD
6208 ></TR
6209 ></TABLE
6210 ></DIV
6211 ></DIV
6212 ><DIV
6213 CLASS="SECT2"
6214 ><HR><H2
6215 CLASS="SECT2"
6216 ><A
6217 NAME="AEN1234"
6218 >8.4.2. "On-the-Fly" Creation of Machine Trust Accounts</A
6219 ></H2
6220 ><P
6221 >The second (and recommended) way of creating machine trust accounts is
6222 simply to allow the Samba server to create them as needed when the client
6223 is joined to the domain. </P
6224 ><P
6225 >Since each Samba machine trust account requires a corresponding
6226 Unix account, a method for automatically creating the
6227 Unix account is usually supplied; this requires configuration of the
6228 <A
6229 HREF="smb.conf.5.html#ADDUSERSCRIPT"
6230 TARGET="_top"
6231 >add user script</A
6232
6233 option in <TT
6234 CLASS="FILENAME"
6235 >smb.conf</TT
6236 >.  This
6237 method is not required, however; corresponding Unix accounts may also
6238 be created manually.</P
6239 ><P
6240 >Below is an example for a RedHat 6.2 Linux system.</P
6241 ><P
6242 ><TABLE
6243 BORDER="0"
6244 BGCOLOR="#E0E0E0"
6245 WIDTH="100%"
6246 ><TR
6247 ><TD
6248 ><PRE
6249 CLASS="PROGRAMLISTING"
6250 >[global]
6251    # &#60;...remainder of parameters...&#62;
6252    add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u </PRE
6253 ></TD
6254 ></TR
6255 ></TABLE
6256 ></P
6257 ></DIV
6258 ><DIV
6259 CLASS="SECT2"
6260 ><HR><H2
6261 CLASS="SECT2"
6262 ><A
6263 NAME="AEN1243"
6264 >8.4.3. Joining the Client to the Domain</A
6265 ></H2
6266 ><P
6267 >The procedure for joining a client to the domain varies with the
6268 version of Windows.</P
6269 ><P
6270 ></P
6271 ><UL
6272 ><LI
6273 ><P
6274 ><EM
6275 >Windows 2000</EM
6276 ></P
6277 ><P
6278 > When the user elects to join the client to a domain, Windows prompts for
6279         an account and password that is privileged to join the domain.  A
6280         Samba administrative account (i.e., a Samba account that has root
6281         privileges on the Samba server) must be entered here; the
6282         operation will fail if an ordinary user account is given. 
6283         The password for this account should be
6284         set to a different password than the associated
6285         <TT
6286 CLASS="FILENAME"
6287 >/etc/passwd</TT
6288 > entry, for security
6289         reasons. </P
6290 ><P
6291 >The session key of the Samba administrative account acts as an
6292         encryption key for setting the password of the machine trust
6293         account. The machine trust account will be created on-the-fly, or
6294         updated if it already exists.</P
6295 ></LI
6296 ><LI
6297 ><P
6298 ><EM
6299 >Windows NT</EM
6300 ></P
6301 ><P
6302 > If the machine trust account was created manually, on the
6303         Identification Changes menu enter the domain name, but do not
6304         check the box "Create a Computer Account in the Domain."  In this case,
6305         the existing machine trust account is used to join the machine to
6306         the domain.</P
6307 ><P
6308 > If the machine trust account is to be created
6309         on-the-fly, on the Identification Changes menu enter the domain
6310         name, and check the box "Create a Computer Account in the Domain."  In
6311         this case, joining the domain proceeds as above for Windows 2000
6312         (i.e., you must supply a Samba administrative account when
6313         prompted).</P
6314 ></LI
6315 ></UL
6316 ></DIV
6317 ></DIV
6318 ><DIV
6319 CLASS="SECT1"
6320 ><HR><H1
6321 CLASS="SECT1"
6322 ><A
6323 NAME="AEN1258"
6324 >8.5. Common Problems and Errors</A
6325 ></H1
6326 ><P
6327 ></P
6328 ><P
6329 ></P
6330 ><UL
6331 ><LI
6332 ><P
6333 >       <EM
6334 >I cannot include a '$' in a machine name.</EM
6335 >
6336         </P
6337 ><P
6338 >       A 'machine name' in (typically) <TT
6339 CLASS="FILENAME"
6340 >/etc/passwd</TT
6341 >       
6342         of the machine name with a '$' appended. FreeBSD (and other BSD 
6343         systems?) won't create a user with a '$' in their name.
6344         </P
6345 ><P
6346 >       The problem is only in the program used to make the entry, once 
6347         made, it works perfectly. So create a user without the '$' and 
6348         use <B
6349 CLASS="COMMAND"
6350 >vipw</B
6351 > to edit the entry, adding the '$'. Or create 
6352         the whole entry with vipw if you like, make sure you use a 
6353         unique User ID !
6354         </P
6355 ></LI
6356 ><LI
6357 ><P
6358 >       <EM
6359 >I get told "You already have a connection to the Domain...." 
6360         or "Cannot join domain, the credentials supplied conflict with an 
6361         existing set.." when creating a machine trust account.</EM
6362 >
6363         </P
6364 ><P
6365 >       This happens if you try to create a machine trust account from the 
6366         machine itself and already have a connection (e.g. mapped drive) 
6367         to a share (or IPC$) on the Samba PDC.  The following command
6368         will remove all network drive connections:
6369         </P
6370 ><P
6371 >       <TT
6372 CLASS="PROMPT"
6373 >C:\WINNT\&#62;</TT
6374 > <B
6375 CLASS="COMMAND"
6376 >net use * /d</B
6377 >
6378         </P
6379 ><P
6380 >       Further, if the machine is a already a 'member of a workgroup' that 
6381         is the same name as the domain you are joining (bad idea) you will 
6382         get this message.  Change the workgroup name to something else, it 
6383         does not matter what, reboot, and try again.
6384         </P
6385 ></LI
6386 ><LI
6387 ><P
6388 >       <EM
6389 >The system can not log you on (C000019B)....</EM
6390 >
6391         </P
6392 ><P
6393 >I joined the domain successfully but after upgrading 
6394         to a newer version of the Samba code I get the message, "The system 
6395         can not log you on (C000019B), Please try a gain or consult your 
6396         system administrator" when attempting to logon.
6397         </P
6398 ><P
6399 >       This occurs when the domain SID stored in 
6400         <TT
6401 CLASS="FILENAME"
6402 >private/WORKGROUP.SID</TT
6403 > is 
6404         changed.  For example, you remove the file and <B
6405 CLASS="COMMAND"
6406 >smbd</B
6407 > automatically 
6408         creates a new one.  Or you are swapping back and forth between 
6409         versions 2.0.7, TNG and the HEAD branch code (not recommended).  The 
6410         only way to correct the problem is to restore the original domain 
6411         SID or remove the domain client from the domain and rejoin.
6412         </P
6413 ></LI
6414 ><LI
6415 ><P
6416 >       <EM
6417 >The machine trust account for this computer either does not 
6418         exist or is not accessible.</EM
6419 >
6420         </P
6421 ><P
6422 >       When I try to join the domain I get the message "The machine account 
6423         for this computer either does not exist or is not accessible". What's 
6424         wrong?
6425         </P
6426 ><P
6427 >       This problem is caused by the PDC not having a suitable machine trust account. 
6428         If you are using the <TT
6429 CLASS="PARAMETER"
6430 ><I
6431 >add user script</I
6432 ></TT
6433 > method to create 
6434         accounts then this would indicate that it has not worked. Ensure the domain 
6435         admin user system is working.
6436         </P
6437 ><P
6438 >       Alternatively if you are creating account entries manually then they 
6439         have not been created correctly. Make sure that you have the entry 
6440         correct for the machine trust account in smbpasswd file on the Samba PDC. 
6441         If you added the account using an editor rather than using the smbpasswd 
6442         utility, make sure that the account name is the machine NetBIOS name 
6443         with a '$' appended to it ( i.e. computer_name$ ). There must be an entry 
6444         in both /etc/passwd and the smbpasswd file. Some people have reported 
6445         that inconsistent subnet masks between the Samba server and the NT 
6446         client have caused this problem.   Make sure that these are consistent 
6447         for both client and server.
6448         </P
6449 ></LI
6450 ><LI
6451 ><P
6452 >       <EM
6453 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
6454         I get a message about my account being disabled.</EM
6455 >
6456         </P
6457 ><P
6458 >       This problem is caused by a PAM related bug in Samba 2.2.0.  This bug is 
6459         fixed in 2.2.1.  Other symptoms could be unaccessible shares on 
6460         NT/W2K member servers in the domain or the following error in your smbd.log:
6461         passdb/pampass.c:pam_account(268) PAM: UNKNOWN ERROR for User: %user%
6462         </P
6463 ><P
6464 >       At first be ensure to enable the useraccounts with <B
6465 CLASS="COMMAND"
6466 >smbpasswd -e 
6467         %user%</B
6468 >, this is normally done, when you create an account.
6469         </P
6470 ><P
6471 >       In order to work around this problem in 2.2.0, configure the 
6472         <TT
6473 CLASS="PARAMETER"
6474 ><I
6475 >account</I
6476 ></TT
6477 > control flag in 
6478         <TT
6479 CLASS="FILENAME"
6480 >/etc/pam.d/samba</TT
6481 > file as follows:
6482         </P
6483 ><P
6484 ><TABLE
6485 BORDER="0"
6486 BGCOLOR="#E0E0E0"
6487 WIDTH="90%"
6488 ><TR
6489 ><TD
6490 ><PRE
6491 CLASS="PROGRAMLISTING"
6492 >       account required        pam_permit.so
6493         </PRE
6494 ></TD
6495 ></TR
6496 ></TABLE
6497 ></P
6498 ><P
6499 >       If you want to remain backward compatibility to samba 2.0.x use
6500         <TT
6501 CLASS="FILENAME"
6502 >pam_permit.so</TT
6503 >, it's also possible to use 
6504         <TT
6505 CLASS="FILENAME"
6506 >pam_pwdb.so</TT
6507 >. There are some bugs if you try to 
6508         use <TT
6509 CLASS="FILENAME"
6510 >pam_unix.so</TT
6511 >, if you need this, be ensure to use
6512         the most recent version of this file.
6513         </P
6514 ></LI
6515 ></UL
6516 ></DIV
6517 ><DIV
6518 CLASS="SECT1"
6519 ><HR><H1
6520 CLASS="SECT1"
6521 ><A
6522 NAME="AEN1306"
6523 >8.6. System Policies and Profiles</A
6524 ></H1
6525 ><P
6526 >Much of the information necessary to implement System Policies and
6527 Roving User Profiles in a Samba domain is the same as that for 
6528 implementing these same items in a Windows NT 4.0 domain. 
6529 You should read the white paper <A
6530 HREF="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp"
6531 TARGET="_top"
6532 >Implementing
6533 Profiles and Policies in Windows NT 4.0</A
6534 > available from Microsoft.</P
6535 ><P
6536 >Here are some additional details:</P
6537 ><P
6538 ></P
6539 ><UL
6540 ><LI
6541 ><P
6542 >       <EM
6543 >What about Windows NT Policy Editor?</EM
6544 >
6545         </P
6546 ><P
6547 >       To create or edit <TT
6548 CLASS="FILENAME"
6549 >ntconfig.pol</TT
6550 > you must use 
6551         the NT Server Policy Editor, <B
6552 CLASS="COMMAND"
6553 >poledit.exe</B
6554 >       which 
6555         is included with NT Server but <EM
6556 >not NT Workstation</EM
6557 >. 
6558         There is a Policy Editor on a NTws 
6559         but it is not suitable for creating <EM
6560 >Domain Policies</EM
6561 >. 
6562         Further, although the Windows 95 
6563         Policy Editor can be installed on an NT Workstation/Server, it will not
6564         work with NT policies because the registry key that are set by the policy templates. 
6565         However, the files from the NT Server will run happily enough on an NTws.       
6566         You need <TT
6567 CLASS="FILENAME"
6568 >poledit.exe, common.adm</TT
6569 > and <TT
6570 CLASS="FILENAME"
6571 >winnt.adm</TT
6572 >. It is convenient
6573         to put the two *.adm files in <TT
6574 CLASS="FILENAME"
6575 >c:\winnt\inf</TT
6576 > which is where
6577         the binary will look for them unless told otherwise. Note also that that 
6578         directory is 'hidden'.
6579         </P
6580 ><P
6581 >       The Windows NT policy editor is also included with the Service Pack 3 (and 
6582         later) for Windows NT 4.0. Extract the files using <B
6583 CLASS="COMMAND"
6584 >servicepackname /x</B
6585 >, 
6586         i.e. that's <B
6587 CLASS="COMMAND"
6588 >Nt4sp6ai.exe /x</B
6589 > for service pack 6a.  The policy editor, 
6590         <B
6591 CLASS="COMMAND"
6592 >poledit.exe</B
6593 > and the associated template files (*.adm) should
6594         be extracted as well.  It is also possible to downloaded the policy template 
6595         files for Office97 and get a copy of the policy editor.  Another possible 
6596         location is with the Zero Administration Kit available for download from Microsoft.
6597         </P
6598 ></LI
6599 ><LI
6600 ><P
6601 >       <EM
6602 >Can Win95 do Policies?</EM
6603 >
6604         </P
6605 ><P
6606 >       Install the group policy handler for Win9x to pick up group 
6607         policies.   Look on the Win98 CD in <TT
6608 CLASS="FILENAME"
6609 >\tools\reskit\netadmin\poledit</TT
6610 >. 
6611         Install group policies on a Win9x client by double-clicking 
6612         <TT
6613 CLASS="FILENAME"
6614 >grouppol.inf</TT
6615 >. Log off and on again a couple of 
6616         times and see if Win98 picks up group policies.  Unfortunately this needs 
6617         to be done on every Win9x machine that uses group policies....
6618         </P
6619 ><P
6620 >       If group policies don't work one reports suggests getting the updated 
6621         (read: working) grouppol.dll for Windows 9x. The group list is grabbed 
6622         from /etc/group.
6623         </P
6624 ></LI
6625 ><LI
6626 ><P
6627 >       <EM
6628 >How do I get 'User Manager' and 'Server Manager'</EM
6629 >
6630         </P
6631 ><P
6632 >       Since I don't need to buy an NT Server CD now, how do I get 
6633         the 'User Manager for Domains', the 'Server Manager'?
6634         </P
6635 ><P
6636 >       Microsoft distributes a version of these tools called nexus for 
6637         installation on Windows 95 systems.  The tools set includes
6638         </P
6639 ><P
6640 ></P
6641 ><UL
6642 ><LI
6643 ><P
6644 >Server Manager</P
6645 ></LI
6646 ><LI
6647 ><P
6648 >User Manager for Domains</P
6649 ></LI
6650 ><LI
6651 ><P
6652 >Event Viewer</P
6653 ></LI
6654 ></UL
6655 ><P
6656 >       Click here to download the archived file <A
6657 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE"
6658 TARGET="_top"
6659 >ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</A
6660 >
6661         </P
6662 ><P
6663 >       The Windows NT 4.0 version of the 'User Manager for 
6664         Domains' and 'Server Manager' are available from Microsoft via ftp 
6665         from <A
6666 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE"
6667 TARGET="_top"
6668 >ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</A
6669 >
6670         </P
6671 ></LI
6672 ></UL
6673 ></DIV
6674 ><DIV
6675 CLASS="SECT1"
6676 ><HR><H1
6677 CLASS="SECT1"
6678 ><A
6679 NAME="AEN1350"
6680 >8.7. What other help can I get?</A
6681 ></H1
6682 ><P
6683 >There are many sources of information available in the form 
6684 of mailing lists, RFC's and documentation.  The docs that come 
6685 with the samba distribution contain very good explanations of 
6686 general SMB topics such as browsing.</P
6687 ><P
6688 ></P
6689 ><UL
6690 ><LI
6691 ><P
6692 >       <EM
6693 >What are some diagnostics tools I can use to debug the domain logon 
6694         process and where can I find them?</EM
6695 >
6696         </P
6697 ><P
6698 >       One of the best diagnostic tools for debugging problems is Samba itself.  
6699         You can use the -d option for both smbd and nmbd to specify what 
6700         'debug level' at which to run.  See the man pages on smbd, nmbd  and 
6701         smb.conf for more information on debugging options.  The debug 
6702         level can range from 1 (the default) to 10 (100 for debugging passwords).
6703         </P
6704 ><P
6705 >       Another helpful method of debugging is to compile samba using the 
6706         <B
6707 CLASS="COMMAND"
6708 >gcc -g </B
6709 > flag.   This will include debug 
6710         information in the binaries and allow you to attach gdb to the 
6711         running smbd / nmbd process.  In order to attach gdb to an smbd 
6712         process for an NT workstation, first get the workstation to make the 
6713         connection. Pressing ctrl-alt-delete and going down to the domain box 
6714         is sufficient (at least, on the first time you join the domain) to 
6715         generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation 
6716         maintains an open connection, and therefore there will be an smbd 
6717         process running (assuming that you haven't set a really short smbd 
6718         idle timeout)  So, in between pressing ctrl alt delete, and actually 
6719         typing in your password, you can gdb attach and continue.
6720         </P
6721 ><P
6722 >       Some useful samba commands worth investigating:
6723         </P
6724 ><P
6725 ></P
6726 ><UL
6727 ><LI
6728 ><P
6729 >testparam | more</P
6730 ></LI
6731 ><LI
6732 ><P
6733 >smbclient -L //{netbios name of server}</P
6734 ></LI
6735 ></UL
6736 ><P
6737 >       An SMB enabled version of tcpdump is available from 
6738         <A
6739 HREF="http://www.tcpdump.org/"
6740 TARGET="_top"
6741 >http://www.tcpdup.org/</A
6742 >.
6743         Ethereal, another good packet sniffer for Unix and Win32
6744         hosts, can be downloaded from <A
6745 HREF="http://www.ethereal.com/"
6746 TARGET="_top"
6747 >http://www.ethereal.com</A
6748 >.
6749         </P
6750 ><P
6751 >       For tracing things on the Microsoft Windows NT, Network Monitor 
6752         (aka. netmon) is available on the Microsoft Developer Network CD's, 
6753         the Windows NT Server install CD and the SMS CD's.  The version of 
6754         netmon that ships with SMS allows for dumping packets between any two 
6755         computers (i.e. placing the network interface in promiscuous mode).  
6756         The version on the NT Server install CD will only allow monitoring 
6757         of network traffic directed to the local NT box and broadcasts on the 
6758         local subnet.  Be aware that Ethereal can read and write netmon 
6759         formatted files.
6760         </P
6761 ></LI
6762 ><LI
6763 ><P
6764 >       <EM
6765 >How do I install 'Network Monitor' on an NT Workstation 
6766         or a Windows 9x box?</EM
6767 >
6768         </P
6769 ><P
6770 >       Installing netmon on an NT workstation requires a couple 
6771         of steps.  The following are for installing Netmon V4.00.349, which comes 
6772         with Microsoft Windows NT Server 4.0, on Microsoft Windows NT 
6773         Workstation 4.0.  The process should be similar for other version of 
6774         Windows NT / Netmon.  You will need both the Microsoft Windows 
6775         NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
6776         </P
6777 ><P
6778 >       Initially you will need to install 'Network Monitor Tools and Agent' 
6779         on the NT Server.  To do this 
6780         </P
6781 ><P
6782 ></P
6783 ><UL
6784 ><LI
6785 ><P
6786 >Goto Start - Settings - Control Panel - 
6787                 Network - Services - Add </P
6788 ></LI
6789 ><LI
6790 ><P
6791 >Select the 'Network Monitor Tools and Agent' and 
6792                 click on 'OK'.</P
6793 ></LI
6794 ><LI
6795 ><P
6796 >Click 'OK' on the Network Control Panel.
6797                 </P
6798 ></LI
6799 ><LI
6800 ><P
6801 >Insert the Windows NT Server 4.0 install CD 
6802                 when prompted.</P
6803 ></LI
6804 ></UL
6805 ><P
6806 >       At this point the Netmon files should exist in 
6807         <TT
6808 CLASS="FILENAME"
6809 >%SYSTEMROOT%\System32\netmon\*.*</TT
6810 >.    
6811         Two subdirectories exist as well, <TT
6812 CLASS="FILENAME"
6813 >parsers\</TT
6814
6815         which contains the necessary DLL's for parsing the netmon packet 
6816         dump, and <TT
6817 CLASS="FILENAME"
6818 >captures\</TT
6819 >.
6820         </P
6821 ><P
6822 >       In order to install the Netmon tools on an NT Workstation, you will 
6823         first need to install the 'Network  Monitor Agent' from the Workstation 
6824         install CD.
6825         </P
6826 ><P
6827 ></P
6828 ><UL
6829 ><LI
6830 ><P
6831 >Goto Start - Settings - Control Panel - 
6832                 Network - Services - Add</P
6833 ></LI
6834 ><LI
6835 ><P
6836 >Select the 'Network Monitor Agent' and click 
6837                 on 'OK'.</P
6838 ></LI
6839 ><LI
6840 ><P
6841 >Click 'OK' on the Network Control Panel.
6842                 </P
6843 ></LI
6844 ><LI
6845 ><P
6846 >Insert the Windows NT Workstation 4.0 install 
6847                 CD when prompted.</P
6848 ></LI
6849 ></UL
6850 ><P
6851 >       Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.* 
6852         to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set 
6853         permissions as  you deem appropriate for your site. You will need 
6854         administrative rights on the NT box to run netmon.
6855         </P
6856 ><P
6857 >       To install Netmon on a Windows 9x box install the network monitor agent 
6858         from the Windows 9x CD (\admin\nettools\netmon).  There is a readme 
6859         file located with the netmon driver files on the CD if you need 
6860         information on how to do this.  Copy the files from a working 
6861         Netmon installation.
6862         </P
6863 ></LI
6864 ><LI
6865 ><P
6866 >       The following is a list if helpful URLs and other links:
6867         </P
6868 ><P
6869 ></P
6870 ><UL
6871 ><LI
6872 ><P
6873 >Home of Samba site <A
6874 HREF="http://samba.org"
6875 TARGET="_top"
6876 >        http://samba.org</A
6877 >. We have a mirror near you !</P
6878 ></LI
6879 ><LI
6880 ><P
6881 > The <EM
6882 >Development</EM
6883 > document 
6884         on the Samba mirrors might mention your problem. If so,
6885         it might mean that the developers are working on it.</P
6886 ></LI
6887 ><LI
6888 ><P
6889 >See how Scott Merrill simulates a BDC behavior at 
6890         <A
6891 HREF="http://www.skippy.net/linux/smb-howto.html"
6892 TARGET="_top"
6893 >        http://www.skippy.net/linux/smb-howto.html</A
6894 >. </P
6895 ></LI
6896 ><LI
6897 ><P
6898 >Although 2.0.7 has almost had its day as a PDC, David Bannon will
6899         keep the 2.0.7 PDC pages at <A
6900 HREF="http://bioserve.latrobe.edu.au/samba"
6901 TARGET="_top"
6902 >        http://bioserve.latrobe.edu.au/samba</A
6903 > going for a while yet.</P
6904 ></LI
6905 ><LI
6906 ><P
6907 >Misc links to CIFS information 
6908         <A
6909 HREF="http://samba.org/cifs/"
6910 TARGET="_top"
6911 >http://samba.org/cifs/</A
6912 ></P
6913 ></LI
6914 ><LI
6915 ><P
6916 >NT Domains for Unix <A
6917 HREF="http://mailhost.cb1.com/~lkcl/ntdom/"
6918 TARGET="_top"
6919 >        http://mailhost.cb1.com/~lkcl/ntdom/</A
6920 ></P
6921 ></LI
6922 ><LI
6923 ><P
6924 >FTP site for older SMB specs: 
6925         <A
6926 HREF="ftp://ftp.microsoft.com/developr/drg/CIFS/"
6927 TARGET="_top"
6928 >        ftp://ftp.microsoft.com/developr/drg/CIFS/</A
6929 ></P
6930 ></LI
6931 ></UL
6932 ></LI
6933 ></UL
6934 ><P
6935 ></P
6936 ><UL
6937 ><LI
6938 ><P
6939 >       <EM
6940 >How do I get help from the mailing lists?</EM
6941 >
6942         </P
6943 ><P
6944 >       There are a number of Samba related mailing lists. Go to <A
6945 HREF="http://samba.org"
6946 TARGET="_top"
6947 >http://samba.org</A
6948 >, click on your nearest mirror
6949         and then click on <B
6950 CLASS="COMMAND"
6951 >Support</B
6952 > and then click on <B
6953 CLASS="COMMAND"
6954 >       Samba related mailing lists</B
6955 >.
6956         </P
6957 ><P
6958 >       For questions relating to Samba TNG go to
6959         <A
6960 HREF="http://www.samba-tng.org/"
6961 TARGET="_top"
6962 >http://www.samba-tng.org/</A
6963
6964         It has been requested that you don't post questions about Samba-TNG to the
6965         main stream Samba lists.</P
6966 ><P
6967 >       If you post a message to one of the lists please observe the following guide lines :
6968         </P
6969 ><P
6970 ></P
6971 ><UL
6972 ><LI
6973 ><P
6974 > Always remember that the developers are volunteers, they are 
6975                 not paid and they never guarantee to produce a particular feature at 
6976                 a particular time. Any time lines are 'best guess' and nothing more.
6977                 </P
6978 ></LI
6979 ><LI
6980 ><P
6981 > Always mention what version of samba you are using and what 
6982                 operating system its running under. You should probably list the
6983         relevant sections of your smb.conf file, at least the options 
6984         in [global] that affect PDC support.</P
6985 ></LI
6986 ><LI
6987 ><P
6988 >In addition to the version, if you obtained Samba via
6989         CVS mention the date when you last checked it out.</P
6990 ></LI
6991 ><LI
6992 ><P
6993 > Try and make your question clear and brief, lots of long, 
6994                 convoluted questions get deleted before they are completely read ! 
6995                 Don't post html encoded messages (if you can select colour or font 
6996                 size its html).</P
6997 ></LI
6998 ><LI
6999 ><P
7000 > If you run one of those nifty 'I'm on holidays' things when 
7001                 you are away, make sure its configured  to not answer mailing lists.
7002                 </P
7003 ></LI
7004 ><LI
7005 ><P
7006 > Don't cross post. Work out which is the best list to post to 
7007                 and see what happens, i.e. don't post to both samba-ntdom and samba-technical.
7008         Many people active on the lists subscribe to more 
7009                 than one list and get annoyed to see the same message two or more times. 
7010                 Often someone will see a message and thinking it would be better dealt 
7011                 with on another, will forward it on for you.</P
7012 ></LI
7013 ><LI
7014 ><P
7015 >You might include <EM
7016 >partial</EM
7017 >
7018         log files written at a debug level set to as much as 20.  
7019         Please don't send the entire log but enough to give the context of the 
7020         error messages.</P
7021 ></LI
7022 ><LI
7023 ><P
7024 >(Possibly) If you have a complete netmon trace ( from the opening of 
7025         the pipe to the error ) you can send the *.CAP file as well.</P
7026 ></LI
7027 ><LI
7028 ><P
7029 >Please think carefully before attaching a document to an email.
7030         Consider pasting the relevant parts into the body of the message. The samba
7031         mailing lists go to a huge number of people, do they all need a copy of your 
7032         smb.conf in their attach directory?</P
7033 ></LI
7034 ></UL
7035 ></LI
7036 ><LI
7037 ><P
7038 >       <EM
7039 >How do I get off the mailing lists?</EM
7040 >
7041         </P
7042 ><P
7043 >To have your name removed from a samba mailing list, go to the
7044         same place you went to to get on it. Go to <A
7045 HREF="http://lists.samba.org/"
7046 TARGET="_top"
7047 >http://lists.samba.org</A
7048 >, 
7049         click on your nearest mirror and then click on <B
7050 CLASS="COMMAND"
7051 >Support</B
7052 > and 
7053         then click on <B
7054 CLASS="COMMAND"
7055 > Samba related mailing lists</B
7056 >. Or perhaps see 
7057         <A
7058 HREF="http://lists.samba.org/mailman/roster/samba-ntdom"
7059 TARGET="_top"
7060 >here</A
7061 >
7062         </P
7063 ><P
7064 >       Please don't post messages to the list asking to be removed, you will just
7065         be referred to the above address (unless that process failed in some way...)
7066         </P
7067 ></LI
7068 ></UL
7069 ></DIV
7070 ><DIV
7071 CLASS="SECT1"
7072 ><HR><H1
7073 CLASS="SECT1"
7074 ><A
7075 NAME="AEN1464"
7076 >8.8. Domain Control for Windows 9x/ME</A
7077 ></H1
7078 ><DIV
7079 CLASS="NOTE"
7080 ><BLOCKQUOTE
7081 CLASS="NOTE"
7082 ><P
7083 ><B
7084 >Note: </B
7085 >The following section contains much of the original 
7086 DOMAIN.txt file previously included with Samba.  Much of 
7087 the material is based on what went into the book <EM
7088 >Special 
7089 Edition, Using Samba</EM
7090 >, by Richard Sharpe.</P
7091 ></BLOCKQUOTE
7092 ></DIV
7093 ><P
7094 >A domain and a workgroup are exactly the same thing in terms of network
7095 browsing.  The difference is that a distributable authentication
7096 database is associated with a domain, for secure login access to a
7097 network.  Also, different access rights can be granted to users if they
7098 successfully authenticate against a domain logon server (NT server and 
7099 other systems based on NT server support this, as does at least Samba TNG now).</P
7100 ><P
7101 >The SMB client logging on to a domain has an expectation that every other
7102 server in the domain should accept the same authentication information.
7103 Network browsing functionality of domains and workgroups is
7104 identical and is explained in BROWSING.txt. It should be noted, that browsing
7105 is totally orthogonal to logon support.</P
7106 ><P
7107 >Issues related to the single-logon network model are discussed in this
7108 section.  Samba supports domain logons, network logon scripts, and user
7109 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
7110 which will be the focus of this section.</P
7111 ><P
7112 >When an SMB client in a domain wishes to logon it broadcast requests for a
7113 logon server.  The first one to reply gets the job, and validates its
7114 password using whatever mechanism the Samba administrator has installed.
7115 It is possible (but very stupid) to create a domain where the user
7116 database is not shared between servers, i.e. they are effectively workgroup
7117 servers advertising themselves as participating in a domain.  This
7118 demonstrates how authentication is quite different from but closely
7119 involved with domains.</P
7120 ><P
7121 >Using these features you can make your clients verify their logon via
7122 the Samba server; make clients run a batch file when they logon to
7123 the network and download their preferences, desktop and start menu.</P
7124 ><P
7125 >Before launching into the configuration instructions, it is 
7126 worthwhile lookingat how a Windows 9x/ME client performs a logon:</P
7127 ><P
7128 ></P
7129 ><OL
7130 TYPE="1"
7131 ><LI
7132 ><P
7133 >       The client broadcasts (to the IP broadcast address of the subnet it is in)
7134         a NetLogon request. This is sent to the NetBIOS name DOMAIN&#60;1c&#62; at the
7135         NetBIOS layer.  The client chooses the first response it receives, which
7136         contains the NetBIOS name of the logon server to use in the format of 
7137         \\SERVER.
7138         </P
7139 ></LI
7140 ><LI
7141 ><P
7142 >       The client then connects to that server, logs on (does an SMBsessetupX) and
7143         then connects to the IPC$ share (using an SMBtconX).
7144         </P
7145 ></LI
7146 ><LI
7147 ><P
7148 >       The client then does a NetWkstaUserLogon request, which retrieves the name
7149         of the user's logon script. 
7150         </P
7151 ></LI
7152 ><LI
7153 ><P
7154 >       The client then connects to the NetLogon share and searches for this    
7155         and if it is found and can be read, is retrieved and executed by the client.
7156         After this, the client disconnects from the NetLogon share.
7157         </P
7158 ></LI
7159 ><LI
7160 ><P
7161 >       The client then sends a NetUserGetInfo request to the server, to retrieve
7162         the user's home share, which is used to search for profiles. Since the
7163         response to the NetUserGetInfo request does not contain much more       
7164         the user's home share, profiles for Win9X clients MUST reside in the user
7165         home directory.
7166         </P
7167 ></LI
7168 ><LI
7169 ><P
7170 >       The client then connects to the user's home share and searches for the 
7171         user's profile. As it turns out, you can specify the user's home share as
7172         a sharename and path. For example, \\server\fred\.profile.
7173         If the profiles are found, they are implemented.
7174         </P
7175 ></LI
7176 ><LI
7177 ><P
7178 >       The client then disconnects from the user's home share, and reconnects to
7179         the NetLogon share and looks for CONFIG.POL, the policies file. If this is
7180         found, it is read and implemented.
7181         </P
7182 ></LI
7183 ></OL
7184 ><DIV
7185 CLASS="SECT2"
7186 ><HR><H2
7187 CLASS="SECT2"
7188 ><A
7189 NAME="AEN1490"
7190 >8.8.1. Configuration Instructions:     Network Logons</A
7191 ></H2
7192 ><P
7193 >The main difference between a PDC and a Windows 9x logon 
7194 server configuration is that</P
7195 ><P
7196 ></P
7197 ><UL
7198 ><LI
7199 ><P
7200 >Password encryption is not required for a Windows 9x logon server.</P
7201 ></LI
7202 ><LI
7203 ><P
7204 >Windows 9x/ME clients do not possess machine trust accounts.</P
7205 ></LI
7206 ></UL
7207 ><P
7208 >Therefore, a Samba PDC will also act as a Windows 9x logon 
7209 server.</P
7210 ><DIV
7211 CLASS="WARNING"
7212 ><P
7213 ></P
7214 ><TABLE
7215 CLASS="WARNING"
7216 BORDER="1"
7217 WIDTH="100%"
7218 ><TR
7219 ><TD
7220 ALIGN="CENTER"
7221 ><B
7222 >security mode and master browsers</B
7223 ></TD
7224 ></TR
7225 ><TR
7226 ><TD
7227 ALIGN="LEFT"
7228 ><P
7229 >There are a few comments to make in order to tie up some 
7230 loose ends.  There has been much debate over the issue of whether
7231 or not it is ok to configure Samba as a Domain Controller in security
7232 modes other than <TT
7233 CLASS="CONSTANT"
7234 >USER</TT
7235 >.  The only security mode 
7236 which  will not work due to technical reasons is <TT
7237 CLASS="CONSTANT"
7238 >SHARE</TT
7239 >
7240 mode security.  <TT
7241 CLASS="CONSTANT"
7242 >DOMAIN</TT
7243 > and <TT
7244 CLASS="CONSTANT"
7245 >SERVER</TT
7246 >
7247 mode security is really just a variation on SMB user level security.</P
7248 ><P
7249 >Actually, this issue is also closely tied to the debate on whether 
7250 or not Samba must be the domain master browser for its workgroup
7251 when operating as a DC.  While it may technically be possible
7252 to configure a server as such (after all, browsing and domain logons
7253 are two distinctly different functions), it is not a good idea to
7254 so.  You should remember that the DC must register the DOMAIN#1b NetBIOS 
7255 name.  This is the name used by Windows clients to locate the DC.
7256 Windows clients do not distinguish between the DC and the DMB.
7257 For this reason, it is very wise to configure the Samba DC as the DMB.</P
7258 ><P
7259 >Now back to the issue of configuring a Samba DC to use a mode other
7260 than "security = user".  If a Samba host is configured to use 
7261 another SMB server or DC in order to validate user connection 
7262 requests, then it is a fact that some other machine on the network 
7263 (the "password server") knows more about user than the Samba host.
7264 99% of the time, this other host is a domain controller.  Now 
7265 in order to operate in domain mode security, the "workgroup" parameter
7266 must be set to the name of the Windows NT domain (which already 
7267 has a domain controller, right?)</P
7268 ><P
7269 >Therefore configuring a Samba box as a DC for a domain that 
7270 already by definition has a PDC is asking for trouble.
7271 Therefore, you should always configure the Samba DC to be the DMB
7272 for its domain.</P
7273 ></TD
7274 ></TR
7275 ></TABLE
7276 ></DIV
7277 ></DIV
7278 ><DIV
7279 CLASS="SECT2"
7280 ><HR><H2
7281 CLASS="SECT2"
7282 ><A
7283 NAME="AEN1509"
7284 >8.8.2. Configuration Instructions:     Setting up Roaming User Profiles</A
7285 ></H2
7286 ><DIV
7287 CLASS="WARNING"
7288 ><P
7289 ></P
7290 ><TABLE
7291 CLASS="WARNING"
7292 BORDER="1"
7293 WIDTH="100%"
7294 ><TR
7295 ><TD
7296 ALIGN="CENTER"
7297 ><B
7298 >Warning</B
7299 ></TD
7300 ></TR
7301 ><TR
7302 ><TD
7303 ALIGN="LEFT"
7304 ><P
7305 ><EM
7306 >NOTE!</EM
7307 > Roaming profiles support is different 
7308 for Win9X and WinNT.</P
7309 ></TD
7310 ></TR
7311 ></TABLE
7312 ></DIV
7313 ><P
7314 >Before discussing how to configure roaming profiles, it is useful to see how
7315 Win9X and WinNT clients implement these features.</P
7316 ><P
7317 >Win9X clients send a NetUserGetInfo request to the server to get the user's
7318 profiles location. However, the response does not have room for a separate 
7319 profiles location field, only the user's home share. This means that Win9X 
7320 profiles are restricted to being in the user's home directory.</P
7321 ><P
7322 >WinNT clients send a NetSAMLogon RPC request, which contains many fields, 
7323 including a separate field for the location of the user's profiles. 
7324 This means that support for profiles is different for Win9X and WinNT.</P
7325 ><DIV
7326 CLASS="SECT3"
7327 ><HR><H3
7328 CLASS="SECT3"
7329 ><A
7330 NAME="AEN1517"
7331 >8.8.2.1. Windows NT Configuration</A
7332 ></H3
7333 ><P
7334 >To support WinNT clients, in the [global] section of smb.conf set the
7335 following (for example):</P
7336 ><P
7337 ><TABLE
7338 BORDER="0"
7339 BGCOLOR="#E0E0E0"
7340 WIDTH="100%"
7341 ><TR
7342 ><TD
7343 ><PRE
7344 CLASS="PROGRAMLISTING"
7345 >logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath</PRE
7346 ></TD
7347 ></TR
7348 ></TABLE
7349 ></P
7350 ><P
7351 >The default for this option is \\%N\%U\profile, namely
7352 \\sambaserver\username\profile.  The \\N%\%U service is created
7353 automatically by the [homes] service.
7354 If you are using a samba server for the profiles, you _must_ make the
7355 share specified in the logon path browseable. </P
7356 ><DIV
7357 CLASS="NOTE"
7358 ><BLOCKQUOTE
7359 CLASS="NOTE"
7360 ><P
7361 ><B
7362 >Note: </B
7363 >[lkcl 26aug96 - we have discovered a problem where Windows clients can
7364 maintain a connection to the [homes] share in between logins.  The
7365 [homes] share must NOT therefore be used in a profile path.]</P
7366 ></BLOCKQUOTE
7367 ></DIV
7368 ></DIV
7369 ><DIV
7370 CLASS="SECT3"
7371 ><HR><H3
7372 CLASS="SECT3"
7373 ><A
7374 NAME="AEN1525"
7375 >8.8.2.2. Windows 9X Configuration</A
7376 ></H3
7377 ><P
7378 >To support Win9X clients, you must use the "logon home" parameter. Samba has
7379 now been fixed so that "net use/home" now works as well, and it, too, relies
7380 on the "logon home" parameter.</P
7381 ><P
7382 >By using the logon home parameter, you are restricted to putting Win9X 
7383 profiles in the user's home directory.   But wait! There is a trick you 
7384 can use. If you set the following in the [global] section of your 
7385 smb.conf file:</P
7386 ><P
7387 ><TABLE
7388 BORDER="0"
7389 BGCOLOR="#E0E0E0"
7390 WIDTH="100%"
7391 ><TR
7392 ><TD
7393 ><PRE
7394 CLASS="PROGRAMLISTING"
7395 >logon home = \\%L\%U\.profiles</PRE
7396 ></TD
7397 ></TR
7398 ></TABLE
7399 ></P
7400 ><P
7401 >then your Win9X clients will dutifully put their clients in a subdirectory
7402 of your home directory called .profiles (thus making them hidden).</P
7403 ><P
7404 >Not only that, but 'net use/home' will also work, because of a feature in 
7405 Win9X. It removes any directory stuff off the end of the home directory area
7406 and only uses the server and share portion. That is, it looks like you
7407 specified \\%L\%U for "logon home".</P
7408 ></DIV
7409 ><DIV
7410 CLASS="SECT3"
7411 ><HR><H3
7412 CLASS="SECT3"
7413 ><A
7414 NAME="AEN1533"
7415 >8.8.2.3. Win9X and WinNT Configuration</A
7416 ></H3
7417 ><P
7418 >You can support profiles for both Win9X and WinNT clients by setting both the
7419 "logon home" and "logon path" parameters. For example:</P
7420 ><P
7421 ><TABLE
7422 BORDER="0"
7423 BGCOLOR="#E0E0E0"
7424 WIDTH="100%"
7425 ><TR
7426 ><TD
7427 ><PRE
7428 CLASS="PROGRAMLISTING"
7429 >logon home = \\%L\%U\.profiles
7430 logon path = \\%L\profiles\%U</PRE
7431 ></TD
7432 ></TR
7433 ></TABLE
7434 ></P
7435 ><DIV
7436 CLASS="NOTE"
7437 ><BLOCKQUOTE
7438 CLASS="NOTE"
7439 ><P
7440 ><B
7441 >Note: </B
7442 >I have not checked what 'net use /home' does on NT when "logon home" is
7443 set as above.</P
7444 ></BLOCKQUOTE
7445 ></DIV
7446 ></DIV
7447 ><DIV
7448 CLASS="SECT3"
7449 ><HR><H3
7450 CLASS="SECT3"
7451 ><A
7452 NAME="AEN1540"
7453 >8.8.2.4. Windows 9X Profile Setup</A
7454 ></H3
7455 ><P
7456 >When a user first logs in on Windows 9X, the file user.DAT is created,
7457 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".  
7458 These directories and their contents will be merged with the local
7459 versions stored in c:\windows\profiles\username on subsequent logins,
7460 taking the most recent from each.  You will need to use the [global]
7461 options "preserve case = yes", "short preserve case = yes" and
7462 "case sensitive = no" in order to maintain capital letters in shortcuts
7463 in any of the profile folders.</P
7464 ><P
7465 >The user.DAT file contains all the user's preferences.  If you wish to
7466 enforce a set of preferences, rename their user.DAT file to user.MAN,
7467 and deny them write access to this file.</P
7468 ><P
7469 ></P
7470 ><OL
7471 TYPE="1"
7472 ><LI
7473 ><P
7474 >       On the Windows 95 machine, go to Control Panel | Passwords and
7475         select the User Profiles tab.  Select the required level of
7476         roaming preferences.  Press OK, but do _not_ allow the computer
7477         to reboot.
7478         </P
7479 ></LI
7480 ><LI
7481 ><P
7482 >       On the Windows 95 machine, go to Control Panel | Network |
7483         Client for Microsoft Networks | Preferences.  Select 'Log on to
7484         NT Domain'.  Then, ensure that the Primary Logon is 'Client for
7485         Microsoft Networks'.  Press OK, and this time allow the computer
7486         to reboot.
7487         </P
7488 ></LI
7489 ></OL
7490 ><P
7491 >Under Windows 95, Profiles are downloaded from the Primary Logon.
7492 If you have the Primary Logon as 'Client for Novell Networks', then
7493 the profiles and logon script will be downloaded from your Novell
7494 Server.  If you have the Primary Logon as 'Windows Logon', then the
7495 profiles will be loaded from the local machine - a bit against the
7496 concept of roaming profiles, if you ask me.</P
7497 ><P
7498 >You will now find that the Microsoft Networks Login box contains
7499 [user, password, domain] instead of just [user, password].  Type in
7500 the samba server's domain name (or any other domain known to exist,
7501 but bear in mind that the user will be authenticated against this
7502 domain and profiles downloaded from it, if that domain logon server
7503 supports it), user name and user's password.</P
7504 ><P
7505 >Once the user has been successfully validated, the Windows 95 machine
7506 will inform you that 'The user has not logged on before' and asks you
7507 if you wish to save the user's preferences?  Select 'yes'.</P
7508 ><P
7509 >Once the Windows 95 client comes up with the desktop, you should be able
7510 to examine the contents of the directory specified in the "logon path"
7511 on the samba server and verify that the "Desktop", "Start Menu",
7512 "Programs" and "Nethood" folders have been created.</P
7513 ><P
7514 >These folders will be cached locally on the client, and updated when
7515 the user logs off (if you haven't made them read-only by then :-).
7516 You will find that if the user creates further folders or short-cuts,
7517 that the client will merge the profile contents downloaded with the
7518 contents of the profile directory already on the local client, taking
7519 the newest folders and short-cuts from each set.</P
7520 ><P
7521 >If you have made the folders / files read-only on the samba server,
7522 then you will get errors from the w95 machine on logon and logout, as
7523 it attempts to merge the local and the remote profile.  Basically, if
7524 you have any errors reported by the w95 machine, check the Unix file
7525 permissions and ownership rights on the profile directory contents,
7526 on the samba server.</P
7527 ><P
7528 >If you have problems creating user profiles, you can reset the user's
7529 local desktop cache, as shown below.  When this user then next logs in,
7530 they will be told that they are logging in "for the first time".</P
7531 ><P
7532 ></P
7533 ><OL
7534 TYPE="1"
7535 ><LI
7536 ><P
7537 >       instead of logging in under the [user, password, domain] dialog,
7538         press escape.
7539         </P
7540 ></LI
7541 ><LI
7542 ><P
7543 >       run the regedit.exe program, and look in:
7544         </P
7545 ><P
7546 >       HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
7547         </P
7548 ><P
7549 >       you will find an entry, for each user, of ProfilePath.  Note the
7550         contents of this key (likely to be c:\windows\profiles\username),
7551         then delete the key ProfilePath for the required user.
7552         </P
7553 ><P
7554 >       [Exit the registry editor].
7555         </P
7556 ></LI
7557 ><LI
7558 ><P
7559 >       <EM
7560 >WARNING</EM
7561 > - before deleting the contents of the 
7562         directory listed in
7563    the ProfilePath (this is likely to be c:\windows\profiles\username),
7564    ask them if they have any important files stored on their desktop
7565    or in their start menu.  delete the contents of the directory
7566    ProfilePath (making a backup if any of the files are needed).
7567         </P
7568 ><P
7569 >   This will have the effect of removing the local (read-only hidden
7570    system file) user.DAT in their profile directory, as well as the
7571    local "desktop", "nethood", "start menu" and "programs" folders.
7572         </P
7573 ></LI
7574 ><LI
7575 ><P
7576 >       search for the user's .PWL password-caching file in the c:\windows
7577         directory, and delete it.
7578         </P
7579 ></LI
7580 ><LI
7581 ><P
7582 >       log off the windows 95 client.
7583         </P
7584 ></LI
7585 ><LI
7586 ><P
7587 >       check the contents of the profile path (see "logon path" described
7588         above), and delete the user.DAT or user.MAN file for the user,
7589         making a backup if required.  
7590         </P
7591 ></LI
7592 ></OL
7593 ><P
7594 >If all else fails, increase samba's debug log levels to between 3 and 10,
7595 and / or run a packet trace program such as tcpdump or netmon.exe, and
7596 look for any error reports.</P
7597 ><P
7598 >If you have access to an NT server, then first set up roaming profiles
7599 and / or netlogons on the NT server.  Make a packet trace, or examine
7600 the example packet traces provided with NT server, and see what the
7601 differences are with the equivalent samba trace.</P
7602 ></DIV
7603 ><DIV
7604 CLASS="SECT3"
7605 ><HR><H3
7606 CLASS="SECT3"
7607 ><A
7608 NAME="AEN1576"
7609 >8.8.2.5. Windows NT Workstation 4.0</A
7610 ></H3
7611 ><P
7612 >When a user first logs in to a Windows NT Workstation, the profile
7613 NTuser.DAT is created.  The profile location can be now specified
7614 through the "logon path" parameter.  </P
7615 ><DIV
7616 CLASS="NOTE"
7617 ><BLOCKQUOTE
7618 CLASS="NOTE"
7619 ><P
7620 ><B
7621 >Note: </B
7622 >[lkcl 10aug97 - i tried setting the path to
7623 \\samba-server\homes\profile, and discovered that this fails because
7624 a background process maintains the connection to the [homes] share
7625 which does _not_ close down in between user logins.  you have to
7626 have \\samba-server\%L\profile, where user is the username created
7627 from the [homes] share].</P
7628 ></BLOCKQUOTE
7629 ></DIV
7630 ><P
7631 >There is a parameter that is now available for use with NT Profiles:
7632 "logon drive".  This should be set to "h:" or any other drive, and
7633 should be used in conjunction with the new "logon home" parameter.</P
7634 ><P
7635 >The entry for the NT 4.0 profile is a _directory_ not a file.  The NT
7636 help on profiles mentions that a directory is also created with a .PDS
7637 extension.  The user, while logging in, must have write permission to
7638 create the full profile path (and the folder with the .PDS extension)
7639 [lkcl 10aug97 - i found that the creation of the .PDS directory failed,
7640 and had to create these manually for each user, with a shell script.
7641 also, i presume, but have not tested, that the full profile path must
7642 be browseable just as it is for w95, due to the manner in which they
7643 attempt to create the full profile path: test existence of each path
7644 component; create path component].</P
7645 ><P
7646 >In the profile directory, NT creates more folders than 95.  It creates
7647 "Application Data" and others, as well as "Desktop", "Nethood",
7648 "Start Menu" and "Programs".  The profile itself is stored in a file
7649 NTuser.DAT.  Nothing appears to be stored in the .PDS directory, and
7650 its purpose is currently unknown.</P
7651 ><P
7652 >You can use the System Control Panel to copy a local profile onto
7653 a samba server (see NT Help on profiles: it is also capable of firing
7654 up the correct location in the System Control Panel for you).  The
7655 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
7656 turns a profile into a mandatory one.</P
7657 ><DIV
7658 CLASS="NOTE"
7659 ><BLOCKQUOTE
7660 CLASS="NOTE"
7661 ><P
7662 ><B
7663 >Note: </B
7664 >[lkcl 10aug97 - i notice that NT Workstation tells me that it is
7665 downloading a profile from a slow link.  whether this is actually the
7666 case, or whether there is some configuration issue, as yet unknown,
7667 that makes NT Workstation _think_ that the link is a slow one is a
7668 matter to be resolved].</P
7669 ><P
7670 >[lkcl 20aug97 - after samba digest correspondence, one user found, and
7671 another confirmed, that profiles cannot be loaded from a samba server
7672 unless "security = user" and "encrypt passwords = yes" (see the file
7673 ENCRYPTION.txt) or "security = server" and "password server = ip.address.
7674 of.yourNTserver" are used.  Either of these options will allow the NT
7675 workstation to access the samba server using LAN manager encrypted
7676 passwords, without the user intervention normally required by NT
7677 workstation for clear-text passwords].</P
7678 ><P
7679 >[lkcl 25aug97 - more comments received about NT profiles: the case of
7680 the profile _matters_.  the file _must_ be called NTuser.DAT or, for
7681 a mandatory profile, NTuser.MAN].</P
7682 ></BLOCKQUOTE
7683 ></DIV
7684 ></DIV
7685 ><DIV
7686 CLASS="SECT3"
7687 ><HR><H3
7688 CLASS="SECT3"
7689 ><A
7690 NAME="AEN1589"
7691 >8.8.2.6. Windows NT Server</A
7692 ></H3
7693 ><P
7694 >There is nothing to stop you specifying any path that you like for the
7695 location of users' profiles.  Therefore, you could specify that the
7696 profile be stored on a samba server, or any other SMB server, as long as
7697 that SMB server supports encrypted passwords.</P
7698 ></DIV
7699 ><DIV
7700 CLASS="SECT3"
7701 ><HR><H3
7702 CLASS="SECT3"
7703 ><A
7704 NAME="AEN1592"
7705 >8.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0</A
7706 ></H3
7707 ><DIV
7708 CLASS="WARNING"
7709 ><P
7710 ></P
7711 ><TABLE
7712 CLASS="WARNING"
7713 BORDER="1"
7714 WIDTH="100%"
7715 ><TR
7716 ><TD
7717 ALIGN="CENTER"
7718 ><B
7719 >Potentially outdated or incorrect material follows</B
7720 ></TD
7721 ></TR
7722 ><TR
7723 ><TD
7724 ALIGN="LEFT"
7725 ><P
7726 >I think this is all bogus, but have not deleted it. (Richard Sharpe)</P
7727 ></TD
7728 ></TR
7729 ></TABLE
7730 ></DIV
7731 ><P
7732 >The default logon path is \\%N\U%.  NT Workstation will attempt to create
7733 a directory "\\samba-server\username.PDS" if you specify the logon path
7734 as "\\samba-server\username" with the NT User Manager.  Therefore, you
7735 will need to specify (for example) "\\samba-server\username\profile".
7736 NT 4.0 will attempt to create "\\samba-server\username\profile.PDS", which
7737 is more likely to succeed.</P
7738 ><P
7739 >If you then want to share the same Start Menu / Desktop with W95, you will
7740 need to specify "logon path = \\samba-server\username\profile" [lkcl 10aug97
7741 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
7742 to run from the c:\winnt\system32 directory.  this directory is obviously
7743 unlikely to exist on a Win95-only host].</P
7744 ><P
7745 >&#13;If you have this set up correctly, you will find separate user.DAT and
7746 NTuser.DAT files in the same profile directory.</P
7747 ><DIV
7748 CLASS="NOTE"
7749 ><BLOCKQUOTE
7750 CLASS="NOTE"
7751 ><P
7752 ><B
7753 >Note: </B
7754 >[lkcl 25aug97 - there are some issues to resolve with downloading of
7755 NT profiles, probably to do with time/date stamps.  i have found that
7756 NTuser.DAT is never updated on the workstation after the first time that
7757 it is copied to the local workstation profile directory.  this is in
7758 contrast to w95, where it _does_ transfer / update profiles correctly].</P
7759 ></BLOCKQUOTE
7760 ></DIV
7761 ></DIV
7762 ></DIV
7763 ></DIV
7764 ><DIV
7765 CLASS="SECT1"
7766 ><HR><H1
7767 CLASS="SECT1"
7768 ><A
7769 NAME="AEN1602"
7770 >8.9. DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
7771 ></H1
7772 ><DIV
7773 CLASS="WARNING"
7774 ><P
7775 ></P
7776 ><TABLE
7777 CLASS="WARNING"
7778 BORDER="1"
7779 WIDTH="100%"
7780 ><TR
7781 ><TD
7782 ALIGN="CENTER"
7783 ><B
7784 >Possibly Outdated Material</B
7785 ></TD
7786 ></TR
7787 ><TR
7788 ><TD
7789 ALIGN="LEFT"
7790 ><P
7791 >       This appendix was originally authored by John H Terpstra of 
7792         the Samba Team and is included here for posterity.
7793         </P
7794 ></TD
7795 ></TR
7796 ></TABLE
7797 ></DIV
7798 ><P
7799 ><EM
7800 >NOTE :</EM
7801
7802 The term "Domain Controller" and those related to it refer to one specific
7803 method of authentication that can underly an SMB domain. Domain Controllers
7804 prior to Windows NT Server 3.1 were sold by various companies and based on 
7805 private extensions to the LAN Manager 2.1 protocol. Windows NT introduced
7806 Microsoft-specific ways of distributing the user authentication database.
7807 See DOMAIN.txt for examples of how Samba can participate in or create
7808 SMB domains based on shared authentication database schemes other than the 
7809 Windows NT SAM.</P
7810 ><P
7811 >Windows NT Server can be installed as either a plain file and print server
7812 (WORKGROUP workstation or server) or as a server that participates in Domain
7813 Control (DOMAIN member, Primary Domain controller or Backup Domain controller).
7814 The same is true for OS/2 Warp Server, Digital Pathworks and other similar
7815 products, all of which can participate in Domain Control along with Windows NT.</P
7816 ><P
7817 >To many people these terms can be confusing, so let's try to clear the air.</P
7818 ><P
7819 >Every Windows NT system (workstation or server) has a registry database.
7820 The registry contains entries that describe the initialization information
7821 for all services (the equivalent of Unix Daemons) that run within the Windows
7822 NT environment. The registry also contains entries that tell application
7823 software where to find dynamically loadable libraries that they depend upon.
7824 In fact, the registry contains entries that describes everything that anything
7825 may need to know to interact with the rest of the system.</P
7826 ><P
7827 >The registry files can be located on any Windows NT machine by opening a
7828 command prompt and typing:</P
7829 ><P
7830 ><TT
7831 CLASS="PROMPT"
7832 >C:\WINNT\&#62;</TT
7833 > dir %SystemRoot%\System32\config</P
7834 ><P
7835 >The environment variable %SystemRoot% value can be obtained by typing:</P
7836 ><P
7837 ><TT
7838 CLASS="PROMPT"
7839 >C:\WINNT&#62;</TT
7840 >echo %SystemRoot%</P
7841 ><P
7842 >The active parts of the registry that you may want to be familiar with are
7843 the files called: default, system, software, sam and security.</P
7844 ><P
7845 >In a domain environment, Microsoft Windows NT domain controllers participate
7846 in replication of the SAM and SECURITY files so that all controllers within
7847 the domain have an exactly identical copy of each.</P
7848 ><P
7849 >The Microsoft Windows NT system is structured within a security model that
7850 says that all applications and services must authenticate themselves before
7851 they can obtain permission from the security manager to do what they set out
7852 to do.</P
7853 ><P
7854 >The Windows NT User database also resides within the registry. This part of
7855 the registry contains the user's security identifier, home directory, group
7856 memberships, desktop profile, and so on.</P
7857 ><P
7858 >Every Windows NT system (workstation as well as server) will have its own
7859 registry. Windows NT Servers that participate in Domain Security control
7860 have a database that they share in common - thus they do NOT own an
7861 independent full registry database of their own, as do Workstations and
7862 plain Servers.</P
7863 ><P
7864 >The User database is called the SAM (Security Access Manager) database and
7865 is used for all user authentication as well as for authentication of inter-
7866 process authentication (i.e. to ensure that the service action a user has
7867 requested is permitted within the limits of that user's privileges).</P
7868 ><P
7869 >The Samba team have produced a utility that can dump the Windows NT SAM into 
7870 smbpasswd format: see ENCRYPTION.txt for information on smbpasswd and
7871 /pub/samba/pwdump on your nearest Samba mirror for the utility. This 
7872 facility is useful but cannot be easily used to implement SAM replication
7873 to Samba systems.</P
7874 ><P
7875 >Windows for Workgroups, Windows 95, and Windows NT Workstations and Servers
7876 can participate in a Domain security system that is controlled by Windows NT
7877 servers that have been correctly configured. Almost every domain will have
7878 ONE Primary Domain Controller (PDC). It is desirable that each domain will
7879 have at least one Backup Domain Controller (BDC).</P
7880 ><P
7881 >The PDC and BDCs then participate in replication of the SAM database so that
7882 each Domain Controlling participant will have an up to date SAM component
7883 within its registry.</P
7884 ></DIV
7885 ></DIV
7886 ><DIV
7887 CLASS="CHAPTER"
7888 ><HR><H1
7889 ><A
7890 NAME="SAMBA-LDAP-HOWTO"
7891 >Chapter 9. Storing Samba's User/Machine Account information in an LDAP Directory</A
7892 ></H1
7893 ><DIV
7894 CLASS="SECT1"
7895 ><H1
7896 CLASS="SECT1"
7897 ><A
7898 NAME="AEN1638"
7899 >9.1. Purpose</A
7900 ></H1
7901 ><P
7902 >This document describes how to use an LDAP directory for storing Samba user
7903 account information normally stored in the smbpasswd(5) file.  It is
7904 assumed that the reader already has a basic understanding of LDAP concepts
7905 and has a working directory server already installed.  For more information
7906 on LDAP architectures and Directories, please refer to the following sites.</P
7907 ><P
7908 ></P
7909 ><UL
7910 ><LI
7911 ><P
7912 >OpenLDAP - <A
7913 HREF="http://www.openldap.org/"
7914 TARGET="_top"
7915 >http://www.openldap.org/</A
7916 ></P
7917 ></LI
7918 ><LI
7919 ><P
7920 >iPlanet Directory Server - <A
7921 HREF="http://iplanet.netscape.com/directory"
7922 TARGET="_top"
7923 >http://iplanet.netscape.com/directory</A
7924 ></P
7925 ></LI
7926 ></UL
7927 ><P
7928 >Note that <A
7929 HREF="http://www.ora.com/"
7930 TARGET="_top"
7931 >O'Reilly Publishing</A
7932 > is working on
7933 a guide to LDAP for System Administrators which has a planned release date of
7934 early summer, 2002.</P
7935 ><P
7936 >It may also be helpful to supplement the reading of the HOWTO with 
7937 the <A
7938 HREF="http://www.unav.es/cti/ldap-smb/ldap-smb-2_2-howto.html"
7939 TARGET="_top"
7940 >Samba-PDC-LDAP-HOWTO</A
7941 >
7942 maintained by Ignacio Coupeau.</P
7943 ></DIV
7944 ><DIV
7945 CLASS="SECT1"
7946 ><HR><H1
7947 CLASS="SECT1"
7948 ><A
7949 NAME="AEN1652"
7950 >9.2. Introduction</A
7951 ></H1
7952 ><P
7953 >Traditionally, when configuring <A
7954 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
7955 TARGET="_top"
7956 >"encrypt
7957 passwords = yes"</A
7958 > in Samba's <TT
7959 CLASS="FILENAME"
7960 >smb.conf</TT
7961 > file, user account
7962 information such as username, LM/NT password hashes, password change times, and account
7963 flags have been stored in the <TT
7964 CLASS="FILENAME"
7965 >smbpasswd(5)</TT
7966 > file.  There are several
7967 disadvantages to this approach for sites with very large numbers of users (counted
7968 in the thousands).</P
7969 ><P
7970 >The first is that all lookups must be performed sequentially.  Given that
7971 there are approximately two lookups per domain logon (one for a normal
7972 session connection such as when mapping a network drive or printer), this
7973 is non-optimal.  What is needed is an indexed approach such as is used in
7974 databases.</P
7975 ><P
7976 >The second problem is that administrators who desired to replicate a
7977 smbpasswd file to more than one Samba server were left to use external
7978 tools such as <B
7979 CLASS="COMMAND"
7980 >rsync(1)</B
7981 > and <B
7982 CLASS="COMMAND"
7983 >ssh(1)</B
7984 >
7985 and wrote custom, in-house scripts.</P
7986 ><P
7987 >And finally, the amount of information which is stored in an
7988 smbpasswd entry leaves no room for additional attributes such as
7989 a home directory, password expiration time, or even a Relative
7990 Identified (RID).</P
7991 ><P
7992 >As a result of these defeciencies, a more robust means of storing user attributes
7993 used by smbd was developed.  The API which defines access to user accounts
7994 is referred to as the samdb interface (previously this was called the passdb
7995 API, and is still so named in the CVS trees).  In Samba 2.2.3, enabling support
7996 for a samdb backend (e.g. <TT
7997 CLASS="PARAMETER"
7998 ><I
7999 >--with-ldapsam</I
8000 ></TT
8001 > or
8002 <TT
8003 CLASS="PARAMETER"
8004 ><I
8005 >--with-tdbsam</I
8006 ></TT
8007 >) requires compile time support.</P
8008 ><P
8009 >When compiling Samba to include the <TT
8010 CLASS="PARAMETER"
8011 ><I
8012 >--with-ldapsam</I
8013 ></TT
8014 > autoconf
8015 option, smbd (and associated tools) will store and lookup user accounts in
8016 an LDAP directory.  In reality, this is very easy to understand.  If you are
8017 comfortable with using an smbpasswd file, simply replace "smbpasswd" with
8018 "LDAP directory" in all the documentation.</P
8019 ><P
8020 >There are a few points to stress about what the <TT
8021 CLASS="PARAMETER"
8022 ><I
8023 >--with-ldapsam</I
8024 ></TT
8025 >
8026 does not provide.  The LDAP support referred to in the this documentation does not
8027 include:</P
8028 ><P
8029 ></P
8030 ><UL
8031 ><LI
8032 ><P
8033 >A means of retrieving user account information from
8034         an Windows 2000 Active Directory server.</P
8035 ></LI
8036 ><LI
8037 ><P
8038 >A means of replacing /etc/passwd.</P
8039 ></LI
8040 ></UL
8041 ><P
8042 >The second item can be accomplished by using LDAP NSS and PAM modules.  LGPL
8043 versions of these libraries can be obtained from PADL Software
8044 (<A
8045 HREF="http://www.padl.com/"
8046 TARGET="_top"
8047 >http://www.padl.com/</A
8048 >).  However,
8049 the details of configuring these packages are beyond the scope of this document.</P
8050 ></DIV
8051 ><DIV
8052 CLASS="SECT1"
8053 ><HR><H1
8054 CLASS="SECT1"
8055 ><A
8056 NAME="AEN1677"
8057 >9.3. Supported LDAP Servers</A
8058 ></H1
8059 ><P
8060 >The LDAP samdb code in 2.2.3 has been developed and tested using the OpenLDAP
8061 2.0 server and client libraries.  The same code should be able to work with
8062 Netscape's Directory Server and client SDK. However, due to lack of testing
8063 so far, there are bound to be compile errors and bugs.  These should not be
8064 hard to fix. If you are so inclined, please be sure to forward all patches to
8065 <A
8066 HREF="samba-patches@samba.org"
8067 TARGET="_top"
8068 >samba-patches@samba.org</A
8069 > and
8070 <A
8071 HREF="jerry@samba.org"
8072 TARGET="_top"
8073 >jerry@samba.org</A
8074 >.</P
8075 ></DIV
8076 ><DIV
8077 CLASS="SECT1"
8078 ><HR><H1
8079 CLASS="SECT1"
8080 ><A
8081 NAME="AEN1682"
8082 >9.4. Schema and Relationship to the RFC 2307 posixAccount</A
8083 ></H1
8084 ><P
8085 >Samba 2.2.3 includes the necessary schema file for OpenLDAP 2.0 in
8086 <TT
8087 CLASS="FILENAME"
8088 >examples/LDAP/samba.schema</TT
8089 >.  (Note that this schema
8090 file has been modified since the experimental support initially included
8091 in 2.2.2).  The sambaAccount objectclass is given here:</P
8092 ><P
8093 ><TABLE
8094 BORDER="0"
8095 BGCOLOR="#E0E0E0"
8096 WIDTH="100%"
8097 ><TR
8098 ><TD
8099 ><PRE
8100 CLASS="PROGRAMLISTING"
8101 >objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL
8102      DESC 'Samba Account'
8103      MUST ( uid $ rid )
8104      MAY  ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $
8105             logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $
8106             displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $
8107             description $ userWorkstations $ primaryGroupID ))</PRE
8108 ></TD
8109 ></TR
8110 ></TABLE
8111 ></P
8112 ><P
8113 >The samba.schema file has been formatted for OpenLDAP 2.0.  The OID's are
8114 owned by the Samba Team and as such is legal to be openly published.
8115 If you translate the schema to be used with Netscape DS, please
8116 submit the modified schema file as a patch to <A
8117 HREF="jerry@samba.org"
8118 TARGET="_top"
8119 >jerry@samba.org</A
8120 ></P
8121 ><P
8122 >Just as the smbpasswd file is mean to store information which supplements a
8123 user's <TT
8124 CLASS="FILENAME"
8125 >/etc/passwd</TT
8126 > entry, so is the sambaAccount object
8127 meant to supplement the UNIX user account information.  A sambaAccount is a
8128 <TT
8129 CLASS="CONSTANT"
8130 >STRUCTURAL</TT
8131 > objectclass so it can be stored individually
8132 in the directory.  However, there are several fields (e.g. uid) which overlap
8133 with the posixAccount objectclass outlined in RFC2307.  This is by design.</P
8134 ><P
8135 >In order to store all user account information (UNIX and Samba) in the directory,
8136 it is necessary to use the sambaAccount and posixAccount objectclasses in
8137 combination.  However, smbd will still obtain the user's UNIX account
8138 information via the standard C library calls (e.g. getpwnam(), et. al.).
8139 This means that the Samba server must also have the LDAP NSS library installed
8140 and functioning correctly.  This division of information makes it possible to
8141 store all Samba account information in LDAP, but still maintain UNIX account
8142 information in NIS while the network is transitioning to a full LDAP infrastructure.</P
8143 ><P
8144 >To include support for the sambaAccount object in an OpenLDAP directory
8145 server, first copy the samba.schema file to slapd's configuration directory.</P
8146 ><P
8147 ><TT
8148 CLASS="PROMPT"
8149 >root# </TT
8150 ><B
8151 CLASS="COMMAND"
8152 >cp samba.schema /etc/openldap/schema/</B
8153 ></P
8154 ><P
8155 >Next, include the <TT
8156 CLASS="FILENAME"
8157 >samba.schema</TT
8158 > file in <TT
8159 CLASS="FILENAME"
8160 >slapd.conf</TT
8161 >.
8162 The sambaAccount object contains two attributes which depend upon other schema
8163 files.  The 'uid' attribute is defined in <TT
8164 CLASS="FILENAME"
8165 >cosine.schema</TT
8166 > and
8167 the 'displayName' attribute is defined in the <TT
8168 CLASS="FILENAME"
8169 >inetorgperson.schema</TT
8170 >
8171 file.  Bother of these must be included before the <TT
8172 CLASS="FILENAME"
8173 >samba.schema</TT
8174 > file.</P
8175 ><P
8176 ><TABLE
8177 BORDER="0"
8178 BGCOLOR="#E0E0E0"
8179 WIDTH="100%"
8180 ><TR
8181 ><TD
8182 ><PRE
8183 CLASS="PROGRAMLISTING"
8184 >## /etc/openldap/slapd.conf
8185
8186 ## schema files (core.schema is required by default)
8187 include            /etc/openldap/schema/core.schema
8188
8189 ## needed for sambaAccount
8190 include            /etc/openldap/schema/cosine.schema
8191 include            /etc/openldap/schema/inetorgperson.schema
8192 include            /etc/openldap/schema/samba.schema
8193
8194 ## uncomment this line if you want to support the RFC2307 (NIS) schema
8195 ## include         /etc/openldap/schema/nis.schema
8196
8197 ....</PRE
8198 ></TD
8199 ></TR
8200 ></TABLE
8201 ></P
8202 ></DIV
8203 ><DIV
8204 CLASS="SECT1"
8205 ><HR><H1
8206 CLASS="SECT1"
8207 ><A
8208 NAME="AEN1706"
8209 >9.5. smb.conf LDAP parameters</A
8210 ></H1
8211 ><P
8212 >The following parameters are available in smb.conf only with <TT
8213 CLASS="PARAMETER"
8214 ><I
8215 >--with-ldapsam</I
8216 ></TT
8217 >
8218 was included with compiling Samba.</P
8219 ><P
8220 ></P
8221 ><UL
8222 ><LI
8223 ><P
8224 ><A
8225 HREF="smb.conf.5.html#LDAPSSL"
8226 TARGET="_top"
8227 >ldap ssl</A
8228 ></P
8229 ></LI
8230 ><LI
8231 ><P
8232 ><A
8233 HREF="smb.conf.5.html#LDAPSERVER"
8234 TARGET="_top"
8235 >ldap server</A
8236 ></P
8237 ></LI
8238 ><LI
8239 ><P
8240 ><A
8241 HREF="smb.conf.5.html#LDAPADMINDN"
8242 TARGET="_top"
8243 >ldap admin dn</A
8244 ></P
8245 ></LI
8246 ><LI
8247 ><P
8248 ><A
8249 HREF="smb.conf.5.html#LDAPSUFFIX"
8250 TARGET="_top"
8251 >ldap suffix</A
8252 ></P
8253 ></LI
8254 ><LI
8255 ><P
8256 ><A
8257 HREF="smb.conf.5.html#LDAPFILTER"
8258 TARGET="_top"
8259 >ldap filter</A
8260 ></P
8261 ></LI
8262 ><LI
8263 ><P
8264 ><A
8265 HREF="smb.conf.5.html#LDAPPORT"
8266 TARGET="_top"
8267 >ldap port</A
8268 ></P
8269 ></LI
8270 ></UL
8271 ><P
8272 >These are described in the <A
8273 HREF="smb.conf.5.html"
8274 TARGET="_top"
8275 >smb.conf(5)</A
8276 > man
8277 page and so will not be repeated here.  However, a sample smb.conf file for
8278 use with an LDAP directory could appear as</P
8279 ><P
8280 ><TABLE
8281 BORDER="0"
8282 BGCOLOR="#E0E0E0"
8283 WIDTH="100%"
8284 ><TR
8285 ><TD
8286 ><PRE
8287 CLASS="PROGRAMLISTING"
8288 >## /usr/local/samba/lib/smb.conf
8289 [global]
8290      security = user
8291      encrypt passwords = yes
8292
8293      netbios name = TASHTEGO
8294      workgroup = NARNIA
8295
8296      # ldap related parameters
8297
8298      # define the DN to use when binding to the directory servers
8299      # The password for this DN is not stored in smb.conf.  Rather it
8300      # must be set by using 'smbpasswd -w <TT
8301 CLASS="REPLACEABLE"
8302 ><I
8303 >secretpw</I
8304 ></TT
8305 >' to store the
8306      # passphrase in the secrets.tdb file.  If the "ldap admin dn" values
8307      # changes, this password will need to be reset.
8308      ldap admin dn = "cn=Manager,dc=samba,dc=org"
8309
8310      #  specify the LDAP server's hostname (defaults to locahost)
8311      ldap server = ahab.samba.org
8312
8313      # Define the SSL option when connecting to the directory
8314      # ('off', 'start tls', or 'on' (default))
8315      ldap ssl = start tls
8316
8317      # define the port to use in the LDAP session (defaults to 636 when
8318      # "ldap ssl = on")
8319      ldap port = 389
8320
8321      # specify the base DN to use when searching the directory
8322      ldap suffix = "ou=people,dc=samba,dc=org"
8323
8324      # generally the default ldap search filter is ok
8325      # ldap filter = "(&#38;(uid=%u)(objectclass=sambaAccount))"</PRE
8326 ></TD
8327 ></TR
8328 ></TABLE
8329 ></P
8330 ></DIV
8331 ><DIV
8332 CLASS="SECT1"
8333 ><HR><H1
8334 CLASS="SECT1"
8335 ><A
8336 NAME="AEN1734"
8337 >9.6. Security and sambaAccount</A
8338 ></H1
8339 ><P
8340 >There are two important points to remember when discussing the security
8341 of sambaAccount entries in the directory.</P
8342 ><P
8343 ></P
8344 ><UL
8345 ><LI
8346 ><P
8347 ><EM
8348 >Never</EM
8349 > retrieve the lmPassword or
8350         ntPassword attribute values over an unencrypted LDAP session.</P
8351 ></LI
8352 ><LI
8353 ><P
8354 ><EM
8355 >Never</EM
8356 > allow non-admin users to
8357         view the lmPassword or ntPassword attribute values.</P
8358 ></LI
8359 ></UL
8360 ><P
8361 >These password hashes are clear text equivalents and can be used to impersonate
8362 the user without deriving the original clear text strings.</P
8363 ><P
8364 >To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults
8365 to require an encrypted session (<B
8366 CLASS="COMMAND"
8367 >ldap ssl = on</B
8368 >) using
8369 the default port of 636
8370 when contacting the directory server.  When using an OpenLDAP 2.0 server, it
8371 is possible to use the use the StartTLS LDAP extended  operation in the place of
8372 LDAPS.  In either case, you are strongly discouraged to disable this security
8373 (<B
8374 CLASS="COMMAND"
8375 >ldap ssl = off</B
8376 >).</P
8377 ><P
8378 >The second security precaution is to prevent non-administrative users from
8379 harvesting password hashes from the directory.  This can be done using the
8380 following ACL in <TT
8381 CLASS="FILENAME"
8382 >slapd.conf</TT
8383 >:</P
8384 ><P
8385 ><TABLE
8386 BORDER="0"
8387 BGCOLOR="#E0E0E0"
8388 WIDTH="100%"
8389 ><TR
8390 ><TD
8391 ><PRE
8392 CLASS="PROGRAMLISTING"
8393 >## allow users to update their own password, but not to browse others
8394 access to attrs=userPassword,lmPassword,ntPassword
8395      by self write
8396      by * auth</PRE
8397 ></TD
8398 ></TR
8399 ></TABLE
8400 ></P
8401 ><P
8402 >You may of course, add in write access to administrative DN's as necessary.</P
8403 ></DIV
8404 ><DIV
8405 CLASS="SECT1"
8406 ><HR><H1
8407 CLASS="SECT1"
8408 ><A
8409 NAME="AEN1753"
8410 >9.7. </A
8411 ></H1
8412 ><P
8413 >There are currently four sambaAccount attributes which map directly onto
8414 <TT
8415 CLASS="FILENAME"
8416 >smb.conf</TT
8417 > parameters.</P
8418 ><P
8419 ></P
8420 ><UL
8421 ><LI
8422 ><P
8423 >smbHome -&#62; "logon home"</P
8424 ></LI
8425 ><LI
8426 ><P
8427 >profilePath -&#62; "logon path"</P
8428 ></LI
8429 ><LI
8430 ><P
8431 >homeDrive -&#62; "logon drive"</P
8432 ></LI
8433 ><LI
8434 ><P
8435 >scriptPath -&#62; "logon script"</P
8436 ></LI
8437 ></UL
8438 ><P
8439 >First of all, these parameters are only used when Samba is acting as a
8440 PDC or a domain (refer to the <A
8441 HREF="Samba-PDC-HOWTO.html"
8442 TARGET="_top"
8443 >Samba-PDC-HOWTO</A
8444 >
8445 for details on how to configure Samba as a Primary Domain Controller).
8446 Furthermore, these attributes are only stored with the sambaAccount entry if
8447 the values are non-default values.  For example, assume TASHTEGO has now been
8448 configured as a PDC and that <B
8449 CLASS="COMMAND"
8450 >logon home = \\%L\%u</B
8451 > was defined in
8452 its <TT
8453 CLASS="FILENAME"
8454 >smb.conf</TT
8455 > file. When a user named "becky" logons to the domain,
8456 the <TT
8457 CLASS="PARAMETER"
8458 ><I
8459 >logon home</I
8460 ></TT
8461 > string is expanded to \\TASHTEGO\becky.</P
8462 ><P
8463 >If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org",
8464 this value is used.  However, if this attribute does not exist, then the value
8465 of the <TT
8466 CLASS="PARAMETER"
8467 ><I
8468 >logon home</I
8469 ></TT
8470 > parameter is used in its place.  Samba
8471 will only write the attribute value to the directory entry is the value is
8472 something other than the default (e.g. \\MOBY\becky).</P
8473 ></DIV
8474 ><DIV
8475 CLASS="SECT1"
8476 ><HR><H1
8477 CLASS="SECT1"
8478 ><A
8479 NAME="AEN1773"
8480 >9.8. Example LDIF Entries for a sambaAccount</A
8481 ></H1
8482 ><P
8483 >The following is a working LDIF with the inclusion of the posixAccount objectclass:</P
8484 ><P
8485 ><TABLE
8486 BORDER="0"
8487 BGCOLOR="#E0E0E0"
8488 WIDTH="100%"
8489 ><TR
8490 ><TD
8491 ><PRE
8492 CLASS="PROGRAMLISTING"
8493 >dn: uid=guest2, ou=people,dc=plainjoe,dc=org
8494 ntPassword: 878D8014606CDA29677A44EFA1353FC7
8495 pwdMustChange: 2147483647
8496 primaryGroupID: 1201
8497 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
8498 pwdLastSet: 1010179124
8499 logonTime: 0
8500 objectClass: sambaAccount
8501 uid: guest2
8502 kickoffTime: 2147483647
8503 acctFlags: [UX         ]
8504 logoffTime: 2147483647
8505 rid: 19006
8506 pwdCanChange: 0</PRE
8507 ></TD
8508 ></TR
8509 ></TABLE
8510 ></P
8511 ><P
8512 >The following is an LDIF entry for using both the sambaAccount and
8513 posixAccount objectclasses:</P
8514 ><P
8515 ><TABLE
8516 BORDER="0"
8517 BGCOLOR="#E0E0E0"
8518 WIDTH="100%"
8519 ><TR
8520 ><TD
8521 ><PRE
8522 CLASS="PROGRAMLISTING"
8523 >dn: uid=gcarter, ou=people,dc=plainjoe,dc=org
8524 logonTime: 0
8525 displayName: Gerald Carter
8526 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
8527 primaryGroupID: 1201
8528 objectClass: posixAccount
8529 objectClass: sambaAccount
8530 acctFlags: [UX         ]
8531 userPassword: {crypt}BpM2ej8Rkzogo
8532 uid: gcarter
8533 uidNumber: 9000
8534 cn: Gerald Carter
8535 loginShell: /bin/bash
8536 logoffTime: 2147483647
8537 gidNumber: 100
8538 kickoffTime: 2147483647
8539 pwdLastSet: 1010179230
8540 rid: 19000
8541 homeDirectory: /home/tashtego/gcarter
8542 pwdCanChange: 0
8543 pwdMustChange: 2147483647
8544 ntPassword: 878D8014606CDA29677A44EFA1353FC7</PRE
8545 ></TD
8546 ></TR
8547 ></TABLE
8548 ></P
8549 ></DIV
8550 ><DIV
8551 CLASS="SECT1"
8552 ><HR><H1
8553 CLASS="SECT1"
8554 ><A
8555 NAME="AEN1781"
8556 >9.9. Comments</A
8557 ></H1
8558 ><P
8559 >Please mail all comments regarding this HOWTO to <A
8560 HREF="mailto:jerry@samba.org"
8561 TARGET="_top"
8562 >jerry@samba.org</A
8563 >.  This documents was
8564 last updated to reflect the Samba 2.2.3 release.&#13;</P
8565 ></DIV
8566 ></DIV
8567 ><DIV
8568 CLASS="CHAPTER"
8569 ><HR><H1
8570 ><A
8571 NAME="WINBIND"
8572 >Chapter 10. Unified Logons between Windows NT and UNIX using Winbind</A
8573 ></H1
8574 ><DIV
8575 CLASS="SECT1"
8576 ><H1
8577 CLASS="SECT1"
8578 ><A
8579 NAME="AEN1810"
8580 >10.1. Abstract</A
8581 ></H1
8582 ><P
8583 >Integration of UNIX and Microsoft Windows NT through 
8584         a unified logon has been considered a "holy grail" in heterogeneous 
8585         computing environments for a long time. We present 
8586         <EM
8587 >winbind</EM
8588 >, a component of the Samba suite 
8589         of programs as a solution to the unified logon problem. Winbind 
8590         uses a UNIX implementation 
8591         of Microsoft RPC calls, Pluggable Authentication Modules, and the Name 
8592         Service Switch to allow Windows NT domain users to appear and operate 
8593         as UNIX users on a UNIX machine. This paper describes the winbind 
8594         system, explaining the functionality it provides, how it is configured, 
8595         and how it works internally.</P
8596 ></DIV
8597 ><DIV
8598 CLASS="SECT1"
8599 ><HR><H1
8600 CLASS="SECT1"
8601 ><A
8602 NAME="AEN1814"
8603 >10.2. Introduction</A
8604 ></H1
8605 ><P
8606 >It is well known that UNIX and Microsoft Windows NT have 
8607         different models for representing user and group information and 
8608         use different technologies for implementing them. This fact has 
8609         made it difficult to integrate the two systems in a satisfactory 
8610         manner.</P
8611 ><P
8612 >One common solution in use today has been to create 
8613         identically named user accounts on both the UNIX and Windows systems 
8614         and use the Samba suite of programs to provide file and print services 
8615         between the two. This solution is far from perfect however, as 
8616         adding and deleting users on both sets of machines becomes a chore 
8617         and two sets of passwords are required both of which
8618         can lead to synchronization problems between the UNIX and Windows 
8619         systems and confusion for users.</P
8620 ><P
8621 >We divide the unified logon problem for UNIX machines into 
8622         three smaller problems:</P
8623 ><P
8624 ></P
8625 ><UL
8626 ><LI
8627 ><P
8628 >Obtaining Windows NT user and group information
8629                 </P
8630 ></LI
8631 ><LI
8632 ><P
8633 >Authenticating Windows NT users
8634                 </P
8635 ></LI
8636 ><LI
8637 ><P
8638 >Password changing for Windows NT users
8639                 </P
8640 ></LI
8641 ></UL
8642 ><P
8643 >Ideally, a prospective solution to the unified logon problem 
8644         would satisfy all the above components without duplication of 
8645         information on the UNIX machines and without creating additional 
8646         tasks for the system administrator when maintaining users and 
8647         groups on either system. The winbind system provides a simple 
8648         and elegant solution to all three components of the unified logon 
8649         problem.</P
8650 ></DIV
8651 ><DIV
8652 CLASS="SECT1"
8653 ><HR><H1
8654 CLASS="SECT1"
8655 ><A
8656 NAME="AEN1827"
8657 >10.3. What Winbind Provides</A
8658 ></H1
8659 ><P
8660 >Winbind unifies UNIX and Windows NT account management by 
8661         allowing a UNIX box to become a full member of a NT domain. Once 
8662         this is done the UNIX box will see NT users and groups as if 
8663         they were native UNIX users and groups, allowing the NT domain 
8664         to be used in much the same manner that NIS+ is used within 
8665         UNIX-only environments.</P
8666 ><P
8667 >The end result is that whenever any 
8668         program on the UNIX machine asks the operating system to lookup 
8669         a user or group name, the query will be resolved by asking the 
8670         NT domain controller for the specified domain to do the lookup.
8671         Because Winbind hooks into the operating system at a low level 
8672         (via the NSS name resolution modules in the C library) this 
8673         redirection to the NT domain controller is completely 
8674         transparent.</P
8675 ><P
8676 >Users on the UNIX machine can then use NT user and group 
8677         names as they would use "native" UNIX names. They can chown files 
8678         so that they are owned by NT domain users or even login to the 
8679         UNIX machine and run a UNIX X-Window session as a domain user.</P
8680 ><P
8681 >The only obvious indication that Winbind is being used is 
8682         that user and group names take the form DOMAIN\user and 
8683         DOMAIN\group. This is necessary as it allows Winbind to determine 
8684         that redirection to a domain controller is wanted for a particular 
8685         lookup and which trusted domain is being referenced.</P
8686 ><P
8687 >Additionally, Winbind provides an authentication service 
8688         that hooks into the Pluggable Authentication Modules (PAM) system 
8689         to provide authentication via a NT domain to any PAM enabled 
8690         applications. This capability solves the problem of synchronizing 
8691         passwords between systems since all passwords are stored in a single 
8692         location (on the domain controller).</P
8693 ><DIV
8694 CLASS="SECT2"
8695 ><HR><H2
8696 CLASS="SECT2"
8697 ><A
8698 NAME="AEN1834"
8699 >10.3.1. Target Uses</A
8700 ></H2
8701 ><P
8702 >Winbind is targeted at organizations that have an 
8703                 existing NT based domain infrastructure into which they wish 
8704                 to put UNIX workstations or servers. Winbind will allow these 
8705                 organizations to deploy UNIX workstations without having to 
8706                 maintain a separate account infrastructure. This greatly 
8707                 simplifies the administrative overhead of deploying UNIX 
8708                 workstations into a NT based organization.</P
8709 ><P
8710 >Another interesting way in which we expect Winbind to 
8711                 be used is as a central part of UNIX based appliances. Appliances 
8712                 that provide file and print services to Microsoft based networks 
8713                 will be able to use Winbind to provide seamless integration of 
8714                 the appliance into the domain.</P
8715 ></DIV
8716 ></DIV
8717 ><DIV
8718 CLASS="SECT1"
8719 ><HR><H1
8720 CLASS="SECT1"
8721 ><A
8722 NAME="AEN1838"
8723 >10.4. How Winbind Works</A
8724 ></H1
8725 ><P
8726 >The winbind system is designed around a client/server 
8727         architecture. A long running <B
8728 CLASS="COMMAND"
8729 >winbindd</B
8730 > daemon 
8731         listens on a UNIX domain socket waiting for requests
8732         to arrive. These requests are generated by the NSS and PAM 
8733         clients and processed sequentially.</P
8734 ><P
8735 >The technologies used to implement winbind are described 
8736         in detail below.</P
8737 ><DIV
8738 CLASS="SECT2"
8739 ><HR><H2
8740 CLASS="SECT2"
8741 ><A
8742 NAME="AEN1843"
8743 >10.4.1. Microsoft Remote Procedure Calls</A
8744 ></H2
8745 ><P
8746 >Over the last two years, efforts have been underway 
8747                 by various Samba Team members to decode various aspects of 
8748                 the Microsoft Remote Procedure Call (MSRPC) system. This 
8749                 system is used for most network related operations between 
8750                 Windows NT machines including remote management, user authentication
8751                 and print spooling. Although initially this work was done 
8752                 to aid the implementation of Primary Domain Controller (PDC) 
8753                 functionality in Samba, it has also yielded a body of code which 
8754                 can be used for other purposes.</P
8755 ><P
8756 >Winbind uses various MSRPC calls to enumerate domain users 
8757                 and groups and to obtain detailed information about individual 
8758                 users or groups. Other MSRPC calls can be used to authenticate 
8759                 NT domain users and to change user passwords. By directly querying 
8760                 a Windows PDC for user and group information, winbind maps the 
8761                 NT account information onto UNIX user and group names.</P
8762 ></DIV
8763 ><DIV
8764 CLASS="SECT2"
8765 ><HR><H2
8766 CLASS="SECT2"
8767 ><A
8768 NAME="AEN1847"
8769 >10.4.2. Name Service Switch</A
8770 ></H2
8771 ><P
8772 >The Name Service Switch, or NSS, is a feature that is 
8773                 present in many UNIX operating systems. It allows system 
8774                 information such as hostnames, mail aliases and user information 
8775                 to be resolved from different sources. For example, a standalone 
8776                 UNIX workstation may resolve system information from a series of 
8777                 flat files stored on the local filesystem. A networked workstation 
8778                 may first attempt to resolve system information from local files, 
8779                 and then consult a NIS database for user information or a DNS server 
8780                 for hostname information.</P
8781 ><P
8782 >The NSS application programming interface allows winbind 
8783                 to present itself as a source of system information when 
8784                 resolving UNIX usernames and groups.  Winbind uses this interface, 
8785                 and information obtained from a Windows NT server using MSRPC 
8786                 calls to provide a new source of account enumeration.  Using standard 
8787                 UNIX library calls, one can enumerate the users and groups on
8788                 a UNIX machine running winbind and see all users and groups in 
8789                 a NT domain plus any trusted domain as though they were local 
8790                 users and groups.</P
8791 ><P
8792 >The primary control file for NSS is 
8793                 <TT
8794 CLASS="FILENAME"
8795 >/etc/nsswitch.conf</TT
8796 >. 
8797                 When a UNIX application makes a request to do a lookup 
8798                 the C library looks in <TT
8799 CLASS="FILENAME"
8800 >/etc/nsswitch.conf</TT
8801
8802                 for a line which matches the service type being requested, for 
8803                 example the "passwd" service type is used when user or group names 
8804                 are looked up. This     config line species which implementations 
8805                 of that service should be tried and in what order. If the passwd 
8806                 config line is:</P
8807 ><P
8808 ><B
8809 CLASS="COMMAND"
8810 >passwd: files example</B
8811 ></P
8812 ><P
8813 >then the C library will first load a module called 
8814                 <TT
8815 CLASS="FILENAME"
8816 >/lib/libnss_files.so</TT
8817 > followed by
8818                 the module <TT
8819 CLASS="FILENAME"
8820 >/lib/libnss_example.so</TT
8821 >. The 
8822                 C library will dynamically load each of these modules in turn 
8823                 and call resolver functions within the modules to try to resolve 
8824                 the request. Once the request is resolved the C library returns the
8825                 result to the application.</P
8826 ><P
8827 >This NSS interface provides a very easy way for Winbind 
8828                 to hook into the operating system. All that needs to be done 
8829                 is to put <TT
8830 CLASS="FILENAME"
8831 >libnss_winbind.so</TT
8832 > in <TT
8833 CLASS="FILENAME"
8834 >/lib/</TT
8835
8836                 then add "winbind" into <TT
8837 CLASS="FILENAME"
8838 >/etc/nsswitch.conf</TT
8839 > at 
8840                 the appropriate place. The C library will then call Winbind to 
8841                 resolve user and group names.</P
8842 ></DIV
8843 ><DIV
8844 CLASS="SECT2"
8845 ><HR><H2
8846 CLASS="SECT2"
8847 ><A
8848 NAME="AEN1863"
8849 >10.4.3. Pluggable Authentication Modules</A
8850 ></H2
8851 ><P
8852 >Pluggable Authentication Modules, also known as PAM, 
8853                 is a system for abstracting authentication and authorization 
8854                 technologies. With a PAM module it is possible to specify different 
8855                 authentication methods for different system applications without 
8856                 having to recompile these applications. PAM is also useful
8857                 for implementing a particular policy for authorization. For example, 
8858                 a system administrator may only allow console logins from users 
8859                 stored in the local password file but only allow users resolved from 
8860                 a NIS database to log in over the network.</P
8861 ><P
8862 >Winbind uses the authentication management and password 
8863                 management PAM interface to integrate Windows NT users into a 
8864                 UNIX system. This allows Windows NT users to log in to a UNIX 
8865                 machine and be authenticated against a suitable Primary Domain 
8866                 Controller. These users can also change their passwords and have 
8867                 this change take effect directly on the Primary Domain Controller.
8868                 </P
8869 ><P
8870 >PAM is configured by providing control files in the directory 
8871                 <TT
8872 CLASS="FILENAME"
8873 >/etc/pam.d/</TT
8874 > for each of the services that 
8875                 require authentication. When an authentication request is made 
8876                 by an application the PAM code in the C library looks up this
8877                 control file to determine what modules to load to do the 
8878                 authentication check and in what order. This interface makes adding 
8879                 a new authentication service for Winbind very easy, all that needs 
8880                 to be done is that the <TT
8881 CLASS="FILENAME"
8882 >pam_winbind.so</TT
8883 > module 
8884                 is copied to <TT
8885 CLASS="FILENAME"
8886 >/lib/security/</TT
8887 > and the PAM 
8888                 control files for relevant services are updated to allow 
8889                 authentication via winbind. See the PAM documentation
8890                 for more details.</P
8891 ></DIV
8892 ><DIV
8893 CLASS="SECT2"
8894 ><HR><H2
8895 CLASS="SECT2"
8896 ><A
8897 NAME="AEN1871"
8898 >10.4.4. User and Group ID Allocation</A
8899 ></H2
8900 ><P
8901 >When a user or group is created under Windows NT 
8902                 is it allocated a numerical relative identifier (RID). This is 
8903                 slightly different to UNIX which has a range of numbers that are 
8904                 used to identify users, and the same range in which to identify 
8905                 groups. It is winbind's job to convert RIDs to UNIX id numbers and
8906                 vice versa.  When winbind is configured it is given part of the UNIX 
8907                 user id space and a part of the UNIX group id space in which to 
8908                 store Windows NT users and groups. If a Windows NT user is 
8909                 resolved for the first time, it is allocated the next UNIX id from 
8910                 the range. The same process applies for Windows NT groups. Over 
8911                 time, winbind will have mapped all Windows NT users and groups
8912                 to UNIX user ids and group ids.</P
8913 ><P
8914 >The results of this mapping are stored persistently in 
8915                 an ID mapping database held in a tdb database). This ensures that 
8916                 RIDs are mapped to UNIX IDs in a consistent way.</P
8917 ></DIV
8918 ><DIV
8919 CLASS="SECT2"
8920 ><HR><H2
8921 CLASS="SECT2"
8922 ><A
8923 NAME="AEN1875"
8924 >10.4.5. Result Caching</A
8925 ></H2
8926 ><P
8927 >An active system can generate a lot of user and group 
8928                 name lookups. To reduce the network cost of these lookups winbind 
8929                 uses a caching scheme based on the SAM sequence number supplied 
8930                 by NT domain controllers.  User or group information returned 
8931                 by a PDC is cached by winbind along with a sequence number also 
8932                 returned by the PDC. This sequence number is incremented by 
8933                 Windows NT whenever any user or group information is modified. If 
8934                 a cached entry has expired, the sequence number is requested from 
8935                 the PDC and compared against the sequence number of the cached entry. 
8936                 If the sequence numbers do not match, then the cached information 
8937                 is discarded and up to date information is requested directly 
8938                 from the PDC.</P
8939 ></DIV
8940 ></DIV
8941 ><DIV
8942 CLASS="SECT1"
8943 ><HR><H1
8944 CLASS="SECT1"
8945 ><A
8946 NAME="AEN1878"
8947 >10.5. Installation and Configuration</A
8948 ></H1
8949 ><P
8950 >Many thanks to John Trostel <A
8951 HREF="mailto:jtrostel@snapserver.com"
8952 TARGET="_top"
8953 >jtrostel@snapserver.com</A
8954 >
8955 for providing the HOWTO for this section.</P
8956 ><P
8957 >This HOWTO describes how to get winbind services up and running 
8958 to control access and authenticate users on your Linux box using 
8959 the winbind services which come with SAMBA 2.2.2.</P
8960 ><DIV
8961 CLASS="SECT2"
8962 ><HR><H2
8963 CLASS="SECT2"
8964 ><A
8965 NAME="AEN1883"
8966 >10.5.1. Introduction</A
8967 ></H2
8968 ><P
8969 >This HOWTO describes the procedures used to get winbind up and 
8970 running on my RedHat 7.1 system.  Winbind is capable of providing access 
8971 and authentication control for Windows Domain users through an NT 
8972 or Win2K PDC for 'regular' services, such as telnet a nd ftp, as
8973 well for SAMBA services.</P
8974 ><P
8975 >This HOWTO has been written from a 'RedHat-centric' perspective, so if 
8976 you are using another distribution, you may have to modify the instructions 
8977 somewhat to fit the way your distribution works.</P
8978 ><P
8979 ></P
8980 ><UL
8981 ><LI
8982 ><P
8983 >       <EM
8984 >Why should I to this?</EM
8985 >
8986         </P
8987 ><P
8988 >This allows the SAMBA administrator to rely on the 
8989         authentication mechanisms on the NT/Win2K PDC for the authentication 
8990         of domain members.  NT/Win2K users no longer need to have separate 
8991         accounts on the SAMBA server.
8992         </P
8993 ></LI
8994 ><LI
8995 ><P
8996 >       <EM
8997 >Who should be reading this document?</EM
8998 >
8999         </P
9000 ><P
9001 >       This HOWTO is designed for system administrators.  If you are 
9002         implementing SAMBA on a file server and wish to (fairly easily) 
9003         integrate existing NT/Win2K users from your PDC onto the
9004         SAMBA server, this HOWTO is for you.  That said, I am no NT or PAM 
9005         expert, so you may find a better or easier way to accomplish 
9006         these tasks.
9007         </P
9008 ></LI
9009 ></UL
9010 ></DIV
9011 ><DIV
9012 CLASS="SECT2"
9013 ><HR><H2
9014 CLASS="SECT2"
9015 ><A
9016 NAME="AEN1896"
9017 >10.5.2. Requirements</A
9018 ></H2
9019 ><P
9020 >If you have a samba configuration file that you are currently 
9021 using... <EM
9022 >BACK IT UP!</EM
9023 >  If your system already uses PAM, 
9024 <EM
9025 >back up the <TT
9026 CLASS="FILENAME"
9027 >/etc/pam.d</TT
9028 > directory 
9029 contents!</EM
9030 > If you haven't already made a boot disk, 
9031 <EM
9032 >MAKE ONE NOW!</EM
9033 ></P
9034 ><P
9035 >Messing with the pam configuration files can make it nearly impossible 
9036 to log in to yourmachine. That's why you want to be able to boot back 
9037 into your machine in single user mode and restore your 
9038 <TT
9039 CLASS="FILENAME"
9040 >/etc/pam.d</TT
9041 > back to the original state they were in if 
9042 you get frustrated with the way things are going.  ;-)</P
9043 ><P
9044 >The latest version of SAMBA (version 2.2.2 as of this writing), now 
9045 includes a functioning winbindd daemon.  Please refer to the 
9046 <A
9047 HREF="http://samba.org/"
9048 TARGET="_top"
9049 >main SAMBA web page</A
9050 > or, 
9051 better yet, your closest SAMBA mirror site for instructions on 
9052 downloading the source code.</P
9053 ><P
9054 >To allow Domain users the ability to access SAMBA shares and 
9055 files, as well as potentially other services provided by your 
9056 SAMBA machine, PAM (pluggable authentication modules) must
9057 be setup properly on your machine.  In order to compile the 
9058 winbind modules, you should have at least the pam libraries resident 
9059 on your system.  For recent RedHat systems (7.1, for instance), that 
9060 means <TT
9061 CLASS="FILENAME"
9062 >pam-0.74-22</TT
9063 >.  For best results, it is helpful to also
9064 install the development packages in <TT
9065 CLASS="FILENAME"
9066 >pam-devel-0.74-22</TT
9067 >.</P
9068 ></DIV
9069 ><DIV
9070 CLASS="SECT2"
9071 ><HR><H2
9072 CLASS="SECT2"
9073 ><A
9074 NAME="AEN1910"
9075 >10.5.3. Testing Things Out</A
9076 ></H2
9077 ><P
9078 >Before starting, it is probably best to kill off all the SAMBA 
9079 related daemons running on your server.  Kill off all <B
9080 CLASS="COMMAND"
9081 >smbd</B
9082 >, 
9083 <B
9084 CLASS="COMMAND"
9085 >nmbd</B
9086 >, and <B
9087 CLASS="COMMAND"
9088 >winbindd</B
9089 > processes that may 
9090 be running.  To use PAM, you will want to make sure that you have the 
9091 standard PAM package (for RedHat) which supplies the <TT
9092 CLASS="FILENAME"
9093 >/etc/pam.d</TT
9094
9095 directory structure, including the pam modules are used by pam-aware 
9096 services, several pam libraries, and the <TT
9097 CLASS="FILENAME"
9098 >/usr/doc</TT
9099
9100 and <TT
9101 CLASS="FILENAME"
9102 >/usr/man</TT
9103 > entries for pam.  Winbind built better 
9104 in SAMBA if the pam-devel package was also installed.  This package includes 
9105 the header files needed to compile pam-aware applications. For instance, 
9106 my RedHat system has both <TT
9107 CLASS="FILENAME"
9108 >pam-0.74-22</TT
9109 > and
9110 <TT
9111 CLASS="FILENAME"
9112 >pam-devel-0.74-22</TT
9113 > RPMs installed.</P
9114 ><DIV
9115 CLASS="SECT3"
9116 ><HR><H3
9117 CLASS="SECT3"
9118 ><A
9119 NAME="AEN1921"
9120 >10.5.3.1. Configure and compile SAMBA</A
9121 ></H3
9122 ><P
9123 >The configuration and compilation of SAMBA is pretty straightforward.
9124 The first three steps may not be necessary depending upon
9125 whether or not you have previously built the Samba binaries.</P
9126 ><P
9127 ><TABLE
9128 BORDER="0"
9129 BGCOLOR="#E0E0E0"
9130 WIDTH="100%"
9131 ><TR
9132 ><TD
9133 ><PRE
9134 CLASS="PROGRAMLISTING"
9135 ><TT
9136 CLASS="PROMPT"
9137 >root#</TT
9138 > <B
9139 CLASS="COMMAND"
9140 >autoconf</B
9141 >
9142 <TT
9143 CLASS="PROMPT"
9144 >root#</TT
9145 > <B
9146 CLASS="COMMAND"
9147 >make clean</B
9148 >
9149 <TT
9150 CLASS="PROMPT"
9151 >root#</TT
9152 > <B
9153 CLASS="COMMAND"
9154 >rm config.cache</B
9155 >
9156 <TT
9157 CLASS="PROMPT"
9158 >root#</TT
9159 > <B
9160 CLASS="COMMAND"
9161 >./configure --with-winbind</B
9162 >
9163 <TT
9164 CLASS="PROMPT"
9165 >root#</TT
9166 > <B
9167 CLASS="COMMAND"
9168 >make</B
9169 >
9170 <TT
9171 CLASS="PROMPT"
9172 >root#</TT
9173 > <B
9174 CLASS="COMMAND"
9175 >make install</B
9176 ></PRE
9177 ></TD
9178 ></TR
9179 ></TABLE
9180 ></P
9181 ><P
9182 >This will, by default, install SAMBA in <TT
9183 CLASS="FILENAME"
9184 >/usr/local/samba</TT
9185 >.
9186 See the main SAMBA documentation if you want to install SAMBA somewhere else.
9187 It will also build the winbindd executable and libraries. </P
9188 ></DIV
9189 ><DIV
9190 CLASS="SECT3"
9191 ><HR><H3
9192 CLASS="SECT3"
9193 ><A
9194 NAME="AEN1940"
9195 >10.5.3.2. Configure <TT
9196 CLASS="FILENAME"
9197 >nsswitch.conf</TT
9198 > and the 
9199 winbind libraries</A
9200 ></H3
9201 ><P
9202 >The libraries needed to run the <B
9203 CLASS="COMMAND"
9204 >winbindd</B
9205 > daemon 
9206 through nsswitch need to be copied to their proper locations, so</P
9207 ><P
9208 ><TT
9209 CLASS="PROMPT"
9210 >root#</TT
9211 > <B
9212 CLASS="COMMAND"
9213 >cp ../samba/source/nsswitch/libnss_winbind.so /lib</B
9214 ></P
9215 ><P
9216 >I also found it necessary to make the following symbolic link:</P
9217 ><P
9218 ><TT
9219 CLASS="PROMPT"
9220 >root#</TT
9221 > <B
9222 CLASS="COMMAND"
9223 >ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2</B
9224 ></P
9225 ><P
9226 >Now, as root you need to edit <TT
9227 CLASS="FILENAME"
9228 >/etc/nsswitch.conf</TT
9229 > to 
9230 allow user and group entries to be visible from the <B
9231 CLASS="COMMAND"
9232 >winbindd</B
9233
9234 daemon.  My <TT
9235 CLASS="FILENAME"
9236 >/etc/nsswitch.conf</TT
9237 > file look like 
9238 this after editing:</P
9239 ><P
9240 ><TABLE
9241 BORDER="0"
9242 BGCOLOR="#E0E0E0"
9243 WIDTH="100%"
9244 ><TR
9245 ><TD
9246 ><PRE
9247 CLASS="PROGRAMLISTING"
9248 >       passwd:     files winbind
9249         shadow:     files 
9250         group:      files winbind</PRE
9251 ></TD
9252 ></TR
9253 ></TABLE
9254 ></P
9255 ><P
9256 >       
9257 The libraries needed by the winbind daemon will be automatically 
9258 entered into the <B
9259 CLASS="COMMAND"
9260 >ldconfig</B
9261 > cache the next time 
9262 your system reboots, but it 
9263 is faster (and you don't need to reboot) if you do it manually:</P
9264 ><P
9265 ><TT
9266 CLASS="PROMPT"
9267 >root#</TT
9268 > <B
9269 CLASS="COMMAND"
9270 >/sbin/ldconfig -v | grep winbind</B
9271 ></P
9272 ><P
9273 >This makes <TT
9274 CLASS="FILENAME"
9275 >libnss_winbind</TT
9276 > available to winbindd 
9277 and echos back a check to you.</P
9278 ></DIV
9279 ><DIV
9280 CLASS="SECT3"
9281 ><HR><H3
9282 CLASS="SECT3"
9283 ><A
9284 NAME="AEN1965"
9285 >10.5.3.3. Configure smb.conf</A
9286 ></H3
9287 ><P
9288 >Several parameters are needed in the smb.conf file to control 
9289 the behavior of <B
9290 CLASS="COMMAND"
9291 >winbindd</B
9292 >. Configure 
9293 <TT
9294 CLASS="FILENAME"
9295 >smb.conf</TT
9296 > These are described in more detail in 
9297 the <A
9298 HREF="winbindd.8.html"
9299 TARGET="_top"
9300 >winbindd(8)</A
9301 > man page.  My 
9302 <TT
9303 CLASS="FILENAME"
9304 >smb.conf</TT
9305 > file was modified to
9306 include the following entries in the [global] section:</P
9307 ><P
9308 ><TABLE
9309 BORDER="0"
9310 BGCOLOR="#E0E0E0"
9311 WIDTH="100%"
9312 ><TR
9313 ><TD
9314 ><PRE
9315 CLASS="PROGRAMLISTING"
9316 >[global]
9317      &#60;...&#62;
9318      # separate domain and username with '+', like DOMAIN+username
9319      <A
9320 HREF="winbindd.8.html#WINBINDSEPARATOR"
9321 TARGET="_top"
9322 >winbind separator</A
9323 > = +
9324      # use uids from 10000 to 20000 for domain users
9325      <A
9326 HREF="winbindd.8.html#WINBINDUID"
9327 TARGET="_top"
9328 >winbind uid</A
9329 > = 10000-20000
9330      # use gids from 10000 to 20000 for domain groups
9331      <A
9332 HREF="winbindd.8.html#WINBINDGID"
9333 TARGET="_top"
9334 >winbind gid</A
9335 > = 10000-20000
9336      # allow enumeration of winbind users and groups
9337      <A
9338 HREF="winbindd.8.html#WINBINDENUMUSERS"
9339 TARGET="_top"
9340 >winbind enum users</A
9341 > = yes
9342      <A
9343 HREF="winbindd.8.html#WINBINDENUMGROUP"
9344 TARGET="_top"
9345 >winbind enum groups</A
9346 > = yes
9347      # give winbind users a real shell (only needed if they have telnet access)
9348      <A
9349 HREF="winbindd.8.html#TEMPLATEHOMEDIR"
9350 TARGET="_top"
9351 >template homedir</A
9352 > = /home/winnt/%D/%U
9353      <A
9354 HREF="winbindd.8.html#TEMPLATESHELL"
9355 TARGET="_top"
9356 >template shell</A
9357 > = /bin/bash</PRE
9358 ></TD
9359 ></TR
9360 ></TABLE
9361 ></P
9362 ></DIV
9363 ><DIV
9364 CLASS="SECT3"
9365 ><HR><H3
9366 CLASS="SECT3"
9367 ><A
9368 NAME="AEN1981"
9369 >10.5.3.4. Join the SAMBA server to the PDC domain</A
9370 ></H3
9371 ><P
9372 >Enter the following command to make the SAMBA server join the 
9373 PDC domain, where <TT
9374 CLASS="REPLACEABLE"
9375 ><I
9376 >DOMAIN</I
9377 ></TT
9378 > is the name of 
9379 your Windows domain and <TT
9380 CLASS="REPLACEABLE"
9381 ><I
9382 >Administrator</I
9383 ></TT
9384 > is 
9385 a domain user who has administrative privileges in the domain.</P
9386 ><P
9387 ><TT
9388 CLASS="PROMPT"
9389 >root#</TT
9390 > <B
9391 CLASS="COMMAND"
9392 >/usr/local/samba/bin/smbpasswd -j DOMAIN -r PDC -U Administrator</B
9393 ></P
9394 ><P
9395 >The proper response to the command should be: "Joined the domain 
9396 <TT
9397 CLASS="REPLACEABLE"
9398 ><I
9399 >DOMAIN</I
9400 ></TT
9401 >" where <TT
9402 CLASS="REPLACEABLE"
9403 ><I
9404 >DOMAIN</I
9405 ></TT
9406
9407 is your DOMAIN name.</P
9408 ></DIV
9409 ><DIV
9410 CLASS="SECT3"
9411 ><HR><H3
9412 CLASS="SECT3"
9413 ><A
9414 NAME="AEN1992"
9415 >10.5.3.5. Start up the winbindd daemon and test it!</A
9416 ></H3
9417 ><P
9418 >Eventually, you will want to modify your smb startup script to 
9419 automatically invoke the winbindd daemon when the other parts of 
9420 SAMBA start, but it is possible to test out just the winbind
9421 portion first.  To start up winbind services, enter the following 
9422 command as root:</P
9423 ><P
9424 ><TT
9425 CLASS="PROMPT"
9426 >root#</TT
9427 > <B
9428 CLASS="COMMAND"
9429 >/usr/local/samba/bin/winbindd</B
9430 ></P
9431 ><P
9432 >I'm always paranoid and like to make sure the daemon 
9433 is really running...</P
9434 ><P
9435 ><TT
9436 CLASS="PROMPT"
9437 >root#</TT
9438 > <B
9439 CLASS="COMMAND"
9440 >ps -ae | grep winbindd</B
9441 ></P
9442 ><P
9443 >This command should produce output like this, if the daemon is running</P
9444 ><P
9445 >3025 ?        00:00:00 winbindd</P
9446 ><P
9447 >Now... for the real test, try to get some information about the 
9448 users on your PDC</P
9449 ><P
9450 ><TT
9451 CLASS="PROMPT"
9452 >root#</TT
9453 > <B
9454 CLASS="COMMAND"
9455 >/usr/local/samba/bin/wbinfo -u</B
9456 ></P
9457 ><P
9458 >       
9459 This should echo back a list of users on your Windows users on 
9460 your PDC.  For example, I get the following response:</P
9461 ><P
9462 ><TABLE
9463 BORDER="0"
9464 BGCOLOR="#E0E0E0"
9465 WIDTH="100%"
9466 ><TR
9467 ><TD
9468 ><PRE
9469 CLASS="PROGRAMLISTING"
9470 >CEO+Administrator
9471 CEO+burdell
9472 CEO+Guest
9473 CEO+jt-ad
9474 CEO+krbtgt
9475 CEO+TsInternetUser</PRE
9476 ></TD
9477 ></TR
9478 ></TABLE
9479 ></P
9480 ><P
9481 >Obviously, I have named my domain 'CEO' and my <TT
9482 CLASS="PARAMETER"
9483 ><I
9484 >winbindd
9485 separator</I
9486 ></TT
9487 > is '+'.</P
9488 ><P
9489 >You can do the same sort of thing to get group information from 
9490 the PDC:</P
9491 ><P
9492 ><TABLE
9493 BORDER="0"
9494 BGCOLOR="#E0E0E0"
9495 WIDTH="100%"
9496 ><TR
9497 ><TD
9498 ><PRE
9499 CLASS="PROGRAMLISTING"
9500 ><TT
9501 CLASS="PROMPT"
9502 >root#</TT
9503 > <B
9504 CLASS="COMMAND"
9505 >/usr/local/samba/bin/wbinfo -g</B
9506 >
9507 CEO+Domain Admins
9508 CEO+Domain Users
9509 CEO+Domain Guests
9510 CEO+Domain Computers
9511 CEO+Domain Controllers
9512 CEO+Cert Publishers
9513 CEO+Schema Admins
9514 CEO+Enterprise Admins
9515 CEO+Group Policy Creator Owners</PRE
9516 ></TD
9517 ></TR
9518 ></TABLE
9519 ></P
9520 ><P
9521 >The function 'getent' can now be used to get unified 
9522 lists of both local and PDC users and groups.
9523 Try the following command:</P
9524 ><P
9525 ><TT
9526 CLASS="PROMPT"
9527 >root#</TT
9528 > <B
9529 CLASS="COMMAND"
9530 >getent passwd</B
9531 ></P
9532 ><P
9533 >You should get a list that looks like your <TT
9534 CLASS="FILENAME"
9535 >/etc/passwd</TT
9536
9537 list followed by the domain users with their new uids, gids, home 
9538 directories and default shells.</P
9539 ><P
9540 >The same thing can be done for groups with the command</P
9541 ><P
9542 ><TT
9543 CLASS="PROMPT"
9544 >root#</TT
9545 > <B
9546 CLASS="COMMAND"
9547 >getent group</B
9548 ></P
9549 ></DIV
9550 ><DIV
9551 CLASS="SECT3"
9552 ><HR><H3
9553 CLASS="SECT3"
9554 ><A
9555 NAME="AEN2028"
9556 >10.5.3.6. Fix the <TT
9557 CLASS="FILENAME"
9558 >/etc/rc.d/init.d/smb</TT
9559 > startup files</A
9560 ></H3
9561 ><P
9562 >The <B
9563 CLASS="COMMAND"
9564 >winbindd</B
9565 > daemon needs to start up after the 
9566 <B
9567 CLASS="COMMAND"
9568 >smbd</B
9569 > and <B
9570 CLASS="COMMAND"
9571 >nmbd</B
9572 > daemons are running.  
9573 To accomplish this task, you need to modify the <TT
9574 CLASS="FILENAME"
9575 >/etc/init.d/smb</TT
9576 >
9577 script to add commands to invoke this daemon in the proper sequence.  My 
9578 <TT
9579 CLASS="FILENAME"
9580 >/etc/init.d/smb</TT
9581 > file starts up <B
9582 CLASS="COMMAND"
9583 >smbd</B
9584 >, 
9585 <B
9586 CLASS="COMMAND"
9587 >nmbd</B
9588 >, and <B
9589 CLASS="COMMAND"
9590 >winbindd</B
9591 > from the 
9592 <TT
9593 CLASS="FILENAME"
9594 >/usr/local/samba/bin</TT
9595 > directory directly.  The 'start' 
9596 function in the script looks like this:</P
9597 ><P
9598 ><TABLE
9599 BORDER="0"
9600 BGCOLOR="#E0E0E0"
9601 WIDTH="100%"
9602 ><TR
9603 ><TD
9604 ><PRE
9605 CLASS="PROGRAMLISTING"
9606 >start() {
9607         KIND="SMB"
9608         echo -n $"Starting $KIND services: "
9609         daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
9610         RETVAL=$?
9611         echo
9612         KIND="NMB"
9613         echo -n $"Starting $KIND services: "
9614         daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
9615         RETVAL2=$?
9616         echo
9617         KIND="Winbind"
9618         echo -n $"Starting $KIND services: "
9619         daemon /usr/local/samba/bin/winbindd
9620         RETVAL3=$?
9621         echo
9622         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; touch /var/lock/subsys/smb || \
9623            RETVAL=1
9624         return $RETVAL
9625 }</PRE
9626 ></TD
9627 ></TR
9628 ></TABLE
9629 ></P
9630 ><P
9631 >The 'stop' function has a corresponding entry to shut down the 
9632 services and look s like this:</P
9633 ><P
9634 ><TABLE
9635 BORDER="0"
9636 BGCOLOR="#E0E0E0"
9637 WIDTH="100%"
9638 ><TR
9639 ><TD
9640 ><PRE
9641 CLASS="PROGRAMLISTING"
9642 >stop() {
9643         KIND="SMB"
9644         echo -n $"Shutting down $KIND services: "
9645         killproc smbd
9646         RETVAL=$?
9647         echo
9648         KIND="NMB"
9649         echo -n $"Shutting down $KIND services: "
9650         killproc nmbd
9651         RETVAL2=$?
9652         echo
9653         KIND="Winbind"
9654         echo -n $"Shutting down $KIND services: "
9655         killproc winbindd
9656         RETVAL3=$?
9657         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; rm -f /var/lock/subsys/smb
9658         echo ""
9659         return $RETVAL
9660 }</PRE
9661 ></TD
9662 ></TR
9663 ></TABLE
9664 ></P
9665 ><P
9666 >If you restart the <B
9667 CLASS="COMMAND"
9668 >smbd</B
9669 >, <B
9670 CLASS="COMMAND"
9671 >nmbd</B
9672 >, 
9673 and <B
9674 CLASS="COMMAND"
9675 >winbindd</B
9676 > daemons at this point, you
9677 should be able to connect to the samba server as a domain member just as
9678 if you were a local user.</P
9679 ></DIV
9680 ><DIV
9681 CLASS="SECT3"
9682 ><HR><H3
9683 CLASS="SECT3"
9684 ><A
9685 NAME="AEN2050"
9686 >10.5.3.7. Configure Winbind and PAM</A
9687 ></H3
9688 ><P
9689 >If you have made it this far, you know that winbindd and samba are working
9690 together.  If you want to use winbind to provide authentication for other 
9691 services, keep reading.  The pam configuration files need to be altered in
9692 this step.  (Did you remember to make backups of your original 
9693 <TT
9694 CLASS="FILENAME"
9695 >/etc/pam.d</TT
9696 > files? If not, do it now.)</P
9697 ><P
9698 >You will need a pam module to use winbindd with these other services.  This 
9699 module will be compiled in the <TT
9700 CLASS="FILENAME"
9701 >../source/nsswitch</TT
9702 > directory
9703 by invoking the command</P
9704 ><P
9705 ><TT
9706 CLASS="PROMPT"
9707 >root#</TT
9708 > <B
9709 CLASS="COMMAND"
9710 >make nsswitch/pam_winbind.so</B
9711 ></P
9712 ><P
9713 >from the <TT
9714 CLASS="FILENAME"
9715 >../source</TT
9716 > directory.  The
9717 <TT
9718 CLASS="FILENAME"
9719 >pam_winbind.so</TT
9720 > file should be copied to the location of
9721 your other pam security modules.  On my RedHat system, this was the
9722 <TT
9723 CLASS="FILENAME"
9724 >/lib/security</TT
9725 > directory.</P
9726 ><P
9727 ><TT
9728 CLASS="PROMPT"
9729 >root#</TT
9730 > <B
9731 CLASS="COMMAND"
9732 >cp ../samba/source/nsswitch/pam_winbind.so /lib/security</B
9733 ></P
9734 ><P
9735 >The <TT
9736 CLASS="FILENAME"
9737 >/etc/pam.d/samba</TT
9738 > file does not need to be changed. I 
9739 just left this fileas it was:</P
9740 ><P
9741 ><TABLE
9742 BORDER="0"
9743 BGCOLOR="#E0E0E0"
9744 WIDTH="100%"
9745 ><TR
9746 ><TD
9747 ><PRE
9748 CLASS="PROGRAMLISTING"
9749 >auth    required        /lib/security/pam_stack.so service=system-auth
9750 account required        /lib/security/pam_stack.so service=system-auth</PRE
9751 ></TD
9752 ></TR
9753 ></TABLE
9754 ></P
9755 ><P
9756 >The other services that I modified to allow the use of winbind 
9757 as an authentication service were the normal login on the console (or a terminal 
9758 session), telnet logins, and ftp service.  In order to enable these 
9759 services, you may first need to change the entries in 
9760 <TT
9761 CLASS="FILENAME"
9762 >/etc/xinetd.d</TT
9763 > (or <TT
9764 CLASS="FILENAME"
9765 >/etc/inetd.conf</TT
9766 >).  
9767 RedHat 7.1 uses the new xinetd.d structure, in this case you need 
9768 to change the lines in <TT
9769 CLASS="FILENAME"
9770 >/etc/xinetd.d/telnet</TT
9771
9772 and <TT
9773 CLASS="FILENAME"
9774 >/etc/xinetd.d/wu-ftp</TT
9775 > from </P
9776 ><P
9777 ><TABLE
9778 BORDER="0"
9779 BGCOLOR="#E0E0E0"
9780 WIDTH="100%"
9781 ><TR
9782 ><TD
9783 ><PRE
9784 CLASS="PROGRAMLISTING"
9785 >enable = no</PRE
9786 ></TD
9787 ></TR
9788 ></TABLE
9789 ></P
9790 ><P
9791 >to</P
9792 ><P
9793 ><TABLE
9794 BORDER="0"
9795 BGCOLOR="#E0E0E0"
9796 WIDTH="100%"
9797 ><TR
9798 ><TD
9799 ><PRE
9800 CLASS="PROGRAMLISTING"
9801 >enable = yes</PRE
9802 ></TD
9803 ></TR
9804 ></TABLE
9805 ></P
9806 ><P
9807 >       
9808 For ftp services to work properly, you will also need to either 
9809 have individual directories for the domain users already present on 
9810 the server, or change the home directory template to a general
9811 directory for all domain users.  These can be easily set using 
9812 the <TT
9813 CLASS="FILENAME"
9814 >smb.conf</TT
9815 > global entry 
9816 <B
9817 CLASS="COMMAND"
9818 >template homedir</B
9819 >.</P
9820 ><P
9821 >The <TT
9822 CLASS="FILENAME"
9823 >/etc/pam.d/ftp</TT
9824 > file can be changed 
9825 to allow winbind ftp access in a manner similar to the
9826 samba file.  My <TT
9827 CLASS="FILENAME"
9828 >/etc/pam.d/ftp</TT
9829 > file was 
9830 changed to look like this:</P
9831 ><P
9832 ><TABLE
9833 BORDER="0"
9834 BGCOLOR="#E0E0E0"
9835 WIDTH="100%"
9836 ><TR
9837 ><TD
9838 ><PRE
9839 CLASS="PROGRAMLISTING"
9840 >auth       required     /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
9841 auth       sufficient   /lib/security/pam_winbind.so
9842 auth       required     /lib/security/pam_stack.so service=system-auth
9843 auth       required     /lib/security/pam_shells.so
9844 account    sufficient   /lib/security/pam_winbind.so
9845 account    required     /lib/security/pam_stack.so service=system-auth
9846 session    required     /lib/security/pam_stack.so service=system-auth</PRE
9847 ></TD
9848 ></TR
9849 ></TABLE
9850 ></P
9851 ><P
9852 >The <TT
9853 CLASS="FILENAME"
9854 >/etc/pam.d/login</TT
9855 > file can be changed nearly the 
9856 same way.  It now looks like this:</P
9857 ><P
9858 ><TABLE
9859 BORDER="0"
9860 BGCOLOR="#E0E0E0"
9861 WIDTH="100%"
9862 ><TR
9863 ><TD
9864 ><PRE
9865 CLASS="PROGRAMLISTING"
9866 >auth       required     /lib/security/pam_securetty.so
9867 auth       sufficient   /lib/security/pam_winbind.so
9868 auth       sufficient   /lib/security/pam_unix.so use_first_pass
9869 auth       required     /lib/security/pam_stack.so service=system-auth
9870 auth       required     /lib/security/pam_nologin.so
9871 account    sufficient   /lib/security/pam_winbind.so
9872 account    required     /lib/security/pam_stack.so service=system-auth
9873 password   required     /lib/security/pam_stack.so service=system-auth
9874 session    required     /lib/security/pam_stack.so service=system-auth
9875 session    optional     /lib/security/pam_console.so</PRE
9876 ></TD
9877 ></TR
9878 ></TABLE
9879 ></P
9880 ><P
9881 >In this case, I added the <B
9882 CLASS="COMMAND"
9883 >auth sufficient /lib/security/pam_winbind.so</B
9884
9885 lines as before, but also added the <B
9886 CLASS="COMMAND"
9887 >required pam_securetty.so</B
9888
9889 above it, to disallow root logins over the network.  I also added a 
9890 <B
9891 CLASS="COMMAND"
9892 >sufficient /lib/security/pam_unix.so use_first_pass</B
9893 >
9894 line after the <B
9895 CLASS="COMMAND"
9896 >winbind.so</B
9897 > line to get rid of annoying 
9898 double prompts for passwords.</P
9899 ></DIV
9900 ></DIV
9901 ></DIV
9902 ><DIV
9903 CLASS="SECT1"
9904 ><HR><H1
9905 CLASS="SECT1"
9906 ><A
9907 NAME="AEN2097"
9908 >10.6. Limitations</A
9909 ></H1
9910 ><P
9911 >Winbind has a number of limitations in its current 
9912         released version that we hope to overcome in future 
9913         releases:</P
9914 ><P
9915 ></P
9916 ><UL
9917 ><LI
9918 ><P
9919 >Winbind is currently only available for 
9920                 the Linux operating system, although ports to other operating 
9921                 systems are certainly possible. For such ports to be feasible, 
9922                 we require the C library of the target operating system to 
9923                 support the Name Service Switch and Pluggable Authentication
9924                 Modules systems. This is becoming more common as NSS and 
9925                 PAM gain        support among UNIX vendors.</P
9926 ></LI
9927 ><LI
9928 ><P
9929 >The mappings of Windows NT RIDs to UNIX ids 
9930                 is not made algorithmically and depends on the order in which 
9931                 unmapped users or groups are seen by winbind. It may be difficult 
9932                 to recover the mappings of rid to UNIX id mapping if the file 
9933                 containing this information is corrupted or destroyed.</P
9934 ></LI
9935 ><LI
9936 ><P
9937 >Currently the winbind PAM module does not take 
9938                 into account possible workstation and logon time restrictions 
9939                 that may be been set for Windows NT users.</P
9940 ></LI
9941 ></UL
9942 ></DIV
9943 ><DIV
9944 CLASS="SECT1"
9945 ><HR><H1
9946 CLASS="SECT1"
9947 ><A
9948 NAME="AEN2107"
9949 >10.7. Conclusion</A
9950 ></H1
9951 ><P
9952 >The winbind system, through the use of the Name Service 
9953         Switch, Pluggable Authentication Modules, and appropriate 
9954         Microsoft RPC calls have allowed us to provide seamless 
9955         integration of Microsoft Windows NT domain users on a
9956         UNIX system. The result is a great reduction in the administrative 
9957         cost of running a mixed UNIX and NT network.</P
9958 ></DIV
9959 ></DIV
9960 ><DIV
9961 CLASS="CHAPTER"
9962 ><HR><H1
9963 ><A
9964 NAME="OS2"
9965 >Chapter 11. OS2 Client HOWTO</A
9966 ></H1
9967 ><DIV
9968 CLASS="SECT1"
9969 ><H1
9970 CLASS="SECT1"
9971 ><A
9972 NAME="AEN2121"
9973 >11.1. FAQs</A
9974 ></H1
9975 ><DIV
9976 CLASS="SECT2"
9977 ><H2
9978 CLASS="SECT2"
9979 ><A
9980 NAME="AEN2123"
9981 >11.1.1. How can I configure OS/2 Warp Connect or 
9982                 OS/2 Warp 4 as a client for Samba?</A
9983 ></H2
9984 ><P
9985 >A more complete answer to this question can be 
9986                 found on <A
9987 HREF="http://carol.wins.uva.nl/~leeuw/samba/warp.html"
9988 TARGET="_top"
9989 >               http://carol.wins.uva.nl/~leeuw/samba/warp.html</A
9990 >.</P
9991 ><P
9992 >Basically, you need three components:</P
9993 ><P
9994 ></P
9995 ><UL
9996 ><LI
9997 ><P
9998 >The File and Print Client ('IBM Peer')
9999                         </P
10000 ></LI
10001 ><LI
10002 ><P
10003 >TCP/IP ('Internet support') 
10004                         </P
10005 ></LI
10006 ><LI
10007 ><P
10008 >The "NetBIOS over TCP/IP" driver ('TCPBEUI')
10009                         </P
10010 ></LI
10011 ></UL
10012 ><P
10013 >Installing the first two together with the base operating 
10014                 system on a blank system is explained in the Warp manual. If Warp 
10015                 has already been installed, but you now want to install the 
10016                 networking support, use the "Selective Install for Networking" 
10017                 object in the "System Setup" folder.</P
10018 ><P
10019 >Adding the "NetBIOS over TCP/IP" driver is not described 
10020                 in the manual and just barely in the online documentation. Start 
10021                 MPTS.EXE, click on OK, click on "Configure LAPS" and click 
10022                 on "IBM OS/2 NETBIOS OVER TCP/IP" in  'Protocols'.  This line 
10023                 is then moved to 'Current Configuration'. Select that line, 
10024                 click on "Change number" and increase it from 0 to 1. Save this
10025                 configuration.</P
10026 ><P
10027 >If the Samba server(s) is not on your local subnet, you 
10028                 can optionally add IP names and addresses of these servers 
10029                 to the "Names List", or specify a  WINS server ('NetBIOS 
10030                 Nameserver' in IBM and RFC terminology). For Warp Connect you 
10031                 may need to download an update for 'IBM Peer' to bring it on 
10032                 the same level as Warp 4. See the webpage mentioned above.</P
10033 ></DIV
10034 ><DIV
10035 CLASS="SECT2"
10036 ><HR><H2
10037 CLASS="SECT2"
10038 ><A
10039 NAME="AEN2138"
10040 >11.1.2. How can I configure OS/2 Warp 3 (not Connect), 
10041                 OS/2 1.2, 1.3 or 2.x for Samba?</A
10042 ></H2
10043 ><P
10044 >You can use the free Microsoft LAN Manager 2.2c Client 
10045                 for OS/2 from 
10046                 <A
10047 HREF="ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/"
10048 TARGET="_top"
10049 >               ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/</A
10050 >.
10051         See <A
10052 HREF="http://carol.wins.uva.nl/~leeuw/lanman.html"
10053 TARGET="_top"
10054 >               http://carol.wins.uva.nl/~leeuw/lanman.html</A
10055 > for 
10056                 more information on how to install and use this client. In 
10057                 a nutshell, edit the file \OS2VER in the root directory of 
10058                 the OS/2 boot partition and add the lines:</P
10059 ><P
10060 ><TABLE
10061 BORDER="0"
10062 BGCOLOR="#E0E0E0"
10063 WIDTH="100%"
10064 ><TR
10065 ><TD
10066 ><PRE
10067 CLASS="PROGRAMLISTING"
10068 >               20=setup.exe
10069                 20=netwksta.sys
10070                 20=netvdd.sys
10071                 </PRE
10072 ></TD
10073 ></TR
10074 ></TABLE
10075 ></P
10076 ><P
10077 >before you install the client. Also, don't use the 
10078                 included NE2000 driver because it is buggy. Try the NE2000 
10079                 or NS2000 driver from 
10080                 <A
10081 HREF="ftp://ftp.cdrom.com/pub/os2/network/ndis/"
10082 TARGET="_top"
10083 >               ftp://ftp.cdrom.com/pub/os2/network/ndis/</A
10084 > instead.
10085                 </P
10086 ></DIV
10087 ><DIV
10088 CLASS="SECT2"
10089 ><HR><H2
10090 CLASS="SECT2"
10091 ><A
10092 NAME="AEN2147"
10093 >11.1.3. Are there any other issues when OS/2 (any version) 
10094                 is used as a client?</A
10095 ></H2
10096 ><P
10097 >When you do a NET VIEW or use the "File and Print 
10098                 Client Resource Browser", no Samba servers show up. This can 
10099                 be fixed by a patch from <A
10100 HREF="http://carol.wins.uva.nl/~leeuw/samba/fix.html"
10101 TARGET="_top"
10102 >               http://carol.wins.uva.nl/~leeuw/samba/fix.html</A
10103 >.
10104                 The patch will be included in a later version of Samba. It also 
10105                 fixes a couple of other problems, such as preserving long 
10106                 filenames when objects are dragged from the Workplace Shell 
10107                 to the Samba server. </P
10108 ></DIV
10109 ><DIV
10110 CLASS="SECT2"
10111 ><HR><H2
10112 CLASS="SECT2"
10113 ><A
10114 NAME="AEN2151"
10115 >11.1.4. How do I get printer driver download working 
10116                 for OS/2 clients?</A
10117 ></H2
10118 ><P
10119 >First, create a share called [PRINTDRV] that is 
10120                 world-readable.  Copy your OS/2 driver files there.  Note 
10121                 that the .EA_ files must still be separate, so you will need 
10122                 to use the original install files, and not copy an installed 
10123                 driver from an OS/2 system.</P
10124 ><P
10125 >Install the NT driver first for that printer.  Then, 
10126                 add to your smb.conf a parameter, "os2 driver map = 
10127                 <TT
10128 CLASS="REPLACEABLE"
10129 ><I
10130 >filename</I
10131 ></TT
10132 >".  Then, in the file 
10133                 specified by <TT
10134 CLASS="REPLACEABLE"
10135 ><I
10136 >filename</I
10137 ></TT
10138 >, map the 
10139                 name of the NT driver name to the OS/2 driver name as 
10140                 follows:</P
10141 ><P
10142 >&#60;nt driver name&#62; = &#60;os2 driver 
10143                 name&#62;.&#60;device name&#62;, e.g.:
10144                 HP LaserJet 5L = LASERJET.HP LaserJet 5L</P
10145 ><P
10146 >You can have multiple drivers mapped in this file.</P
10147 ><P
10148 >If you only specify the OS/2 driver name, and not the 
10149                 device name, the first attempt to download the driver will 
10150                 actually download the files, but the OS/2 client will tell 
10151                 you the driver is not available.  On the second attempt, it 
10152                 will work.  This is fixed simply by adding the device name
10153                  to the mapping, after which it will work on the first attempt.
10154                 </P
10155 ></DIV
10156 ></DIV
10157 ></DIV
10158 ><DIV
10159 CLASS="CHAPTER"
10160 ><HR><H1
10161 ><A
10162 NAME="CVS-ACCESS"
10163 >Chapter 12. HOWTO Access Samba source code via CVS</A
10164 ></H1
10165 ><DIV
10166 CLASS="SECT1"
10167 ><H1
10168 CLASS="SECT1"
10169 ><A
10170 NAME="AEN2167"
10171 >12.1. Introduction</A
10172 ></H1
10173 ><P
10174 >Samba is developed in an open environment.  Developers use CVS
10175 (Concurrent Versioning System) to "checkin" (also known as 
10176 "commit") new source code.  Samba's various CVS branches can
10177 be accessed via anonymous CVS using the instructions
10178 detailed in this chapter.</P
10179 ><P
10180 >This document is a modified version of the instructions found at
10181 <A
10182 HREF="http://samba.org/samba/cvs.html"
10183 TARGET="_top"
10184 >http://samba.org/samba/cvs.html</A
10185 ></P
10186 ></DIV
10187 ><DIV
10188 CLASS="SECT1"
10189 ><HR><H1
10190 CLASS="SECT1"
10191 ><A
10192 NAME="AEN2172"
10193 >12.2. CVS Access to samba.org</A
10194 ></H1
10195 ><P
10196 >The machine samba.org runs a publicly accessible CVS 
10197 repository for access to the source code of several packages, 
10198 including samba, rsync and jitterbug. There are two main ways of 
10199 accessing the CVS server on this host.</P
10200 ><DIV
10201 CLASS="SECT2"
10202 ><HR><H2
10203 CLASS="SECT2"
10204 ><A
10205 NAME="AEN2175"
10206 >12.2.1. Access via CVSweb</A
10207 ></H2
10208 ><P
10209 >You can access the source code via your 
10210 favourite WWW browser. This allows you to access the contents of 
10211 individual files in the repository and also to look at the revision 
10212 history and commit logs of individual files. You can also ask for a diff 
10213 listing between any two versions on the repository.</P
10214 ><P
10215 >Use the URL : <A
10216 HREF="http://samba.org/cgi-bin/cvsweb"
10217 TARGET="_top"
10218 >http://samba.org/cgi-bin/cvsweb</A
10219 ></P
10220 ></DIV
10221 ><DIV
10222 CLASS="SECT2"
10223 ><HR><H2
10224 CLASS="SECT2"
10225 ><A
10226 NAME="AEN2180"
10227 >12.2.2. Access via cvs</A
10228 ></H2
10229 ><P
10230 >You can also access the source code via a 
10231 normal cvs client.  This gives you much more control over you can 
10232 do with the repository and allows you to checkout whole source trees 
10233 and keep them up to date via normal cvs commands. This is the 
10234 preferred method of access if you are a developer and not
10235 just a casual browser.</P
10236 ><P
10237 >To download the latest cvs source code, point your
10238 browser at the URL : <A
10239 HREF="http://www.cyclic.com/"
10240 TARGET="_top"
10241 >http://www.cyclic.com/</A
10242 >.
10243 and click on the 'How to get cvs' link. CVS is free software under 
10244 the GNU GPL (as is Samba).  Note that there are several graphical CVS clients
10245 which provide a graphical interface to the sometimes mundane CVS commands.
10246 Links to theses clients are also available from http://www.cyclic.com.</P
10247 ><P
10248 >To gain access via anonymous cvs use the following steps. 
10249 For this example it is assumed that you want a copy of the 
10250 samba source code. For the other source code repositories 
10251 on this system just substitute the correct package name</P
10252 ><P
10253 ></P
10254 ><OL
10255 TYPE="1"
10256 ><LI
10257 ><P
10258 >       Install a recent copy of cvs. All you really need is a 
10259         copy of the cvs client binary. 
10260         </P
10261 ></LI
10262 ><LI
10263 ><P
10264 >       Run the command 
10265         </P
10266 ><P
10267 >       <B
10268 CLASS="COMMAND"
10269 >cvs -d :pserver:cvs@samba.org:/cvsroot login</B
10270 >
10271         </P
10272 ><P
10273 >       When it asks you for a password type <TT
10274 CLASS="USERINPUT"
10275 ><B
10276 >cvs</B
10277 ></TT
10278 >.
10279         </P
10280 ></LI
10281 ><LI
10282 ><P
10283 >       Run the command 
10284         </P
10285 ><P
10286 >       <B
10287 CLASS="COMMAND"
10288 >cvs -d :pserver:cvs@samba.org:/cvsroot co samba</B
10289 >
10290         </P
10291 ><P
10292 >       This will create a directory called samba containing the 
10293         latest samba source code (i.e. the HEAD tagged cvs branch). This 
10294         currently corresponds to the 3.0 development tree. 
10295         </P
10296 ><P
10297 >       CVS branches other HEAD can be obtained by using the <TT
10298 CLASS="PARAMETER"
10299 ><I
10300 >-r</I
10301 ></TT
10302 >
10303         and defining a tag name.  A list of branch tag names can be found on the
10304         "Development" page of the samba web site.  A common request is to obtain the
10305         latest 2.2 release code.  This could be done by using the following command.
10306         </P
10307 ><P
10308 >       <B
10309 CLASS="COMMAND"
10310 >cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_2_2 samba</B
10311 >
10312         </P
10313 ></LI
10314 ><LI
10315 ><P
10316 >       Whenever you want to merge in the latest code changes use 
10317         the following command from within the samba directory: 
10318         </P
10319 ><P
10320 >       <B
10321 CLASS="COMMAND"
10322 >cvs update -d -P</B
10323 >
10324         </P
10325 ></LI
10326 ></OL
10327 ></DIV
10328 ></DIV
10329 ></DIV
10330 ><HR><H1
10331 ><A
10332 NAME="AEN2208"
10333 >Index</A
10334 ></H1
10335 ><DL
10336 ><DT
10337 >Primary Domain Controller,
10338     <A
10339 HREF="x1098.htm"
10340 >Background</A
10341 >
10342   </DT
10343 ></DL
10344 ></DIV
10345 ></BODY
10346 ></HTML
10347 >