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