few updates. Nothing major.....
[Samba.git] / docs / htmldocs / Samba-HOWTO-Collection.html
blob5de09ca5e5a0afc86619b989c0160fe1d36f211e
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="#AEN497"
340 >Distributed Authentication</A
341 ></DT
342 ><DT
343 >3.3. <A
344 HREF="#AEN504"
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="#AEN524"
359 >Instructions</A
360 ></DT
361 ><DD
362 ><DL
363 ><DT
364 >4.1.1. <A
365 HREF="#AEN559"
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="#AEN579"
382 >Viewing and changing UNIX permissions using the NT
383 security dialogs</A
384 ></DT
385 ><DT
386 >5.2. <A
387 HREF="#AEN588"
388 >How to view file security on a Samba share</A
389 ></DT
390 ><DT
391 >5.3. <A
392 HREF="#AEN599"
393 >Viewing file ownership</A
394 ></DT
395 ><DT
396 >5.4. <A
397 HREF="#AEN619"
398 >Viewing file or directory permissions</A
399 ></DT
400 ><DD
401 ><DL
402 ><DT
403 >5.4.1. <A
404 HREF="#AEN634"
405 >File Permissions</A
406 ></DT
407 ><DT
408 >5.4.2. <A
409 HREF="#AEN648"
410 >Directory Permissions</A
411 ></DT
412 ></DL
413 ></DD
414 ><DT
415 >5.5. <A
416 HREF="#AEN655"
417 >Modifying file or directory permissions</A
418 ></DT
419 ><DT
420 >5.6. <A
421 HREF="#AEN677"
422 >Interaction with the standard Samba create mask
423 parameters</A
424 ></DT
425 ><DT
426 >5.7. <A
427 HREF="#AEN741"
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="#AEN762"
443 >Introduction</A
444 ></DT
445 ><DT
446 >6.2. <A
447 HREF="#AEN784"
448 >Configuration</A
449 ></DT
450 ><DD
451 ><DL
452 ><DT
453 >6.2.1. <A
454 HREF="#AEN795"
455 >Creating [print$]</A
456 ></DT
457 ><DT
458 >6.2.2. <A
459 HREF="#AEN830"
460 >Setting Drivers for Existing Printers</A
461 ></DT
462 ><DT
463 >6.2.3. <A
464 HREF="#AEN847"
465 >Support a large number of printers</A
466 ></DT
467 ><DT
468 >6.2.4. <A
469 HREF="#AEN858"
470 >Adding New Printers via the Windows NT APW</A
471 ></DT
472 ><DT
473 >6.2.5. <A
474 HREF="#AEN883"
475 >Samba and Printer Ports</A
476 ></DT
477 ></DL
478 ></DD
479 ><DT
480 >6.3. <A
481 HREF="#AEN891"
482 >The Imprints Toolset</A
483 ></DT
484 ><DD
485 ><DL
486 ><DT
487 >6.3.1. <A
488 HREF="#AEN895"
489 >What is Imprints?</A
490 ></DT
491 ><DT
492 >6.3.2. <A
493 HREF="#AEN905"
494 >Creating Printer Driver Packages</A
495 ></DT
496 ><DT
497 >6.3.3. <A
498 HREF="#AEN908"
499 >The Imprints server</A
500 ></DT
501 ><DT
502 >6.3.4. <A
503 HREF="#AEN912"
504 >The Installation Client</A
505 ></DT
506 ></DL
507 ></DD
508 ><DT
509 >6.4. <A
510 HREF="#AEN934"
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="#AEN996"
528 >Joining an NT Domain with Samba 2.2</A
529 ></DT
530 ><DT
531 >7.2. <A
532 HREF="#AEN1060"
533 >Samba and Windows 2000 Domains</A
534 ></DT
535 ><DT
536 >7.3. <A
537 HREF="#AEN1065"
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="#AEN1098"
552 >Prerequisite Reading</A
553 ></DT
554 ><DT
555 >8.2. <A
556 HREF="#AEN1104"
557 >Background</A
558 ></DT
559 ><DT
560 >8.3. <A
561 HREF="#AEN1146"
562 >Configuring the Samba Domain Controller</A
563 ></DT
564 ><DT
565 >8.4. <A
566 HREF="#AEN1189"
567 >Creating Machine Trust Accounts and Joining Clients
568 to the Domain</A
569 ></DT
570 ><DD
571 ><DL
572 ><DT
573 >8.4.1. <A
574 HREF="#AEN1203"
575 >Manually creating machine trust accounts</A
576 ></DT
577 ><DT
578 >8.4.2. <A
579 HREF="#AEN1231"
580 >Creating machine trust accounts "on the fly"</A
581 ></DT
582 ></DL
583 ></DD
584 ><DT
585 >8.5. <A
586 HREF="#AEN1242"
587 >Common Problems and Errors</A
588 ></DT
589 ><DT
590 >8.6. <A
591 HREF="#AEN1290"
592 >System Policies and Profiles</A
593 ></DT
594 ><DT
595 >8.7. <A
596 HREF="#AEN1334"
597 >What other help can I get ?</A
598 ></DT
599 ><DT
600 >8.8. <A
601 HREF="#AEN1448"
602 >Domain Control for Windows 9x/ME</A
603 ></DT
604 ><DD
605 ><DL
606 ><DT
607 >8.8.1. <A
608 HREF="#AEN1478"
609 >Configuration Instructions: Network Logons</A
610 ></DT
611 ><DT
612 >8.8.2. <A
613 HREF="#AEN1512"
614 >Configuration Instructions: Setting up Roaming User Profiles</A
615 ></DT
616 ><DD
617 ><DL
618 ><DT
619 >8.8.2.1. <A
620 HREF="#AEN1520"
621 >Windows NT Configuration</A
622 ></DT
623 ><DT
624 >8.8.2.2. <A
625 HREF="#AEN1528"
626 >Windows 9X Configuration</A
627 ></DT
628 ><DT
629 >8.8.2.3. <A
630 HREF="#AEN1536"
631 >Win9X and WinNT Configuration</A
632 ></DT
633 ><DT
634 >8.8.2.4. <A
635 HREF="#AEN1543"
636 >Windows 9X Profile Setup</A
637 ></DT
638 ><DT
639 >8.8.2.5. <A
640 HREF="#AEN1579"
641 >Windows NT Workstation 4.0</A
642 ></DT
643 ><DT
644 >8.8.2.6. <A
645 HREF="#AEN1592"
646 >Windows NT Server</A
647 ></DT
648 ><DT
649 >8.8.2.7. <A
650 HREF="#AEN1595"
651 >Sharing Profiles between W95 and NT Workstation 4.0</A
652 ></DT
653 ></DL
654 ></DD
655 ></DL
656 ></DD
657 ><DT
658 >8.9. <A
659 HREF="#AEN1605"
660 >DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
661 ></DT
662 ></DL
663 ></DD
664 ><DT
665 >9. <A
666 HREF="#WINBIND"
667 >Unified Logons between Windows NT and UNIX using Winbind</A
668 ></DT
669 ><DD
670 ><DL
671 ><DT
672 >9.1. <A
673 HREF="#AEN1648"
674 >Abstract</A
675 ></DT
676 ><DT
677 >9.2. <A
678 HREF="#AEN1652"
679 >Introduction</A
680 ></DT
681 ><DT
682 >9.3. <A
683 HREF="#AEN1665"
684 >What Winbind Provides</A
685 ></DT
686 ><DD
687 ><DL
688 ><DT
689 >9.3.1. <A
690 HREF="#AEN1672"
691 >Target Uses</A
692 ></DT
693 ></DL
694 ></DD
695 ><DT
696 >9.4. <A
697 HREF="#AEN1676"
698 >How Winbind Works</A
699 ></DT
700 ><DD
701 ><DL
702 ><DT
703 >9.4.1. <A
704 HREF="#AEN1681"
705 >Microsoft Remote Procedure Calls</A
706 ></DT
707 ><DT
708 >9.4.2. <A
709 HREF="#AEN1685"
710 >Name Service Switch</A
711 ></DT
712 ><DT
713 >9.4.3. <A
714 HREF="#AEN1701"
715 >Pluggable Authentication Modules</A
716 ></DT
717 ><DT
718 >9.4.4. <A
719 HREF="#AEN1709"
720 >User and Group ID Allocation</A
721 ></DT
722 ><DT
723 >9.4.5. <A
724 HREF="#AEN1713"
725 >Result Caching</A
726 ></DT
727 ></DL
728 ></DD
729 ><DT
730 >9.5. <A
731 HREF="#AEN1716"
732 >Installation and Configuration</A
733 ></DT
734 ><DT
735 >9.6. <A
736 HREF="#AEN1722"
737 >Limitations</A
738 ></DT
739 ><DT
740 >9.7. <A
741 HREF="#AEN1734"
742 >Conclusion</A
743 ></DT
744 ></DL
745 ></DD
746 ><DT
747 >10. <A
748 HREF="#OS2"
749 >OS2 Client HOWTO</A
750 ></DT
751 ><DD
752 ><DL
753 ><DT
754 >10.1. <A
755 HREF="#AEN1748"
756 >FAQs</A
757 ></DT
758 ><DD
759 ><DL
760 ><DT
761 >10.1.1. <A
762 HREF="#AEN1750"
763 >How can I configure OS/2 Warp Connect or
764 OS/2 Warp 4 as a client for Samba?</A
765 ></DT
766 ><DT
767 >10.1.2. <A
768 HREF="#AEN1765"
769 >How can I configure OS/2 Warp 3 (not Connect),
770 OS/2 1.2, 1.3 or 2.x for Samba?</A
771 ></DT
772 ><DT
773 >10.1.3. <A
774 HREF="#AEN1774"
775 >Are there any other issues when OS/2 (any version)
776 is used as a client?</A
777 ></DT
778 ><DT
779 >10.1.4. <A
780 HREF="#AEN1778"
781 >How do I get printer driver download working
782 for OS/2 clients?</A
783 ></DT
784 ></DL
785 ></DD
786 ></DL
787 ></DD
788 ><DT
789 >11. <A
790 HREF="#CVS-ACCESS"
791 >HOWTO Access Samba source code via CVS</A
792 ></DT
793 ><DD
794 ><DL
795 ><DT
796 >11.1. <A
797 HREF="#AEN1794"
798 >Introduction</A
799 ></DT
800 ><DT
801 >11.2. <A
802 HREF="#AEN1799"
803 >CVS Access to samba.org</A
804 ></DT
805 ><DD
806 ><DL
807 ><DT
808 >11.2.1. <A
809 HREF="#AEN1802"
810 >Access via CVSweb</A
811 ></DT
812 ><DT
813 >11.2.2. <A
814 HREF="#AEN1807"
815 >Access via cvs</A
816 ></DT
817 ></DL
818 ></DD
819 ></DL
820 ></DD
821 ><DT
823 HREF="#AEN1835"
824 >Index</A
825 ></DT
826 ></DL
827 ></DIV
828 ><DIV
829 CLASS="CHAPTER"
830 ><HR><H1
832 NAME="INSTALL"
833 >Chapter 1. How to Install and Test SAMBA</A
834 ></H1
835 ><DIV
836 CLASS="SECT1"
837 ><H1
838 CLASS="SECT1"
840 NAME="AEN18"
841 >1.1. Step 0: Read the man pages</A
842 ></H1
844 >The man pages distributed with SAMBA contain
845 lots of useful info that will help to get you started.
846 If you don't know how to read man pages then try
847 something like:</P
849 ><TT
850 CLASS="PROMPT"
851 >$ </TT
852 ><TT
853 CLASS="USERINPUT"
855 >nroff -man smbd.8 | more
857 ></TT
858 ></P
860 >Other sources of information are pointed to
861 by the Samba web site,<A
862 HREF="http://www.samba.org/"
863 TARGET="_top"
864 > http://www.samba.org</A
865 ></P
866 ></DIV
867 ><DIV
868 CLASS="SECT1"
869 ><HR><H1
870 CLASS="SECT1"
872 NAME="AEN26"
873 >1.2. Step 1: Building the Binaries</A
874 ></H1
876 >To do this, first run the program <B
877 CLASS="COMMAND"
878 >./configure
880 > in the source directory. This should automatically
881 configure Samba for your operating system. If you have unusual
882 needs then you may wish to run</P
884 ><TT
885 CLASS="PROMPT"
886 >root# </TT
887 ><TT
888 CLASS="USERINPUT"
890 >./configure --help
892 ></TT
893 ></P
895 >first to see what special options you can enable.
896 Then executing</P
898 ><TT
899 CLASS="PROMPT"
900 >root# </TT
901 ><TT
902 CLASS="USERINPUT"
904 >make</B
905 ></TT
906 ></P
908 >will create the binaries. Once it's successfully
909 compiled you can use </P
911 ><TT
912 CLASS="PROMPT"
913 >root# </TT
914 ><TT
915 CLASS="USERINPUT"
917 >make install</B
918 ></TT
919 ></P
921 >to install the binaries and manual pages. You can
922 separately install the binaries and/or man pages using</P
924 ><TT
925 CLASS="PROMPT"
926 >root# </TT
927 ><TT
928 CLASS="USERINPUT"
930 >make installbin
932 ></TT
933 ></P
935 >and</P
937 ><TT
938 CLASS="PROMPT"
939 >root# </TT
940 ><TT
941 CLASS="USERINPUT"
943 >make installman
945 ></TT
946 ></P
948 >Note that if you are upgrading for a previous version
949 of Samba you might like to know that the old versions of
950 the binaries will be renamed with a ".old" extension. You
951 can go back to the previous version with</P
953 ><TT
954 CLASS="PROMPT"
955 >root# </TT
956 ><TT
957 CLASS="USERINPUT"
959 >make revert
961 ></TT
962 ></P
964 >if you find this version a disaster!</P
965 ></DIV
966 ><DIV
967 CLASS="SECT1"
968 ><HR><H1
969 CLASS="SECT1"
971 NAME="AEN54"
972 >1.3. Step 2: The all important step</A
973 ></H1
975 >At this stage you must fetch yourself a
976 coffee or other drink you find stimulating. Getting the rest
977 of the install right can sometimes be tricky, so you will
978 probably need it.</P
980 >If you have installed samba before then you can skip
981 this step.</P
982 ></DIV
983 ><DIV
984 CLASS="SECT1"
985 ><HR><H1
986 CLASS="SECT1"
988 NAME="AEN58"
989 >1.4. Step 3: Create the smb configuration file.</A
990 ></H1
992 >There are sample configuration files in the examples
993 subdirectory in the distribution. I suggest you read them
994 carefully so you can see how the options go together in
995 practice. See the man page for all the options.</P
997 >The simplest useful configuration file would be
998 something like this:</P
1000 ><TABLE
1001 BORDER="0"
1002 BGCOLOR="#E0E0E0"
1003 WIDTH="100%"
1004 ><TR
1005 ><TD
1006 ><PRE
1007 CLASS="PROGRAMLISTING"
1008 > [global]
1009 workgroup = MYGROUP
1011 [homes]
1012 guest ok = no
1013 read only = no
1014 </PRE
1015 ></TD
1016 ></TR
1017 ></TABLE
1018 ></P
1020 >which would allow connections by anyone with an
1021 account on the server, using either their login name or
1022 "homes" as the service name. (Note that I also set the
1023 workgroup that Samba is part of. See BROWSING.txt for details)</P
1025 >Note that <B
1026 CLASS="COMMAND"
1027 >make install</B
1028 > will not install
1029 a <TT
1030 CLASS="FILENAME"
1031 >smb.conf</TT
1032 > file. You need to create it
1033 yourself. </P
1035 >Make sure you put the smb.conf file in the same place
1036 you specified in the<TT
1037 CLASS="FILENAME"
1038 >Makefile</TT
1039 > (the default is to
1040 look for it in <TT
1041 CLASS="FILENAME"
1042 >/usr/local/samba/lib/</TT
1043 >).</P
1045 >For more information about security settings for the
1046 [homes] share please refer to the document UNIX_SECURITY.txt.</P
1047 ></DIV
1048 ><DIV
1049 CLASS="SECT1"
1050 ><HR><H1
1051 CLASS="SECT1"
1053 NAME="AEN72"
1054 >1.5. Step 4: Test your config file with
1056 CLASS="COMMAND"
1057 >testparm</B
1058 ></A
1059 ></H1
1061 >It's important that you test the validity of your
1063 CLASS="FILENAME"
1064 >smb.conf</TT
1065 > file using the testparm program.
1066 If testparm runs OK then it will list the loaded services. If
1067 not it will give an error message.</P
1069 >Make sure it runs OK and that the services look
1070 reasonable before proceeding. </P
1071 ></DIV
1072 ><DIV
1073 CLASS="SECT1"
1074 ><HR><H1
1075 CLASS="SECT1"
1077 NAME="AEN78"
1078 >1.6. Step 5: Starting the smbd and nmbd</A
1079 ></H1
1081 >You must choose to start smbd and nmbd either
1082 as daemons or from <B
1083 CLASS="COMMAND"
1084 >inetd</B
1085 >. Don't try
1086 to do both! Either you can put them in <TT
1087 CLASS="FILENAME"
1088 > inetd.conf</TT
1089 > and have them started on demand
1090 by <B
1091 CLASS="COMMAND"
1092 >inetd</B
1093 >, or you can start them as
1094 daemons either from the command line or in <TT
1095 CLASS="FILENAME"
1096 > /etc/rc.local</TT
1097 >. See the man pages for details
1098 on the command line options. Take particular care to read
1099 the bit about what user you need to be in order to start
1100 Samba. In many cases you must be root.</P
1102 >The main advantage of starting <B
1103 CLASS="COMMAND"
1104 >smbd</B
1106 and <B
1107 CLASS="COMMAND"
1108 >nmbd</B
1109 > as a daemon is that they will
1110 respond slightly more quickly to an initial connection
1111 request. This is, however, unlikely to be a problem.</P
1112 ><DIV
1113 CLASS="SECT2"
1114 ><HR><H2
1115 CLASS="SECT2"
1117 NAME="AEN88"
1118 >1.6.1. Step 5a: Starting from inetd.conf</A
1119 ></H2
1121 >NOTE; The following will be different if
1122 you use NIS or NIS+ to distributed services maps.</P
1124 >Look at your <TT
1125 CLASS="FILENAME"
1126 >/etc/services</TT
1128 What is defined at port 139/tcp. If nothing is defined
1129 then add a line like this:</P
1131 ><TT
1132 CLASS="USERINPUT"
1134 >netbios-ssn 139/tcp</B
1135 ></TT
1136 ></P
1138 >similarly for 137/udp you should have an entry like:</P
1140 ><TT
1141 CLASS="USERINPUT"
1143 >netbios-ns 137/udp</B
1144 ></TT
1145 ></P
1147 >Next edit your <TT
1148 CLASS="FILENAME"
1149 >/etc/inetd.conf</TT
1151 and add two lines something like this:</P
1153 ><TABLE
1154 BORDER="0"
1155 BGCOLOR="#E0E0E0"
1156 WIDTH="100%"
1157 ><TR
1158 ><TD
1159 ><PRE
1160 CLASS="PROGRAMLISTING"
1161 > netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
1162 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
1163 </PRE
1164 ></TD
1165 ></TR
1166 ></TABLE
1167 ></P
1169 >The exact syntax of <TT
1170 CLASS="FILENAME"
1171 >/etc/inetd.conf</TT
1173 varies between unixes. Look at the other entries in inetd.conf
1174 for a guide.</P
1176 >NOTE: Some unixes already have entries like netbios_ns
1177 (note the underscore) in <TT
1178 CLASS="FILENAME"
1179 >/etc/services</TT
1181 You must either edit <TT
1182 CLASS="FILENAME"
1183 >/etc/services</TT
1184 > or
1186 CLASS="FILENAME"
1187 >/etc/inetd.conf</TT
1188 > to make them consistent.</P
1190 >NOTE: On many systems you may need to use the
1191 "interfaces" option in smb.conf to specify the IP address
1192 and netmask of your interfaces. Run <B
1193 CLASS="COMMAND"
1194 >ifconfig</B
1196 as root if you don't know what the broadcast is for your
1197 net. <B
1198 CLASS="COMMAND"
1199 >nmbd</B
1200 > tries to determine it at run
1201 time, but fails on some unixes. See the section on "testing nmbd"
1202 for a method of finding if you need to do this.</P
1204 >!!!WARNING!!! Many unixes only accept around 5
1205 parameters on the command line in <TT
1206 CLASS="FILENAME"
1207 >inetd.conf</TT
1209 This means you shouldn't use spaces between the options and
1210 arguments, or you should use a script, and start the script
1211 from <B
1212 CLASS="COMMAND"
1213 >inetd</B
1214 >.</P
1216 >Restart <B
1217 CLASS="COMMAND"
1218 >inetd</B
1219 >, perhaps just send
1220 it a HUP. If you have installed an earlier version of <B
1221 CLASS="COMMAND"
1222 > nmbd</B
1223 > then you may need to kill nmbd as well.</P
1224 ></DIV
1225 ><DIV
1226 CLASS="SECT2"
1227 ><HR><H2
1228 CLASS="SECT2"
1230 NAME="AEN117"
1231 >1.6.2. Step 5b. Alternative: starting it as a daemon</A
1232 ></H2
1234 >To start the server as a daemon you should create
1235 a script something like this one, perhaps calling
1236 it <TT
1237 CLASS="FILENAME"
1238 >startsmb</TT
1239 >.</P
1241 ><TABLE
1242 BORDER="0"
1243 BGCOLOR="#E0E0E0"
1244 WIDTH="100%"
1245 ><TR
1246 ><TD
1247 ><PRE
1248 CLASS="PROGRAMLISTING"
1249 > #!/bin/sh
1250 /usr/local/samba/bin/smbd -D
1251 /usr/local/samba/bin/nmbd -D
1252 </PRE
1253 ></TD
1254 ></TR
1255 ></TABLE
1256 ></P
1258 >then make it executable with <B
1259 CLASS="COMMAND"
1260 >chmod
1261 +x startsmb</B
1262 ></P
1264 >You can then run <B
1265 CLASS="COMMAND"
1266 >startsmb</B
1267 > by
1268 hand or execute it from <TT
1269 CLASS="FILENAME"
1270 >/etc/rc.local</TT
1274 >To kill it send a kill signal to the processes
1276 CLASS="COMMAND"
1277 >nmbd</B
1278 > and <B
1279 CLASS="COMMAND"
1280 >smbd</B
1281 >.</P
1283 >NOTE: If you use the SVR4 style init system then
1284 you may like to look at the <TT
1285 CLASS="FILENAME"
1286 >examples/svr4-startup</TT
1288 script to make Samba fit into that system.</P
1289 ></DIV
1290 ></DIV
1291 ><DIV
1292 CLASS="SECT1"
1293 ><HR><H1
1294 CLASS="SECT1"
1296 NAME="AEN133"
1297 >1.7. Step 6: Try listing the shares available on your
1298 server</A
1299 ></H1
1301 ><TT
1302 CLASS="PROMPT"
1303 >$ </TT
1304 ><TT
1305 CLASS="USERINPUT"
1307 >smbclient -L
1309 CLASS="REPLACEABLE"
1311 >yourhostname</I
1312 ></TT
1313 ></B
1314 ></TT
1315 ></P
1317 >Your should get back a list of shares available on
1318 your server. If you don't then something is incorrectly setup.
1319 Note that this method can also be used to see what shares
1320 are available on other LanManager clients (such as WfWg).</P
1322 >If you choose user level security then you may find
1323 that Samba requests a password before it will list the shares.
1324 See the <B
1325 CLASS="COMMAND"
1326 >smbclient</B
1327 > man page for details. (you
1328 can force it to list the shares without a password by
1329 adding the option -U% to the command line. This will not work
1330 with non-Samba servers)</P
1331 ></DIV
1332 ><DIV
1333 CLASS="SECT1"
1334 ><HR><H1
1335 CLASS="SECT1"
1337 NAME="AEN142"
1338 >1.8. Step 7: Try connecting with the unix client</A
1339 ></H1
1341 ><TT
1342 CLASS="PROMPT"
1343 >$ </TT
1344 ><TT
1345 CLASS="USERINPUT"
1347 >smbclient <TT
1348 CLASS="REPLACEABLE"
1350 > //yourhostname/aservice</I
1351 ></TT
1352 ></B
1353 ></TT
1354 ></P
1356 >Typically the <TT
1357 CLASS="REPLACEABLE"
1359 >yourhostname</I
1360 ></TT
1362 would be the name of the host where you installed <B
1363 CLASS="COMMAND"
1364 > smbd</B
1365 >. The <TT
1366 CLASS="REPLACEABLE"
1368 >aservice</I
1369 ></TT
1370 > is
1371 any service you have defined in the <TT
1372 CLASS="FILENAME"
1373 >smb.conf</TT
1375 file. Try your user name if you just have a [homes] section
1376 in <TT
1377 CLASS="FILENAME"
1378 >smb.conf</TT
1379 >.</P
1381 >For example if your unix host is bambi and your login
1382 name is fred you would type:</P
1384 ><TT
1385 CLASS="PROMPT"
1386 >$ </TT
1387 ><TT
1388 CLASS="USERINPUT"
1390 >smbclient //bambi/fred
1392 ></TT
1393 ></P
1394 ></DIV
1395 ><DIV
1396 CLASS="SECT1"
1397 ><HR><H1
1398 CLASS="SECT1"
1400 NAME="AEN158"
1401 >1.9. Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT,
1402 Win2k, OS/2, etc... client</A
1403 ></H1
1405 >Try mounting disks. eg:</P
1407 ><TT
1408 CLASS="PROMPT"
1409 >C:\WINDOWS\&#62; </TT
1410 ><TT
1411 CLASS="USERINPUT"
1413 >net use d: \\servername\service
1415 ></TT
1416 ></P
1418 >Try printing. eg:</P
1420 ><TT
1421 CLASS="PROMPT"
1422 >C:\WINDOWS\&#62; </TT
1423 ><TT
1424 CLASS="USERINPUT"
1426 >net use lpt1:
1427 \\servername\spoolservice</B
1428 ></TT
1429 ></P
1431 ><TT
1432 CLASS="PROMPT"
1433 >C:\WINDOWS\&#62; </TT
1434 ><TT
1435 CLASS="USERINPUT"
1437 >print filename
1439 ></TT
1440 ></P
1442 >Celebrate, or send me a bug report!</P
1443 ></DIV
1444 ><DIV
1445 CLASS="SECT1"
1446 ><HR><H1
1447 CLASS="SECT1"
1449 NAME="AEN172"
1450 >1.10. What If Things Don't Work?</A
1451 ></H1
1453 >If nothing works and you start to think "who wrote
1454 this pile of trash" then I suggest you do step 2 again (and
1455 again) till you calm down.</P
1457 >Then you might read the file DIAGNOSIS.txt and the
1458 FAQ. If you are still stuck then try the mailing list or
1459 newsgroup (look in the README for details). Samba has been
1460 successfully installed at thousands of sites worldwide, so maybe
1461 someone else has hit your problem and has overcome it. You could
1462 also use the WWW site to scan back issues of the samba-digest.</P
1464 >When you fix the problem PLEASE send me some updates to the
1465 documentation (or source code) so that the next person will find it
1466 easier. </P
1467 ><DIV
1468 CLASS="SECT2"
1469 ><HR><H2
1470 CLASS="SECT2"
1472 NAME="AEN177"
1473 >1.10.1. Diagnosing Problems</A
1474 ></H2
1476 >If you have installation problems then go to
1478 CLASS="FILENAME"
1479 >DIAGNOSIS.txt</TT
1480 > to try to find the
1481 problem.</P
1482 ></DIV
1483 ><DIV
1484 CLASS="SECT2"
1485 ><HR><H2
1486 CLASS="SECT2"
1488 NAME="AEN181"
1489 >1.10.2. Scope IDs</A
1490 ></H2
1492 >By default Samba uses a blank scope ID. This means
1493 all your windows boxes must also have a blank scope ID.
1494 If you really want to use a non-blank scope ID then you will
1495 need to use the -i &#60;scope&#62; option to nmbd, smbd, and
1496 smbclient. All your PCs will need to have the same setting for
1497 this to work. I do not recommend scope IDs.</P
1498 ></DIV
1499 ><DIV
1500 CLASS="SECT2"
1501 ><HR><H2
1502 CLASS="SECT2"
1504 NAME="AEN184"
1505 >1.10.3. Choosing the Protocol Level</A
1506 ></H2
1508 >The SMB protocol has many dialects. Currently
1509 Samba supports 5, called CORE, COREPLUS, LANMAN1,
1510 LANMAN2 and NT1.</P
1512 >You can choose what maximum protocol to support
1513 in the <TT
1514 CLASS="FILENAME"
1515 >smb.conf</TT
1516 > file. The default is
1517 NT1 and that is the best for the vast majority of sites.</P
1519 >In older versions of Samba you may have found it
1520 necessary to use COREPLUS. The limitations that led to
1521 this have mostly been fixed. It is now less likely that you
1522 will want to use less than LANMAN1. The only remaining advantage
1523 of COREPLUS is that for some obscure reason WfWg preserves
1524 the case of passwords in this protocol, whereas under LANMAN1,
1525 LANMAN2 or NT1 it uppercases all passwords before sending them,
1526 forcing you to use the "password level=" option in some cases.</P
1528 >The main advantage of LANMAN2 and NT1 is support for
1529 long filenames with some clients (eg: smbclient, Windows NT
1530 or Win95). </P
1532 >See the smb.conf(5) manual page for more details.</P
1534 >Note: To support print queue reporting you may find
1535 that you have to use TCP/IP as the default protocol under
1536 WfWg. For some reason if you leave Netbeui as the default
1537 it may break the print queue reporting on some systems.
1538 It is presumably a WfWg bug.</P
1539 ></DIV
1540 ><DIV
1541 CLASS="SECT2"
1542 ><HR><H2
1543 CLASS="SECT2"
1545 NAME="AEN193"
1546 >1.10.4. Printing from UNIX to a Client PC</A
1547 ></H2
1549 >To use a printer that is available via a smb-based
1550 server from a unix host you will need to compile the
1551 smbclient program. You then need to install the script
1552 "smbprint". Read the instruction in smbprint for more details.
1555 >There is also a SYSV style script that does much
1556 the same thing called smbprint.sysv. It contains instructions.</P
1557 ></DIV
1558 ><DIV
1559 CLASS="SECT2"
1560 ><HR><H2
1561 CLASS="SECT2"
1563 NAME="AEN197"
1564 >1.10.5. Locking</A
1565 ></H2
1567 >One area which sometimes causes trouble is locking.</P
1569 >There are two types of locking which need to be
1570 performed by a SMB server. The first is "record locking"
1571 which allows a client to lock a range of bytes in a open file.
1572 The second is the "deny modes" that are specified when a file
1573 is open.</P
1575 >Samba supports "record locking" using the fcntl() unix system
1576 call. This is often implemented using rpc calls to a rpc.lockd process
1577 running on the system that owns the filesystem. Unfortunately many
1578 rpc.lockd implementations are very buggy, particularly when made to
1579 talk to versions from other vendors. It is not uncommon for the
1580 rpc.lockd to crash.</P
1582 >There is also a problem translating the 32 bit lock
1583 requests generated by PC clients to 31 bit requests supported
1584 by most unixes. Unfortunately many PC applications (typically
1585 OLE2 applications) use byte ranges with the top bit set
1586 as semaphore sets. Samba attempts translation to support
1587 these types of applications, and the translation has proved
1588 to be quite successful.</P
1590 >Strictly a SMB server should check for locks before
1591 every read and write call on a file. Unfortunately with the
1592 way fcntl() works this can be slow and may overstress the
1593 rpc.lockd. It is also almost always unnecessary as clients
1594 are supposed to independently make locking calls before reads
1595 and writes anyway if locking is important to them. By default
1596 Samba only makes locking calls when explicitly asked
1597 to by a client, but if you set "strict locking = yes" then it will
1598 make lock checking calls on every read and write. </P
1600 >You can also disable by range locking completely
1601 using "locking = no". This is useful for those shares that
1602 don't support locking or don't need it (such as cdroms). In
1603 this case Samba fakes the return codes of locking calls to
1604 tell clients that everything is OK.</P
1606 >The second class of locking is the "deny modes". These
1607 are set by an application when it opens a file to determine
1608 what types of access should be allowed simultaneously with
1609 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE
1610 or DENY_ALL. There are also special compatibility modes called
1611 DENY_FCB and DENY_DOS.</P
1613 >You can disable share modes using "share modes = no".
1614 This may be useful on a heavily loaded server as the share
1615 modes code is very slow. See also the FAST_SHARE_MODES
1616 option in the Makefile for a way to do full share modes
1617 very fast using shared memory (if your OS supports it).</P
1618 ></DIV
1619 ><DIV
1620 CLASS="SECT2"
1621 ><HR><H2
1622 CLASS="SECT2"
1624 NAME="AEN207"
1625 >1.10.6. Mapping Usernames</A
1626 ></H2
1628 >If you have different usernames on the PCs and
1629 the unix server then take a look at the "username map" option.
1630 See the smb.conf man page for details.</P
1631 ></DIV
1632 ><DIV
1633 CLASS="SECT2"
1634 ><HR><H2
1635 CLASS="SECT2"
1637 NAME="AEN210"
1638 >1.10.7. Other Character Sets</A
1639 ></H2
1641 >If you have problems using filenames with accented
1642 characters in them (like the German, French or Scandinavian
1643 character sets) then I recommend you look at the "valid chars"
1644 option in smb.conf and also take a look at the validchars
1645 package in the examples directory.</P
1646 ></DIV
1647 ></DIV
1648 ></DIV
1649 ><DIV
1650 CLASS="CHAPTER"
1651 ><HR><H1
1653 NAME="INTEGRATE-MS-NETWORKS"
1654 >Chapter 2. Integrating MS Windows networks with Samba</A
1655 ></H1
1656 ><DIV
1657 CLASS="SECT1"
1658 ><H1
1659 CLASS="SECT1"
1661 NAME="AEN224"
1662 >2.1. Agenda</A
1663 ></H1
1665 >To identify the key functional mechanisms of MS Windows networking
1666 to enable the deployment of Samba as a means of extending and/or
1667 replacing MS Windows NT/2000 technology.</P
1669 >We will examine:</P
1671 ></P
1672 ><OL
1673 TYPE="1"
1674 ><LI
1676 >Name resolution in a pure Unix/Linux TCP/IP
1677 environment
1679 ></LI
1680 ><LI
1682 >Name resolution as used within MS Windows
1683 networking
1685 ></LI
1686 ><LI
1688 >How browsing functions and how to deploy stable
1689 and dependable browsing using Samba
1691 ></LI
1692 ><LI
1694 >MS Windows security options and how to
1695 configure Samba for seemless integration
1697 ></LI
1698 ><LI
1700 >Configuration of Samba as:</P
1702 ></P
1703 ><OL
1704 TYPE="a"
1705 ><LI
1707 >A stand-alone server</P
1708 ></LI
1709 ><LI
1711 >An MS Windows NT 3.x/4.0 security domain member
1713 ></LI
1714 ><LI
1716 >An alternative to an MS Windows NT 3.x/4.0 Domain Controller
1718 ></LI
1719 ></OL
1720 ></LI
1721 ></OL
1722 ></DIV
1723 ><DIV
1724 CLASS="SECT1"
1725 ><HR><H1
1726 CLASS="SECT1"
1728 NAME="AEN246"
1729 >2.2. Name Resolution in a pure Unix/Linux world</A
1730 ></H1
1732 >The key configuration files covered in this section are:</P
1734 ></P
1735 ><UL
1736 ><LI
1738 ><TT
1739 CLASS="FILENAME"
1740 >/etc/hosts</TT
1741 ></P
1742 ></LI
1743 ><LI
1745 ><TT
1746 CLASS="FILENAME"
1747 >/etc/resolv.conf</TT
1748 ></P
1749 ></LI
1750 ><LI
1752 ><TT
1753 CLASS="FILENAME"
1754 >/etc/host.conf</TT
1755 ></P
1756 ></LI
1757 ><LI
1759 ><TT
1760 CLASS="FILENAME"
1761 >/etc/nsswitch.conf</TT
1762 ></P
1763 ></LI
1764 ></UL
1765 ><DIV
1766 CLASS="SECT2"
1767 ><HR><H2
1768 CLASS="SECT2"
1770 NAME="AEN262"
1771 >2.2.1. <TT
1772 CLASS="FILENAME"
1773 >/etc/hosts</TT
1774 ></A
1775 ></H2
1777 >Contains a static list of IP Addresses and names.
1778 eg:</P
1780 ><TABLE
1781 BORDER="0"
1782 BGCOLOR="#E0E0E0"
1783 WIDTH="100%"
1784 ><TR
1785 ><TD
1786 ><PRE
1787 CLASS="PROGRAMLISTING"
1788 > 127.0.0.1 localhost localhost.localdomain
1789 192.168.1.1 bigbox.caldera.com bigbox alias4box</PRE
1790 ></TD
1791 ></TR
1792 ></TABLE
1793 ></P
1795 >The purpose of <TT
1796 CLASS="FILENAME"
1797 >/etc/hosts</TT
1798 > is to provide a
1799 name resolution mechanism so that uses do not need to remember
1800 IP addresses.</P
1802 >Network packets that are sent over the physical network transport
1803 layer communicate not via IP addresses but rather using the Media
1804 Access Control address, or MAC address. IP Addresses are currently
1805 32 bits in length and are typically presented as four (4) decimal
1806 numbers that are separated by a dot (or period). eg: 168.192.1.1</P
1808 >MAC Addresses use 48 bits (or 6 bytes) and are typically represented
1809 as two digit hexadecimal numbers separated by colons. eg:
1810 40:8e:0a:12:34:56</P
1812 >Every network interfrace must have an MAC address. Associated with
1813 a MAC address there may be one or more IP addresses. There is NO
1814 relationship between an IP address and a MAC address, all such assignments
1815 are arbitary or discretionary in nature. At the most basic level all
1816 network communications takes place using MAC addressing. Since MAC
1817 addresses must be globally unique, and generally remains fixed for
1818 any particular interface, the assignment of an IP address makes sense
1819 from a network management perspective. More than one IP address can
1820 be assigned per MAC address. One address must be the primary IP address,
1821 this is the address that will be returned in the ARP reply.</P
1823 >When a user or a process wants to communicate with another machine
1824 the protocol implementation ensures that the "machine name" or "host
1825 name" is resolved to an IP address in a manner that is controlled
1826 by the TCP/IP configuration control files. The file
1828 CLASS="FILENAME"
1829 >/etc/hosts</TT
1830 > is one such file.</P
1832 >When the IP address of the destination interface has been
1833 determined a protocol called ARP/RARP isused to identify
1834 the MAC address of the target interface. ARP stands for Address
1835 Resolution Protocol, and is a broadcast oriented method that
1836 uses UDP (User Datagram Protocol) to send a request to all
1837 interfaces on the local network segment using the all 1's MAC
1838 address. Network interfaces are programmed to respond to two
1839 MAC addresses only; their own unique address and the address
1840 ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will
1841 contain the MAC address and the primary IP address for each
1842 interface.</P
1844 >The <TT
1845 CLASS="FILENAME"
1846 >/etc/hosts</TT
1847 > file is foundational to all
1848 Unix/Linux TCP/IP installations and as a minumum will contain
1849 the localhost and local network interface IP addresses and the
1850 primary names by which they are known within the local machine.
1851 This file helps to prime the pump so that a basic level of name
1852 resolution can exist before any other method of name resolution
1853 becomes available.</P
1854 ></DIV
1855 ><DIV
1856 CLASS="SECT2"
1857 ><HR><H2
1858 CLASS="SECT2"
1860 NAME="AEN278"
1861 >2.2.2. <TT
1862 CLASS="FILENAME"
1863 >/etc/resolv.conf</TT
1864 ></A
1865 ></H2
1867 >This file tells the name resolution libraries:</P
1869 ></P
1870 ><UL
1871 ><LI
1873 >The name of the domain to which the machine
1874 belongs
1876 ></LI
1877 ><LI
1879 >The name(s) of any domains that should be
1880 automatically searched when trying to resolve unqualified
1881 host names to their IP address
1883 ></LI
1884 ><LI
1886 >The name or IP address of available Domain
1887 Name Servers that may be asked to perform name to address
1888 translation lookups
1890 ></LI
1891 ></UL
1892 ></DIV
1893 ><DIV
1894 CLASS="SECT2"
1895 ><HR><H2
1896 CLASS="SECT2"
1898 NAME="AEN289"
1899 >2.2.3. <TT
1900 CLASS="FILENAME"
1901 >/etc/host.conf</TT
1902 ></A
1903 ></H2
1905 ><TT
1906 CLASS="FILENAME"
1907 >/etc/host.conf</TT
1908 > is the primary means by
1909 which the setting in /etc/resolv.conf may be affected. It is a
1910 critical configuration file. This file controls the order by
1911 which name resolution may procede. The typical structure is:</P
1913 ><TABLE
1914 BORDER="0"
1915 BGCOLOR="#E0E0E0"
1916 WIDTH="100%"
1917 ><TR
1918 ><TD
1919 ><PRE
1920 CLASS="PROGRAMLISTING"
1921 > order hosts,bind
1922 multi on</PRE
1923 ></TD
1924 ></TR
1925 ></TABLE
1926 ></P
1928 >then both addresses should be returned. Please refer to the
1929 man page for host.conf for further details.</P
1930 ></DIV
1931 ><DIV
1932 CLASS="SECT2"
1933 ><HR><H2
1934 CLASS="SECT2"
1936 NAME="AEN297"
1937 >2.2.4. <TT
1938 CLASS="FILENAME"
1939 >/etc/nsswitch.conf</TT
1940 ></A
1941 ></H2
1943 >This file controls the actual name resolution targets. The
1944 file typically has resolver object specifications as follows:</P
1946 ><TABLE
1947 BORDER="0"
1948 BGCOLOR="#E0E0E0"
1949 WIDTH="100%"
1950 ><TR
1951 ><TD
1952 ><PRE
1953 CLASS="PROGRAMLISTING"
1954 > # /etc/nsswitch.conf
1956 # Name Service Switch configuration file.
1959 passwd: compat
1960 # Alternative entries for password authentication are:
1961 # passwd: compat files nis ldap winbind
1962 shadow: compat
1963 group: compat
1965 hosts: files nis dns
1966 # Alternative entries for host name resolution are:
1967 # hosts: files dns nis nis+ hesoid db compat ldap wins
1968 networks: nis files dns
1970 ethers: nis files
1971 protocols: nis files
1972 rpc: nis files
1973 services: nis files</PRE
1974 ></TD
1975 ></TR
1976 ></TABLE
1977 ></P
1979 >Of course, each of these mechanisms requires that the appropriate
1980 facilities and/or services are correctly configured.</P
1982 >It should be noted that unless a network request/message must be
1983 sent, TCP/IP networks are silent. All TCP/IP communications assumes a
1984 principal of speaking only when necessary.</P
1986 >Samba version 2.2.0 will add Linux support for extensions to
1987 the name service switch infrastructure so that linux clients will
1988 be able to obtain resolution of MS Windows NetBIOS names to IP
1989 Addresses. To gain this functionality Samba needs to be compiled
1990 with appropriate arguments to the make command (ie: <B
1991 CLASS="COMMAND"
1992 >make
1993 nsswitch/libnss_wins.so</B
1994 >). The resulting library should
1995 then be installed in the <TT
1996 CLASS="FILENAME"
1997 >/lib</TT
1998 > directory and
1999 the "wins" parameter needs to be added to the "hosts:" line in
2000 the <TT
2001 CLASS="FILENAME"
2002 >/etc/nsswitch.conf</TT
2003 > file. At this point it
2004 will be possible to ping any MS Windows machine by it's NetBIOS
2005 machine name, so long as that machine is within the workgroup to
2006 which both the samba machine and the MS Windows machine belong.</P
2007 ></DIV
2008 ></DIV
2009 ><DIV
2010 CLASS="SECT1"
2011 ><HR><H1
2012 CLASS="SECT1"
2014 NAME="AEN309"
2015 >2.3. Name resolution as used within MS Windows networking</A
2016 ></H1
2018 >MS Windows networking is predicated about the name each machine
2019 is given. This name is known variously (and inconsistently) as
2020 the "computer name", "machine name", "networking name", "netbios name",
2021 "SMB name". All terms mean the same thing with the exception of
2022 "netbios name" which can apply also to the name of the workgroup or the
2023 domain name. The terms "workgroup" and "domain" are really just a
2024 simply name with which the machine is associated. All NetBIOS names
2025 are exactly 16 characters in length. The 16th character is reserved.
2026 It is used to store a one byte value that indicates service level
2027 information for the NetBIOS name that is registered. A NetBIOS machine
2028 name is therefore registered for each service type that is provided by
2029 the client/server.</P
2031 >The following are typical NetBIOS name/service type registrations:</P
2033 ><TABLE
2034 BORDER="0"
2035 BGCOLOR="#E0E0E0"
2036 WIDTH="100%"
2037 ><TR
2038 ><TD
2039 ><PRE
2040 CLASS="PROGRAMLISTING"
2041 > Unique NetBIOS Names:
2042 MACHINENAME&#60;00&#62; = Server Service is running on MACHINENAME
2043 MACHINENAME&#60;03&#62; = Generic Machine Name (NetBIOS name)
2044 MACHINENAME&#60;20&#62; = LanMan Server service is running on MACHINENAME
2045 WORKGROUP&#60;1b&#62; = Domain Master Browser
2047 Group Names:
2048 WORKGROUP&#60;03&#62; = Generic Name registered by all members of WORKGROUP
2049 WORKGROUP&#60;1c&#62; = Domain Controllers / Netlogon Servers
2050 WORKGROUP&#60;1d&#62; = Local Master Browsers
2051 WORKGROUP&#60;1e&#62; = Internet Name Resolvers</PRE
2052 ></TD
2053 ></TR
2054 ></TABLE
2055 ></P
2057 >It should be noted that all NetBIOS machines register their own
2058 names as per the above. This is in vast contrast to TCP/IP
2059 installations where traditionally the system administrator will
2060 determine in the /etc/hosts or in the DNS database what names
2061 are associated with each IP address.</P
2063 >One further point of clarification should be noted, the <TT
2064 CLASS="FILENAME"
2065 >/etc/hosts</TT
2067 file and the DNS records do not provide the NetBIOS name type information
2068 that MS Windows clients depend on to locate the type of service that may
2069 be needed. An example of this is what happens when an MS Windows client
2070 wants to locate a domain logon server. It find this service and the IP
2071 address of a server that provides it by performing a lookup (via a
2072 NetBIOS broadcast) for enumeration of all machines that have
2073 registered the name type *&#60;1c&#62;. A logon request is then sent to each
2074 IP address that is returned in the enumerated list of IP addresses. Which
2075 ever machine first replies then ends up providing the logon services.</P
2077 >The name "workgroup" or "domain" really can be confusing since these
2078 have the added significance of indicating what is the security
2079 architecture of the MS Windows network. The term "workgroup" indicates
2080 that the primary nature of the network environment is that of a
2081 peer-to-peer design. In a WORKGROUP all machines are responsible for
2082 their own security, and generally such security is limited to use of
2083 just a password (known as SHARE MORE security). In most situations
2084 with peer-to-peer networking the users who control their own machines
2085 will simply opt to have no security at all. It is possible to have
2086 USER MODE security in a WORKGROUP environment, thus requiring use
2087 of a user name and a matching password.</P
2089 >MS Windows networking is thus predetermined to use machine names
2090 for all local and remote machine message passing. The protocol used is
2091 called Server Message Block (SMB) and this is implemented using
2092 the NetBIOS protocol (Network Basic Input Output System). NetBIOS can
2093 be encapsulated using LLC (Logical Link Control) protocol - in which case
2094 the resulting protocol is called NetBEUI (Network Basic Extended User
2095 Interface). NetBIOS can also be run over IPX (Internetworking Packet
2096 Exchange) protocol as used by Novell NetWare, and it can be run
2097 over TCP/IP protocols - in which case the resulting protocol is called
2098 NBT or NetBT, the NetBIOS over TCP/IP.</P
2100 >MS Windows machines use a complex array of name resolution mechanisms.
2101 Since we are primarily concerned with TCP/IP this demonstration is
2102 limited to this area.</P
2103 ><DIV
2104 CLASS="SECT2"
2105 ><HR><H2
2106 CLASS="SECT2"
2108 NAME="AEN321"
2109 >2.3.1. The NetBIOS Name Cache</A
2110 ></H2
2112 >All MS Windows machines employ an in memory buffer in which is
2113 stored the NetBIOS names and their IP addresses for all external
2114 machines that that the local machine has communicated with over the
2115 past 10-15 minutes. It is more efficient to obtain an IP address
2116 for a machine from the local cache than it is to go through all the
2117 configured name resolution mechanisms.</P
2119 >If a machine whose name is in the local name cache has been shut
2120 down before the name had been expired and flushed from the cache, then
2121 an attempt to exchange a message with that machine will be subject
2122 to time-out delays. ie: It's name is in the cache, so a name resolution
2123 lookup will succeed, but the machine can not respond. This can be
2124 frustrating for users - but it is a characteristic of the protocol.</P
2126 >The MS Windows utility that allows examination of the NetBIOS
2127 name cache is called "nbtstat". The Samba equivalent of this
2128 is called "nmblookup".</P
2129 ></DIV
2130 ><DIV
2131 CLASS="SECT2"
2132 ><HR><H2
2133 CLASS="SECT2"
2135 NAME="AEN326"
2136 >2.3.2. The LMHOSTS file</A
2137 ></H2
2139 >This file is usually located in MS Windows NT 4.0 or
2140 2000 in <TT
2141 CLASS="FILENAME"
2142 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2143 > and contains
2144 the IP Address and the machine name in matched pairs. The
2146 CLASS="FILENAME"
2147 >LMHOSTS</TT
2148 > file performs NetBIOS name
2149 to IP address mapping oriented.</P
2151 >It typically looks like:</P
2153 ><TABLE
2154 BORDER="0"
2155 BGCOLOR="#E0E0E0"
2156 WIDTH="100%"
2157 ><TR
2158 ><TD
2159 ><PRE
2160 CLASS="PROGRAMLISTING"
2161 > # Copyright (c) 1998 Microsoft Corp.
2163 # This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
2164 # over TCP/IP) stack for Windows98
2166 # This file contains the mappings of IP addresses to NT computernames
2167 # (NetBIOS) names. Each entry should be kept on an individual line.
2168 # The IP address should be placed in the first column followed by the
2169 # corresponding computername. The address and the comptername
2170 # should be separated by at least one space or tab. The "#" character
2171 # is generally used to denote the start of a comment (see the exceptions
2172 # below).
2174 # This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
2175 # files and offers the following extensions:
2177 # #PRE
2178 # #DOM:&#60;domain&#62;
2179 # #INCLUDE &#60;filename&#62;
2180 # #BEGIN_ALTERNATE
2181 # #END_ALTERNATE
2182 # \0xnn (non-printing character support)
2184 # Following any entry in the file with the characters "#PRE" will cause
2185 # the entry to be preloaded into the name cache. By default, entries are
2186 # not preloaded, but are parsed only after dynamic name resolution fails.
2188 # Following an entry with the "#DOM:&#60;domain&#62;" tag will associate the
2189 # entry with the domain specified by &#60;domain&#62;. This affects how the
2190 # browser and logon services behave in TCP/IP environments. To preload
2191 # the host name associated with #DOM entry, it is necessary to also add a
2192 # #PRE to the line. The &#60;domain&#62; is always preloaded although it will not
2193 # be shown when the name cache is viewed.
2195 # Specifying "#INCLUDE &#60;filename&#62;" will force the RFC NetBIOS (NBT)
2196 # software to seek the specified &#60;filename&#62; and parse it as if it were
2197 # local. &#60;filename&#62; is generally a UNC-based name, allowing a
2198 # centralized lmhosts file to be maintained on a server.
2199 # It is ALWAYS necessary to provide a mapping for the IP address of the
2200 # server prior to the #INCLUDE. This mapping must use the #PRE directive.
2201 # In addtion the share "public" in the example below must be in the
2202 # LanManServer list of "NullSessionShares" in order for client machines to
2203 # be able to read the lmhosts file successfully. This key is under
2204 # \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
2205 # in the registry. Simply add "public" to the list found there.
2207 # The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
2208 # statements to be grouped together. Any single successful include
2209 # will cause the group to succeed.
2211 # Finally, non-printing characters can be embedded in mappings by
2212 # first surrounding the NetBIOS name in quotations, then using the
2213 # \0xnn notation to specify a hex value for a non-printing character.
2215 # The following example illustrates all of these extensions:
2217 # 102.54.94.97 rhino #PRE #DOM:networking #net group's DC
2218 # 102.54.94.102 "appname \0x14" #special app server
2219 # 102.54.94.123 popular #PRE #source server
2220 # 102.54.94.117 localsrv #PRE #needed for the include
2222 # #BEGIN_ALTERNATE
2223 # #INCLUDE \\localsrv\public\lmhosts
2224 # #INCLUDE \\rhino\public\lmhosts
2225 # #END_ALTERNATE
2227 # In the above example, the "appname" server contains a special
2228 # character in its name, the "popular" and "localsrv" server names are
2229 # preloaded, and the "rhino" server name is specified so it can be used
2230 # to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
2231 # system is unavailable.
2233 # Note that the whole file is parsed including comments on each lookup,
2234 # so keeping the number of comments to a minimum will improve performance.
2235 # Therefore it is not advisable to simply add lmhosts file entries onto the
2236 # end of this file.</PRE
2237 ></TD
2238 ></TR
2239 ></TABLE
2240 ></P
2241 ></DIV
2242 ><DIV
2243 CLASS="SECT2"
2244 ><HR><H2
2245 CLASS="SECT2"
2247 NAME="AEN334"
2248 >2.3.3. HOSTS file</A
2249 ></H2
2251 >This file is usually located in MS Windows NT 4.0 or 2000 in
2253 CLASS="FILENAME"
2254 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2255 > and contains
2256 the IP Address and the IP hostname in matched pairs. It can be
2257 used by the name resolution infrastructure in MS Windows, depending
2258 on how the TCP/IP environment is configured. This file is in
2259 every way the equivalent of the Unix/Linux <TT
2260 CLASS="FILENAME"
2261 >/etc/hosts</TT
2262 > file.</P
2263 ></DIV
2264 ><DIV
2265 CLASS="SECT2"
2266 ><HR><H2
2267 CLASS="SECT2"
2269 NAME="AEN339"
2270 >2.3.4. DNS Lookup</A
2271 ></H2
2273 >This capability is configured in the TCP/IP setup area in the network
2274 configuration facility. If enabled an elaborate name resolution sequence
2275 is followed the precise nature of which isdependant on what the NetBIOS
2276 Node Type parameter is configured to. A Node Type of 0 means use
2277 NetBIOS broadcast (over UDP broadcast) is first used if the name
2278 that is the subject of a name lookup is not found in the NetBIOS name
2279 cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to
2280 Node Type 8, then a NetBIOS Unicast (over UDP Unicast) is sent to the
2281 WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast
2282 lookup is used.</P
2283 ></DIV
2284 ><DIV
2285 CLASS="SECT2"
2286 ><HR><H2
2287 CLASS="SECT2"
2289 NAME="AEN342"
2290 >2.3.5. WINS Lookup</A
2291 ></H2
2293 >A WINS (Windows Internet Name Server) service is the equivaent of the
2294 rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores
2295 the names and IP addresses that are registered by a Windows client
2296 if the TCP/IP setup has been given at least one WINS Server IP Address.</P
2298 >To configure Samba to be a WINS server the following parameter needs
2299 to be added to the <TT
2300 CLASS="FILENAME"
2301 >smb.conf</TT
2302 > file:</P
2304 ><TABLE
2305 BORDER="0"
2306 BGCOLOR="#E0E0E0"
2307 WIDTH="100%"
2308 ><TR
2309 ><TD
2310 ><PRE
2311 CLASS="PROGRAMLISTING"
2312 > wins support = Yes</PRE
2313 ></TD
2314 ></TR
2315 ></TABLE
2316 ></P
2318 >To configure Samba to use a WINS server the following parameters are
2319 needed in the smb.conf file:</P
2321 ><TABLE
2322 BORDER="0"
2323 BGCOLOR="#E0E0E0"
2324 WIDTH="100%"
2325 ><TR
2326 ><TD
2327 ><PRE
2328 CLASS="PROGRAMLISTING"
2329 > wins support = No
2330 wins server = xxx.xxx.xxx.xxx</PRE
2331 ></TD
2332 ></TR
2333 ></TABLE
2334 ></P
2336 >where <TT
2337 CLASS="REPLACEABLE"
2339 >xxx.xxx.xxx.xxx</I
2340 ></TT
2341 > is the IP address
2342 of the WINS server.</P
2343 ></DIV
2344 ></DIV
2345 ><DIV
2346 CLASS="SECT1"
2347 ><HR><H1
2348 CLASS="SECT1"
2350 NAME="AEN354"
2351 >2.4. How browsing functions and how to deploy stable and
2352 dependable browsing using Samba</A
2353 ></H1
2355 >As stated above, MS Windows machines register their NetBIOS names
2356 (ie: the machine name for each service type in operation) on start
2357 up. Also, as stated above, the exact method by which this name registration
2358 takes place is determined by whether or not the MS Windows client/server
2359 has been given a WINS server address, whether or not LMHOSTS lookup
2360 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.</P
2362 >In the case where there is no WINS server all name registrations as
2363 well as name lookups are done by UDP broadcast. This isolates name
2364 resolution to the local subnet, unless LMHOSTS is used to list all
2365 names and IP addresses. In such situations Samba provides a means by
2366 which the samba server name may be forcibly injected into the browse
2367 list of a remote MS Windows network (using the "remote announce" parameter).</P
2369 >Where a WINS server is used, the MS Windows client will use UDP
2370 unicast to register with the WINS server. Such packets can be routed
2371 and thus WINS allows name resolution to function across routed networks.</P
2373 >During the startup process an election will take place to create a
2374 local master browser if one does not already exist. On each NetBIOS network
2375 one machine will be elected to function as the domain master browser. This
2376 domain browsing has nothing to do with MS security domain control.
2377 Instead, the domain master browser serves the role of contacting each local
2378 master browser (found by asking WINS or from LMHOSTS) and exchanging browse
2379 list contents. This way every master browser will eventually obtain a complete
2380 list of all machines that are on the network. Every 11-15 minutes an election
2381 is held to determine which machine will be the master browser. By nature of
2382 the election criteria used, the machine with the highest uptime, or the
2383 most senior protocol version, or other criteria, will win the election
2384 as domain master browser.</P
2386 >Clients wishing to browse the network make use of this list, but also depend
2387 on the availability of correct name resolution to the respective IP
2388 address/addresses. </P
2390 >Any configuration that breaks name resolution and/or browsing intrinsics
2391 will annoy users because they will have to put up with protracted
2392 inability to use the network services.</P
2394 >Samba supports a feature that allows forced synchonisation
2395 of browse lists across routed networks using the "remote
2396 browse sync" parameter in the smb.conf file. This causes Samba
2397 to contact the local master browser on a remote network and
2398 to request browse list synchronisation. This effectively bridges
2399 two networks that are separated by routers. The two remote
2400 networks may use either broadcast based name resolution or WINS
2401 based name resolution, but it should be noted that the "remote
2402 browse sync" parameter provides browse list synchronisation - and
2403 that is distinct from name to address resolution, in other
2404 words, for cross subnet browsing to function correctly it is
2405 essential that a name to address resolution mechanism be provided.
2406 This mechanism could be via DNS, <TT
2407 CLASS="FILENAME"
2408 >/etc/hosts</TT
2410 and so on.</P
2411 ></DIV
2412 ><DIV
2413 CLASS="SECT1"
2414 ><HR><H1
2415 CLASS="SECT1"
2417 NAME="AEN364"
2418 >2.5. MS Windows security options and how to configure
2419 Samba for seemless integration</A
2420 ></H1
2422 >MS Windows clients may use encrypted passwords as part of a
2423 challenege/response authentication model (a.k.a. NTLMv1) or
2424 alone, or clear text strings for simple password based
2425 authentication. It should be realized that with the SMB
2426 protocol the password is passed over the network either
2427 in plain text or encrypted, but not both in the same
2428 authentication requets.</P
2430 >When encrypted passwords are used a password that has been
2431 entered by the user is encrypted in two ways:</P
2433 ></P
2434 ><UL
2435 ><LI
2437 >An MD4 hash of the UNICODE of the password
2438 string. This is known as the NT hash.
2440 ></LI
2441 ><LI
2443 >The password is converted to upper case,
2444 and then padded or trucated to 14 bytes. This string is
2445 then appended with 5 bytes of NULL characters and split to
2446 form two 56 bit DES keys to encrypt a "magic" 8 byte value.
2447 The resulting 16 bytes for the LanMan hash.
2449 ></LI
2450 ></UL
2452 >You should refer to the <A
2453 HREF="ENCRYPTION.html"
2454 TARGET="_top"
2455 >Password Encryption</A
2456 > chapter in this HOWTO collection
2457 for more details on the inner workings</P
2459 >MS Windows 95 pre-service pack 1, MS Windows NT versions 3.x
2460 and version 4.0 pre-service pack 3 will use either mode of
2461 password authentication. All versions of MS Windows that follow
2462 these versions no longer support plain text passwords by default.</P
2464 >MS Windows clients have a habit of dropping network mappings that
2465 have been idle for 10 minutes or longer. When the user attempts to
2466 use the mapped drive connection that has been dropped the SMB protocol
2467 has a mechanism by which the connection can be re-established using
2468 a cached copy of the password.</P
2470 >When Microsoft changed the default password mode, they dropped support for
2471 caching of the plain text password. This means that when the registry
2472 parameter is changed to re-enable use of plain text passwords it appears to
2473 work, but when a dropped mapping attempts to revalidate it will fail if
2474 the remote authentication server does not support encrypted passwords.
2475 This means that it is definitely not a good idea to re-enable plain text
2476 password support in such clients.</P
2478 >The following parameters can be used to work around the
2479 issue of Windows 9x client upper casing usernames and
2480 password before transmitting them to the SMB server
2481 when using clear text authentication.</P
2483 ><TABLE
2484 BORDER="0"
2485 BGCOLOR="#E0E0E0"
2486 WIDTH="100%"
2487 ><TR
2488 ><TD
2489 ><PRE
2490 CLASS="PROGRAMLISTING"
2491 > <A
2492 HREF="smb.conf.5.html#PASSWORDLEVEL"
2493 TARGET="_top"
2494 >passsword level</A
2495 > = <TT
2496 CLASS="REPLACEABLE"
2498 >integer</I
2499 ></TT
2502 HREF="smb.conf.5.html#USERNAMELEVEL"
2503 TARGET="_top"
2504 >username level</A
2505 > = <TT
2506 CLASS="REPLACEABLE"
2508 >integer</I
2509 ></TT
2510 ></PRE
2511 ></TD
2512 ></TR
2513 ></TABLE
2514 ></P
2516 >By default Samba will lower case the username before attempting
2517 to lookup the user in the database of local system accounts.
2518 Because UNIX usernames conventionally only contain lower case
2519 character, the <TT
2520 CLASS="PARAMETER"
2522 >username level</I
2523 ></TT
2524 > parameter
2525 is rarely even needed.</P
2527 >However, password on UNIX systems often make use of mixed case
2528 characters. This means that in order for a user on a Windows 9x
2529 client to connect to a Samba server using clear text authentication,
2530 the <TT
2531 CLASS="PARAMETER"
2533 >password level</I
2534 ></TT
2535 > must be set to the maximum
2536 number of upper case letter which <EM
2537 >could</EM
2538 > appear
2539 is a password. Note that is the server OS uses the traditional
2540 DES version of crypt(), then a <TT
2541 CLASS="PARAMETER"
2543 >password level</I
2544 ></TT
2546 of 8 will result in case insensitive passwords as seen from Windows
2547 users. This will also result in longer login times as Samba
2548 hash to compute the permutations of the password string and
2549 try them one by one until a match is located (or all combinations fail).</P
2551 >The best option to adopt is to enable support for encrypted passwords
2552 where ever Samba is used. There are three configuration possibilities
2553 for support of encrypted passwords:</P
2554 ><DIV
2555 CLASS="SECT2"
2556 ><HR><H2
2557 CLASS="SECT2"
2559 NAME="AEN392"
2560 >2.5.1. Use MS Windows NT as an authentication server</A
2561 ></H2
2563 >This method involves the additions of the following parameters
2564 in the smb.conf file:</P
2566 ><TABLE
2567 BORDER="0"
2568 BGCOLOR="#E0E0E0"
2569 WIDTH="100%"
2570 ><TR
2571 ><TD
2572 ><PRE
2573 CLASS="PROGRAMLISTING"
2574 > encrypt passwords = Yes
2575 security = server
2576 password server = "NetBIOS_name_of_PDC"</PRE
2577 ></TD
2578 ></TR
2579 ></TABLE
2580 ></P
2582 >There are two ways of identifying whether or not a username and
2583 password pair was valid or not. One uses the reply information provided
2584 as part of the authentication messaging process, the other uses
2585 just and error code.</P
2587 >The down-side of this mode of configuration is the fact that
2588 for security reasons Samba will send the password server a bogus
2589 username and a bogus password and if the remote server fails to
2590 reject the username and password pair then an alternative mode
2591 of identification of validation is used. Where a site uses password
2592 lock out after a certain number of failed authentication attempts
2593 this will result in user lockouts.</P
2595 >Use of this mode of authentication does require there to be
2596 a standard Unix account for the user, this account can be blocked
2597 to prevent logons by other than MS Windows clients.</P
2598 ></DIV
2599 ><DIV
2600 CLASS="SECT2"
2601 ><HR><H2
2602 CLASS="SECT2"
2604 NAME="AEN400"
2605 >2.5.2. Make Samba a member of an MS Windows NT security domain</A
2606 ></H2
2608 >This method involves additon of the following paramters in the smb.conf file:</P
2610 ><TABLE
2611 BORDER="0"
2612 BGCOLOR="#E0E0E0"
2613 WIDTH="100%"
2614 ><TR
2615 ><TD
2616 ><PRE
2617 CLASS="PROGRAMLISTING"
2618 > encrypt passwords = Yes
2619 security = domain
2620 workgroup = "name of NT domain"
2621 password server = *</PRE
2622 ></TD
2623 ></TR
2624 ></TABLE
2625 ></P
2627 >The use of the "*" argument to "password server" will cause samba
2628 to locate the domain controller in a way analogous to the way
2629 this is done within MS Windows NT.</P
2631 >In order for this method to work the Samba server needs to join the
2632 MS Windows NT security domain. This is done as follows:</P
2634 ></P
2635 ><UL
2636 ><LI
2638 >On the MS Windows NT domain controller using
2639 the Server Manager add a machine account for the Samba server.
2641 ></LI
2642 ><LI
2644 >Next, on the Linux system execute:
2646 CLASS="COMMAND"
2647 >smbpasswd -r PDC_NAME -j DOMAIN_NAME</B
2650 ></LI
2651 ></UL
2653 >Use of this mode of authentication does require there to be
2654 a standard Unix account for the user in order to assign
2655 a uid once the account has been authenticated by the remote
2656 Windows DC. This account can be blocked to prevent logons by
2657 other than MS Windows clients by things such as setting an invalid
2658 shell in the <TT
2659 CLASS="FILENAME"
2660 >/etc/passwd</TT
2661 > entry.</P
2663 >An alternative to assigning UIDs to Windows users on a
2664 Samba member server is presented in the <A
2665 HREF="winbind.html"
2666 TARGET="_top"
2667 >Winbind Overview</A
2668 > chapter in
2669 this HOWTO collection.</P
2670 ></DIV
2671 ><DIV
2672 CLASS="SECT2"
2673 ><HR><H2
2674 CLASS="SECT2"
2676 NAME="AEN417"
2677 >2.5.3. Configure Samba as an authentication server</A
2678 ></H2
2680 >This mode of authentication demands that there be on the
2681 Unix/Linux system both a Unix style account as well as and
2682 smbpasswd entry for the user. The Unix system account can be
2683 locked if required as only the encrypted password will be
2684 used for SMB client authentication.</P
2686 >This method involves addition of the following parameters to
2687 the smb.conf file:</P
2689 ><TABLE
2690 BORDER="0"
2691 BGCOLOR="#E0E0E0"
2692 WIDTH="100%"
2693 ><TR
2694 ><TD
2695 ><PRE
2696 CLASS="PROGRAMLISTING"
2697 >## please refer to the Samba PDC HOWTO chapter later in
2698 ## this collection for more details
2699 [global]
2700 encrypt passwords = Yes
2701 security = user
2702 domain logons = Yes
2703 ; an OS level of 33 or more is recommended
2704 os level = 33
2706 [NETLOGON]
2707 path = /somewhare/in/file/system
2708 read only = yes</PRE
2709 ></TD
2710 ></TR
2711 ></TABLE
2712 ></P
2714 >in order for this method to work a Unix system account needs
2715 to be created for each user, as well as for each MS Windows NT/2000
2716 machine. The following structure is required.</P
2717 ><DIV
2718 CLASS="SECT3"
2719 ><HR><H3
2720 CLASS="SECT3"
2722 NAME="AEN424"
2723 >2.5.3.1. Users</A
2724 ></H3
2726 >A user account that may provide a home directory should be
2727 created. The following Linux system commands are typical of
2728 the procedure for creating an account.</P
2730 ><TABLE
2731 BORDER="0"
2732 BGCOLOR="#E0E0E0"
2733 WIDTH="100%"
2734 ><TR
2735 ><TD
2736 ><PRE
2737 CLASS="PROGRAMLISTING"
2738 > # useradd -s /bin/bash -d /home/"userid" -m
2739 # passwd "userid"
2740 Enter Password: &#60;pw&#62;
2742 # smbpasswd -a "userid"
2743 Enter Password: &#60;pw&#62;</PRE
2744 ></TD
2745 ></TR
2746 ></TABLE
2747 ></P
2748 ></DIV
2749 ><DIV
2750 CLASS="SECT3"
2751 ><HR><H3
2752 CLASS="SECT3"
2754 NAME="AEN429"
2755 >2.5.3.2. MS Windows NT Machine Accounts</A
2756 ></H3
2758 >These are required only when Samba is used as a domain
2759 controller. Refer to the Samba-PDC-HOWTO for more details.</P
2761 ><TABLE
2762 BORDER="0"
2763 BGCOLOR="#E0E0E0"
2764 WIDTH="100%"
2765 ><TR
2766 ><TD
2767 ><PRE
2768 CLASS="PROGRAMLISTING"
2769 > # useradd -a /bin/false -d /dev/null "machine_name"\$
2770 # passwd -l "machine_name"\$
2771 # smbpasswd -a -m "machine_name"</PRE
2772 ></TD
2773 ></TR
2774 ></TABLE
2775 ></P
2776 ></DIV
2777 ></DIV
2778 ></DIV
2779 ><DIV
2780 CLASS="SECT1"
2781 ><HR><H1
2782 CLASS="SECT1"
2784 NAME="AEN434"
2785 >2.6. Conclusions</A
2786 ></H1
2788 >Samba provides a flexible means to operate as...</P
2790 ></P
2791 ><UL
2792 ><LI
2794 >A Stand-alone server - No special action is needed
2795 other than to create user accounts. Stand-alone servers do NOT
2796 provide network logon services, meaning that machines that use this
2797 server do NOT perform a domain logon but instead make use only of
2798 the MS Windows logon which is local to the MS Windows
2799 workstation/server.
2801 ></LI
2802 ><LI
2804 >An MS Windows NT 3.x/4.0 security domain member.
2806 ></LI
2807 ><LI
2809 >An alternative to an MS Windows NT 3.x/4.0
2810 Domain Controller.
2812 ></LI
2813 ></UL
2814 ></DIV
2815 ></DIV
2816 ><DIV
2817 CLASS="CHAPTER"
2818 ><HR><H1
2820 NAME="PAM"
2821 >Chapter 3. Configuring PAM for distributed but centrally
2822 managed authentication</A
2823 ></H1
2824 ><DIV
2825 CLASS="SECT1"
2826 ><H1
2827 CLASS="SECT1"
2829 NAME="AEN455"
2830 >3.1. Samba and PAM</A
2831 ></H1
2833 >A number of Unix systems (eg: Sun Solaris), as well as the
2834 xxxxBSD family and Linux, now utilize the Pluggable Authentication
2835 Modules (PAM) facility to provide all authentication,
2836 authorization and resource control services. Prior to the
2837 introduction of PAM, a decision to use an alternative to
2838 the system password database (<TT
2839 CLASS="FILENAME"
2840 >/etc/passwd</TT
2842 would require the provision of alternatives for all programs that provide
2843 security services. Such a choice would involve provision of
2844 alternatives to such programs as: <B
2845 CLASS="COMMAND"
2846 >login</B
2849 CLASS="COMMAND"
2850 >passwd</B
2851 >, <B
2852 CLASS="COMMAND"
2853 >chown</B
2854 >, etc.</P
2856 >PAM provides a mechanism that disconnects these security programs
2857 from the underlying authentication/authorization infrastructure.
2858 PAM is configured either through one file <TT
2859 CLASS="FILENAME"
2860 >/etc/pam.conf</TT
2861 > (Solaris),
2862 or by editing individual files that are located in <TT
2863 CLASS="FILENAME"
2864 >/etc/pam.d</TT
2865 >.</P
2867 >The following is an example <TT
2868 CLASS="FILENAME"
2869 >/etc/pam.d/login</TT
2870 > configuration file.
2871 This example had all options been uncommented is probably not usable
2872 as it stacks many conditions before allowing successful completion
2873 of the login process. Essentially all conditions can be disabled
2874 by commenting them out except the calls to <TT
2875 CLASS="FILENAME"
2876 >pam_pwdb.so</TT
2877 >.</P
2879 ><TABLE
2880 BORDER="0"
2881 BGCOLOR="#E0E0E0"
2882 WIDTH="100%"
2883 ><TR
2884 ><TD
2885 ><PRE
2886 CLASS="PROGRAMLISTING"
2887 >#%PAM-1.0
2888 # The PAM configuration file for the `login' service
2890 auth required pam_securetty.so
2891 auth required pam_nologin.so
2892 # auth required pam_dialup.so
2893 # auth optional pam_mail.so
2894 auth required pam_pwdb.so shadow md5
2895 # account requisite pam_time.so
2896 account required pam_pwdb.so
2897 session required pam_pwdb.so
2898 # session optional pam_lastlog.so
2899 # password required pam_cracklib.so retry=3
2900 password required pam_pwdb.so shadow md5</PRE
2901 ></TD
2902 ></TR
2903 ></TABLE
2904 ></P
2906 >PAM allows use of replacable modules. Those available on a
2907 sample system include:</P
2909 ><TABLE
2910 BORDER="0"
2911 BGCOLOR="#E0E0E0"
2912 WIDTH="100%"
2913 ><TR
2914 ><TD
2915 ><PRE
2916 CLASS="PROGRAMLISTING"
2917 >$ /bin/ls /lib/security
2918 pam_access.so pam_ftp.so pam_limits.so
2919 pam_ncp_auth.so pam_rhosts_auth.so pam_stress.so
2920 pam_cracklib.so pam_group.so pam_listfile.so
2921 pam_nologin.so pam_rootok.so pam_tally.so
2922 pam_deny.so pam_issue.so pam_mail.so
2923 pam_permit.so pam_securetty.so pam_time.so
2924 pam_dialup.so pam_lastlog.so pam_mkhomedir.so
2925 pam_pwdb.so pam_shells.so pam_unix.so
2926 pam_env.so pam_ldap.so pam_motd.so
2927 pam_radius.so pam_smbpass.so pam_unix_acct.so
2928 pam_wheel.so pam_unix_auth.so pam_unix_passwd.so
2929 pam_userdb.so pam_warn.so pam_unix_session.so</PRE
2930 ></TD
2931 ></TR
2932 ></TABLE
2933 ></P
2935 >The following example for the login program replaces the use of
2936 the <TT
2937 CLASS="FILENAME"
2938 >pam_pwdb.so</TT
2939 > module which uses the system
2940 password database (<TT
2941 CLASS="FILENAME"
2942 >/etc/passwd</TT
2945 CLASS="FILENAME"
2946 >/etc/shadow</TT
2947 >, <TT
2948 CLASS="FILENAME"
2949 >/etc/group</TT
2950 >) with
2951 the module <TT
2952 CLASS="FILENAME"
2953 >pam_smbpass.so</TT
2954 > which uses the Samba
2955 database which contains the Microsoft MD4 encrypted password
2956 hashes. This database is stored in either
2958 CLASS="FILENAME"
2959 >/usr/local/samba/private/smbpasswd</TT
2962 CLASS="FILENAME"
2963 >/etc/samba/smbpasswd</TT
2964 >, or in
2966 CLASS="FILENAME"
2967 >/etc/samba.d/smbpasswd</TT
2968 >, depending on the
2969 Samba implementation for your Unix/Linux system. The
2971 CLASS="FILENAME"
2972 >pam_smbpass.so</TT
2973 > module is provided by
2974 Samba version 2.2.1 or later. It can be compiled only if the
2976 CLASS="CONSTANT"
2977 >--with-pam --with-pam_smbpass</TT
2978 > options are both
2979 provided to the Samba <B
2980 CLASS="COMMAND"
2981 >configure</B
2982 > program.</P
2984 ><TABLE
2985 BORDER="0"
2986 BGCOLOR="#E0E0E0"
2987 WIDTH="100%"
2988 ><TR
2989 ><TD
2990 ><PRE
2991 CLASS="PROGRAMLISTING"
2992 >#%PAM-1.0
2993 # The PAM configuration file for the `login' service
2995 auth required pam_smbpass.so nodelay
2996 account required pam_smbpass.so nodelay
2997 session required pam_smbpass.so nodelay
2998 password required pam_smbpass.so nodelay</PRE
2999 ></TD
3000 ></TR
3001 ></TABLE
3002 ></P
3004 >The following is the PAM configuration file for a particular
3005 Linux system. The default condition uses <TT
3006 CLASS="FILENAME"
3007 >pam_pwdb.so</TT
3008 >.</P
3010 ><TABLE
3011 BORDER="0"
3012 BGCOLOR="#E0E0E0"
3013 WIDTH="100%"
3014 ><TR
3015 ><TD
3016 ><PRE
3017 CLASS="PROGRAMLISTING"
3018 >#%PAM-1.0
3019 # The PAM configuration file for the `samba' service
3021 auth required /lib/security/pam_pwdb.so nullok nodelay shadow audit
3022 account required /lib/security/pam_pwdb.so audit nodelay
3023 session required /lib/security/pam_pwdb.so nodelay
3024 password required /lib/security/pam_pwdb.so shadow md5</PRE
3025 ></TD
3026 ></TR
3027 ></TABLE
3028 ></P
3030 >In the following example the decision has been made to use the
3031 smbpasswd database even for basic samba authentication. Such a
3032 decision could also be made for the passwd program and would
3033 thus allow the smbpasswd passwords to be changed using the passwd
3034 program.</P
3036 ><TABLE
3037 BORDER="0"
3038 BGCOLOR="#E0E0E0"
3039 WIDTH="100%"
3040 ><TR
3041 ><TD
3042 ><PRE
3043 CLASS="PROGRAMLISTING"
3044 >#%PAM-1.0
3045 # The PAM configuration file for the `samba' service
3047 auth required /lib/security/pam_smbpass.so nodelay
3048 account required /lib/security/pam_pwdb.so audit nodelay
3049 session required /lib/security/pam_pwdb.so nodelay
3050 password required /lib/security/pam_smbpass.so nodelay smbconf=/etc/samba.d/smb.conf</PRE
3051 ></TD
3052 ></TR
3053 ></TABLE
3054 ></P
3056 >Note: PAM allows stacking of authentication mechanisms. It is
3057 also possible to pass information obtained within on PAM module through
3058 to the next module in the PAM stack. Please refer to the documentation for
3059 your particular system implementation for details regarding the specific
3060 capabilities of PAM in this environment. Some Linux implmentations also
3061 provide the <TT
3062 CLASS="FILENAME"
3063 >pam_stack.so</TT
3064 > module that allows all
3065 authentication to be configured in a single central file. The
3067 CLASS="FILENAME"
3068 >pam_stack.so</TT
3069 > method has some very devoted followers
3070 on the basis that it allows for easier administration. As with all issues in
3071 life though, every decision makes trade-offs, so you may want examine the
3072 PAM documentation for further helpful information.</P
3073 ></DIV
3074 ><DIV
3075 CLASS="SECT1"
3076 ><HR><H1
3077 CLASS="SECT1"
3079 NAME="AEN497"
3080 >3.2. Distributed Authentication</A
3081 ></H1
3083 >The astute administrator will realize from this that the
3084 combination of <TT
3085 CLASS="FILENAME"
3086 >pam_smbpass.so</TT
3089 CLASS="COMMAND"
3090 >winbindd</B
3091 >, and <B
3092 CLASS="COMMAND"
3093 >rsync</B
3094 > (see
3096 HREF="http://rsync.samba.org/"
3097 TARGET="_top"
3098 >http://rsync.samba.org/</A
3100 will allow the establishment of a centrally managed, distributed
3101 user/password database that can also be used by all
3102 PAM (eg: Linux) aware programs and applications. This arrangement
3103 can have particularly potent advantages compared with the
3104 use of Microsoft Active Directory Service (ADS) in so far as
3105 reduction of wide area network authentication traffic.</P
3106 ></DIV
3107 ><DIV
3108 CLASS="SECT1"
3109 ><HR><H1
3110 CLASS="SECT1"
3112 NAME="AEN504"
3113 >3.3. PAM Configuration in smb.conf</A
3114 ></H1
3116 >There is an option in smb.conf called <A
3117 HREF="smb.conf.5.html#OBEYPAMRESTRICTIONS"
3118 TARGET="_top"
3119 >obey pam restrictions</A
3121 The following is from the on-line help for this option in SWAT;</P
3123 >When Samba 2.2 is configure to enable PAM support (i.e.
3125 CLASS="CONSTANT"
3126 >--with-pam</TT
3127 >), this parameter will
3128 control whether or not Samba should obey PAM's account
3129 and session management directives. The default behavior
3130 is to use PAM for clear text authentication only and to
3131 ignore any account or session management. Note that Samba always
3132 ignores PAM for authentication in the case of
3134 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
3135 TARGET="_top"
3136 >encrypt passwords = yes</A
3138 The reason is that PAM modules cannot support the challenge/response
3139 authentication mechanism needed in the presence of SMB
3140 password encryption. </P
3142 >Default: <B
3143 CLASS="COMMAND"
3144 >obey pam restrictions = no</B
3145 ></P
3146 ></DIV
3147 ></DIV
3148 ><DIV
3149 CLASS="CHAPTER"
3150 ><HR><H1
3152 NAME="MSDFS"
3153 >Chapter 4. Hosting a Microsoft Distributed File System tree on Samba</A
3154 ></H1
3155 ><DIV
3156 CLASS="SECT1"
3157 ><H1
3158 CLASS="SECT1"
3160 NAME="AEN524"
3161 >4.1. Instructions</A
3162 ></H1
3164 >The Distributed File System (or Dfs) provides a means of
3165 separating the logical view of files and directories that users
3166 see from the actual physical locations of these resources on the
3167 network. It allows for higher availability, smoother storage expansion,
3168 load balancing etc. For more information about Dfs, refer to <A
3169 HREF="http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp"
3170 TARGET="_top"
3171 > Microsoft documentation</A
3172 >. </P
3174 >This document explains how to host a Dfs tree on a Unix
3175 machine (for Dfs-aware clients to browse) using Samba.</P
3177 >To enable SMB-based DFS for Samba, configure it with the
3179 CLASS="PARAMETER"
3181 >--with-msdfs</I
3182 ></TT
3183 > option. Once built, a
3184 Samba server can be made a Dfs server by setting the global
3185 boolean <A
3186 HREF="smb.conf.5.html#HOSTMSDFS"
3187 TARGET="_top"
3188 ><TT
3189 CLASS="PARAMETER"
3191 > host msdfs</I
3192 ></TT
3193 ></A
3194 > parameter in the <TT
3195 CLASS="FILENAME"
3196 >smb.conf
3197 </TT
3198 > file. You designate a share as a Dfs root using the share
3199 level boolean <A
3200 HREF="smb.conf.5.html#MSDFSROOT"
3201 TARGET="_top"
3202 ><TT
3203 CLASS="PARAMETER"
3205 > msdfs root</I
3206 ></TT
3207 ></A
3208 > parameter. A Dfs root directory on
3209 Samba hosts Dfs links in the form of symbolic links that point
3210 to other servers. For example, a symbolic link
3212 CLASS="FILENAME"
3213 >junction-&#62;msdfs:storage1\share1</TT
3214 > in
3215 the share directory acts as the Dfs junction. When Dfs-aware
3216 clients attempt to access the junction link, they are redirected
3217 to the storage location (in this case, \\storage1\share1).</P
3219 >Dfs trees on Samba work with all Dfs-aware clients ranging
3220 from Windows 95 to 2000.</P
3222 >Here's an example of setting up a Dfs tree on a Samba
3223 server.</P
3225 ><TABLE
3226 BORDER="0"
3227 BGCOLOR="#E0E0E0"
3228 WIDTH="100%"
3229 ><TR
3230 ><TD
3231 ><PRE
3232 CLASS="PROGRAMLISTING"
3233 ># The smb.conf file:
3234 [global]
3235 netbios name = SAMBA
3236 host msdfs = yes
3238 [dfs]
3239 path = /export/dfsroot
3240 msdfs root = yes
3241 </PRE
3242 ></TD
3243 ></TR
3244 ></TABLE
3245 ></P
3247 >In the /export/dfsroot directory we set up our dfs links to
3248 other servers on the network.</P
3250 ><TT
3251 CLASS="PROMPT"
3252 >root# </TT
3253 ><TT
3254 CLASS="USERINPUT"
3256 >cd /export/dfsroot</B
3257 ></TT
3258 ></P
3260 ><TT
3261 CLASS="PROMPT"
3262 >root# </TT
3263 ><TT
3264 CLASS="USERINPUT"
3266 >chown root /export/dfsroot</B
3267 ></TT
3268 ></P
3270 ><TT
3271 CLASS="PROMPT"
3272 >root# </TT
3273 ><TT
3274 CLASS="USERINPUT"
3276 >chmod 755 /export/dfsroot</B
3277 ></TT
3278 ></P
3280 ><TT
3281 CLASS="PROMPT"
3282 >root# </TT
3283 ><TT
3284 CLASS="USERINPUT"
3286 >ln -s msdfs:storageA\\shareA linka</B
3287 ></TT
3288 ></P
3290 ><TT
3291 CLASS="PROMPT"
3292 >root# </TT
3293 ><TT
3294 CLASS="USERINPUT"
3296 >ln -s msdfs:serverB\\share,serverC\\share linkb</B
3297 ></TT
3298 ></P
3300 >You should set up the permissions and ownership of
3301 the directory acting as the Dfs root such that only designated
3302 users can create, delete or modify the msdfs links. Also note
3303 that symlink names should be all lowercase. This limitation exists
3304 to have Samba avoid trying all the case combinations to get at
3305 the link name. Finally set up the symbolic links to point to the
3306 network shares you want, and start Samba.</P
3308 >Users on Dfs-aware clients can now browse the Dfs tree
3309 on the Samba server at \\samba\dfs. Accessing
3310 links linka or linkb (which appear as directories to the client)
3311 takes users directly to the appropriate shares on the network.</P
3312 ><DIV
3313 CLASS="SECT2"
3314 ><HR><H2
3315 CLASS="SECT2"
3317 NAME="AEN559"
3318 >4.1.1. Notes</A
3319 ></H2
3321 ></P
3322 ><UL
3323 ><LI
3325 >Windows clients need to be rebooted
3326 if a previously mounted non-dfs share is made a dfs
3327 root or vice versa. A better way is to introduce a
3328 new share and make it the dfs root.</P
3329 ></LI
3330 ><LI
3332 >Currently there's a restriction that msdfs
3333 symlink names should all be lowercase.</P
3334 ></LI
3335 ><LI
3337 >For security purposes, the directory
3338 acting as the root of the Dfs tree should have ownership
3339 and permissions set so that only designated users can
3340 modify the symbolic links in the directory.</P
3341 ></LI
3342 ></UL
3343 ></DIV
3344 ></DIV
3345 ></DIV
3346 ><DIV
3347 CLASS="CHAPTER"
3348 ><HR><H1
3350 NAME="UNIX-PERMISSIONS"
3351 >Chapter 5. UNIX Permission Bits and Windows NT Access Control Lists</A
3352 ></H1
3353 ><DIV
3354 CLASS="SECT1"
3355 ><H1
3356 CLASS="SECT1"
3358 NAME="AEN579"
3359 >5.1. Viewing and changing UNIX permissions using the NT
3360 security dialogs</A
3361 ></H1
3363 >New in the Samba 2.0.4 release is the ability for Windows
3364 NT clients to use their native security settings dialog box to
3365 view and modify the underlying UNIX permissions.</P
3367 >Note that this ability is careful not to compromise
3368 the security of the UNIX host Samba is running on, and
3369 still obeys all the file permission rules that a Samba
3370 administrator can set.</P
3372 >In Samba 2.0.4 and above the default value of the
3373 parameter <A
3374 HREF="smb.conf.5.html#NTACLSUPPORT"
3375 TARGET="_top"
3376 ><TT
3377 CLASS="PARAMETER"
3379 > nt acl support</I
3380 ></TT
3381 ></A
3382 > has been changed from
3384 CLASS="CONSTANT"
3385 >false</TT
3386 > to <TT
3387 CLASS="CONSTANT"
3388 >true</TT
3389 >, so
3390 manipulation of permissions is turned on by default.</P
3391 ></DIV
3392 ><DIV
3393 CLASS="SECT1"
3394 ><HR><H1
3395 CLASS="SECT1"
3397 NAME="AEN588"
3398 >5.2. How to view file security on a Samba share</A
3399 ></H1
3401 >From an NT 4.0 client, single-click with the right
3402 mouse button on any file or directory in a Samba mounted
3403 drive letter or UNC path. When the menu pops-up, click
3404 on the <EM
3405 >Properties</EM
3406 > entry at the bottom of
3407 the menu. This brings up the normal file properties dialog
3408 box, but with Samba 2.0.4 this will have a new tab along the top
3409 marked <EM
3410 >Security</EM
3411 >. Click on this tab and you
3412 will see three buttons, <EM
3413 >Permissions</EM
3416 >Auditing</EM
3417 >, and <EM
3418 >Ownership</EM
3420 The <EM
3421 >Auditing</EM
3422 > button will cause either
3423 an error message <SPAN
3424 CLASS="ERRORNAME"
3425 >A requested privilege is not held
3426 by the client</SPAN
3427 > to appear if the user is not the
3428 NT Administrator, or a dialog which is intended to allow an
3429 Administrator to add auditing requirements to a file if the
3430 user is logged on as the NT Administrator. This dialog is
3431 non-functional with a Samba share at this time, as the only
3432 useful button, the <B
3433 CLASS="COMMAND"
3434 >Add</B
3435 > button will not currently
3436 allow a list of users to be seen.</P
3437 ></DIV
3438 ><DIV
3439 CLASS="SECT1"
3440 ><HR><H1
3441 CLASS="SECT1"
3443 NAME="AEN599"
3444 >5.3. Viewing file ownership</A
3445 ></H1
3447 >Clicking on the <B
3448 CLASS="COMMAND"
3449 >"Ownership"</B
3450 > button
3451 brings up a dialog box telling you who owns the given file. The
3452 owner name will be of the form :</P
3455 CLASS="COMMAND"
3456 >"SERVER\user (Long name)"</B
3457 ></P
3459 >Where <TT
3460 CLASS="REPLACEABLE"
3462 >SERVER</I
3463 ></TT
3464 > is the NetBIOS name of
3465 the Samba server, <TT
3466 CLASS="REPLACEABLE"
3468 >user</I
3469 ></TT
3470 > is the user name of
3471 the UNIX user who owns the file, and <TT
3472 CLASS="REPLACEABLE"
3474 >(Long name)</I
3475 ></TT
3477 is the descriptive string identifying the user (normally found in the
3478 GECOS field of the UNIX password database). Click on the <B
3479 CLASS="COMMAND"
3480 >Close
3482 > button to remove this dialog.</P
3484 >If the parameter <TT
3485 CLASS="PARAMETER"
3487 >nt acl support</I
3488 ></TT
3490 is set to <TT
3491 CLASS="CONSTANT"
3492 >false</TT
3493 > then the file owner will
3494 be shown as the NT user <B
3495 CLASS="COMMAND"
3496 >"Everyone"</B
3497 >.</P
3499 >The <B
3500 CLASS="COMMAND"
3501 >Take Ownership</B
3502 > button will not allow
3503 you to change the ownership of this file to yourself (clicking on
3504 it will display a dialog box complaining that the user you are
3505 currently logged onto the NT client cannot be found). The reason
3506 for this is that changing the ownership of a file is a privileged
3507 operation in UNIX, available only to the <EM
3508 >root</EM
3510 user. As clicking on this button causes NT to attempt to change
3511 the ownership of a file to the current user logged into the NT
3512 client this will not work with Samba at this time.</P
3514 >There is an NT chown command that will work with Samba
3515 and allow a user with Administrator privilege connected
3516 to a Samba 2.0.4 server as root to change the ownership of
3517 files on both a local NTFS filesystem or remote mounted NTFS
3518 or Samba drive. This is available as part of the <EM
3519 >Seclib
3520 </EM
3521 > NT security library written by Jeremy Allison of
3522 the Samba Team, available from the main Samba ftp site.</P
3523 ></DIV
3524 ><DIV
3525 CLASS="SECT1"
3526 ><HR><H1
3527 CLASS="SECT1"
3529 NAME="AEN619"
3530 >5.4. Viewing file or directory permissions</A
3531 ></H1
3533 >The third button is the <B
3534 CLASS="COMMAND"
3535 >"Permissions"</B
3537 button. Clicking on this brings up a dialog box that shows both
3538 the permissions and the UNIX owner of the file or directory.
3539 The owner is displayed in the form :</P
3542 CLASS="COMMAND"
3543 >"SERVER\user (Long name)"</B
3544 ></P
3546 >Where <TT
3547 CLASS="REPLACEABLE"
3549 >SERVER</I
3550 ></TT
3551 > is the NetBIOS name of
3552 the Samba server, <TT
3553 CLASS="REPLACEABLE"
3555 >user</I
3556 ></TT
3557 > is the user name of
3558 the UNIX user who owns the file, and <TT
3559 CLASS="REPLACEABLE"
3561 >(Long name)</I
3562 ></TT
3564 is the descriptive string identifying the user (normally found in the
3565 GECOS field of the UNIX password database).</P
3567 >If the parameter <TT
3568 CLASS="PARAMETER"
3570 >nt acl support</I
3571 ></TT
3573 is set to <TT
3574 CLASS="CONSTANT"
3575 >false</TT
3576 > then the file owner will
3577 be shown as the NT user <B
3578 CLASS="COMMAND"
3579 >"Everyone"</B
3580 > and the
3581 permissions will be shown as NT "Full Control".</P
3583 >The permissions field is displayed differently for files
3584 and directories, so I'll describe the way file permissions
3585 are displayed first.</P
3586 ><DIV
3587 CLASS="SECT2"
3588 ><HR><H2
3589 CLASS="SECT2"
3591 NAME="AEN634"
3592 >5.4.1. File Permissions</A
3593 ></H2
3595 >The standard UNIX user/group/world triple and
3596 the corresponding "read", "write", "execute" permissions
3597 triples are mapped by Samba into a three element NT ACL
3598 with the 'r', 'w', and 'x' bits mapped into the corresponding
3599 NT permissions. The UNIX world permissions are mapped into
3600 the global NT group <B
3601 CLASS="COMMAND"
3602 >Everyone</B
3603 >, followed
3604 by the list of permissions allowed for UNIX world. The UNIX
3605 owner and group permissions are displayed as an NT
3607 CLASS="COMMAND"
3608 >user</B
3609 > icon and an NT <B
3610 CLASS="COMMAND"
3611 >local
3612 group</B
3613 > icon respectively followed by the list
3614 of permissions allowed for the UNIX user and group.</P
3616 >As many UNIX permission sets don't map into common
3617 NT names such as <B
3618 CLASS="COMMAND"
3619 >"read"</B
3620 >, <B
3621 CLASS="COMMAND"
3622 > "change"</B
3623 > or <B
3624 CLASS="COMMAND"
3625 >"full control"</B
3626 > then
3627 usually the permissions will be prefixed by the words <B
3628 CLASS="COMMAND"
3629 > "Special Access"</B
3630 > in the NT display list.</P
3632 >But what happens if the file has no permissions allowed
3633 for a particular UNIX user group or world component ? In order
3634 to allow "no permissions" to be seen and modified then Samba
3635 overloads the NT <B
3636 CLASS="COMMAND"
3637 >"Take Ownership"</B
3638 > ACL attribute
3639 (which has no meaning in UNIX) and reports a component with
3640 no permissions as having the NT <B
3641 CLASS="COMMAND"
3642 >"O"</B
3643 > bit set.
3644 This was chosen of course to make it look like a zero, meaning
3645 zero permissions. More details on the decision behind this will
3646 be given below.</P
3647 ></DIV
3648 ><DIV
3649 CLASS="SECT2"
3650 ><HR><H2
3651 CLASS="SECT2"
3653 NAME="AEN648"
3654 >5.4.2. Directory Permissions</A
3655 ></H2
3657 >Directories on an NT NTFS file system have two
3658 different sets of permissions. The first set of permissions
3659 is the ACL set on the directory itself, this is usually displayed
3660 in the first set of parentheses in the normal <B
3661 CLASS="COMMAND"
3662 >"RW"</B
3664 NT style. This first set of permissions is created by Samba in
3665 exactly the same way as normal file permissions are, described
3666 above, and is displayed in the same way.</P
3668 >The second set of directory permissions has no real meaning
3669 in the UNIX permissions world and represents the <B
3670 CLASS="COMMAND"
3671 > "inherited"</B
3672 > permissions that any file created within
3673 this directory would inherit.</P
3675 >Samba synthesises these inherited permissions for NT by
3676 returning as an NT ACL the UNIX permission mode that a new file
3677 created by Samba on this share would receive.</P
3678 ></DIV
3679 ></DIV
3680 ><DIV
3681 CLASS="SECT1"
3682 ><HR><H1
3683 CLASS="SECT1"
3685 NAME="AEN655"
3686 >5.5. Modifying file or directory permissions</A
3687 ></H1
3689 >Modifying file and directory permissions is as simple
3690 as changing the displayed permissions in the dialog box, and
3691 clicking the <B
3692 CLASS="COMMAND"
3693 >OK</B
3694 > button. However, there are
3695 limitations that a user needs to be aware of, and also interactions
3696 with the standard Samba permission masks and mapping of DOS
3697 attributes that need to also be taken into account.</P
3699 >If the parameter <TT
3700 CLASS="PARAMETER"
3702 >nt acl support</I
3703 ></TT
3705 is set to <TT
3706 CLASS="CONSTANT"
3707 >false</TT
3708 > then any attempt to set
3709 security permissions will fail with an <B
3710 CLASS="COMMAND"
3711 >"Access Denied"
3713 > message.</P
3715 >The first thing to note is that the <B
3716 CLASS="COMMAND"
3717 >"Add"</B
3719 button will not return a list of users in Samba 2.0.4 (it will give
3720 an error message of <B
3721 CLASS="COMMAND"
3722 >"The remote procedure call failed
3723 and did not execute"</B
3724 >). This means that you can only
3725 manipulate the current user/group/world permissions listed in
3726 the dialog box. This actually works quite well as these are the
3727 only permissions that UNIX actually has.</P
3729 >If a permission triple (either user, group, or world)
3730 is removed from the list of permissions in the NT dialog box,
3731 then when the <B
3732 CLASS="COMMAND"
3733 >"OK"</B
3734 > button is pressed it will
3735 be applied as "no permissions" on the UNIX side. If you then
3736 view the permissions again the "no permissions" entry will appear
3737 as the NT <B
3738 CLASS="COMMAND"
3739 >"O"</B
3740 > flag, as described above. This
3741 allows you to add permissions back to a file or directory once
3742 you have removed them from a triple component.</P
3744 >As UNIX supports only the "r", "w" and "x" bits of
3745 an NT ACL then if other NT security attributes such as "Delete
3746 access" are selected then they will be ignored when applied on
3747 the Samba server.</P
3749 >When setting permissions on a directory the second
3750 set of permissions (in the second set of parentheses) is
3751 by default applied to all files within that directory. If this
3752 is not what you want you must uncheck the <B
3753 CLASS="COMMAND"
3754 >"Replace
3755 permissions on existing files"</B
3756 > checkbox in the NT
3757 dialog before clicking <B
3758 CLASS="COMMAND"
3759 >"OK"</B
3760 >.</P
3762 >If you wish to remove all permissions from a
3763 user/group/world component then you may either highlight the
3764 component and click the <B
3765 CLASS="COMMAND"
3766 >"Remove"</B
3767 > button,
3768 or set the component to only have the special <B
3769 CLASS="COMMAND"
3770 >"Take
3771 Ownership"</B
3772 > permission (displayed as <B
3773 CLASS="COMMAND"
3774 >"O"
3776 >) highlighted.</P
3777 ></DIV
3778 ><DIV
3779 CLASS="SECT1"
3780 ><HR><H1
3781 CLASS="SECT1"
3783 NAME="AEN677"
3784 >5.6. Interaction with the standard Samba create mask
3785 parameters</A
3786 ></H1
3788 >Note that with Samba 2.0.5 there are four new parameters
3789 to control this interaction. These are :</P
3791 ><TT
3792 CLASS="PARAMETER"
3794 >security mask</I
3795 ></TT
3796 ></P
3798 ><TT
3799 CLASS="PARAMETER"
3801 >force security mode</I
3802 ></TT
3803 ></P
3805 ><TT
3806 CLASS="PARAMETER"
3808 >directory security mask</I
3809 ></TT
3810 ></P
3812 ><TT
3813 CLASS="PARAMETER"
3815 >force directory security mode</I
3816 ></TT
3817 ></P
3819 >Once a user clicks <B
3820 CLASS="COMMAND"
3821 >"OK"</B
3822 > to apply the
3823 permissions Samba maps the given permissions into a user/group/world
3824 r/w/x triple set, and then will check the changed permissions for a
3825 file against the bits set in the <A
3826 HREF="smb.conf.5.html#SECURITYMASK"
3827 TARGET="_top"
3830 CLASS="PARAMETER"
3832 >security mask</I
3833 ></TT
3834 ></A
3835 > parameter. Any bits that
3836 were changed that are not set to '1' in this parameter are left alone
3837 in the file permissions.</P
3839 >Essentially, zero bits in the <TT
3840 CLASS="PARAMETER"
3842 >security mask</I
3843 ></TT
3845 mask may be treated as a set of bits the user is <EM
3846 >not</EM
3848 allowed to change, and one bits are those the user is allowed to change.
3851 >If not set explicitly this parameter is set to the same value as
3852 the <A
3853 HREF="smb.conf.5.html#CREATEMASK"
3854 TARGET="_top"
3855 ><TT
3856 CLASS="PARAMETER"
3858 >create mask
3860 ></TT
3861 ></A
3862 > parameter to provide compatibility with Samba 2.0.4
3863 where this permission change facility was introduced. To allow a user to
3864 modify all the user/group/world permissions on a file, set this parameter
3865 to 0777.</P
3867 >Next Samba checks the changed permissions for a file against
3868 the bits set in the <A
3869 HREF="smb.conf.5.html#FORCESECURITYMODE"
3870 TARGET="_top"
3871 > <TT
3872 CLASS="PARAMETER"
3874 >force security mode</I
3875 ></TT
3876 ></A
3877 > parameter. Any bits
3878 that were changed that correspond to bits set to '1' in this parameter
3879 are forced to be set.</P
3881 >Essentially, bits set in the <TT
3882 CLASS="PARAMETER"
3884 >force security mode
3886 ></TT
3887 > parameter may be treated as a set of bits that, when
3888 modifying security on a file, the user has always set to be 'on'.</P
3890 >If not set explicitly this parameter is set to the same value
3891 as the <A
3892 HREF="smb.conf.5.html#FORCECREATEMODE"
3893 TARGET="_top"
3894 ><TT
3895 CLASS="PARAMETER"
3897 >force
3898 create mode</I
3899 ></TT
3900 ></A
3901 > parameter to provide compatibility
3902 with Samba 2.0.4 where the permission change facility was introduced.
3903 To allow a user to modify all the user/group/world permissions on a file
3904 with no restrictions set this parameter to 000.</P
3906 >The <TT
3907 CLASS="PARAMETER"
3909 >security mask</I
3910 ></TT
3911 > and <TT
3912 CLASS="PARAMETER"
3914 >force
3915 security mode</I
3916 ></TT
3917 > parameters are applied to the change
3918 request in that order.</P
3920 >For a directory Samba will perform the same operations as
3921 described above for a file except using the parameter <TT
3922 CLASS="PARAMETER"
3924 > directory security mask</I
3925 ></TT
3926 > instead of <TT
3927 CLASS="PARAMETER"
3929 >security
3930 mask</I
3931 ></TT
3932 >, and <TT
3933 CLASS="PARAMETER"
3935 >force directory security mode
3937 ></TT
3938 > parameter instead of <TT
3939 CLASS="PARAMETER"
3941 >force security mode
3943 ></TT
3944 >.</P
3946 >The <TT
3947 CLASS="PARAMETER"
3949 >directory security mask</I
3950 ></TT
3951 > parameter
3952 by default is set to the same value as the <TT
3953 CLASS="PARAMETER"
3955 >directory mask
3957 ></TT
3958 > parameter and the <TT
3959 CLASS="PARAMETER"
3961 >force directory security
3962 mode</I
3963 ></TT
3964 > parameter by default is set to the same value as
3965 the <TT
3966 CLASS="PARAMETER"
3968 >force directory mode</I
3969 ></TT
3970 > parameter to provide
3971 compatibility with Samba 2.0.4 where the permission change facility
3972 was introduced.</P
3974 >In this way Samba enforces the permission restrictions that
3975 an administrator can set on a Samba share, whilst still allowing users
3976 to modify the permission bits within that restriction.</P
3978 >If you want to set up a share that allows users full control
3979 in modifying the permission bits on their files and directories and
3980 doesn't force any particular bits to be set 'on', then set the following
3981 parameters in the <A
3982 HREF="smb.conf.5.html"
3983 TARGET="_top"
3984 ><TT
3985 CLASS="FILENAME"
3986 >smb.conf(5)
3987 </TT
3988 ></A
3989 > file in that share specific section :</P
3991 ><TT
3992 CLASS="PARAMETER"
3994 >security mask = 0777</I
3995 ></TT
3996 ></P
3998 ><TT
3999 CLASS="PARAMETER"
4001 >force security mode = 0</I
4002 ></TT
4003 ></P
4005 ><TT
4006 CLASS="PARAMETER"
4008 >directory security mask = 0777</I
4009 ></TT
4010 ></P
4012 ><TT
4013 CLASS="PARAMETER"
4015 >force directory security mode = 0</I
4016 ></TT
4017 ></P
4019 >As described, in Samba 2.0.4 the parameters :</P
4021 ><TT
4022 CLASS="PARAMETER"
4024 >create mask</I
4025 ></TT
4026 ></P
4028 ><TT
4029 CLASS="PARAMETER"
4031 >force create mode</I
4032 ></TT
4033 ></P
4035 ><TT
4036 CLASS="PARAMETER"
4038 >directory mask</I
4039 ></TT
4040 ></P
4042 ><TT
4043 CLASS="PARAMETER"
4045 >force directory mode</I
4046 ></TT
4047 ></P
4049 >were used instead of the parameters discussed here.</P
4050 ></DIV
4051 ><DIV
4052 CLASS="SECT1"
4053 ><HR><H1
4054 CLASS="SECT1"
4056 NAME="AEN741"
4057 >5.7. Interaction with the standard Samba file attribute
4058 mapping</A
4059 ></H1
4061 >Samba maps some of the DOS attribute bits (such as "read
4062 only") into the UNIX permissions of a file. This means there can
4063 be a conflict between the permission bits set via the security
4064 dialog and the permission bits set by the file attribute mapping.
4067 >One way this can show up is if a file has no UNIX read access
4068 for the owner it will show up as "read only" in the standard
4069 file attributes tabbed dialog. Unfortunately this dialog is
4070 the same one that contains the security info in another tab.</P
4072 >What this can mean is that if the owner changes the permissions
4073 to allow themselves read access using the security dialog, clicks
4075 CLASS="COMMAND"
4076 >"OK"</B
4077 > to get back to the standard attributes tab
4078 dialog, and then clicks <B
4079 CLASS="COMMAND"
4080 >"OK"</B
4081 > on that dialog, then
4082 NT will set the file permissions back to read-only (as that is what
4083 the attributes still say in the dialog). This means that after setting
4084 permissions and clicking <B
4085 CLASS="COMMAND"
4086 >"OK"</B
4087 > to get back to the
4088 attributes dialog you should always hit <B
4089 CLASS="COMMAND"
4090 >"Cancel"</B
4092 rather than <B
4093 CLASS="COMMAND"
4094 >"OK"</B
4095 > to ensure that your changes
4096 are not overridden.</P
4097 ></DIV
4098 ></DIV
4099 ><DIV
4100 CLASS="CHAPTER"
4101 ><HR><H1
4103 NAME="PRINTING"
4104 >Chapter 6. Printing Support in Samba 2.2.x</A
4105 ></H1
4106 ><DIV
4107 CLASS="SECT1"
4108 ><H1
4109 CLASS="SECT1"
4111 NAME="AEN762"
4112 >6.1. Introduction</A
4113 ></H1
4115 >Beginning with the 2.2.0 release, Samba supports
4116 the native Windows NT printing mechanisms implemented via
4117 MS-RPC (i.e. the SPOOLSS named pipe). Previous versions of
4118 Samba only supported LanMan printing calls.</P
4120 >The additional functionality provided by the new
4121 SPOOLSS support includes:</P
4123 ></P
4124 ><UL
4125 ><LI
4127 >Support for downloading printer driver
4128 files to Windows 95/98/NT/2000 clients upon demand.
4130 ></LI
4131 ><LI
4133 >Uploading of printer drivers via the
4134 Windows NT Add Printer Wizard (APW) or the
4135 Imprints tool set (refer to <A
4136 HREF="http://imprints.sourceforge.net"
4137 TARGET="_top"
4138 >http://imprints.sourceforge.net</A
4139 >).
4141 ></LI
4142 ><LI
4144 >Support for the native MS-RPC printing
4145 calls such as StartDocPrinter, EnumJobs(), etc... (See
4146 the MSDN documentation at <A
4147 HREF="http://msdn.microsoft.com/"
4148 TARGET="_top"
4149 >http://msdn.microsoft.com/</A
4151 for more information on the Win32 printing API)
4153 ></LI
4154 ><LI
4156 >Support for NT Access Control Lists (ACL)
4157 on printer objects</P
4158 ></LI
4159 ><LI
4161 >Improved support for printer queue manipulation
4162 through the use of an internal databases for spooled job
4163 information</P
4164 ></LI
4165 ></UL
4167 >There has been some initial confusion about what all this means
4168 and whether or not it is a requirement for printer drivers to be
4169 installed on a Samba host in order to support printing from Windows
4170 clients. A bug existed in Samba 2.2.0 which made Windows NT/2000 clients
4171 require that the Samba server possess a valid driver for the printer.
4172 This is fixed in Samba 2.2.1 and once again, Windows NT/2000 clients
4173 can use the local APW for installing drivers to be used with a Samba
4174 served printer. This is the same behavior exhibited by Windows 9x clients.
4175 As a side note, Samba does not use these drivers in any way to process
4176 spooled files. They are utilized entirely by the clients.</P
4178 >The following MS KB article, may be of some help if you are dealing with
4179 Windows 2000 clients: <EM
4180 >How to Add Printers with No User
4181 Interaction in Windows 2000</EM
4182 ></P
4185 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
4186 TARGET="_top"
4187 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
4188 ></P
4189 ></DIV
4190 ><DIV
4191 CLASS="SECT1"
4192 ><HR><H1
4193 CLASS="SECT1"
4195 NAME="AEN784"
4196 >6.2. Configuration</A
4197 ></H1
4198 ><DIV
4199 CLASS="WARNING"
4201 ></P
4202 ><TABLE
4203 CLASS="WARNING"
4204 BORDER="1"
4205 WIDTH="100%"
4206 ><TR
4207 ><TD
4208 ALIGN="CENTER"
4210 >[print$] vs. [printer$]</B
4211 ></TD
4212 ></TR
4213 ><TR
4214 ><TD
4215 ALIGN="LEFT"
4217 >Previous versions of Samba recommended using a share named [printer$].
4218 This name was taken from the printer$ service created by Windows 9x
4219 clients when a printer was shared. Windows 9x printer servers always have
4220 a printer$ service which provides read-only access via no
4221 password in order to support printer driver downloads.</P
4223 >However, the initial implementation allowed for a
4224 parameter named <TT
4225 CLASS="PARAMETER"
4227 >printer driver location</I
4228 ></TT
4230 to be used on a per share basis to specify the location of
4231 the driver files associated with that printer. Another
4232 parameter named <TT
4233 CLASS="PARAMETER"
4235 >printer driver</I
4236 ></TT
4237 > provided
4238 a means of defining the printer driver name to be sent to
4239 the client.</P
4241 >These parameters, including <TT
4242 CLASS="PARAMETER"
4244 >printer driver
4245 file</I
4246 ></TT
4247 > parameter, are being depreciated and should not
4248 be used in new installations. For more information on this change,
4249 you should refer to the <A
4250 HREF="#MIGRATION"
4251 >Migration section</A
4253 of this document.</P
4254 ></TD
4255 ></TR
4256 ></TABLE
4257 ></DIV
4258 ><DIV
4259 CLASS="SECT2"
4260 ><HR><H2
4261 CLASS="SECT2"
4263 NAME="AEN795"
4264 >6.2.1. Creating [print$]</A
4265 ></H2
4267 >In order to support the uploading of printer driver
4268 files, you must first configure a file share named [print$].
4269 The name of this share is hard coded in Samba's internals so
4270 the name is very important (print$ is the service used by
4271 Windows NT print servers to provide support for printer driver
4272 download).</P
4274 >You should modify the server's smb.conf file to add the global
4275 parameters and to create the
4276 following file share (of course, some of the parameter values,
4277 such as 'path' are arbitrary and should be replaced with
4278 appropriate values for your site):</P
4280 ><TABLE
4281 BORDER="0"
4282 BGCOLOR="#E0E0E0"
4283 WIDTH="100%"
4284 ><TR
4285 ><TD
4286 ><PRE
4287 CLASS="PROGRAMLISTING"
4288 >[global]
4289 ; members of the ntadmin group should be able
4290 ; to add drivers and set printer properties
4291 ; root is implicitly a 'printer admin'
4292 printer admin = @ntadmin
4294 [print$]
4295 path = /usr/local/samba/printers
4296 guest ok = yes
4297 browseable = yes
4298 read only = yes
4299 ; since this share is configured as read only, then we need
4300 ; a 'write list'. Check the file system permissions to make
4301 ; sure this account can copy files to the share. If this
4302 ; is setup to a non-root account, then it should also exist
4303 ; as a 'printer admin'
4304 write list = @ntadmin,root</PRE
4305 ></TD
4306 ></TR
4307 ></TABLE
4308 ></P
4310 >The <A
4311 HREF="smb.conf.5.html#WRITELIST"
4312 TARGET="_top"
4313 ><TT
4314 CLASS="PARAMETER"
4316 >write list</I
4317 ></TT
4318 ></A
4319 > is used to allow administrative
4320 level user accounts to have write access in order to update files
4321 on the share. See the <A
4322 HREF="smb.conf.5.html"
4323 TARGET="_top"
4324 >smb.conf(5)
4325 man page</A
4326 > for more information on configuring file shares.</P
4328 >The requirement for <A
4329 HREF="smb.conf.5.html#GUESTOK"
4330 TARGET="_top"
4332 CLASS="COMMAND"
4333 >guest
4334 ok = yes</B
4335 ></A
4336 > depends upon how your
4337 site is configured. If users will be guaranteed to have
4338 an account on the Samba host, then this is a non-issue.</P
4339 ><DIV
4340 CLASS="NOTE"
4341 ><BLOCKQUOTE
4342 CLASS="NOTE"
4345 >Author's Note: </B
4346 >The non-issue is that if all your Windows NT users are guaranteed to be
4347 authenticated by the Samba server (such as a domain member server and the NT
4348 user has already been validated by the Domain Controller in
4349 order to logon to the Windows NT console), then guest access
4350 is not necessary. Of course, in a workgroup environment where
4351 you just want to be able to print without worrying about
4352 silly accounts and security, then configure the share for
4353 guest access. You'll probably want to add <A
4354 HREF="smb.conf.5.html#MAPTOGUEST"
4355 TARGET="_top"
4357 CLASS="COMMAND"
4358 >map to guest = Bad User</B
4359 ></A
4360 > in the [global] section as well. Make sure
4361 you understand what this parameter does before using it
4362 though. --jerry</P
4363 ></BLOCKQUOTE
4364 ></DIV
4366 >In order for a Windows NT print server to support
4367 the downloading of driver files by multiple client architectures,
4368 it must create subdirectories within the [print$] service
4369 which correspond to each of the supported client architectures.
4370 Samba follows this model as well.</P
4372 >Next create the directory tree below the [print$] share
4373 for each architecture you wish to support.</P
4375 ><TABLE
4376 BORDER="0"
4377 BGCOLOR="#E0E0E0"
4378 WIDTH="100%"
4379 ><TR
4380 ><TD
4381 ><PRE
4382 CLASS="PROGRAMLISTING"
4383 >[print$]-----
4384 |-W32X86 ; "Windows NT x86"
4385 |-WIN40 ; "Windows 95/98"
4386 |-W32ALPHA ; "Windows NT Alpha_AXP"
4387 |-W32MIPS ; "Windows NT R4000"
4388 |-W32PPC ; "Windows NT PowerPC"</PRE
4389 ></TD
4390 ></TR
4391 ></TABLE
4392 ></P
4393 ><DIV
4394 CLASS="WARNING"
4396 ></P
4397 ><TABLE
4398 CLASS="WARNING"
4399 BORDER="1"
4400 WIDTH="100%"
4401 ><TR
4402 ><TD
4403 ALIGN="CENTER"
4405 >ATTENTION! REQUIRED PERMISSIONS</B
4406 ></TD
4407 ></TR
4408 ><TR
4409 ><TD
4410 ALIGN="LEFT"
4412 >In order to currently add a new driver to you Samba host,
4413 one of two conditions must hold true:</P
4415 ></P
4416 ><UL
4417 ><LI
4419 >The account used to connect to the Samba host
4420 must have a uid of 0 (i.e. a root account)</P
4421 ></LI
4422 ><LI
4424 >The account used to connect to the Samba host
4425 must be a member of the <A
4426 HREF="smb.conf.5.html#PRINTERADMIN"
4427 TARGET="_top"
4428 ><TT
4429 CLASS="PARAMETER"
4431 >printer
4432 admin</I
4433 ></TT
4434 ></A
4435 > list.</P
4436 ></LI
4437 ></UL
4439 >Of course, the connected account must still possess access
4440 to add files to the subdirectories beneath [print$]. Remember
4441 that all file shares are set to 'read only' by default.</P
4442 ></TD
4443 ></TR
4444 ></TABLE
4445 ></DIV
4447 >Once you have created the required [print$] service and
4448 associated subdirectories, simply log onto the Samba server using
4449 a root (or <TT
4450 CLASS="PARAMETER"
4452 >printer admin</I
4453 ></TT
4454 >) account
4455 from a Windows NT 4.0 client. Navigate to the "Printers" folder
4456 on the Samba server. You should see an initial listing of printers
4457 that matches the printer shares defined on your Samba host.</P
4458 ></DIV
4459 ><DIV
4460 CLASS="SECT2"
4461 ><HR><H2
4462 CLASS="SECT2"
4464 NAME="AEN830"
4465 >6.2.2. Setting Drivers for Existing Printers</A
4466 ></H2
4468 >The initial listing of printers in the Samba host's
4469 Printers folder will have no real printer driver assigned
4470 to them. By default, in Samba 2.2.0 this driver name was set to
4472 >NO PRINTER DRIVER AVAILABLE FOR THIS PRINTER</EM
4474 Later versions changed this to a NULL string to allow the use
4475 tof the local Add Printer Wizard on NT/2000 clients.
4476 Attempting to view the printer properties for a printer
4477 which has this default driver assigned will result in
4478 the error message:</P
4480 ><EM
4481 >Device settings cannot be displayed. The driver
4482 for the specified printer is not installed, only spooler
4483 properties will be displayed. Do you want to install the
4484 driver now?</EM
4485 ></P
4487 >Click "No" in the error dialog and you will be presented with
4488 the printer properties window. The way assign a driver to a
4489 printer is to either</P
4491 ></P
4492 ><UL
4493 ><LI
4495 >Use the "New Driver..." button to install
4496 a new printer driver, or</P
4497 ></LI
4498 ><LI
4500 >Select a driver from the popup list of
4501 installed drivers. Initially this list will be empty.</P
4502 ></LI
4503 ></UL
4505 >If you wish to install printer drivers for client
4506 operating systems other than "Windows NT x86", you will need
4507 to use the "Sharing" tab of the printer properties dialog.</P
4509 >Assuming you have connected with a root account, you
4510 will also be able modify other printer properties such as
4511 ACLs and device settings using this dialog box.</P
4513 >A few closing comments for this section, it is possible
4514 on a Windows NT print server to have printers
4515 listed in the Printers folder which are not shared. Samba does
4516 not make this distinction. By definition, the only printers of
4517 which Samba is aware are those which are specified as shares in
4519 CLASS="FILENAME"
4520 >smb.conf</TT
4521 >.</P
4523 >Another interesting side note is that Windows NT clients do
4524 not use the SMB printer share, but rather can print directly
4525 to any printer on another Windows NT host using MS-RPC. This
4526 of course assumes that the printing client has the necessary
4527 privileges on the remote host serving the printer. The default
4528 permissions assigned by Windows NT to a printer gives the "Print"
4529 permissions to the "Everyone" well-known group.</P
4530 ></DIV
4531 ><DIV
4532 CLASS="SECT2"
4533 ><HR><H2
4534 CLASS="SECT2"
4536 NAME="AEN847"
4537 >6.2.3. Support a large number of printers</A
4538 ></H2
4540 >One issue that has arisen during the development
4541 phase of Samba 2.2 is the need to support driver downloads for
4542 100's of printers. Using the Windows NT APW is somewhat
4543 awkward to say the list. If more than one printer are using the
4544 same driver, the <A
4545 HREF="rpcclient.1.html"
4546 TARGET="_top"
4548 CLASS="COMMAND"
4549 >rpcclient's
4550 setdriver command</B
4551 ></A
4552 > can be used to set the driver
4553 associated with an installed driver. The following is example
4554 of how this could be accomplished:</P
4556 ><TABLE
4557 BORDER="0"
4558 BGCOLOR="#E0E0E0"
4559 WIDTH="100%"
4560 ><TR
4561 ><TD
4562 ><PRE
4563 CLASS="PROGRAMLISTING"
4566 CLASS="PROMPT"
4567 >$ </TT
4568 >rpcclient pogo -U root%secret -c "enumdrivers"
4569 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4571 [Windows NT x86]
4572 Printer Driver Info 1:
4573 Driver Name: [HP LaserJet 4000 Series PS]
4575 Printer Driver Info 1:
4576 Driver Name: [HP LaserJet 2100 Series PS]
4578 Printer Driver Info 1:
4579 Driver Name: [HP LaserJet 4Si/4SiMX PS]
4582 CLASS="PROMPT"
4583 >$ </TT
4584 >rpcclient pogo -U root%secret -c "enumprinters"
4585 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4586 flags:[0x800000]
4587 name:[\\POGO\hp-print]
4588 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
4589 comment:[]
4592 CLASS="PROMPT"
4593 >$ </TT
4594 >rpcclient pogo -U root%secret \
4596 CLASS="PROMPT"
4597 >&#62; </TT
4598 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
4599 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4600 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
4601 ></TD
4602 ></TR
4603 ></TABLE
4604 ></P
4605 ></DIV
4606 ><DIV
4607 CLASS="SECT2"
4608 ><HR><H2
4609 CLASS="SECT2"
4611 NAME="AEN858"
4612 >6.2.4. Adding New Printers via the Windows NT APW</A
4613 ></H2
4615 >By default, Samba offers all printer shares defined in <TT
4616 CLASS="FILENAME"
4617 >smb.conf</TT
4619 in the "Printers..." folder. Also existing in this folder is the Windows NT
4620 Add Printer Wizard icon. The APW will be show only if</P
4622 ></P
4623 ><UL
4624 ><LI
4626 >The connected user is able to successfully
4627 execute an OpenPrinterEx(\\server) with administrative
4628 privileges (i.e. root or <TT
4629 CLASS="PARAMETER"
4631 >printer admin</I
4632 ></TT
4635 ></LI
4636 ><LI
4639 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
4640 TARGET="_top"
4641 ><TT
4642 CLASS="PARAMETER"
4644 >show
4645 add printer wizard = yes</I
4646 ></TT
4647 ></A
4648 > (the default).
4650 ></LI
4651 ></UL
4653 >In order to be able to use the APW to successfully add a printer to a Samba
4654 server, the <A
4655 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
4656 TARGET="_top"
4657 ><TT
4658 CLASS="PARAMETER"
4660 >add
4661 printer command</I
4662 ></TT
4663 ></A
4664 > must have a defined value. The program
4665 hook must successfully add the printer to the system (i.e.
4667 CLASS="FILENAME"
4668 >/etc/printcap</TT
4669 > or appropriate files) and
4671 CLASS="FILENAME"
4672 >smb.conf</TT
4673 > if necessary.</P
4675 >When using the APW from a client, if the named printer share does
4676 not exist, <B
4677 CLASS="COMMAND"
4678 >smbd</B
4679 > will execute the <TT
4680 CLASS="PARAMETER"
4682 >add printer
4683 command</I
4684 ></TT
4685 > and reparse to the <TT
4686 CLASS="FILENAME"
4687 >smb.conf</TT
4689 to attempt to locate the new printer share. If the share is still not defined,
4690 an error of "Access Denied" is returned to the client. Note that the
4692 CLASS="PARAMETER"
4694 >add printer program</I
4695 ></TT
4696 > is executed under the context
4697 of the connected user, not necessarily a root account.</P
4699 >There is a complementing <A
4700 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
4701 TARGET="_top"
4702 ><TT
4703 CLASS="PARAMETER"
4705 >delete
4706 printer command</I
4707 ></TT
4708 ></A
4709 > for removing entries from the "Printers..."
4710 folder.</P
4711 ></DIV
4712 ><DIV
4713 CLASS="SECT2"
4714 ><HR><H2
4715 CLASS="SECT2"
4717 NAME="AEN883"
4718 >6.2.5. Samba and Printer Ports</A
4719 ></H2
4721 >Windows NT/2000 print servers associate a port with each printer. These normally
4722 take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the
4723 concept of ports associated with a printer. By default, only one printer port,
4724 named "Samba Printer Port", exists on a system. Samba does not really a port in
4725 order to print, rather it is a requirement of Windows clients. </P
4727 >Note that Samba does not support the concept of "Printer Pooling" internally
4728 either. This is when a logical printer is assigned to multiple ports as
4729 a form of load balancing or fail over.</P
4731 >If you require that multiple ports be defined for some reason,
4733 CLASS="FILENAME"
4734 >smb.conf</TT
4735 > possesses a <A
4736 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
4737 TARGET="_top"
4738 ><TT
4739 CLASS="PARAMETER"
4741 >enumports
4742 command</I
4743 ></TT
4744 ></A
4745 > which can be used to define an external program
4746 that generates a listing of ports on a system.</P
4747 ></DIV
4748 ></DIV
4749 ><DIV
4750 CLASS="SECT1"
4751 ><HR><H1
4752 CLASS="SECT1"
4754 NAME="AEN891"
4755 >6.3. The Imprints Toolset</A
4756 ></H1
4758 >The Imprints tool set provides a UNIX equivalent of the
4759 Windows NT Add Printer Wizard. For complete information, please
4760 refer to the Imprints web site at <A
4761 HREF="http://imprints.sourceforge.net/"
4762 TARGET="_top"
4763 > http://imprints.sourceforge.net/</A
4764 > as well as the documentation
4765 included with the imprints source distribution. This section will
4766 only provide a brief introduction to the features of Imprints.</P
4767 ><DIV
4768 CLASS="SECT2"
4769 ><HR><H2
4770 CLASS="SECT2"
4772 NAME="AEN895"
4773 >6.3.1. What is Imprints?</A
4774 ></H2
4776 >Imprints is a collection of tools for supporting the goals
4777 of</P
4779 ></P
4780 ><UL
4781 ><LI
4783 >Providing a central repository information
4784 regarding Windows NT and 95/98 printer driver packages</P
4785 ></LI
4786 ><LI
4788 >Providing the tools necessary for creating
4789 the Imprints printer driver packages.</P
4790 ></LI
4791 ><LI
4793 >Providing an installation client which
4794 will obtain and install printer drivers on remote Samba
4795 and Windows NT 4 print servers.</P
4796 ></LI
4797 ></UL
4798 ></DIV
4799 ><DIV
4800 CLASS="SECT2"
4801 ><HR><H2
4802 CLASS="SECT2"
4804 NAME="AEN905"
4805 >6.3.2. Creating Printer Driver Packages</A
4806 ></H2
4808 >The process of creating printer driver packages is beyond
4809 the scope of this document (refer to Imprints.txt also included
4810 with the Samba distribution for more information). In short,
4811 an Imprints driver package is a gzipped tarball containing the
4812 driver files, related INF files, and a control file needed by the
4813 installation client.</P
4814 ></DIV
4815 ><DIV
4816 CLASS="SECT2"
4817 ><HR><H2
4818 CLASS="SECT2"
4820 NAME="AEN908"
4821 >6.3.3. The Imprints server</A
4822 ></H2
4824 >The Imprints server is really a database server that
4825 may be queried via standard HTTP mechanisms. Each printer
4826 entry in the database has an associated URL for the actual
4827 downloading of the package. Each package is digitally signed
4828 via GnuPG which can be used to verify that package downloaded
4829 is actually the one referred in the Imprints database. It is
4831 >not</EM
4832 > recommended that this security check
4833 be disabled.</P
4834 ></DIV
4835 ><DIV
4836 CLASS="SECT2"
4837 ><HR><H2
4838 CLASS="SECT2"
4840 NAME="AEN912"
4841 >6.3.4. The Installation Client</A
4842 ></H2
4844 >More information regarding the Imprints installation client
4845 is available in the <TT
4846 CLASS="FILENAME"
4847 >Imprints-Client-HOWTO.ps</TT
4849 file included with the imprints source package.</P
4851 >The Imprints installation client comes in two forms.</P
4853 ></P
4854 ><UL
4855 ><LI
4857 >a set of command line Perl scripts</P
4858 ></LI
4859 ><LI
4861 >a GTK+ based graphical interface to
4862 the command line perl scripts</P
4863 ></LI
4864 ></UL
4866 >The installation client (in both forms) provides a means
4867 of querying the Imprints database server for a matching
4868 list of known printer model names as well as a means to
4869 download and install the drivers on remote Samba and Windows
4870 NT print servers.</P
4872 >The basic installation process is in four steps and
4873 perl code is wrapped around <B
4874 CLASS="COMMAND"
4875 >smbclient</B
4877 and <B
4878 CLASS="COMMAND"
4879 >rpcclient</B
4880 >.</P
4882 ><TABLE
4883 BORDER="0"
4884 BGCOLOR="#E0E0E0"
4885 WIDTH="100%"
4886 ><TR
4887 ><TD
4888 ><PRE
4889 CLASS="PROGRAMLISTING"
4891 foreach (supported architecture for a given driver)
4893 1. rpcclient: Get the appropriate upload directory
4894 on the remote server
4895 2. smbclient: Upload the driver files
4896 3. rpcclient: Issues an AddPrinterDriver() MS-RPC
4899 4. rpcclient: Issue an AddPrinterEx() MS-RPC to actually
4900 create the printer</PRE
4901 ></TD
4902 ></TR
4903 ></TABLE
4904 ></P
4906 >One of the problems encountered when implementing
4907 the Imprints tool set was the name space issues between
4908 various supported client architectures. For example, Windows
4909 NT includes a driver named "Apple LaserWriter II NTX v51.8"
4910 and Windows 95 calls its version of this driver "Apple
4911 LaserWriter II NTX"</P
4913 >The problem is how to know what client drivers have
4914 been uploaded for a printer. As astute reader will remember
4915 that the Windows NT Printer Properties dialog only includes
4916 space for one printer driver name. A quick look in the
4917 Windows NT 4.0 system registry at</P
4919 ><TT
4920 CLASS="FILENAME"
4921 >HKLM\System\CurrentControlSet\Control\Print\Environment
4922 </TT
4923 ></P
4925 >will reveal that Windows NT always uses the NT driver
4926 name. This is ok as Windows NT always requires that at least
4927 the Windows NT version of the printer driver is present.
4928 However, Samba does not have the requirement internally.
4929 Therefore, how can you use the NT driver name if is has not
4930 already been installed?</P
4932 >The way of sidestepping this limitation is to require
4933 that all Imprints printer driver packages include both the Intel
4934 Windows NT and 95/98 printer drivers and that NT driver is
4935 installed first.</P
4936 ></DIV
4937 ></DIV
4938 ><DIV
4939 CLASS="SECT1"
4940 ><HR><H1
4941 CLASS="SECT1"
4943 NAME="AEN934"
4944 >6.4. <A
4945 NAME="MIGRATION"
4946 ></A
4947 >Migration to from Samba 2.0.x to 2.2.x</A
4948 ></H1
4950 >Given that printer driver management has changed (we hope improved) in
4951 2.2 over prior releases, migration from an existing setup to 2.2 can
4952 follow several paths.</P
4954 >Windows clients have a tendency to remember things for quite a while.
4955 For example, if a Windows NT client has attached to a Samba 2.0 server,
4956 it will remember the server as a LanMan printer server. Upgrading
4957 the Samba host to 2.2 makes support for MSRPC printing possible, but
4958 the NT client will still remember the previous setting.</P
4960 >In order to give an NT client printing "amnesia" (only necessary if you
4961 want to use the newer MSRPC printing functionality in Samba), delete
4962 the registry keys associated with the print server contained in
4964 CLASS="CONSTANT"
4965 >[HKLM\SYSTEM\CurrentControlSet\Control\Print]</TT
4966 >. The
4967 spooler service on the client should be stopped prior to doing this:</P
4969 ><TT
4970 CLASS="PROMPT"
4971 >C:\WINNT\ &#62;</TT
4972 > <TT
4973 CLASS="USERINPUT"
4975 >net stop spooler</B
4976 ></TT
4977 ></P
4979 ><EM
4980 >All the normal disclaimers about editing the registry go
4981 here.</EM
4982 > Be careful, and know what you are doing.</P
4984 >The spooler service should be restarted after you have finished
4985 removing the appropriate registry entries by replacing the
4987 CLASS="COMMAND"
4988 >stop</B
4989 > command above with <B
4990 CLASS="COMMAND"
4991 >start</B
4992 >.</P
4994 >Windows 9x clients will continue to use LanMan printing calls
4995 with a 2.2 Samba server so there is no need to perform any of these
4996 modifications on non-NT clients.</P
4997 ><DIV
4998 CLASS="WARNING"
5000 ></P
5001 ><TABLE
5002 CLASS="WARNING"
5003 BORDER="1"
5004 WIDTH="100%"
5005 ><TR
5006 ><TD
5007 ALIGN="CENTER"
5009 >Achtung!</B
5010 ></TD
5011 ></TR
5012 ><TR
5013 ><TD
5014 ALIGN="LEFT"
5016 >The following smb.conf parameters are considered to be depreciated and will
5017 be removed soon. Do not use them in new installations</P
5019 ></P
5020 ><UL
5021 ><LI
5023 ><TT
5024 CLASS="PARAMETER"
5026 >printer driver file (G)</I
5027 ></TT
5030 ></LI
5031 ><LI
5033 ><TT
5034 CLASS="PARAMETER"
5036 >printer driver (S)</I
5037 ></TT
5040 ></LI
5041 ><LI
5043 ><TT
5044 CLASS="PARAMETER"
5046 >printer driver location (S)</I
5047 ></TT
5050 ></LI
5051 ></UL
5052 ></TD
5053 ></TR
5054 ></TABLE
5055 ></DIV
5057 >Here are the possible scenarios for supporting migration:</P
5059 ></P
5060 ><UL
5061 ><LI
5063 >If you do not desire the new Windows NT
5064 print driver support, nothing needs to be done.
5065 All existing parameters work the same.</P
5066 ></LI
5067 ><LI
5069 >If you want to take advantage of NT printer
5070 driver support but do not want to migrate the
5071 9x drivers to the new setup, the leave the existing
5072 printers.def file. When smbd attempts to locate a
5073 9x driver for the printer in the TDB and fails it
5074 will drop down to using the printers.def (and all
5075 associated parameters). The <B
5076 CLASS="COMMAND"
5077 >make_printerdef</B
5079 tool will also remain for backwards compatibility but will
5080 be moved to the "this tool is the old way of doing it"
5081 pile.</P
5082 ></LI
5083 ><LI
5085 >If you install a Windows 9x driver for a printer
5086 on your Samba host (in the printing TDB), this information will
5087 take precedence and the three old printing parameters
5088 will be ignored (including print driver location).</P
5089 ></LI
5090 ><LI
5092 >If you want to migrate an existing <TT
5093 CLASS="FILENAME"
5094 >printers.def</TT
5096 file into the new setup, the current only solution is to use the Windows
5097 NT APW to install the NT drivers and the 9x drivers. This can be scripted
5098 using <B
5099 CLASS="COMMAND"
5100 >smbclient</B
5101 > and <B
5102 CLASS="COMMAND"
5103 >rpcclient</B
5104 >. See the
5105 Imprints installation client at <A
5106 HREF="http://imprints.sourceforge.net/"
5107 TARGET="_top"
5108 >http://imprints.sourceforge.net/</A
5110 for an example.
5112 ></LI
5113 ></UL
5114 ></DIV
5115 ></DIV
5116 ><DIV
5117 CLASS="CHAPTER"
5118 ><HR><H1
5120 NAME="DOMAIN-SECURITY"
5121 >Chapter 7. security = domain in Samba 2.x</A
5122 ></H1
5123 ><DIV
5124 CLASS="SECT1"
5125 ><H1
5126 CLASS="SECT1"
5128 NAME="AEN996"
5129 >7.1. Joining an NT Domain with Samba 2.2</A
5130 ></H1
5132 >In order for a Samba-2 server to join an NT domain,
5133 you must first add the NetBIOS name of the Samba server to the
5134 NT domain on the PDC using Server Manager for Domains. This creates
5135 the machine account in the domain (PDC) SAM. Note that you should
5136 add the Samba server as a "Windows NT Workstation or Server",
5138 >NOT</EM
5139 > as a Primary or backup domain controller.</P
5141 >Assume you have a Samba-2 server with a NetBIOS name of
5143 CLASS="CONSTANT"
5144 >SERV1</TT
5145 > and are joining an NT domain called
5147 CLASS="CONSTANT"
5148 >DOM</TT
5149 >, which has a PDC with a NetBIOS name
5150 of <TT
5151 CLASS="CONSTANT"
5152 >DOMPDC</TT
5153 > and two backup domain controllers
5154 with NetBIOS names <TT
5155 CLASS="CONSTANT"
5156 >DOMBDC1</TT
5157 > and <TT
5158 CLASS="CONSTANT"
5159 >DOMBDC2
5160 </TT
5161 >.</P
5163 >In order to join the domain, first stop all Samba daemons
5164 and run the command:</P
5166 ><TT
5167 CLASS="PROMPT"
5168 >root# </TT
5169 ><TT
5170 CLASS="USERINPUT"
5172 >smbpasswd -j DOM -r DOMPDC
5174 ></TT
5175 ></P
5177 >as we are joining the domain DOM and the PDC for that domain
5178 (the only machine that has write access to the domain SAM database)
5179 is DOMPDC. If this is successful you will see the message:</P
5181 ><TT
5182 CLASS="COMPUTEROUTPUT"
5183 >smbpasswd: Joined domain DOM.</TT
5187 >in your terminal window. See the <A
5188 HREF="smbpasswd.8.html"
5189 TARGET="_top"
5190 > smbpasswd(8)</A
5191 > man page for more details.</P
5193 >There is existing development code to join a domain
5194 without having to create the machine trust account on the PDC
5195 beforehand. This code will hopefully be available soon
5196 in release branches as well.</P
5198 >This command goes through the machine account password
5199 change protocol, then writes the new (random) machine account
5200 password for this Samba server into a file in the same directory
5201 in which an smbpasswd file would be stored - normally :</P
5203 ><TT
5204 CLASS="FILENAME"
5205 >/usr/local/samba/private</TT
5206 ></P
5208 >In Samba 2.0.x, the filename looks like this:</P
5210 ><TT
5211 CLASS="FILENAME"
5212 ><TT
5213 CLASS="REPLACEABLE"
5215 >&#60;NT DOMAIN NAME&#62;</I
5216 ></TT
5217 >.<TT
5218 CLASS="REPLACEABLE"
5220 >&#60;Samba
5221 Server Name&#62;</I
5222 ></TT
5223 >.mac</TT
5224 ></P
5226 >The <TT
5227 CLASS="FILENAME"
5228 >.mac</TT
5229 > suffix stands for machine account
5230 password file. So in our example above, the file would be called:</P
5232 ><TT
5233 CLASS="FILENAME"
5234 >DOM.SERV1.mac</TT
5235 ></P
5237 >In Samba 2.2, this file has been replaced with a TDB
5238 (Trivial Database) file named <TT
5239 CLASS="FILENAME"
5240 >secrets.tdb</TT
5244 >This file is created and owned by root and is not
5245 readable by any other user. It is the key to the domain-level
5246 security for your system, and should be treated as carefully
5247 as a shadow password file.</P
5249 >Now, before restarting the Samba daemons you must
5250 edit your <A
5251 HREF="smb.conf.5.html"
5252 TARGET="_top"
5253 ><TT
5254 CLASS="FILENAME"
5255 >smb.conf(5)</TT
5258 > file to tell Samba it should now use domain security.</P
5260 >Change (or add) your <A
5261 HREF="smb.conf.5.html#SECURITY"
5262 TARGET="_top"
5263 > <TT
5264 CLASS="PARAMETER"
5266 >security =</I
5267 ></TT
5268 ></A
5269 > line in the [global] section
5270 of your smb.conf to read:</P
5273 CLASS="COMMAND"
5274 >security = domain</B
5275 ></P
5277 >Next change the <A
5278 HREF="smb.conf.5.html#WORKGROUP"
5279 TARGET="_top"
5280 ><TT
5281 CLASS="PARAMETER"
5283 > workgroup =</I
5284 ></TT
5285 ></A
5286 > line in the [global] section to read: </P
5289 CLASS="COMMAND"
5290 >workgroup = DOM</B
5291 ></P
5293 >as this is the name of the domain we are joining. </P
5295 >You must also have the parameter <A
5296 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
5297 TARGET="_top"
5298 > <TT
5299 CLASS="PARAMETER"
5301 >encrypt passwords</I
5302 ></TT
5303 ></A
5304 > set to <TT
5305 CLASS="CONSTANT"
5306 >yes
5307 </TT
5308 > in order for your users to authenticate to the NT PDC.</P
5310 >Finally, add (or modify) a <A
5311 HREF="smb.conf.5.html#PASSWORDSERVER"
5312 TARGET="_top"
5313 > <TT
5314 CLASS="PARAMETER"
5316 >password server =</I
5317 ></TT
5318 ></A
5319 > line in the [global]
5320 section to read: </P
5323 CLASS="COMMAND"
5324 >password server = DOMPDC DOMBDC1 DOMBDC2</B
5325 ></P
5327 >These are the primary and backup domain controllers Samba
5328 will attempt to contact in order to authenticate users. Samba will
5329 try to contact each of these servers in order, so you may want to
5330 rearrange this list in order to spread out the authentication load
5331 among domain controllers.</P
5333 >Alternatively, if you want smbd to automatically determine
5334 the list of Domain controllers to use for authentication, you may
5335 set this line to be :</P
5338 CLASS="COMMAND"
5339 >password server = *</B
5340 ></P
5342 >This method, which was introduced in Samba 2.0.6,
5343 allows Samba to use exactly the same mechanism that NT does. This
5344 method either broadcasts or uses a WINS database in order to
5345 find domain controllers to authenticate against.</P
5347 >Finally, restart your Samba daemons and get ready for
5348 clients to begin using domain security!</P
5349 ></DIV
5350 ><DIV
5351 CLASS="SECT1"
5352 ><HR><H1
5353 CLASS="SECT1"
5355 NAME="AEN1060"
5356 >7.2. Samba and Windows 2000 Domains</A
5357 ></H1
5359 >Many people have asked regarding the state of Samba's ability to participate in
5360 a Windows 2000 Domain. Samba 2.2 is able to act as a member server of a Windows
5361 2000 domain operating in mixed or native mode.</P
5363 >There is much confusion between the circumstances that require a "mixed" mode
5364 Win2k DC and a when this host can be switched to "native" mode. A "mixed" mode
5365 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
5366 domain. By default, a Win2k DC in "native" mode will still support
5367 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and
5368 NT 4.0. Samba has the same requirements as a Windows NT 4.0 member server.</P
5370 >The steps for adding a Samba 2.2 host to a Win2k domain are the same as those
5371 for adding a Samba server to a Windows NT 4.0 domain. The only exception is that
5372 the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and
5373 Computers" MMC (Microsoft Management Console) plugin.</P
5374 ></DIV
5375 ><DIV
5376 CLASS="SECT1"
5377 ><HR><H1
5378 CLASS="SECT1"
5380 NAME="AEN1065"
5381 >7.3. Why is this better than security = server?</A
5382 ></H1
5384 >Currently, domain security in Samba doesn't free you from
5385 having to create local Unix users to represent the users attaching
5386 to your server. This means that if domain user <TT
5387 CLASS="CONSTANT"
5388 >DOM\fred
5389 </TT
5390 > attaches to your domain security Samba server, there needs
5391 to be a local Unix user fred to represent that user in the Unix
5392 filesystem. This is very similar to the older Samba security mode
5394 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
5395 TARGET="_top"
5396 >security = server</A
5398 where Samba would pass through the authentication request to a Windows
5399 NT server in the same way as a Windows 95 or Windows 98 server would.
5402 >Please refer to the <A
5403 HREF="winbind.html"
5404 TARGET="_top"
5405 >Winbind
5406 paper</A
5407 > for information on a system to automatically
5408 assign UNIX uids and gids to Windows NT Domain users and groups.
5409 This code is available in development branches only at the moment,
5410 but will be moved to release branches soon.</P
5412 >The advantage to domain-level security is that the
5413 authentication in domain-level security is passed down the authenticated
5414 RPC channel in exactly the same way that an NT server would do it. This
5415 means Samba servers now participate in domain trust relationships in
5416 exactly the same way NT servers do (i.e., you can add Samba servers into
5417 a resource domain and have the authentication passed on from a resource
5418 domain PDC to an account domain PDC.</P
5420 >In addition, with <B
5421 CLASS="COMMAND"
5422 >security = server</B
5423 > every Samba
5424 daemon on a server has to keep a connection open to the
5425 authenticating server for as long as that daemon lasts. This can drain
5426 the connection resources on a Microsoft NT server and cause it to run
5427 out of available connections. With <B
5428 CLASS="COMMAND"
5429 >security = domain</B
5431 however, the Samba daemons connect to the PDC/BDC only for as long
5432 as is necessary to authenticate the user, and then drop the connection,
5433 thus conserving PDC connection resources.</P
5435 >And finally, acting in the same manner as an NT server
5436 authenticating to a PDC means that as part of the authentication
5437 reply, the Samba server gets the user identification information such
5438 as the user SID, the list of NT groups the user belongs to, etc. All
5439 this information will allow Samba to be extended in the future into
5440 a mode the developers currently call appliance mode. In this mode,
5441 no local Unix users will be necessary, and Samba will generate Unix
5442 uids and gids from the information passed back from the PDC when a
5443 user is authenticated, making a Samba server truly plug and play
5444 in an NT domain environment. Watch for this code soon.</P
5446 ><EM
5447 >NOTE:</EM
5448 > Much of the text of this document
5449 was first published in the Web magazine <A
5450 HREF="http://www.linuxworld.com"
5451 TARGET="_top"
5453 LinuxWorld</A
5454 > as the article <A
5455 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
5456 TARGET="_top"
5457 >Doing
5458 the NIS/NT Samba</A
5459 >.</P
5460 ></DIV
5461 ></DIV
5462 ><DIV
5463 CLASS="CHAPTER"
5464 ><HR><H1
5466 NAME="SAMBA-PDC"
5467 >Chapter 8. How to Configure Samba 2.2 as a Primary Domain Controller</A
5468 ></H1
5469 ><DIV
5470 CLASS="SECT1"
5471 ><H1
5472 CLASS="SECT1"
5474 NAME="AEN1098"
5475 >8.1. Prerequisite Reading</A
5476 ></H1
5478 >Before you continue reading in this chapter, please make sure
5479 that you are comfortable with configuring basic files services
5480 in smb.conf and how to enable and administer password
5481 encryption in Samba. Theses two topics are covered in the
5483 HREF="smb.conf.5.html"
5484 TARGET="_top"
5485 ><TT
5486 CLASS="FILENAME"
5487 >smb.conf(5)</TT
5488 ></A
5490 manpage and the <A
5491 HREF="ENCRYPTION.html"
5492 TARGET="_top"
5493 >Encryption chapter</A
5495 of this HOWTO Collection.</P
5496 ></DIV
5497 ><DIV
5498 CLASS="SECT1"
5499 ><HR><H1
5500 CLASS="SECT1"
5502 NAME="AEN1104"
5503 >8.2. Background</A
5504 ></H1
5505 ><DIV
5506 CLASS="NOTE"
5507 ><BLOCKQUOTE
5508 CLASS="NOTE"
5511 >Note: </B
5512 ><EM
5513 >Author's Note :</EM
5514 > This document is a combination
5515 of David Bannon's Samba 2.2 PDC HOWTO and the Samba NT Domain FAQ.
5516 Both documents are superseded by this one.</P
5517 ></BLOCKQUOTE
5518 ></DIV
5520 >Version of Samba prior to release 2.2 had marginal capabilities to
5521 act as a Windows NT 4.0 Primary DOmain Controller (PDC). Beginning with
5522 Samba 2.2.0, we are proud to announce official support for Windows NT 4.0
5523 style domain logons from Windows NT 4.0 (through SP6) and Windows 2000 (through
5524 SP1) clients. This article outlines the steps necessary for configuring Samba
5525 as a PDC. It is necessary to have a working Samba server prior to implementing the
5526 PDC functionality. If you have not followed the steps outlined in
5528 HREF="UNIX_INSTALL.html"
5529 TARGET="_top"
5530 > UNIX_INSTALL.html</A
5531 >, please make sure
5532 that your server is configured correctly before proceeding. Another good
5533 resource in the <A
5534 HREF="smb.conf.5.html"
5535 TARGET="_top"
5536 >smb.conf(5) man
5537 page</A
5538 >. The following functionality should work in 2.2:</P
5540 ></P
5541 ><UL
5542 ><LI
5544 > domain logons for Windows NT 4.0/2000 clients.
5546 ></LI
5547 ><LI
5549 > placing a Windows 9x client in user level security
5551 ></LI
5552 ><LI
5554 > retrieving a list of users and groups from a Samba PDC to
5555 Windows 9x/NT/2000 clients
5557 ></LI
5558 ><LI
5560 > roving (roaming) user profiles
5562 ></LI
5563 ><LI
5565 > Windows NT 4.0 style system policies
5567 ></LI
5568 ></UL
5569 ><DIV
5570 CLASS="WARNING"
5572 ></P
5573 ><TABLE
5574 CLASS="WARNING"
5575 BORDER="1"
5576 WIDTH="100%"
5577 ><TR
5578 ><TD
5579 ALIGN="CENTER"
5581 >Windows 2000 Service Pack 2 Clients</B
5582 ></TD
5583 ></TR
5584 ><TR
5585 ><TD
5586 ALIGN="LEFT"
5588 > Samba 2.2.1 is required for PDC functionality when using Windows 2000
5589 SP2 clients.
5591 ></TD
5592 ></TR
5593 ></TABLE
5594 ></DIV
5596 >The following pieces of functionality are not included in the 2.2 release:</P
5598 ></P
5599 ><UL
5600 ><LI
5602 > Windows NT 4 domain trusts
5604 ></LI
5605 ><LI
5607 > SAM replication with Windows NT 4.0 Domain Controllers
5608 (i.e. a Samba PDC and a Windows NT BDC or vice versa)
5610 ></LI
5611 ><LI
5613 > Adding users via the User Manager for Domains
5615 ></LI
5616 ><LI
5618 > Acting as a Windows 2000 Domain Controller (i.e. Kerberos and
5619 Active Directory)
5621 ></LI
5622 ></UL
5624 >Please note that Windows 9x clients are not true members of a domain
5625 for reasons outlined in this article. Therefore the protocol for
5626 support Windows 9x style domain logons is completely different
5627 from NT4 domain logons and has been officially supported for some
5628 time.</P
5630 >Implementing a Samba PDC can basically be divided into 2 broad
5631 steps.</P
5633 ></P
5634 ><OL
5635 TYPE="1"
5636 ><LI
5638 > Configuring the Samba PDC
5640 ></LI
5641 ><LI
5643 > Creating machine trust accounts and joining clients
5644 to the domain
5646 ></LI
5647 ></OL
5649 >There are other minor details such as user profiles, system
5650 policies, etc... However, these are not necessarily specific
5651 to a Samba PDC as much as they are related to Windows NT networking
5652 concepts. They will be mentioned only briefly here.</P
5653 ></DIV
5654 ><DIV
5655 CLASS="SECT1"
5656 ><HR><H1
5657 CLASS="SECT1"
5659 NAME="AEN1146"
5660 >8.3. Configuring the Samba Domain Controller</A
5661 ></H1
5663 >The first step in creating a working Samba PDC is to
5664 understand the parameters necessary in smb.conf. I will not
5665 attempt to re-explain the parameters here as they are more that
5666 adequately covered in <A
5667 HREF="smb.conf.5.html"
5668 TARGET="_top"
5669 > the smb.conf
5670 man page</A
5671 >. For convenience, the parameters have been
5672 linked with the actual smb.conf description.</P
5674 >Here is an example smb.conf for acting as a PDC:</P
5676 ><TABLE
5677 BORDER="0"
5678 BGCOLOR="#E0E0E0"
5679 WIDTH="100%"
5680 ><TR
5681 ><TD
5682 ><PRE
5683 CLASS="PROGRAMLISTING"
5684 >[global]
5685 ; Basic server settings
5687 HREF="smb.conf.5.html#NETBIOSNAME"
5688 TARGET="_top"
5689 >netbios name</A
5690 > = <TT
5691 CLASS="REPLACEABLE"
5693 >POGO</I
5694 ></TT
5697 HREF="smb.conf.5.html#WORKGROUP"
5698 TARGET="_top"
5699 >workgroup</A
5700 > = <TT
5701 CLASS="REPLACEABLE"
5703 >NARNIA</I
5704 ></TT
5707 ; we should act as the domain and local master browser
5709 HREF="smb.conf.5.html#OSLEVEL"
5710 TARGET="_top"
5711 >os level</A
5712 > = 64
5714 HREF="smb.conf.5.html#PERFERREDMASTER"
5715 TARGET="_top"
5716 >preferred master</A
5717 > = yes
5719 HREF="smb.conf.5.html#DOMAINMASTER"
5720 TARGET="_top"
5721 >domain master</A
5722 > = yes
5724 HREF="smb.conf.5.html#LOCALMASTER"
5725 TARGET="_top"
5726 >local master</A
5727 > = yes
5729 ; security settings (must user security = user)
5731 HREF="smb.conf.5.html#SECURITYEQUALSUSER"
5732 TARGET="_top"
5733 >security</A
5734 > = user
5736 ; encrypted passwords are a requirement for a PDC
5738 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
5739 TARGET="_top"
5740 >encrypt passwords</A
5741 > = yes
5743 ; support domain logons
5745 HREF="smb.conf.5.html#DOMAINLOGONS"
5746 TARGET="_top"
5747 >domain logons</A
5748 > = yes
5750 ; where to store user profiles?
5752 HREF="smb.conf.5.html#LOGONPATH"
5753 TARGET="_top"
5754 >logon path</A
5755 > = \\%N\profiles\%u
5757 ; where is a user's home directory and where should it
5758 ; be mounted at?
5760 HREF="smb.conf.5.html#LOGONDRIVE"
5761 TARGET="_top"
5762 >logon drive</A
5763 > = H:
5765 HREF="smb.conf.5.html#LOGONHOME"
5766 TARGET="_top"
5767 >logon home</A
5768 > = \\homeserver\%u
5770 ; specify a generic logon script for all users
5771 ; this is a relative **DOS** path to the [netlogon] share
5773 HREF="smb.conf.5.html#LOGONSCRIPT"
5774 TARGET="_top"
5775 >logon script</A
5776 > = logon.cmd
5778 ; necessary share for domain controller
5779 [netlogon]
5781 HREF="smb.conf.5.html#PATH"
5782 TARGET="_top"
5783 >path</A
5784 > = /usr/local/samba/lib/netlogon
5786 HREF="smb.conf.5.html#WRITEABLE"
5787 TARGET="_top"
5788 >writeable</A
5789 > = no
5791 HREF="smb.conf.5.html#WRITELIST"
5792 TARGET="_top"
5793 >write list</A
5794 > = <TT
5795 CLASS="REPLACEABLE"
5797 >ntadmin</I
5798 ></TT
5801 ; share for storing user profiles
5802 [profiles]
5804 HREF="smb.conf.5.html#PATH"
5805 TARGET="_top"
5806 >path</A
5807 > = /export/smb/ntprofile
5809 HREF="smb.conf.5.html#WRITEABLE"
5810 TARGET="_top"
5811 >writeable</A
5812 > = yes
5814 HREF="smb.conf.5.html#CREATEMASK"
5815 TARGET="_top"
5816 >create mask</A
5817 > = 0600
5819 HREF="smb.conf.5.html#DIRECTORYMASK"
5820 TARGET="_top"
5821 >directory mask</A
5822 > = 0700</PRE
5823 ></TD
5824 ></TR
5825 ></TABLE
5826 ></P
5828 >There are a couple of points to emphasize in the above configuration.</P
5830 ></P
5831 ><UL
5832 ><LI
5834 > Encrypted passwords must be enabled. For more details on how
5835 to do this, refer to <A
5836 HREF="ENCRYPTION.html"
5837 TARGET="_top"
5838 >ENCRYPTION.html</A
5841 ></LI
5842 ><LI
5844 > The server must support domain logons and a
5846 CLASS="FILENAME"
5847 >[netlogon]</TT
5848 > share
5850 ></LI
5851 ><LI
5853 > The server must be the domain master browser in order for Windows
5854 client to locate the server as a DC. Please refer to the various
5855 Network Browsing documentation included with this distribution for
5856 details.
5858 ></LI
5859 ></UL
5861 >As Samba 2.2 does not offer a complete implementation of group mapping between
5862 Windows NT groups and UNIX groups (this is really quite complicated to explain
5863 in a short space), you should refer to the <A
5864 HREF="smb.conf.5.html#DOMAINADMINUSERS"
5865 TARGET="_top"
5866 >domain
5867 admin users</A
5868 > and <A
5869 HREF="smb.conf.5.html#DOMAINADMINGROUP"
5870 TARGET="_top"
5871 >domain
5872 admin group</A
5873 > smb.conf parameters for information of creating a Domain Admins
5874 style accounts.</P
5875 ></DIV
5876 ><DIV
5877 CLASS="SECT1"
5878 ><HR><H1
5879 CLASS="SECT1"
5881 NAME="AEN1189"
5882 >8.4. Creating Machine Trust Accounts and Joining Clients
5883 to the Domain</A
5884 ></H1
5886 >A machine trust account is a samba user account owned by a computer.
5887 The account password acts as the shared secret for secure
5888 communication with the Domain Controller. This is a security feature
5889 to prevent an unauthorized machine with the same NetBIOS name from
5890 joining the domain and gaining access to domain user/group accounts.
5891 Hence a Windows 9x host is never a true member of a domain because it does
5892 not posses a machine trust account, and thus has no shared secret with the DC.</P
5894 >On a Windows NT PDC, these machine trust account passwords are stored
5895 in the registry. A Samba PDC stores these accounts in the same location
5896 as user LanMan and NT password hashes (currently <TT
5897 CLASS="FILENAME"
5898 >smbpasswd</TT
5900 However, machine trust accounts only possess and use the NT password hash.</P
5902 >Because Samba requires machine accounts to possess a UNIX uid from
5903 which an Windows NT SID can be generated, all of these accounts
5904 must have an entry in <TT
5905 CLASS="FILENAME"
5906 >/etc/passwd</TT
5907 > and smbpasswd.
5908 Future releases will alleviate the need to create
5910 CLASS="FILENAME"
5911 >/etc/passwd</TT
5912 > entries. </P
5914 >There are two means of creating machine trust accounts.</P
5916 ></P
5917 ><UL
5918 ><LI
5920 > Manual creation before joining the client to the domain. In this case,
5921 the password is set to a known value -- the lower case of the
5922 machine's NetBIOS name.
5924 ></LI
5925 ><LI
5927 > Creation of the account at the time of joining the domain. In
5928 this case, the session key of the administrative account used to join
5929 the client to the domain acts as an encryption key for setting the
5930 password to a random value (This is the recommended method).
5932 ></LI
5933 ></UL
5934 ><DIV
5935 CLASS="SECT2"
5936 ><HR><H2
5937 CLASS="SECT2"
5939 NAME="AEN1203"
5940 >8.4.1. Manually creating machine trust accounts</A
5941 ></H2
5943 >The first step in creating a machine trust account by hand is to
5944 create an entry for the machine in /etc/passwd. This can be done
5945 using <B
5946 CLASS="COMMAND"
5947 >vipw</B
5948 > or any 'add userr' command which is normally
5949 used to create new UNIX accounts. The following is an example for a Linux
5950 based Samba server:</P
5952 ><TT
5953 CLASS="PROMPT"
5954 >root# </TT
5955 >/usr/sbin/useradd -g 100 -d /dev/null -c <TT
5956 CLASS="REPLACEABLE"
5958 >machine_nickname</I
5959 ></TT
5960 > -m -s /bin/false <TT
5961 CLASS="REPLACEABLE"
5963 >machine_name</I
5964 ></TT
5965 >$</P
5967 >The <TT
5968 CLASS="FILENAME"
5969 >/etc/passwd</TT
5970 > entry will list the machine name
5971 with a $ appended, won't have a passwd, will have a null shell and no
5972 home directory. For example a machine called 'doppy' would have an
5974 CLASS="FILENAME"
5975 >/etc/passwd</TT
5976 > entry like this :</P
5978 ><TABLE
5979 BORDER="0"
5980 BGCOLOR="#E0E0E0"
5981 WIDTH="100%"
5982 ><TR
5983 ><TD
5984 ><PRE
5985 CLASS="PROGRAMLISTING"
5986 >doppy$:x:505:501:<TT
5987 CLASS="REPLACEABLE"
5989 >machine_nickname</I
5990 ></TT
5991 >:/dev/null:/bin/false</PRE
5992 ></TD
5993 ></TR
5994 ></TABLE
5995 ></P
5997 >Above, <TT
5998 CLASS="REPLACEABLE"
6000 >machine_nickname</I
6001 ></TT
6002 > can be any descriptive name for the
6003 pc i.e. BasementComputer. The <TT
6004 CLASS="REPLACEABLE"
6006 >machine_name</I
6007 ></TT
6008 > absolutely must be
6009 the NetBIOS name of the pc to be added to the domain. The "$" must append the NetBIOS
6010 name of the pc or samba will not recognize this as a machine account</P
6012 >Now that the UNIX account has been created, the next step is to create
6013 the smbpasswd entry for the machine containing the well known initial
6014 trust account password. This can be done using the <A
6015 HREF="smbpasswd.6.html"
6016 TARGET="_top"
6018 CLASS="COMMAND"
6019 >smbpasswd(8)</B
6020 ></A
6021 > command
6022 as shown here:</P
6024 ><TT
6025 CLASS="PROMPT"
6026 >root# </TT
6027 > smbpasswd -a -m <TT
6028 CLASS="REPLACEABLE"
6030 >machine_name</I
6031 ></TT
6032 ></P
6034 >where <TT
6035 CLASS="REPLACEABLE"
6037 >machine_name</I
6038 ></TT
6039 > is the machine's NetBIOS
6040 name. </P
6041 ><DIV
6042 CLASS="WARNING"
6044 ></P
6045 ><TABLE
6046 CLASS="WARNING"
6047 BORDER="1"
6048 WIDTH="100%"
6049 ><TR
6050 ><TD
6051 ALIGN="CENTER"
6053 >Join the client to the domain immediately</B
6054 ></TD
6055 ></TR
6056 ><TR
6057 ><TD
6058 ALIGN="LEFT"
6060 > Manually creating a machine trust account using this method is the
6061 equivalent of creating a machine account on a Windows NT PDC using
6062 the "Server Manager". From the time at which the account is created
6063 to the time which th client joins the domain and changes the password,
6064 your domain is vulnerable to an intruder joining your domain using a
6065 a machine with the same NetBIOS name. A PDC inherently trusts
6066 members of the domain and will serve out a large degree of user
6067 information to such clients. You have been warned!
6069 ></TD
6070 ></TR
6071 ></TABLE
6072 ></DIV
6073 ></DIV
6074 ><DIV
6075 CLASS="SECT2"
6076 ><HR><H2
6077 CLASS="SECT2"
6079 NAME="AEN1231"
6080 >8.4.2. Creating machine trust accounts "on the fly"</A
6081 ></H2
6083 >The second, and most recommended way of creating machine trust accounts
6084 is to create them as needed at the time the client is joined to
6085 the domain. You will need to include a value for the <A
6086 HREF="smb.conf.5.html#ADDUSERSCRIPT"
6087 TARGET="_top"
6088 >add user script</A
6090 parameter. Below is an example from a RedHat 6.2 Linux system.</P
6092 ><TABLE
6093 BORDER="0"
6094 BGCOLOR="#E0E0E0"
6095 WIDTH="100%"
6096 ><TR
6097 ><TD
6098 ><PRE
6099 CLASS="PROGRAMLISTING"
6100 >add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u </PRE
6101 ></TD
6102 ></TR
6103 ></TABLE
6104 ></P
6106 >In Samba 2.2.1, <EM
6107 >only the root account</EM
6108 > can be used to create
6109 machine accounts like this. Therefore, it is required to create
6110 an entry in smbpasswd for <EM
6111 >root</EM
6112 >. The password
6114 >SHOULD</EM
6115 > be set to a different password that the
6116 associated <TT
6117 CLASS="FILENAME"
6118 >/etc/passwd</TT
6119 > entry for security reasons.</P
6120 ></DIV
6121 ></DIV
6122 ><DIV
6123 CLASS="SECT1"
6124 ><HR><H1
6125 CLASS="SECT1"
6127 NAME="AEN1242"
6128 >8.5. Common Problems and Errors</A
6129 ></H1
6131 ></P
6133 ></P
6134 ><UL
6135 ><LI
6137 > <EM
6138 >I cannot include a '$' in a machine name.</EM
6142 > A 'machine name' in (typically) <TT
6143 CLASS="FILENAME"
6144 >/etc/passwd</TT
6146 of the machine name with a '$' appended. FreeBSD (and other BSD
6147 systems ?) won't create a user with a '$' in their name.
6150 > The problem is only in the program used to make the entry, once
6151 made, it works perfectly. So create a user without the '$' and
6152 use <B
6153 CLASS="COMMAND"
6154 >vipw</B
6155 > to edit the entry, adding the '$'. Or create
6156 the whole entry with vipw if you like, make sure you use a
6157 unique uid !
6159 ></LI
6160 ><LI
6162 > <EM
6163 >I get told "You already have a connection to the Domain...."
6164 or "Cannot join domain, the credentials supplied conflict with an
6165 existing set.." when creating a machine account.</EM
6169 > This happens if you try to create a machine account from the
6170 machine itself and already have a connection (e.g. mapped drive)
6171 to a share (or IPC$) on the Samba PDC. The following command
6172 will remove all network drive connections:
6175 > <TT
6176 CLASS="PROMPT"
6177 >C:\WINNT\&#62;</TT
6178 > <B
6179 CLASS="COMMAND"
6180 >net use * /d</B
6184 > Further, if the machine is a already a 'member of a workgroup' that
6185 is the same name as the domain you are joining (bad idea) you will
6186 get this message. Change the workgroup name to something else, it
6187 does not matter what, reboot, and try again.
6189 ></LI
6190 ><LI
6192 > <EM
6193 >The system can not log you on (C000019B)....</EM
6197 >I joined the domain successfully but after upgrading
6198 to a newer version of the Samba code I get the message, "The system
6199 can not log you on (C000019B), Please try a gain or consult your
6200 system administrator" when attempting to logon.
6203 > This occurs when the domain SID stored in
6205 CLASS="FILENAME"
6206 >private/WORKGROUP.SID</TT
6207 > is
6208 changed. For example, you remove the file and <B
6209 CLASS="COMMAND"
6210 >smbd</B
6211 > automatically
6212 creates a new one. Or you are swapping back and forth between
6213 versions 2.0.7, TNG and the HEAD branch code (not recommended). The
6214 only way to correct the problem is to restore the original domain
6215 SID or remove the domain client from the domain and rejoin.
6217 ></LI
6218 ><LI
6220 > <EM
6221 >The machine account for this computer either does not
6222 exist or is not accessible.</EM
6226 > When I try to join the domain I get the message "The machine account
6227 for this computer either does not exist or is not accessible". Whats
6228 wrong?
6231 > This problem is caused by the PDC not having a suitable machine account.
6232 If you are using the <TT
6233 CLASS="PARAMETER"
6235 >add user script</I
6236 ></TT
6237 > method to create
6238 accounts then this would indicate that it has not worked. Ensure the domain
6239 admin user system is working.
6242 > Alternatively if you are creating account entries manually then they
6243 have not been created correctly. Make sure that you have the entry
6244 correct for the machine account in smbpasswd file on the Samba PDC.
6245 If you added the account using an editor rather than using the smbpasswd
6246 utility, make sure that the account name is the machine NetBIOS name
6247 with a '$' appended to it ( i.e. computer_name$ ). There must be an entry
6248 in both /etc/passwd and the smbpasswd file. Some people have reported
6249 that inconsistent subnet masks between the Samba server and the NT
6250 client have caused this problem. Make sure that these are consistent
6251 for both client and server.
6253 ></LI
6254 ><LI
6256 > <EM
6257 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
6258 I get a message about my account being disabled.</EM
6262 > This problem is caused by a PAM related bug in Samba 2.2.0. This bug is
6263 fixed in 2.2.1. Other symptoms could be unaccessible shares on
6264 NT/W2K member servers in the domain or the following error in your smbd.log:
6265 passdb/pampass.c:pam_account(268) PAM: UNKNOWN ERROR for User: %user%
6268 > At first be ensure to enable the useraccounts with <B
6269 CLASS="COMMAND"
6270 >smbpasswd -e
6271 %user%</B
6272 >, this is normally done, when you create an account.
6275 > In order to work around this problem in 2.2.0, configure the
6277 CLASS="PARAMETER"
6279 >account</I
6280 ></TT
6281 > control flag in
6283 CLASS="FILENAME"
6284 >/etc/pam.d/samba</TT
6285 > file as follows:
6288 ><TABLE
6289 BORDER="0"
6290 BGCOLOR="#E0E0E0"
6291 WIDTH="90%"
6292 ><TR
6293 ><TD
6294 ><PRE
6295 CLASS="PROGRAMLISTING"
6296 > account required pam_permit.so
6297 </PRE
6298 ></TD
6299 ></TR
6300 ></TABLE
6301 ></P
6303 > If you want to remain backward compatibility to samba 2.0.x use
6305 CLASS="FILENAME"
6306 >pam_permit.so</TT
6307 >, it's also possible to use
6309 CLASS="FILENAME"
6310 >pam_pwdb.so</TT
6311 >. There are some bugs if you try to
6312 use <TT
6313 CLASS="FILENAME"
6314 >pam_unix.so</TT
6315 >, if you need this, be ensure to use
6316 the most recent version of this file.
6318 ></LI
6319 ></UL
6320 ></DIV
6321 ><DIV
6322 CLASS="SECT1"
6323 ><HR><H1
6324 CLASS="SECT1"
6326 NAME="AEN1290"
6327 >8.6. System Policies and Profiles</A
6328 ></H1
6330 >Much of the information necessary to implement System Policies and
6331 Roving User Profiles in a Samba domain is the same as that for
6332 implementing these same items in a Windows NT 4.0 domain.
6333 You should read the white paper <A
6334 HREF="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp"
6335 TARGET="_top"
6336 >Implementing
6337 Profiles and Policies in Windows NT 4.0</A
6338 > available from Microsoft.</P
6340 >Here are some additional details:</P
6342 ></P
6343 ><UL
6344 ><LI
6346 > <EM
6347 >What about Windows NT Policy Editor ?</EM
6351 > To create or edit <TT
6352 CLASS="FILENAME"
6353 >ntconfig.pol</TT
6354 > you must use
6355 the NT Server Policy Editor, <B
6356 CLASS="COMMAND"
6357 >poledit.exe</B
6358 > which
6359 is included with NT Server but <EM
6360 >not NT Workstation</EM
6362 There is a Policy Editor on a NTws
6363 but it is not suitable for creating <EM
6364 >Domain Policies</EM
6366 Further, although the Windows 95
6367 Policy Editor can be installed on an NT Workstation/Server, it will not
6368 work with NT policies because the registry key that are set by the policy templates.
6369 However, the files from the NT Server will run happily enough on an NTws.
6370 You need <TT
6371 CLASS="FILENAME"
6372 >poledit.exe, common.adm</TT
6373 > and <TT
6374 CLASS="FILENAME"
6375 >winnt.adm</TT
6376 >. It is convenient
6377 to put the two *.adm files in <TT
6378 CLASS="FILENAME"
6379 >c:\winnt\inf</TT
6380 > which is where
6381 the binary will look for them unless told otherwise. Note also that that
6382 directory is 'hidden'.
6385 > The Windows NT policy editor is also included with the Service Pack 3 (and
6386 later) for Windows NT 4.0. Extract the files using <B
6387 CLASS="COMMAND"
6388 >servicepackname /x</B
6390 i.e. that's <B
6391 CLASS="COMMAND"
6392 >Nt4sp6ai.exe /x</B
6393 > for service pack 6a. The policy editor,
6395 CLASS="COMMAND"
6396 >poledit.exe</B
6397 > and the associated template files (*.adm) should
6398 be extracted as well. It is also possible to downloaded the policy template
6399 files for Office97 and get a copy of the policy editor. Another possible
6400 location is with the Zero Administration Kit available for download from Microsoft.
6402 ></LI
6403 ><LI
6405 > <EM
6406 >Can Win95 do Policies ?</EM
6410 > Install the group policy handler for Win9x to pick up group
6411 policies. Look on the Win98 CD in <TT
6412 CLASS="FILENAME"
6413 >\tools\reskit\netadmin\poledit</TT
6415 Install group policies on a Win9x client by double-clicking
6417 CLASS="FILENAME"
6418 >grouppol.inf</TT
6419 >. Log off and on again a couple of
6420 times and see if Win98 picks up group policies. Unfortunately this needs
6421 to be done on every Win9x machine that uses group policies....
6424 > If group policies don't work one reports suggests getting the updated
6425 (read: working) grouppol.dll for Windows 9x. The group list is grabbed
6426 from /etc/group.
6428 ></LI
6429 ><LI
6431 > <EM
6432 >How do I get 'User Manager' and 'Server Manager'</EM
6436 > Since I don't need to buy an NT Server CD now, how do I get
6437 the 'User Manager for Domains', the 'Server Manager' ?
6440 > Microsoft distributes a version of these tools called nexus for
6441 installation on Windows 95 systems. The tools set includes
6444 ></P
6445 ><UL
6446 ><LI
6448 >Server Manager</P
6449 ></LI
6450 ><LI
6452 >User Manager for Domains</P
6453 ></LI
6454 ><LI
6456 >Event Viewer</P
6457 ></LI
6458 ></UL
6460 > Click here to download the archived file <A
6461 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE"
6462 TARGET="_top"
6463 >ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</A
6467 > The Windows NT 4.0 version of the 'User Manager for
6468 Domains' and 'Server Manager' are available from Microsoft via ftp
6469 from <A
6470 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE"
6471 TARGET="_top"
6472 >ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</A
6475 ></LI
6476 ></UL
6477 ></DIV
6478 ><DIV
6479 CLASS="SECT1"
6480 ><HR><H1
6481 CLASS="SECT1"
6483 NAME="AEN1334"
6484 >8.7. What other help can I get ?</A
6485 ></H1
6487 >There are many sources of information available in the form
6488 of mailing lists, RFC's and documentation. The docs that come
6489 with the samba distribution contain very good explanations of
6490 general SMB topics such as browsing.</P
6492 ></P
6493 ><UL
6494 ><LI
6496 > <EM
6497 >What are some diagnostics tools I can use to debug the domain logon
6498 process and where can I find them?</EM
6502 > One of the best diagnostic tools for debugging problems is Samba itself.
6503 You can use the -d option for both smbd and nmbd to specify what
6504 'debug level' at which to run. See the man pages on smbd, nmbd and
6505 smb.conf for more information on debugging options. The debug
6506 level can range from 1 (the default) to 10 (100 for debugging passwords).
6509 > Another helpful method of debugging is to compile samba using the
6511 CLASS="COMMAND"
6512 >gcc -g </B
6513 > flag. This will include debug
6514 information in the binaries and allow you to attach gdb to the
6515 running smbd / nmbd process. In order to attach gdb to an smbd
6516 process for an NT workstation, first get the workstation to make the
6517 connection. Pressing ctrl-alt-delete and going down to the domain box
6518 is sufficient (at least, on the first time you join the domain) to
6519 generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation
6520 maintains an open connection, and therefore there will be an smbd
6521 process running (assuming that you haven't set a really short smbd
6522 idle timeout) So, in between pressing ctrl alt delete, and actually
6523 typing in your password, you can gdb attach and continue.
6526 > Some useful samba commands worth investigating:
6529 ></P
6530 ><UL
6531 ><LI
6533 >testparam | more</P
6534 ></LI
6535 ><LI
6537 >smbclient -L //{netbios name of server}</P
6538 ></LI
6539 ></UL
6541 > An SMB enabled version of tcpdump is available from
6543 HREF="http://www.tcpdump.org/"
6544 TARGET="_top"
6545 >http://www.tcpdup.org/</A
6547 Ethereal, another good packet sniffer for UNIX and Win32
6548 hosts, can be downloaded from <A
6549 HREF="http://www.ethereal.com/"
6550 TARGET="_top"
6551 >http://www.ethereal.com</A
6555 > For tracing things on the Microsoft Windows NT, Network Monitor
6556 (aka. netmon) is available on the Microsoft Developer Network CD's,
6557 the Windows NT Server install CD and the SMS CD's. The version of
6558 netmon that ships with SMS allows for dumping packets between any two
6559 computers (i.e. placing the network interface in promiscuous mode).
6560 The version on the NT Server install CD will only allow monitoring
6561 of network traffic directed to the local NT box and broadcasts on the
6562 local subnet. Be aware that Ethereal can read and write netmon
6563 formatted files.
6565 ></LI
6566 ><LI
6568 > <EM
6569 >How do I install 'Network Monitor' on an NT Workstation
6570 or a Windows 9x box?</EM
6574 > Installing netmon on an NT workstation requires a couple
6575 of steps. The following are for installing Netmon V4.00.349, which comes
6576 with Microsoft Windows NT Server 4.0, on Microsoft Windows NT
6577 Workstation 4.0. The process should be similar for other version of
6578 Windows NT / Netmon. You will need both the Microsoft Windows
6579 NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
6582 > Initially you will need to install 'Network Monitor Tools and Agent'
6583 on the NT Server. To do this
6586 ></P
6587 ><UL
6588 ><LI
6590 >Goto Start - Settings - Control Panel -
6591 Network - Services - Add </P
6592 ></LI
6593 ><LI
6595 >Select the 'Network Monitor Tools and Agent' and
6596 click on 'OK'.</P
6597 ></LI
6598 ><LI
6600 >Click 'OK' on the Network Control Panel.
6602 ></LI
6603 ><LI
6605 >Insert the Windows NT Server 4.0 install CD
6606 when prompted.</P
6607 ></LI
6608 ></UL
6610 > At this point the Netmon files should exist in
6612 CLASS="FILENAME"
6613 >%SYSTEMROOT%\System32\netmon\*.*</TT
6615 Two subdirectories exist as well, <TT
6616 CLASS="FILENAME"
6617 >parsers\</TT
6619 which contains the necessary DLL's for parsing the netmon packet
6620 dump, and <TT
6621 CLASS="FILENAME"
6622 >captures\</TT
6626 > In order to install the Netmon tools on an NT Workstation, you will
6627 first need to install the 'Network Monitor Agent' from the Workstation
6628 install CD.
6631 ></P
6632 ><UL
6633 ><LI
6635 >Goto Start - Settings - Control Panel -
6636 Network - Services - Add</P
6637 ></LI
6638 ><LI
6640 >Select the 'Network Monitor Agent' and click
6641 on 'OK'.</P
6642 ></LI
6643 ><LI
6645 >Click 'OK' on the Network Control Panel.
6647 ></LI
6648 ><LI
6650 >Insert the Windows NT Workstation 4.0 install
6651 CD when prompted.</P
6652 ></LI
6653 ></UL
6655 > Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.*
6656 to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set
6657 permissions as you deem appropriate for your site. You will need
6658 administrative rights on the NT box to run netmon.
6661 > To install Netmon on a Windows 9x box install the network monitor agent
6662 from the Windows 9x CD (\admin\nettools\netmon). There is a readme
6663 file located with the netmon driver files on the CD if you need
6664 information on how to do this. Copy the files from a working
6665 Netmon installation.
6667 ></LI
6668 ><LI
6670 > The following is a list if helpful URLs and other links:
6673 ></P
6674 ><UL
6675 ><LI
6677 >Home of Samba site <A
6678 HREF="http://samba.org"
6679 TARGET="_top"
6680 > http://samba.org</A
6681 >. We have a mirror near you !</P
6682 ></LI
6683 ><LI
6685 > The <EM
6686 >Development</EM
6687 > document
6688 on the Samba mirrors might mention your problem. If so,
6689 it might mean that the developers are working on it.</P
6690 ></LI
6691 ><LI
6693 >See how Scott Merrill simulates a BDC behavior at
6695 HREF="http://www.skippy.net/linux/smb-howto.html"
6696 TARGET="_top"
6697 > http://www.skippy.net/linux/smb-howto.html</A
6698 >. </P
6699 ></LI
6700 ><LI
6702 >Although 2.0.7 has almost had its day as a PDC, David Bannon will
6703 keep the 2.0.7 PDC pages at <A
6704 HREF="http://bioserve.latrobe.edu.au/samba"
6705 TARGET="_top"
6706 > http://bioserve.latrobe.edu.au/samba</A
6707 > going for a while yet.</P
6708 ></LI
6709 ><LI
6711 >Misc links to CIFS information
6713 HREF="http://samba.org/cifs/"
6714 TARGET="_top"
6715 >http://samba.org/cifs/</A
6716 ></P
6717 ></LI
6718 ><LI
6720 >NT Domains for Unix <A
6721 HREF="http://mailhost.cb1.com/~lkcl/ntdom/"
6722 TARGET="_top"
6723 > http://mailhost.cb1.com/~lkcl/ntdom/</A
6724 ></P
6725 ></LI
6726 ><LI
6728 >FTP site for older SMB specs:
6730 HREF="ftp://ftp.microsoft.com/developr/drg/CIFS/"
6731 TARGET="_top"
6732 > ftp://ftp.microsoft.com/developr/drg/CIFS/</A
6733 ></P
6734 ></LI
6735 ></UL
6736 ></LI
6737 ></UL
6739 ></P
6740 ><UL
6741 ><LI
6743 > <EM
6744 >How do I get help from the mailing lists ?</EM
6748 > There are a number of Samba related mailing lists. Go to <A
6749 HREF="http://samba.org"
6750 TARGET="_top"
6751 >http://samba.org</A
6752 >, click on your nearest mirror
6753 and then click on <B
6754 CLASS="COMMAND"
6755 >Support</B
6756 > and then click on <B
6757 CLASS="COMMAND"
6758 > Samba related mailing lists</B
6762 > For questions relating to Samba TNG go to
6764 HREF="http://www.samba-tng.org/"
6765 TARGET="_top"
6766 >http://www.samba-tng.org/</A
6768 It has been requested that you don't post questions about Samba-TNG to the
6769 main stream Samba lists.</P
6771 > If you post a message to one of the lists please observe the following guide lines :
6774 ></P
6775 ><UL
6776 ><LI
6778 > Always remember that the developers are volunteers, they are
6779 not paid and they never guarantee to produce a particular feature at
6780 a particular time. Any time lines are 'best guess' and nothing more.
6782 ></LI
6783 ><LI
6785 > Always mention what version of samba you are using and what
6786 operating system its running under. You should probably list the
6787 relevant sections of your smb.conf file, at least the options
6788 in [global] that affect PDC support.</P
6789 ></LI
6790 ><LI
6792 >In addition to the version, if you obtained Samba via
6793 CVS mention the date when you last checked it out.</P
6794 ></LI
6795 ><LI
6797 > Try and make your question clear and brief, lots of long,
6798 convoluted questions get deleted before they are completely read !
6799 Don't post html encoded messages (if you can select colour or font
6800 size its html).</P
6801 ></LI
6802 ><LI
6804 > If you run one of those nifty 'I'm on holidays' things when
6805 you are away, make sure its configured to not answer mailing lists.
6807 ></LI
6808 ><LI
6810 > Don't cross post. Work out which is the best list to post to
6811 and see what happens, i.e. don't post to both samba-ntdom and samba-technical.
6812 Many people active on the lists subscribe to more
6813 than one list and get annoyed to see the same message two or more times.
6814 Often someone will see a message and thinking it would be better dealt
6815 with on another, will forward it on for you.</P
6816 ></LI
6817 ><LI
6819 >You might include <EM
6820 >partial</EM
6822 log files written at a debug level set to as much as 20.
6823 Please don't send the entire log but enough to give the context of the
6824 error messages.</P
6825 ></LI
6826 ><LI
6828 >(Possibly) If you have a complete netmon trace ( from the opening of
6829 the pipe to the error ) you can send the *.CAP file as well.</P
6830 ></LI
6831 ><LI
6833 >Please think carefully before attaching a document to an email.
6834 Consider pasting the relevant parts into the body of the message. The samba
6835 mailing lists go to a huge number of people, do they all need a copy of your
6836 smb.conf in their attach directory ?</P
6837 ></LI
6838 ></UL
6839 ></LI
6840 ><LI
6842 > <EM
6843 >How do I get off the mailing lists ?</EM
6847 >To have your name removed from a samba mailing list, go to the
6848 same place you went to to get on it. Go to <A
6849 HREF="http://lists.samba.org/"
6850 TARGET="_top"
6851 >http://lists.samba.org</A
6853 click on your nearest mirror and then click on <B
6854 CLASS="COMMAND"
6855 >Support</B
6856 > and
6857 then click on <B
6858 CLASS="COMMAND"
6859 > Samba related mailing lists</B
6860 >. Or perhaps see
6862 HREF="http://lists.samba.org/mailman/roster/samba-ntdom"
6863 TARGET="_top"
6864 >here</A
6868 > Please don't post messages to the list asking to be removed, you will just
6869 be referred to the above address (unless that process failed in some way...)
6871 ></LI
6872 ></UL
6873 ></DIV
6874 ><DIV
6875 CLASS="SECT1"
6876 ><HR><H1
6877 CLASS="SECT1"
6879 NAME="AEN1448"
6880 >8.8. Domain Control for Windows 9x/ME</A
6881 ></H1
6882 ><DIV
6883 CLASS="NOTE"
6884 ><BLOCKQUOTE
6885 CLASS="NOTE"
6888 >Note: </B
6889 >The following section contains much of the original
6890 DOMAIN.txt file previously included with Samba. Much of
6891 the material is based on what went into the book Special
6892 Edition, Using Samba. (Richard Sharpe)</P
6893 ></BLOCKQUOTE
6894 ></DIV
6896 >A domain and a workgroup are exactly the same thing in terms of network
6897 browsing. The difference is that a distributable authentication
6898 database is associated with a domain, for secure login access to a
6899 network. Also, different access rights can be granted to users if they
6900 successfully authenticate against a domain logon server (NT server and
6901 other systems based on NT server support this, as does at least Samba TNG now).</P
6903 >The SMB client logging on to a domain has an expectation that every other
6904 server in the domain should accept the same authentication information.
6905 Network browsing functionality of domains and workgroups is
6906 identical and is explained in BROWSING.txt. It should be noted, that browsing
6907 is total orthogonal to logon support.</P
6909 >Issues related to the single-logon network model are discussed in this
6910 document. Samba supports domain logons, network logon scripts, and user
6911 profiles for MS Windows for workgroups and MS Windows 9X clients.</P
6913 >When an SMB client in a domain wishes to logon it broadcast requests for a
6914 logon server. The first one to reply gets the job, and validates its
6915 password using whatever mechanism the Samba administrator has installed.
6916 It is possible (but very stupid) to create a domain where the user
6917 database is not shared between servers, i.e. they are effectively workgroup
6918 servers advertising themselves as participating in a domain. This
6919 demonstrates how authentication is quite different from but closely
6920 involved with domains.</P
6922 >Another thing commonly associated with single-logon domains is remote
6923 administration over the SMB protocol. Again, there is no reason why this
6924 cannot be implemented with an underlying username database which is
6925 different from the Windows NT SAM. Support for the Remote Administration
6926 Protocol is planned for a future release of Samba.</P
6928 >Network logon support as discussed in this section is aimed at Window for
6929 Workgroups, and Windows 9X clients. </P
6931 >Support for profiles is confirmed as working for Win95, NT 4.0 and NT 3.51.
6932 It is possible to specify: the profile location; script file to be loaded
6933 on login; the user's home directory; and for NT a kick-off time could also
6934 now easily be supported. However, there are some differences between Win9X
6935 profile support and WinNT profile support. These are discussed below.</P
6937 >With NT Workstations, all this does not require the use or intervention of
6938 an NT 4.0 or NT 3.51 server: Samba can now replace the logon services
6939 provided by an NT server, to a limited and experimental degree (for example,
6940 running "User Manager for Domains" will not provide you with access to
6941 a domain created by a Samba Server).</P
6943 >With Win95, the help of an NT server can be enlisted, both for profile storage
6944 and for user authentication. For details on user authentication, see
6945 security_level.txt. For details on profile storage, see below.</P
6947 >Using these features you can make your clients verify their logon via
6948 the Samba server; make clients run a batch file when they logon to
6949 the network and download their preferences, desktop and start menu.</P
6951 >Before launching into the configuration instructions, it is worthwhile looking
6952 at how a Win9X client performs a logon:</P
6954 ></P
6955 ><OL
6956 TYPE="1"
6957 ><LI
6959 > The client broadcasts (to the IP broadcast address of the subnet it is in)
6960 a NetLogon request. This is sent to the NetBIOS address DOMAIN&#60;00&#62; at the
6961 NetBIOS layer. The client chooses the first response it receives, which
6962 contains the NetBIOS name of the logon server to use in the format of
6963 \\SERVER.
6965 ></LI
6966 ><LI
6968 > The client then connects to that server, logs on (does an SMBsessetupX) and
6969 then connects to the IPC$ share (using an SMBtconX).
6971 ></LI
6972 ><LI
6974 > The client then does a NetWkstaUserLogon request, which retrieves the name
6975 of the user's logon script.
6977 ></LI
6978 ><LI
6980 > The client then connects to the NetLogon share and searches for this
6981 and if it is found and can be read, is retrieved and executed by the client.
6982 After this, the client disconnects from the NetLogon share.
6984 ></LI
6985 ><LI
6987 > The client then sends a NetUserGetInfo request to the server, to retrieve
6988 the user's home share, which is used to search for profiles. Since the
6989 response to the NetUserGetInfo request does not contain much more
6990 the user's home share, profiles for Win9X clients MUST reside in the user
6991 home directory.
6993 ></LI
6994 ><LI
6996 > The client then connects to the user's home share and searches for the
6997 user's profile. As it turns out, you can specify the user's home share as
6998 a sharename and path. For example, \\server\fred\.profile.
6999 If the profiles are found, they are implemented.
7001 ></LI
7002 ><LI
7004 > The client then disconnects from the user's home share, and reconnects to
7005 the NetLogon share and looks for CONFIG.POL, the policies file. If this is
7006 found, it is read and implemented.
7008 ></LI
7009 ></OL
7010 ><DIV
7011 CLASS="SECT2"
7012 ><HR><H2
7013 CLASS="SECT2"
7015 NAME="AEN1478"
7016 >8.8.1. Configuration Instructions: Network Logons</A
7017 ></H2
7019 >To use domain logons and profiles you need to do the following:</P
7021 ></P
7022 ><OL
7023 TYPE="1"
7024 ><LI
7026 > Create a share called [netlogon] in your smb.conf. This share should
7027 be readable by all users, and probably should not be writeable. This
7028 share will hold your network logon scripts, and the CONFIG.POL file
7029 (Note: for details on the CONFIG.POL file, how to use it, what it is,
7030 refer to the Microsoft Windows NT Administration documentation.
7031 The format of these files is not known, so you will need to use
7032 Microsoft tools).
7035 > For example I have used:
7038 ><TABLE
7039 BORDER="0"
7040 BGCOLOR="#E0E0E0"
7041 WIDTH="90%"
7042 ><TR
7043 ><TD
7044 ><PRE
7045 CLASS="PROGRAMLISTING"
7046 >[netlogon]
7047 path = /data/dos/netlogon
7048 writeable = no
7049 guest ok = no</PRE
7050 ></TD
7051 ></TR
7052 ></TABLE
7053 ></P
7055 > Note that it is important that this share is not writeable by ordinary
7056 users, in a secure environment: ordinary users should not be allowed
7057 to modify or add files that another user's computer would then download
7058 when they log in.
7060 ></LI
7061 ><LI
7063 > in the [global] section of smb.conf set the following:
7066 ><TABLE
7067 BORDER="0"
7068 BGCOLOR="#E0E0E0"
7069 WIDTH="90%"
7070 ><TR
7071 ><TD
7072 ><PRE
7073 CLASS="PROGRAMLISTING"
7074 >domain logons = yes
7075 logon script = %U.bat
7076 </PRE
7077 ></TD
7078 ></TR
7079 ></TABLE
7080 ></P
7082 > The choice of batch file is, of course, up to you. The above would
7083 give each user a separate batch file as the %U will be changed to
7084 their username automatically. The other standard % macros may also be
7085 used. You can make the batch files come from a subdirectory by using
7086 something like:
7089 ><TABLE
7090 BORDER="0"
7091 BGCOLOR="#E0E0E0"
7092 WIDTH="90%"
7093 ><TR
7094 ><TD
7095 ><PRE
7096 CLASS="PROGRAMLISTING"
7097 >logon script = scripts\%U.bat
7098 </PRE
7099 ></TD
7100 ></TR
7101 ></TABLE
7102 ></P
7103 ></LI
7104 ><LI
7106 > create the batch files to be run when the user logs in. If the batch
7107 file doesn't exist then no batch file will be run.
7110 > In the batch files you need to be careful to use DOS style cr/lf line
7111 endings. If you don't then DOS may get confused. I suggest you use a
7112 DOS editor to remotely edit the files if you don't know how to produce
7113 DOS style files under unix.
7115 ></LI
7116 ><LI
7118 > Use smbclient with the -U option for some users to make sure that
7119 the \\server\NETLOGON share is available, the batch files are
7120 visible and they are readable by the users.
7122 ></LI
7123 ><LI
7125 > you will probably find that your clients automatically mount the
7126 \\SERVER\NETLOGON share as drive z: while logging in. You can put
7127 some useful programs there to execute from the batch files.
7129 ></LI
7130 ></OL
7131 ><DIV
7132 CLASS="WARNING"
7134 ></P
7135 ><TABLE
7136 CLASS="WARNING"
7137 BORDER="1"
7138 WIDTH="100%"
7139 ><TR
7140 ><TD
7141 ALIGN="CENTER"
7143 >security mode and master browsers</B
7144 ></TD
7145 ></TR
7146 ><TR
7147 ><TD
7148 ALIGN="LEFT"
7150 >There are a few comments to make in order to tie up some
7151 loose ends. There has been much debate over the issue of whether
7152 or not it is ok to configure Samba as a Domain Controller in security
7153 modes other than <TT
7154 CLASS="CONSTANT"
7155 >USER</TT
7156 >. The only security mode
7157 which will not work due to technical reasons is <TT
7158 CLASS="CONSTANT"
7159 >SHARE</TT
7161 mode security. <TT
7162 CLASS="CONSTANT"
7163 >DOMAIN</TT
7164 > and <TT
7165 CLASS="CONSTANT"
7166 >SERVER</TT
7168 mode security is really just a variation on SMB user level security.</P
7170 >Actually, this issue is also closer tied to the debate on whether
7171 or not Samba must be the domain master browser for its workgroup
7172 when operating as a DC. While it may technically be possible
7173 to configure a server as such (after all, browsing and domain logons
7174 are two distinctly different functions), it is not a good idea to
7175 so. You should remember that the DC must register the DOMAIN#1b NetBIOS
7176 name. This is the name used by Windows clients to locate the DC.
7177 Windows clients do not distinguish between the DC and the DMB.
7178 For this reason, it is very wise to configure the Samba DC as the DMB.</P
7180 >Now back to the issue of configuring a Samba DC to use a mode other
7181 than "security = user". If a Samba host is configured to use
7182 another SMB server or DC in order to validate user connection
7183 requests, then it is a fact that some other machine on the network
7184 (the "password server") knows more about user than the Samba host.
7185 99% of the time, this other host is a domain controller. Now
7186 in order to operate in domain mode security, the "workgroup" parameter
7187 must be set to the name of the Windows NT domain (which already
7188 has a domain controller, right?)</P
7190 >Therefore configuring a Samba box as a DC for a domain that
7191 already by definition has a PDC is asking for trouble.
7192 Therefore, you should always configure the Samba DC to be the DMB
7193 for its domain.</P
7194 ></TD
7195 ></TR
7196 ></TABLE
7197 ></DIV
7198 ></DIV
7199 ><DIV
7200 CLASS="SECT2"
7201 ><HR><H2
7202 CLASS="SECT2"
7204 NAME="AEN1512"
7205 >8.8.2. Configuration Instructions: Setting up Roaming User Profiles</A
7206 ></H2
7207 ><DIV
7208 CLASS="WARNING"
7210 ></P
7211 ><TABLE
7212 CLASS="WARNING"
7213 BORDER="1"
7214 WIDTH="100%"
7215 ><TR
7216 ><TD
7217 ALIGN="CENTER"
7219 >Warning</B
7220 ></TD
7221 ></TR
7222 ><TR
7223 ><TD
7224 ALIGN="LEFT"
7226 ><EM
7227 >NOTE!</EM
7228 > Roaming profiles support is different
7229 for Win9X and WinNT.</P
7230 ></TD
7231 ></TR
7232 ></TABLE
7233 ></DIV
7235 >Before discussing how to configure roaming profiles, it is useful to see how
7236 Win9X and WinNT clients implement these features.</P
7238 >Win9X clients send a NetUserGetInfo request to the server to get the user's
7239 profiles location. However, the response does not have room for a separate
7240 profiles location field, only the user's home share. This means that Win9X
7241 profiles are restricted to being in the user's home directory.</P
7243 >WinNT clients send a NetSAMLogon RPC request, which contains many fields,
7244 including a separate field for the location of the user's profiles.
7245 This means that support for profiles is different for Win9X and WinNT.</P
7246 ><DIV
7247 CLASS="SECT3"
7248 ><HR><H3
7249 CLASS="SECT3"
7251 NAME="AEN1520"
7252 >8.8.2.1. Windows NT Configuration</A
7253 ></H3
7255 >To support WinNT clients, inn the [global] section of smb.conf set the
7256 following (for example):</P
7258 ><TABLE
7259 BORDER="0"
7260 BGCOLOR="#E0E0E0"
7261 WIDTH="100%"
7262 ><TR
7263 ><TD
7264 ><PRE
7265 CLASS="PROGRAMLISTING"
7266 >logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath</PRE
7267 ></TD
7268 ></TR
7269 ></TABLE
7270 ></P
7272 >The default for this option is \\%N\%U\profile, namely
7273 \\sambaserver\username\profile. The \\N%\%U service is created
7274 automatically by the [homes] service.
7275 If you are using a samba server for the profiles, you _must_ make the
7276 share specified in the logon path browseable. </P
7277 ><DIV
7278 CLASS="NOTE"
7279 ><BLOCKQUOTE
7280 CLASS="NOTE"
7283 >Note: </B
7284 >[lkcl 26aug96 - we have discovered a problem where Windows clients can
7285 maintain a connection to the [homes] share in between logins. The
7286 [homes] share must NOT therefore be used in a profile path.]</P
7287 ></BLOCKQUOTE
7288 ></DIV
7289 ></DIV
7290 ><DIV
7291 CLASS="SECT3"
7292 ><HR><H3
7293 CLASS="SECT3"
7295 NAME="AEN1528"
7296 >8.8.2.2. Windows 9X Configuration</A
7297 ></H3
7299 >To support Win9X clients, you must use the "logon home" parameter. Samba has
7300 now been fixed so that "net use/home" now works as well, and it, too, relies
7301 on the "logon home" parameter.</P
7303 >By using the logon home parameter, you are restricted to putting Win9X
7304 profiles in the user's home directory. But wait! There is a trick you
7305 can use. If you set the following in the [global] section of your
7306 smb.conf file:</P
7308 ><TABLE
7309 BORDER="0"
7310 BGCOLOR="#E0E0E0"
7311 WIDTH="100%"
7312 ><TR
7313 ><TD
7314 ><PRE
7315 CLASS="PROGRAMLISTING"
7316 >logon home = \\%L\%U\.profiles</PRE
7317 ></TD
7318 ></TR
7319 ></TABLE
7320 ></P
7322 >then your Win9X clients will dutifully put their clients in a subdirectory
7323 of your home directory called .profiles (thus making them hidden).</P
7325 >Not only that, but 'net use/home' will also work, because of a feature in
7326 Win9X. It removes any directory stuff off the end of the home directory area
7327 and only uses the server and share portion. That is, it looks like you
7328 specified \\%L\%U for "logon home".</P
7329 ></DIV
7330 ><DIV
7331 CLASS="SECT3"
7332 ><HR><H3
7333 CLASS="SECT3"
7335 NAME="AEN1536"
7336 >8.8.2.3. Win9X and WinNT Configuration</A
7337 ></H3
7339 >You can support profiles for both Win9X and WinNT clients by setting both the
7340 "logon home" and "logon path" parameters. For example:</P
7342 ><TABLE
7343 BORDER="0"
7344 BGCOLOR="#E0E0E0"
7345 WIDTH="100%"
7346 ><TR
7347 ><TD
7348 ><PRE
7349 CLASS="PROGRAMLISTING"
7350 >logon home = \\%L\%U\.profiles
7351 logon path = \\%L\profiles\%U</PRE
7352 ></TD
7353 ></TR
7354 ></TABLE
7355 ></P
7356 ><DIV
7357 CLASS="NOTE"
7358 ><BLOCKQUOTE
7359 CLASS="NOTE"
7362 >Note: </B
7363 >I have not checked what 'net use /home' does on NT when "logon home" is
7364 set as above.</P
7365 ></BLOCKQUOTE
7366 ></DIV
7367 ></DIV
7368 ><DIV
7369 CLASS="SECT3"
7370 ><HR><H3
7371 CLASS="SECT3"
7373 NAME="AEN1543"
7374 >8.8.2.4. Windows 9X Profile Setup</A
7375 ></H3
7377 >When a user first logs in on Windows 9X, the file user.DAT is created,
7378 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".
7379 These directories and their contents will be merged with the local
7380 versions stored in c:\windows\profiles\username on subsequent logins,
7381 taking the most recent from each. You will need to use the [global]
7382 options "preserve case = yes", "short case preserve = yes" and
7383 "case sensitive = no" in order to maintain capital letters in shortcuts
7384 in any of the profile folders.</P
7386 >The user.DAT file contains all the user's preferences. If you wish to
7387 enforce a set of preferences, rename their user.DAT file to user.MAN,
7388 and deny them write access to this file.</P
7390 ></P
7391 ><OL
7392 TYPE="1"
7393 ><LI
7395 > On the Windows 95 machine, go to Control Panel | Passwords and
7396 select the User Profiles tab. Select the required level of
7397 roaming preferences. Press OK, but do _not_ allow the computer
7398 to reboot.
7400 ></LI
7401 ><LI
7403 > On the Windows 95 machine, go to Control Panel | Network |
7404 Client for Microsoft Networks | Preferences. Select 'Log on to
7405 NT Domain'. Then, ensure that the Primary Logon is 'Client for
7406 Microsoft Networks'. Press OK, and this time allow the computer
7407 to reboot.
7409 ></LI
7410 ></OL
7412 >Under Windows 95, Profiles are downloaded from the Primary Logon.
7413 If you have the Primary Logon as 'Client for Novell Networks', then
7414 the profiles and logon script will be downloaded from your Novell
7415 Server. If you have the Primary Logon as 'Windows Logon', then the
7416 profiles will be loaded from the local machine - a bit against the
7417 concept of roaming profiles, if you ask me.</P
7419 >You will now find that the Microsoft Networks Login box contains
7420 [user, password, domain] instead of just [user, password]. Type in
7421 the samba server's domain name (or any other domain known to exist,
7422 but bear in mind that the user will be authenticated against this
7423 domain and profiles downloaded from it, if that domain logon server
7424 supports it), user name and user's password.</P
7426 >Once the user has been successfully validated, the Windows 95 machine
7427 will inform you that 'The user has not logged on before' and asks you
7428 if you wish to save the user's preferences? Select 'yes'.</P
7430 >Once the Windows 95 client comes up with the desktop, you should be able
7431 to examine the contents of the directory specified in the "logon path"
7432 on the samba server and verify that the "Desktop", "Start Menu",
7433 "Programs" and "Nethood" folders have been created.</P
7435 >These folders will be cached locally on the client, and updated when
7436 the user logs off (if you haven't made them read-only by then :-).
7437 You will find that if the user creates further folders or short-cuts,
7438 that the client will merge the profile contents downloaded with the
7439 contents of the profile directory already on the local client, taking
7440 the newest folders and short-cuts from each set.</P
7442 >If you have made the folders / files read-only on the samba server,
7443 then you will get errors from the w95 machine on logon and logout, as
7444 it attempts to merge the local and the remote profile. Basically, if
7445 you have any errors reported by the w95 machine, check the unix file
7446 permissions and ownership rights on the profile directory contents,
7447 on the samba server.</P
7449 >If you have problems creating user profiles, you can reset the user's
7450 local desktop cache, as shown below. When this user then next logs in,
7451 they will be told that they are logging in "for the first time".</P
7453 ></P
7454 ><OL
7455 TYPE="1"
7456 ><LI
7458 > instead of logging in under the [user, password, domain] dialog,
7459 press escape.
7461 ></LI
7462 ><LI
7464 > run the regedit.exe program, and look in:
7467 > HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
7470 > you will find an entry, for each user, of ProfilePath. Note the
7471 contents of this key (likely to be c:\windows\profiles\username),
7472 then delete the key ProfilePath for the required user.
7475 > [Exit the registry editor].
7477 ></LI
7478 ><LI
7480 > <EM
7481 >WARNING</EM
7482 > - before deleting the contents of the
7483 directory listed in
7484 the ProfilePath (this is likely to be c:\windows\profiles\username),
7485 ask them if they have any important files stored on their desktop
7486 or in their start menu. delete the contents of the directory
7487 ProfilePath (making a backup if any of the files are needed).
7490 > This will have the effect of removing the local (read-only hidden
7491 system file) user.DAT in their profile directory, as well as the
7492 local "desktop", "nethood", "start menu" and "programs" folders.
7494 ></LI
7495 ><LI
7497 > search for the user's .PWL password-caching file in the c:\windows
7498 directory, and delete it.
7500 ></LI
7501 ><LI
7503 > log off the windows 95 client.
7505 ></LI
7506 ><LI
7508 > check the contents of the profile path (see "logon path" described
7509 above), and delete the user.DAT or user.MAN file for the user,
7510 making a backup if required.
7512 ></LI
7513 ></OL
7515 >If all else fails, increase samba's debug log levels to between 3 and 10,
7516 and / or run a packet trace program such as tcpdump or netmon.exe, and
7517 look for any error reports.</P
7519 >If you have access to an NT server, then first set up roaming profiles
7520 and / or netlogons on the NT server. Make a packet trace, or examine
7521 the example packet traces provided with NT server, and see what the
7522 differences are with the equivalent samba trace.</P
7523 ></DIV
7524 ><DIV
7525 CLASS="SECT3"
7526 ><HR><H3
7527 CLASS="SECT3"
7529 NAME="AEN1579"
7530 >8.8.2.5. Windows NT Workstation 4.0</A
7531 ></H3
7533 >When a user first logs in to a Windows NT Workstation, the profile
7534 NTuser.DAT is created. The profile location can be now specified
7535 through the "logon path" parameter. </P
7536 ><DIV
7537 CLASS="NOTE"
7538 ><BLOCKQUOTE
7539 CLASS="NOTE"
7542 >Note: </B
7543 >[lkcl 10aug97 - i tried setting the path to
7544 \\samba-server\homes\profile, and discovered that this fails because
7545 a background process maintains the connection to the [homes] share
7546 which does _not_ close down in between user logins. you have to
7547 have \\samba-server\%L\profile, where user is the username created
7548 from the [homes] share].</P
7549 ></BLOCKQUOTE
7550 ></DIV
7552 >There is a parameter that is now available for use with NT Profiles:
7553 "logon drive". This should be set to "h:" or any other drive, and
7554 should be used in conjunction with the new "logon home" parameter.</P
7556 >The entry for the NT 4.0 profile is a _directory_ not a file. The NT
7557 help on profiles mentions that a directory is also created with a .PDS
7558 extension. The user, while logging in, must have write permission to
7559 create the full profile path (and the folder with the .PDS extension)
7560 [lkcl 10aug97 - i found that the creation of the .PDS directory failed,
7561 and had to create these manually for each user, with a shell script.
7562 also, i presume, but have not tested, that the full profile path must
7563 be browseable just as it is for w95, due to the manner in which they
7564 attempt to create the full profile path: test existence of each path
7565 component; create path component].</P
7567 >In the profile directory, NT creates more folders than 95. It creates
7568 "Application Data" and others, as well as "Desktop", "Nethood",
7569 "Start Menu" and "Programs". The profile itself is stored in a file
7570 NTuser.DAT. Nothing appears to be stored in the .PDS directory, and
7571 its purpose is currently unknown.</P
7573 >You can use the System Control Panel to copy a local profile onto
7574 a samba server (see NT Help on profiles: it is also capable of firing
7575 up the correct location in the System Control Panel for you). The
7576 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
7577 turns a profile into a mandatory one.</P
7578 ><DIV
7579 CLASS="NOTE"
7580 ><BLOCKQUOTE
7581 CLASS="NOTE"
7584 >Note: </B
7585 >[lkcl 10aug97 - i notice that NT Workstation tells me that it is
7586 downloading a profile from a slow link. whether this is actually the
7587 case, or whether there is some configuration issue, as yet unknown,
7588 that makes NT Workstation _think_ that the link is a slow one is a
7589 matter to be resolved].</P
7591 >[lkcl 20aug97 - after samba digest correspondence, one user found, and
7592 another confirmed, that profiles cannot be loaded from a samba server
7593 unless "security = user" and "encrypt passwords = yes" (see the file
7594 ENCRYPTION.txt) or "security = server" and "password server = ip.address.
7595 of.yourNTserver" are used. Either of these options will allow the NT
7596 workstation to access the samba server using LAN manager encrypted
7597 passwords, without the user intervention normally required by NT
7598 workstation for clear-text passwords].</P
7600 >[lkcl 25aug97 - more comments received about NT profiles: the case of
7601 the profile _matters_. the file _must_ be called NTuser.DAT or, for
7602 a mandatory profile, NTuser.MAN].</P
7603 ></BLOCKQUOTE
7604 ></DIV
7605 ></DIV
7606 ><DIV
7607 CLASS="SECT3"
7608 ><HR><H3
7609 CLASS="SECT3"
7611 NAME="AEN1592"
7612 >8.8.2.6. Windows NT Server</A
7613 ></H3
7615 >There is nothing to stop you specifying any path that you like for the
7616 location of users' profiles. Therefore, you could specify that the
7617 profile be stored on a samba server, or any other SMB server, as long as
7618 that SMB server supports encrypted passwords.</P
7619 ></DIV
7620 ><DIV
7621 CLASS="SECT3"
7622 ><HR><H3
7623 CLASS="SECT3"
7625 NAME="AEN1595"
7626 >8.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0</A
7627 ></H3
7628 ><DIV
7629 CLASS="WARNING"
7631 ></P
7632 ><TABLE
7633 CLASS="WARNING"
7634 BORDER="1"
7635 WIDTH="100%"
7636 ><TR
7637 ><TD
7638 ALIGN="CENTER"
7640 >Potentially outdated or incorrect material follows</B
7641 ></TD
7642 ></TR
7643 ><TR
7644 ><TD
7645 ALIGN="LEFT"
7647 >I think this is all bogus, but have not deleted it. (Richard Sharpe)</P
7648 ></TD
7649 ></TR
7650 ></TABLE
7651 ></DIV
7653 >The default logon path is \\%N\U%. NT Workstation will attempt to create
7654 a directory "\\samba-server\username.PDS" if you specify the logon path
7655 as "\\samba-server\username" with the NT User Manager. Therefore, you
7656 will need to specify (for example) "\\samba-server\username\profile".
7657 NT 4.0 will attempt to create "\\samba-server\username\profile.PDS", which
7658 is more likely to succeed.</P
7660 >If you then want to share the same Start Menu / Desktop with W95, you will
7661 need to specify "logon path = \\samba-server\username\profile" [lkcl 10aug97
7662 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
7663 to run from the c:\winnt\system32 directory. this directory is obviously
7664 unlikely to exist on a Win95-only host].</P
7666 >&#13;If you have this set up correctly, you will find separate user.DAT and
7667 NTuser.DAT files in the same profile directory.</P
7668 ><DIV
7669 CLASS="NOTE"
7670 ><BLOCKQUOTE
7671 CLASS="NOTE"
7674 >Note: </B
7675 >[lkcl 25aug97 - there are some issues to resolve with downloading of
7676 NT profiles, probably to do with time/date stamps. i have found that
7677 NTuser.DAT is never updated on the workstation after the first time that
7678 it is copied to the local workstation profile directory. this is in
7679 contrast to w95, where it _does_ transfer / update profiles correctly].</P
7680 ></BLOCKQUOTE
7681 ></DIV
7682 ></DIV
7683 ></DIV
7684 ></DIV
7685 ><DIV
7686 CLASS="SECT1"
7687 ><HR><H1
7688 CLASS="SECT1"
7690 NAME="AEN1605"
7691 >8.9. DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
7692 ></H1
7693 ><DIV
7694 CLASS="WARNING"
7696 ></P
7697 ><TABLE
7698 CLASS="WARNING"
7699 BORDER="1"
7700 WIDTH="100%"
7701 ><TR
7702 ><TD
7703 ALIGN="CENTER"
7705 >Possibly Outdated Material</B
7706 ></TD
7707 ></TR
7708 ><TR
7709 ><TD
7710 ALIGN="LEFT"
7712 > This appendix was originally authored by John H Terpstra of
7713 the Samba Team and is included here for posterity.
7715 ></TD
7716 ></TR
7717 ></TABLE
7718 ></DIV
7720 ><EM
7721 >NOTE :</EM
7723 The term "Domain Controller" and those related to it refer to one specific
7724 method of authentication that can underly an SMB domain. Domain Controllers
7725 prior to Windows NT Server 3.1 were sold by various companies and based on
7726 private extensions to the LAN Manager 2.1 protocol. Windows NT introduced
7727 Microsoft-specific ways of distributing the user authentication database.
7728 See DOMAIN.txt for examples of how Samba can participate in or create
7729 SMB domains based on shared authentication database schemes other than the
7730 Windows NT SAM.</P
7732 >Windows NT Server can be installed as either a plain file and print server
7733 (WORKGROUP workstation or server) or as a server that participates in Domain
7734 Control (DOMAIN member, Primary Domain controller or Backup Domain controller).
7735 The same is true for OS/2 Warp Server, Digital Pathworks and other similar
7736 products, all of which can participate in Domain Control along with Windows NT.</P
7738 >To many people these terms can be confusing, so let's try to clear the air.</P
7740 >Every Windows NT system (workstation or server) has a registry database.
7741 The registry contains entries that describe the initialization information
7742 for all services (the equivalent of Unix Daemons) that run within the Windows
7743 NT environment. The registry also contains entries that tell application
7744 software where to find dynamically loadable libraries that they depend upon.
7745 In fact, the registry contains entries that describes everything that anything
7746 may need to know to interact with the rest of the system.</P
7748 >The registry files can be located on any Windows NT machine by opening a
7749 command prompt and typing:</P
7751 ><TT
7752 CLASS="PROMPT"
7753 >C:\WINNT\&#62;</TT
7754 > dir %SystemRoot%\System32\config</P
7756 >The environment variable %SystemRoot% value can be obtained by typing:</P
7758 ><TT
7759 CLASS="PROMPT"
7760 >C:\WINNT&#62;</TT
7761 >echo %SystemRoot%</P
7763 >The active parts of the registry that you may want to be familiar with are
7764 the files called: default, system, software, sam and security.</P
7766 >In a domain environment, Microsoft Windows NT domain controllers participate
7767 in replication of the SAM and SECURITY files so that all controllers within
7768 the domain have an exactly identical copy of each.</P
7770 >The Microsoft Windows NT system is structured within a security model that
7771 says that all applications and services must authenticate themselves before
7772 they can obtain permission from the security manager to do what they set out
7773 to do.</P
7775 >The Windows NT User database also resides within the registry. This part of
7776 the registry contains the user's security identifier, home directory, group
7777 memberships, desktop profile, and so on.</P
7779 >Every Windows NT system (workstation as well as server) will have its own
7780 registry. Windows NT Servers that participate in Domain Security control
7781 have a database that they share in common - thus they do NOT own an
7782 independent full registry database of their own, as do Workstations and
7783 plain Servers.</P
7785 >The User database is called the SAM (Security Access Manager) database and
7786 is used for all user authentication as well as for authentication of inter-
7787 process authentication (i.e. to ensure that the service action a user has
7788 requested is permitted within the limits of that user's privileges).</P
7790 >The Samba team have produced a utility that can dump the Windows NT SAM into
7791 smbpasswd format: see ENCRYPTION.txt for information on smbpasswd and
7792 /pub/samba/pwdump on your nearest Samba mirror for the utility. This
7793 facility is useful but cannot be easily used to implement SAM replication
7794 to Samba systems.</P
7796 >Windows for Workgroups, Windows 95, and Windows NT Workstations and Servers
7797 can participate in a Domain security system that is controlled by Windows NT
7798 servers that have been correctly configured. Almost every domain will have
7799 ONE Primary Domain Controller (PDC). It is desirable that each domain will
7800 have at least one Backup Domain Controller (BDC).</P
7802 >The PDC and BDCs then participate in replication of the SAM database so that
7803 each Domain Controlling participant will have an up to date SAM component
7804 within its registry.</P
7805 ></DIV
7806 ></DIV
7807 ><DIV
7808 CLASS="CHAPTER"
7809 ><HR><H1
7811 NAME="WINBIND"
7812 >Chapter 9. Unified Logons between Windows NT and UNIX using Winbind</A
7813 ></H1
7814 ><DIV
7815 CLASS="SECT1"
7816 ><H1
7817 CLASS="SECT1"
7819 NAME="AEN1648"
7820 >9.1. Abstract</A
7821 ></H1
7823 >Integration of UNIX and Microsoft Windows NT through
7824 a unified logon has been considered a "holy grail" in heterogeneous
7825 computing environments for a long time. We present <EM
7826 >winbind
7827 </EM
7828 >, a component of the Samba suite of programs as a
7829 solution to the unified logon problem. Winbind uses a UNIX implementation
7830 of Microsoft RPC calls, Pluggable Authentication Modules, and the Name
7831 Service Switch to allow Windows NT domain users to appear and operate
7832 as UNIX users on a UNIX machine. This paper describes the winbind
7833 system, explaining the functionality it provides, how it is configured,
7834 and how it works internally.</P
7835 ></DIV
7836 ><DIV
7837 CLASS="SECT1"
7838 ><HR><H1
7839 CLASS="SECT1"
7841 NAME="AEN1652"
7842 >9.2. Introduction</A
7843 ></H1
7845 >It is well known that UNIX and Microsoft Windows NT have
7846 different models for representing user and group information and
7847 use different technologies for implementing them. This fact has
7848 made it difficult to integrate the two systems in a satisfactory
7849 manner.</P
7851 >One common solution in use today has been to create
7852 identically named user accounts on both the UNIX and Windows systems
7853 and use the Samba suite of programs to provide file and print services
7854 between the two. This solution is far from perfect however, as
7855 adding and deleting users on both sets of machines becomes a chore
7856 and two sets of passwords are required both of which which
7857 can lead to synchronization problems between the UNIX and Windows
7858 systems and confusion for users.</P
7860 >We divide the unified logon problem for UNIX machines into
7861 three smaller problems:</P
7863 ></P
7864 ><UL
7865 ><LI
7867 >Obtaining Windows NT user and group information
7869 ></LI
7870 ><LI
7872 >Authenticating Windows NT users
7874 ></LI
7875 ><LI
7877 >Password changing for Windows NT users
7879 ></LI
7880 ></UL
7882 >Ideally, a prospective solution to the unified logon problem
7883 would satisfy all the above components without duplication of
7884 information on the UNIX machines and without creating additional
7885 tasks for the system administrator when maintaining users and
7886 groups on either system. The winbind system provides a simple
7887 and elegant solution to all three components of the unified logon
7888 problem.</P
7889 ></DIV
7890 ><DIV
7891 CLASS="SECT1"
7892 ><HR><H1
7893 CLASS="SECT1"
7895 NAME="AEN1665"
7896 >9.3. What Winbind Provides</A
7897 ></H1
7899 >Winbind unifies UNIX and Windows NT account management by
7900 allowing a UNIX box to become a full member of a NT domain. Once
7901 this is done the UNIX box will see NT users and groups as if
7902 they were native UNIX users and groups, allowing the NT domain
7903 to be used in much the same manner that NIS+ is used within
7904 UNIX-only environments.</P
7906 >The end result is that whenever any
7907 program on the UNIX machine asks the operating system to lookup
7908 a user or group name, the query will be resolved by asking the
7909 NT domain controller for the specied domain to do the lookup.
7910 Because Winbind hooks into the operating system at a low level
7911 (via the NSS name resolution modules in the C library) this
7912 redirection to the NT domain controller is completely
7913 transparent.</P
7915 >Users on the UNIX machine can then use NT user and group
7916 names as they would use "native" UNIX names. They can chown files
7917 so that they are owned by NT domain users or even login to the
7918 UNIX machine and run a UNIX X-Window session as a domain user.</P
7920 >The only obvious indication that Winbind is being used is
7921 that user and group names take the form DOMAIN\user and
7922 DOMAIN\group. This is necessary as it allows Winbind to determine
7923 that redirection to a domain controller is wanted for a particular
7924 lookup and which trusted domain is being referenced.</P
7926 >Additionally, Winbind provides a authentication service
7927 that hooks into the Pluggable Authentication Modules (PAM) system
7928 to provide authentication via a NT domain to any PAM enabled
7929 applications. This capability solves the problem of synchronizing
7930 passwords between systems as all passwords are stored in a single
7931 location (on the domain controller).</P
7932 ><DIV
7933 CLASS="SECT2"
7934 ><HR><H2
7935 CLASS="SECT2"
7937 NAME="AEN1672"
7938 >9.3.1. Target Uses</A
7939 ></H2
7941 >Winbind is targeted at organizations that have an
7942 existing NT based domain infrastructure into which they wish
7943 to put UNIX workstations or servers. Winbind will allow these
7944 organizations to deploy UNIX workstations without having to
7945 maintain a separate account infrastructure. This greatly simplies
7946 the administrative overhead of deploying UNIX workstations into
7947 a NT based organization.</P
7949 >Another interesting way in which we expect Winbind to
7950 be used is as a central part of UNIX based appliances. Appliances
7951 that provide file and print services to Microsoft based networks
7952 will be able to use Winbind to provide seamless integration of
7953 the appliance into the domain.</P
7954 ></DIV
7955 ></DIV
7956 ><DIV
7957 CLASS="SECT1"
7958 ><HR><H1
7959 CLASS="SECT1"
7961 NAME="AEN1676"
7962 >9.4. How Winbind Works</A
7963 ></H1
7965 >The winbind system is designed around a client/server
7966 architecture. A long running <B
7967 CLASS="COMMAND"
7968 >winbindd</B
7969 > daemon
7970 listens on a UNIX domain socket waiting for requests
7971 to arrive. These requests are generated by the NSS and PAM
7972 clients and processed sequentially.</P
7974 >The technologies used to implement winbind are described
7975 in detail below.</P
7976 ><DIV
7977 CLASS="SECT2"
7978 ><HR><H2
7979 CLASS="SECT2"
7981 NAME="AEN1681"
7982 >9.4.1. Microsoft Remote Procedure Calls</A
7983 ></H2
7985 >Over the last two years, efforts have been underway
7986 by various Samba Team members to decode various aspects of
7987 the Microsoft Remote Procedure Call (MSRPC) system. This
7988 system is used for most network related operations between
7989 Windows NT machines including remote management, user authentication
7990 and print spooling. Although initially this work was done
7991 to aid the implementation of Primary Domain Controller (PDC)
7992 functionality in Samba, it has also yielded a body of code which
7993 can be used for other purposes.</P
7995 >Winbind uses various MSRPC calls to enumerate domain users
7996 and groups and to obtain detailed information about individual
7997 users or groups. Other MSRPC calls can be used to authenticate
7998 NT domain users and to change user passwords. By directly querying
7999 a Windows PDC for user and group information, winbind maps the
8000 NT account information onto UNIX user and group names.</P
8001 ></DIV
8002 ><DIV
8003 CLASS="SECT2"
8004 ><HR><H2
8005 CLASS="SECT2"
8007 NAME="AEN1685"
8008 >9.4.2. Name Service Switch</A
8009 ></H2
8011 >The Name Service Switch, or NSS, is a feature that is
8012 present in many UNIX operating systems. It allows system
8013 information such as hostnames, mail aliases and user information
8014 to be resolved from different sources. For example, a standalone
8015 UNIX workstation may resolve system information from a series of
8016 flat files stored on the local lesystem. A networked workstation
8017 may first attempt to resolve system information from local files,
8018 then consult a NIS database for user information or a DNS server
8019 for hostname information.</P
8021 >The NSS application programming interface allows winbind
8022 to present itself as a source of system information when
8023 resolving UNIX usernames and groups. Winbind uses this interface,
8024 and information obtained from a Windows NT server using MSRPC
8025 calls to provide a new source of account enumeration. Using standard
8026 UNIX library calls, one can enumerate the users and groups on
8027 a UNIX machine running winbind and see all users and groups in
8028 a NT domain plus any trusted domain as though they were local
8029 users and groups.</P
8031 >The primary control le for NSS is <TT
8032 CLASS="FILENAME"
8033 >/etc/nsswitch.conf
8034 </TT
8035 >. When a UNIX application makes a request to do a lookup
8036 the C library looks in <TT
8037 CLASS="FILENAME"
8038 >/etc/nsswitch.conf</TT
8040 for a line which matches the service type being requested, for
8041 example the "passwd" service type is used when user or group names
8042 are looked up. This config line species which implementations
8043 of that service should be tried and in what order. If the passwd
8044 config line is:</P
8047 CLASS="COMMAND"
8048 >passwd: files example</B
8049 ></P
8051 >then the C library will first load a module called
8053 CLASS="FILENAME"
8054 >/lib/libnss_files.so</TT
8055 > followed by
8056 the module <TT
8057 CLASS="FILENAME"
8058 >/lib/libnss_example.so</TT
8059 >. The
8060 C library will dynamically load each of these modules in turn
8061 and call resolver functions within the modules to try to resolve
8062 the request. Once the request is resolved the C library returns the
8063 result to the application.</P
8065 >This NSS interface provides a very easy way for Winbind
8066 to hook into the operating system. All that needs to be done
8067 is to put <TT
8068 CLASS="FILENAME"
8069 >libnss_winbind.so</TT
8070 > in <TT
8071 CLASS="FILENAME"
8072 >/lib/</TT
8074 then add "winbind" into <TT
8075 CLASS="FILENAME"
8076 >/etc/nsswitch.conf</TT
8077 > at
8078 the appropriate place. The C library will then call Winbind to
8079 resolve user and group names.</P
8080 ></DIV
8081 ><DIV
8082 CLASS="SECT2"
8083 ><HR><H2
8084 CLASS="SECT2"
8086 NAME="AEN1701"
8087 >9.4.3. Pluggable Authentication Modules</A
8088 ></H2
8090 >Pluggable Authentication Modules, also known as PAM,
8091 is a system for abstracting authentication and authorization
8092 technologies. With a PAM module it is possible to specify different
8093 authentication methods for different system applications without
8094 having to recompile these applications. PAM is also useful
8095 for implementing a particular policy for authorization. For example,
8096 a system administrator may only allow console logins from users
8097 stored in the local password file but only allow users resolved from
8098 a NIS database to log in over the network.</P
8100 >Winbind uses the authentication management and password
8101 management PAM interface to integrate Windows NT users into a
8102 UNIX system. This allows Windows NT users to log in to a UNIX
8103 machine and be authenticated against a suitable Primary Domain
8104 Controller. These users can also change their passwords and have
8105 this change take eect directly on the Primary Domain Controller.
8108 >PAM is configured by providing control files in the directory
8110 CLASS="FILENAME"
8111 >/etc/pam.d/</TT
8112 > for each of the services that
8113 require authentication. When an authentication request is made
8114 by an application the PAM code in the C library looks up this
8115 control file to determine what modules to load to do the
8116 authentication check and in what order. This interface makes adding
8117 a new authentication service for Winbind very easy, all that needs
8118 to be done is that the <TT
8119 CLASS="FILENAME"
8120 >pam_winbind.so</TT
8121 > module
8122 is copied to <TT
8123 CLASS="FILENAME"
8124 >/lib/security/</TT
8125 > and the pam
8126 control files for relevant services are updated to allow
8127 authentication via winbind. See the PAM documentation
8128 for more details.</P
8129 ></DIV
8130 ><DIV
8131 CLASS="SECT2"
8132 ><HR><H2
8133 CLASS="SECT2"
8135 NAME="AEN1709"
8136 >9.4.4. User and Group ID Allocation</A
8137 ></H2
8139 >When a user or group is created under Windows NT
8140 is it allocated a numerical relative identifier (RID). This is
8141 slightly different to UNIX which has a range of numbers which are
8142 used to identify users, and the same range in which to identify
8143 groups. It is winbind's job to convert RIDs to UNIX id numbers and
8144 vice versa. When winbind is configured it is given part of the UNIX
8145 user id space and a part of the UNIX group id space in which to
8146 store Windows NT users and groups. If a Windows NT user is
8147 resolved for the first time, it is allocated the next UNIX id from
8148 the range. The same process applies for Windows NT groups. Over
8149 time, winbind will have mapped all Windows NT users and groups
8150 to UNIX user ids and group ids.</P
8152 >The results of this mapping are stored persistently in
8153 a ID mapping database held in a tdb database). This ensures that
8154 RIDs are mapped to UNIX IDs in a consistent way.</P
8155 ></DIV
8156 ><DIV
8157 CLASS="SECT2"
8158 ><HR><H2
8159 CLASS="SECT2"
8161 NAME="AEN1713"
8162 >9.4.5. Result Caching</A
8163 ></H2
8165 >An active system can generate a lot of user and group
8166 name lookups. To reduce the network cost of these lookups winbind
8167 uses a caching scheme based on the SAM sequence number supplied
8168 by NT domain controllers. User or group information returned
8169 by a PDC is cached by winbind along with a sequence number also
8170 returned by the PDC. This sequence number is incremented by
8171 Windows NT whenever any user or group information is modified. If
8172 a cached entry has expired, the sequence number is requested from
8173 the PDC and compared against the sequence number of the cached entry.
8174 If the sequence numbers do not match, then the cached information
8175 is discarded and up to date information is requested directly
8176 from the PDC.</P
8177 ></DIV
8178 ></DIV
8179 ><DIV
8180 CLASS="SECT1"
8181 ><HR><H1
8182 CLASS="SECT1"
8184 NAME="AEN1716"
8185 >9.5. Installation and Configuration</A
8186 ></H1
8188 >The easiest way to install winbind is by using the packages
8189 provided in the <TT
8190 CLASS="FILENAME"
8191 >pub/samba/appliance/</TT
8193 directory on your nearest
8194 Samba mirror. These packages provide snapshots of the Samba source
8195 code and binaries already setup to provide the full functionality
8196 of winbind. This setup is a little more complex than a normal Samba
8197 build as winbind needs a small amount of functionality from a
8198 development code branch called SAMBA_TNG.</P
8200 >Once you have installed the packages you should read
8201 the <B
8202 CLASS="COMMAND"
8203 >winbindd(8)</B
8204 > man page which will provide you
8205 with configuration information and give you sample configuration files.
8206 You may also wish to update the main Samba daemons smbd and nmbd)
8207 with a more recent development release, such as the recently
8208 announced Samba 2.2 alpha release.</P
8209 ></DIV
8210 ><DIV
8211 CLASS="SECT1"
8212 ><HR><H1
8213 CLASS="SECT1"
8215 NAME="AEN1722"
8216 >9.6. Limitations</A
8217 ></H1
8219 >Winbind has a number of limitations in its current
8220 released version which we hope to overcome in future
8221 releases:</P
8223 ></P
8224 ><UL
8225 ><LI
8227 >Winbind is currently only available for
8228 the Linux operating system, although ports to other operating
8229 systems are certainly possible. For such ports to be feasible,
8230 we require the C library of the target operating system to
8231 support the Name Service Switch and Pluggable Authentication
8232 Modules systems. This is becoming more common as NSS and
8233 PAM gain support among UNIX vendors.</P
8234 ></LI
8235 ><LI
8237 >The mappings of Windows NT RIDs to UNIX ids
8238 is not made algorithmically and depends on the order in which
8239 unmapped users or groups are seen by winbind. It may be difficult
8240 to recover the mappings of rid to UNIX id mapping if the file
8241 containing this information is corrupted or destroyed.</P
8242 ></LI
8243 ><LI
8245 >Currently the winbind PAM module does not take
8246 into account possible workstation and logon time restrictions
8247 that may be been set for Windows NT users.</P
8248 ></LI
8249 ><LI
8251 >Building winbind from source is currently
8252 quite tedious as it requires combining source code from two Samba
8253 branches. Work is underway to solve this by providing all
8254 the necessary functionality in the main Samba code branch.</P
8255 ></LI
8256 ></UL
8257 ></DIV
8258 ><DIV
8259 CLASS="SECT1"
8260 ><HR><H1
8261 CLASS="SECT1"
8263 NAME="AEN1734"
8264 >9.7. Conclusion</A
8265 ></H1
8267 >The winbind system, through the use of the Name Service
8268 Switch, Pluggable Authentication Modules, and appropriate
8269 Microsoft RPC calls have allowed us to provide seamless
8270 integration of Microsoft Windows NT domain users on a
8271 UNIX system. The result is a great reduction in the administrative
8272 cost of running a mixed UNIX and NT network.</P
8273 ></DIV
8274 ></DIV
8275 ><DIV
8276 CLASS="CHAPTER"
8277 ><HR><H1
8279 NAME="OS2"
8280 >Chapter 10. OS2 Client HOWTO</A
8281 ></H1
8282 ><DIV
8283 CLASS="SECT1"
8284 ><H1
8285 CLASS="SECT1"
8287 NAME="AEN1748"
8288 >10.1. FAQs</A
8289 ></H1
8290 ><DIV
8291 CLASS="SECT2"
8292 ><H2
8293 CLASS="SECT2"
8295 NAME="AEN1750"
8296 >10.1.1. How can I configure OS/2 Warp Connect or
8297 OS/2 Warp 4 as a client for Samba?</A
8298 ></H2
8300 >A more complete answer to this question can be
8301 found on <A
8302 HREF="http://carol.wins.uva.nl/~leeuw/samba/warp.html"
8303 TARGET="_top"
8304 > http://carol.wins.uva.nl/~leeuw/samba/warp.html</A
8305 >.</P
8307 >Basically, you need three components:</P
8309 ></P
8310 ><UL
8311 ><LI
8313 >The File and Print Client ('IBM Peer')
8315 ></LI
8316 ><LI
8318 >TCP/IP ('Internet support')
8320 ></LI
8321 ><LI
8323 >The "NetBIOS over TCP/IP" driver ('TCPBEUI')
8325 ></LI
8326 ></UL
8328 >Installing the first two together with the base operating
8329 system on a blank system is explained in the Warp manual. If Warp
8330 has already been installed, but you now want to install the
8331 networking support, use the "Selective Install for Networking"
8332 object in the "System Setup" folder.</P
8334 >Adding the "NetBIOS over TCP/IP" driver is not described
8335 in the manual and just barely in the online documentation. Start
8336 MPTS.EXE, click on OK, click on "Configure LAPS" and click
8337 on "IBM OS/2 NETBIOS OVER TCP/IP" in 'Protocols'. This line
8338 is then moved to 'Current Configuration'. Select that line,
8339 click on "Change number" and increase it from 0 to 1. Save this
8340 configuration.</P
8342 >If the Samba server(s) is not on your local subnet, you
8343 can optionally add IP names and addresses of these servers
8344 to the "Names List", or specify a WINS server ('NetBIOS
8345 Nameserver' in IBM and RFC terminology). For Warp Connect you
8346 may need to download an update for 'IBM Peer' to bring it on
8347 the same level as Warp 4. See the webpage mentioned above.</P
8348 ></DIV
8349 ><DIV
8350 CLASS="SECT2"
8351 ><HR><H2
8352 CLASS="SECT2"
8354 NAME="AEN1765"
8355 >10.1.2. How can I configure OS/2 Warp 3 (not Connect),
8356 OS/2 1.2, 1.3 or 2.x for Samba?</A
8357 ></H2
8359 >You can use the free Microsoft LAN Manager 2.2c Client
8360 for OS/2 from
8362 HREF="ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/"
8363 TARGET="_top"
8364 > ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/</A
8366 See <A
8367 HREF="http://carol.wins.uva.nl/~leeuw/lanman.html"
8368 TARGET="_top"
8369 > http://carol.wins.uva.nl/~leeuw/lanman.html</A
8370 > for
8371 more information on how to install and use this client. In
8372 a nutshell, edit the file \OS2VER in the root directory of
8373 the OS/2 boot partition and add the lines:</P
8375 ><TABLE
8376 BORDER="0"
8377 BGCOLOR="#E0E0E0"
8378 WIDTH="100%"
8379 ><TR
8380 ><TD
8381 ><PRE
8382 CLASS="PROGRAMLISTING"
8383 > 20=setup.exe
8384 20=netwksta.sys
8385 20=netvdd.sys
8386 </PRE
8387 ></TD
8388 ></TR
8389 ></TABLE
8390 ></P
8392 >before you install the client. Also, don't use the
8393 included NE2000 driver because it is buggy. Try the NE2000
8394 or NS2000 driver from
8396 HREF="ftp://ftp.cdrom.com/pub/os2/network/ndis/"
8397 TARGET="_top"
8398 > ftp://ftp.cdrom.com/pub/os2/network/ndis/</A
8399 > instead.
8401 ></DIV
8402 ><DIV
8403 CLASS="SECT2"
8404 ><HR><H2
8405 CLASS="SECT2"
8407 NAME="AEN1774"
8408 >10.1.3. Are there any other issues when OS/2 (any version)
8409 is used as a client?</A
8410 ></H2
8412 >When you do a NET VIEW or use the "File and Print
8413 Client Resource Browser", no Samba servers show up. This can
8414 be fixed by a patch from <A
8415 HREF="http://carol.wins.uva.nl/~leeuw/samba/fix.html"
8416 TARGET="_top"
8417 > http://carol.wins.uva.nl/~leeuw/samba/fix.html</A
8419 The patch will be included in a later version of Samba. It also
8420 fixes a couple of other problems, such as preserving long
8421 filenames when objects are dragged from the Workplace Shell
8422 to the Samba server. </P
8423 ></DIV
8424 ><DIV
8425 CLASS="SECT2"
8426 ><HR><H2
8427 CLASS="SECT2"
8429 NAME="AEN1778"
8430 >10.1.4. How do I get printer driver download working
8431 for OS/2 clients?</A
8432 ></H2
8434 >First, create a share called [PRINTDRV] that is
8435 world-readable. Copy your OS/2 driver files there. Note
8436 that the .EA_ files must still be separate, so you will need
8437 to use the original install files, and not copy an installed
8438 driver from an OS/2 system.</P
8440 >Install the NT driver first for that printer. Then,
8441 add to your smb.conf a parameter, "os2 driver map =
8443 CLASS="REPLACEABLE"
8445 >filename</I
8446 ></TT
8447 >". Then, in the file
8448 specified by <TT
8449 CLASS="REPLACEABLE"
8451 >filename</I
8452 ></TT
8453 >, map the
8454 name of the NT driver name to the OS/2 driver name as
8455 follows:</P
8457 >&#60;nt driver name&#62; = &#60;os2 driver
8458 name&#62;.&#60;device name&#62;, e.g.:
8459 HP LaserJet 5L = LASERJET.HP LaserJet 5L</P
8461 >You can have multiple drivers mapped in this file.</P
8463 >If you only specify the OS/2 driver name, and not the
8464 device name, the first attempt to download the driver will
8465 actually download the files, but the OS/2 client will tell
8466 you the driver is not available. On the second attempt, it
8467 will work. This is fixed simply by adding the device name
8468 to the mapping, after which it will work on the first attempt.
8470 ></DIV
8471 ></DIV
8472 ></DIV
8473 ><DIV
8474 CLASS="CHAPTER"
8475 ><HR><H1
8477 NAME="CVS-ACCESS"
8478 >Chapter 11. HOWTO Access Samba source code via CVS</A
8479 ></H1
8480 ><DIV
8481 CLASS="SECT1"
8482 ><H1
8483 CLASS="SECT1"
8485 NAME="AEN1794"
8486 >11.1. Introduction</A
8487 ></H1
8489 >Samba is developed in an open environment. Developers use CVS
8490 (Concurrent Versioning System) to "checkin" (also known as
8491 "commit") new source code. Samba's various CVS branches can
8492 be accessed via anonymous CVS using the instructions
8493 detailed in this chapter.</P
8495 >This document is a modified version of the instructions found at
8497 HREF="http://samba.org/samba/cvs.html"
8498 TARGET="_top"
8499 >http://samba.org/samba/cvs.html</A
8500 ></P
8501 ></DIV
8502 ><DIV
8503 CLASS="SECT1"
8504 ><HR><H1
8505 CLASS="SECT1"
8507 NAME="AEN1799"
8508 >11.2. CVS Access to samba.org</A
8509 ></H1
8511 >The machine samba.org runs a publicly accessible CVS
8512 repository for access to the source code of several packages,
8513 including samba, rsync and jitterbug. There are two main ways of
8514 accessing the CVS server on this host.</P
8515 ><DIV
8516 CLASS="SECT2"
8517 ><HR><H2
8518 CLASS="SECT2"
8520 NAME="AEN1802"
8521 >11.2.1. Access via CVSweb</A
8522 ></H2
8524 >You can access the source code via your
8525 favourite WWW browser. This allows you to access the contents of
8526 individual files in the repository and also to look at the revision
8527 history and commit logs of individual files. You can also ask for a diff
8528 listing between any two versions on the repository.</P
8530 >Use the URL : <A
8531 HREF="http://samba.org/cgi-bin/cvsweb"
8532 TARGET="_top"
8533 >http://samba.org/cgi-bin/cvsweb</A
8534 ></P
8535 ></DIV
8536 ><DIV
8537 CLASS="SECT2"
8538 ><HR><H2
8539 CLASS="SECT2"
8541 NAME="AEN1807"
8542 >11.2.2. Access via cvs</A
8543 ></H2
8545 >You can also access the source code via a
8546 normal cvs client. This gives you much more control over you can
8547 do with the repository and allows you to checkout whole source trees
8548 and keep them up to date via normal cvs commands. This is the
8549 preferred method of access if you are a developer and not
8550 just a casual browser.</P
8552 >To download the latest cvs source code, point your
8553 browser at the URL : <A
8554 HREF="http://www.cyclic.com/"
8555 TARGET="_top"
8556 >http://www.cyclic.com/</A
8558 and click on the 'How to get cvs' link. CVS is free software under
8559 the GNU GPL (as is Samba). Note that there are several graphical CVS clients
8560 which provide a graphical interface to the sometimes mundane CVS commands.
8561 Links to theses clients are also available from http://www.cyclic.com.</P
8563 >To gain access via anonymous cvs use the following steps.
8564 For this example it is assumed that you want a copy of the
8565 samba source code. For the other source code repositories
8566 on this system just substitute the correct package name</P
8568 ></P
8569 ><OL
8570 TYPE="1"
8571 ><LI
8573 > Install a recent copy of cvs. All you really need is a
8574 copy of the cvs client binary.
8576 ></LI
8577 ><LI
8579 > Run the command
8582 > <B
8583 CLASS="COMMAND"
8584 >cvs -d :pserver:cvs@samba.org:/cvsroot login</B
8588 > When it asks you for a password type <TT
8589 CLASS="USERINPUT"
8591 >cvs</B
8592 ></TT
8595 ></LI
8596 ><LI
8598 > Run the command
8601 > <B
8602 CLASS="COMMAND"
8603 >cvs -d :pserver:cvs@samba.org:/cvsroot co samba</B
8607 > This will create a directory called samba containing the
8608 latest samba source code (i.e. the HEAD tagged cvs branch). This
8609 currently corresponds to the 3.0 development tree.
8612 > CVS branches other HEAD can be obtained by using the <TT
8613 CLASS="PARAMETER"
8615 >-r</I
8616 ></TT
8618 and defining a tag name. A list of branch tag names can be found on the
8619 "Development" page of the samba web site. A common request is to obtain the
8620 latest 2.2 release code. This could be done by using the following command.
8623 > <B
8624 CLASS="COMMAND"
8625 >cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_2_2 samba</B
8628 ></LI
8629 ><LI
8631 > Whenever you want to merge in the latest code changes use
8632 the following command from within the samba directory:
8635 > <B
8636 CLASS="COMMAND"
8637 >cvs update -d -P</B
8640 ></LI
8641 ></OL
8642 ></DIV
8643 ></DIV
8644 ></DIV
8645 ><HR><H1
8647 NAME="AEN1835"
8648 >Index</A
8649 ></H1
8650 ><DL
8651 ><DT
8652 >Primary Domain Controller,
8654 HREF="x1104.htm"
8655 >Background</A
8657 </DT
8658 ></DL
8659 ></DIV
8660 ></BODY
8661 ></HTML