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