merge from 2.2
[Samba/gbeck.git] / docs / htmldocs / Samba-HOWTO-Collection.html
blobc7393bc71bc34bbb3d5b6ddcfd082d3a5caea432
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="AEN9"
38 >Abstract</A
39 ></H1
40 ><P
41 >This book is a collection of HOWTOs added to Samba documentation over the years.
42 I try to ensure that all are current, but sometimes the is a larger job
43 than one person can maintain. The most recent version of this document
44 can be found at <A
45 HREF="http://www.samba.org/"
46 TARGET="_top"
47 >http://www.samba.org/</A
49 on the "Documentation" page. Please send updates to <A
50 HREF="mailto:jerry@samba.org"
51 TARGET="_top"
52 >jerry@samba.org</A
53 >.</P
54 ><P
55 >Cheers, jerry</P
56 ><DIV
57 CLASS="TOC"
58 ><DL
59 ><DT
60 ><B
61 >Table of Contents</B
62 ></DT
63 ><DT
64 >1. <A
65 HREF="#AEN15"
66 >How to Install and Test SAMBA</A
67 ></DT
68 ><DD
69 ><DL
70 ><DT
71 >1.1. <A
72 HREF="#AEN17"
73 >Step 0: Read the man pages</A
74 ></DT
75 ><DT
76 >1.2. <A
77 HREF="#AEN25"
78 >Step 1: Building the Binaries</A
79 ></DT
80 ><DT
81 >1.3. <A
82 HREF="#AEN53"
83 >Step 2: The all important step</A
84 ></DT
85 ><DT
86 >1.4. <A
87 HREF="#AEN57"
88 >Step 3: Create the smb configuration file.</A
89 ></DT
90 ><DT
91 >1.5. <A
92 HREF="#AEN71"
93 >Step 4: Test your config file with
95 CLASS="COMMAND"
96 >testparm</B
97 ></A
98 ></DT
99 ><DT
100 >1.6. <A
101 HREF="#AEN77"
102 >Step 5: Starting the smbd and nmbd</A
103 ></DT
104 ><DD
105 ><DL
106 ><DT
107 >1.6.1. <A
108 HREF="#AEN87"
109 >Step 5a: Starting from inetd.conf</A
110 ></DT
111 ><DT
112 >1.6.2. <A
113 HREF="#AEN116"
114 >Step 5b. Alternative: starting it as a daemon</A
115 ></DT
116 ></DL
117 ></DD
118 ><DT
119 >1.7. <A
120 HREF="#AEN132"
121 >Step 6: Try listing the shares available on your
122 server</A
123 ></DT
124 ><DT
125 >1.8. <A
126 HREF="#AEN141"
127 >Step 7: Try connecting with the unix client</A
128 ></DT
129 ><DT
130 >1.9. <A
131 HREF="#AEN157"
132 >Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT,
133 Win2k, OS/2, etc... client</A
134 ></DT
135 ><DT
136 >1.10. <A
137 HREF="#AEN171"
138 >What If Things Don't Work?</A
139 ></DT
140 ><DD
141 ><DL
142 ><DT
143 >1.10.1. <A
144 HREF="#AEN176"
145 >Diagnosing Problems</A
146 ></DT
147 ><DT
148 >1.10.2. <A
149 HREF="#AEN180"
150 >Scope IDs</A
151 ></DT
152 ><DT
153 >1.10.3. <A
154 HREF="#AEN183"
155 >Choosing the Protocol Level</A
156 ></DT
157 ><DT
158 >1.10.4. <A
159 HREF="#AEN192"
160 >Printing from UNIX to a Client PC</A
161 ></DT
162 ><DT
163 >1.10.5. <A
164 HREF="#AEN196"
165 >Locking</A
166 ></DT
167 ><DT
168 >1.10.6. <A
169 HREF="#AEN206"
170 >Mapping Usernames</A
171 ></DT
172 ><DT
173 >1.10.7. <A
174 HREF="#AEN209"
175 >Other Character Sets</A
176 ></DT
177 ></DL
178 ></DD
179 ></DL
180 ></DD
181 ><DT
182 >2. <A
183 HREF="#AEN212"
184 >Integrating MS Windows networks with Samba</A
185 ></DT
186 ><DD
187 ><DL
188 ><DT
189 >2.1. <A
190 HREF="#AEN223"
191 >Agenda</A
192 ></DT
193 ><DT
194 >2.2. <A
195 HREF="#AEN245"
196 >Name Resolution in a pure Unix/Linux world</A
197 ></DT
198 ><DD
199 ><DL
200 ><DT
201 >2.2.1. <A
202 HREF="#AEN248"
203 ><TT
204 CLASS="FILENAME"
205 >/etc/hosts</TT
206 ></A
207 ></DT
208 ><DT
209 >2.2.2. <A
210 HREF="#AEN264"
211 ><TT
212 CLASS="FILENAME"
213 >/etc/resolv.conf</TT
214 ></A
215 ></DT
216 ><DT
217 >2.2.3. <A
218 HREF="#AEN275"
219 ><TT
220 CLASS="FILENAME"
221 >/etc/host.conf</TT
222 ></A
223 ></DT
224 ><DT
225 >2.2.4. <A
226 HREF="#AEN283"
227 ><TT
228 CLASS="FILENAME"
229 >/etc/nsswitch.conf</TT
230 ></A
231 ></DT
232 ></DL
233 ></DD
234 ><DT
235 >2.3. <A
236 HREF="#AEN295"
237 >Name resolution as used within MS Windows networking</A
238 ></DT
239 ><DD
240 ><DL
241 ><DT
242 >2.3.1. <A
243 HREF="#AEN307"
244 >The NetBIOS Name Cache</A
245 ></DT
246 ><DT
247 >2.3.2. <A
248 HREF="#AEN312"
249 >The LMHOSTS file</A
250 ></DT
251 ><DT
252 >2.3.3. <A
253 HREF="#AEN320"
254 >HOSTS file</A
255 ></DT
256 ><DT
257 >2.3.4. <A
258 HREF="#AEN325"
259 >DNS Lookup</A
260 ></DT
261 ><DT
262 >2.3.5. <A
263 HREF="#AEN328"
264 >WINS Lookup</A
265 ></DT
266 ></DL
267 ></DD
268 ><DT
269 >2.4. <A
270 HREF="#AEN342"
271 >How browsing functions and how to deploy stable and
272 dependable browsing using Samba</A
273 ></DT
274 ><DT
275 >2.5. <A
276 HREF="#AEN352"
277 >MS Windows security options and how to configure
278 Samba for seemless integration</A
279 ></DT
280 ><DD
281 ><DL
282 ><DT
283 >2.5.1. <A
284 HREF="#AEN369"
285 >Use MS Windows NT as an authentication server</A
286 ></DT
287 ><DT
288 >2.5.2. <A
289 HREF="#AEN377"
290 >Make Samba a member of an MS Windows NT security domain</A
291 ></DT
292 ><DT
293 >2.5.3. <A
294 HREF="#AEN391"
295 >Configure Samba as an authentication server</A
296 ></DT
297 ><DD
298 ><DL
299 ><DT
300 >2.5.3.1. <A
301 HREF="#AEN398"
302 >Users</A
303 ></DT
304 ><DT
305 >2.5.3.2. <A
306 HREF="#AEN405"
307 >MS Windows NT Machine Accounts</A
308 ></DT
309 ></DL
310 ></DD
311 ></DL
312 ></DD
313 ><DT
314 >2.6. <A
315 HREF="#AEN410"
316 >Configuration of Samba as ...</A
317 ></DT
318 ></DL
319 ></DD
320 ><DT
321 >3. <A
322 HREF="#AEN421"
323 >LanMan and NT Password Encryption in Samba 2.x</A
324 ></DT
325 ><DD
326 ><DL
327 ><DT
328 >3.1. <A
329 HREF="#AEN432"
330 >Introduction</A
331 ></DT
332 ><DT
333 >3.2. <A
334 HREF="#AEN436"
335 >How does it work?</A
336 ></DT
337 ><DT
338 >3.3. <A
339 HREF="#AEN447"
340 >Important Notes About Security</A
341 ></DT
342 ><DD
343 ><DL
344 ><DT
345 >3.3.1. <A
346 HREF="#AEN466"
347 >Advantages of SMB Encryption</A
348 ></DT
349 ><DT
350 >3.3.2. <A
351 HREF="#AEN473"
352 >Advantages of non-encrypted passwords</A
353 ></DT
354 ></DL
355 ></DD
356 ><DT
357 >3.4. <A
358 HREF="#AEN482"
360 NAME="SMBPASSWDFILEFORMAT"
361 ></A
362 >The smbpasswd file</A
363 ></DT
364 ><DT
365 >3.5. <A
366 HREF="#AEN534"
367 >The smbpasswd Command</A
368 ></DT
369 ><DT
370 >3.6. <A
371 HREF="#AEN573"
372 >Setting up Samba to support LanManager Encryption</A
373 ></DT
374 ></DL
375 ></DD
376 ><DT
377 >4. <A
378 HREF="#AEN588"
379 >Hosting a Microsoft Distributed File System tree on Samba</A
380 ></DT
381 ><DD
382 ><DL
383 ><DT
384 >4.1. <A
385 HREF="#AEN599"
386 >Instructions</A
387 ></DT
388 ><DD
389 ><DL
390 ><DT
391 >4.1.1. <A
392 HREF="#AEN634"
393 >Notes</A
394 ></DT
395 ></DL
396 ></DD
397 ></DL
398 ></DD
399 ><DT
400 >5. <A
401 HREF="#AEN643"
402 >Printing Support in Samba 2.2.x</A
403 ></DT
404 ><DD
405 ><DL
406 ><DT
407 >5.1. <A
408 HREF="#AEN654"
409 >Introduction</A
410 ></DT
411 ><DT
412 >5.2. <A
413 HREF="#AEN676"
414 >Configuration</A
415 ></DT
416 ><DD
417 ><DL
418 ><DT
419 >5.2.1. <A
420 HREF="#AEN687"
421 >Creating [print$]</A
422 ></DT
423 ><DT
424 >5.2.2. <A
425 HREF="#AEN722"
426 >Setting Drivers for Existing Printers</A
427 ></DT
428 ><DT
429 >5.2.3. <A
430 HREF="#AEN739"
431 >Support a large number of printers</A
432 ></DT
433 ><DT
434 >5.2.4. <A
435 HREF="#AEN750"
436 >Adding New Printers via the Windows NT APW</A
437 ></DT
438 ><DT
439 >5.2.5. <A
440 HREF="#AEN775"
441 >Samba and Printer Ports</A
442 ></DT
443 ></DL
444 ></DD
445 ><DT
446 >5.3. <A
447 HREF="#AEN783"
448 >The Imprints Toolset</A
449 ></DT
450 ><DD
451 ><DL
452 ><DT
453 >5.3.1. <A
454 HREF="#AEN787"
455 >What is Imprints?</A
456 ></DT
457 ><DT
458 >5.3.2. <A
459 HREF="#AEN797"
460 >Creating Printer Driver Packages</A
461 ></DT
462 ><DT
463 >5.3.3. <A
464 HREF="#AEN800"
465 >The Imprints server</A
466 ></DT
467 ><DT
468 >5.3.4. <A
469 HREF="#AEN804"
470 >The Installation Client</A
471 ></DT
472 ></DL
473 ></DD
474 ><DT
475 >5.4. <A
476 HREF="#AEN826"
478 NAME="MIGRATION"
479 ></A
480 >Migration to from Samba 2.0.x to 2.2.x</A
481 ></DT
482 ></DL
483 ></DD
484 ><DT
485 >6. <A
486 HREF="#AEN870"
487 >security = domain in Samba 2.x</A
488 ></DT
489 ><DD
490 ><DL
491 ><DT
492 >6.1. <A
493 HREF="#AEN888"
494 >Joining an NT Domain with Samba 2.2</A
495 ></DT
496 ><DT
497 >6.2. <A
498 HREF="#AEN952"
499 >Samba and Windows 2000 Domains</A
500 ></DT
501 ><DT
502 >6.3. <A
503 HREF="#AEN957"
504 >Why is this better than security = server?</A
505 ></DT
506 ></DL
507 ></DD
508 ><DT
509 >7. <A
510 HREF="#AEN973"
511 >How to Configure Samba 2.2 as a Primary Domain Controller</A
512 ></DT
513 ><DD
514 ><DL
515 ><DT
516 >7.1. <A
517 HREF="#AEN990"
518 >Prerequisite Reading</A
519 ></DT
520 ><DT
521 >7.2. <A
522 HREF="#AEN996"
523 >Background</A
524 ></DT
525 ><DT
526 >7.3. <A
527 HREF="#AEN1036"
528 >Configuring the Samba Domain Controller</A
529 ></DT
530 ><DT
531 >7.4. <A
532 HREF="#AEN1079"
533 >Creating Machine Trust Accounts and Joining Clients
534 to the Domain</A
535 ></DT
536 ><DD
537 ><DL
538 ><DT
539 >7.4.1. <A
540 HREF="#AEN1093"
541 >Manually creating machine trust accounts</A
542 ></DT
543 ><DT
544 >7.4.2. <A
545 HREF="#AEN1121"
546 >Creating machine trust accounts "on the fly"</A
547 ></DT
548 ></DL
549 ></DD
550 ><DT
551 >7.5. <A
552 HREF="#AEN1132"
553 >Common Problems and Errors</A
554 ></DT
555 ><DT
556 >7.6. <A
557 HREF="#AEN1180"
558 >System Policies and Profiles</A
559 ></DT
560 ><DT
561 >7.7. <A
562 HREF="#AEN1224"
563 >What other help can I get ?</A
564 ></DT
565 ><DT
566 >7.8. <A
567 HREF="#AEN1338"
568 >Domain Control for Windows 9x/ME</A
569 ></DT
570 ><DD
571 ><DL
572 ><DT
573 >7.8.1. <A
574 HREF="#AEN1368"
575 >Configuration Instructions: Network Logons</A
576 ></DT
577 ><DT
578 >7.8.2. <A
579 HREF="#AEN1402"
580 >Configuration Instructions: Setting up Roaming User Profiles</A
581 ></DT
582 ><DD
583 ><DL
584 ><DT
585 >7.8.2.1. <A
586 HREF="#AEN1410"
587 >Windows NT Configuration</A
588 ></DT
589 ><DT
590 >7.8.2.2. <A
591 HREF="#AEN1418"
592 >Windows 9X Configuration</A
593 ></DT
594 ><DT
595 >7.8.2.3. <A
596 HREF="#AEN1426"
597 >Win9X and WinNT Configuration</A
598 ></DT
599 ><DT
600 >7.8.2.4. <A
601 HREF="#AEN1433"
602 >Windows 9X Profile Setup</A
603 ></DT
604 ><DT
605 >7.8.2.5. <A
606 HREF="#AEN1469"
607 >Windows NT Workstation 4.0</A
608 ></DT
609 ><DT
610 >7.8.2.6. <A
611 HREF="#AEN1482"
612 >Windows NT Server</A
613 ></DT
614 ><DT
615 >7.8.2.7. <A
616 HREF="#AEN1485"
617 >Sharing Profiles between W95 and NT Workstation 4.0</A
618 ></DT
619 ></DL
620 ></DD
621 ></DL
622 ></DD
623 ><DT
624 >7.9. <A
625 HREF="#AEN1495"
626 >DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
627 ></DT
628 ></DL
629 ></DD
630 ><DT
631 >8. <A
632 HREF="#AEN1520"
633 >Unifed Logons between Windows NT and UNIX using Winbind</A
634 ></DT
635 ><DD
636 ><DL
637 ><DT
638 >8.1. <A
639 HREF="#AEN1538"
640 >Abstract</A
641 ></DT
642 ><DT
643 >8.2. <A
644 HREF="#AEN1542"
645 >Introduction</A
646 ></DT
647 ><DT
648 >8.3. <A
649 HREF="#AEN1555"
650 >What Winbind Provides</A
651 ></DT
652 ><DD
653 ><DL
654 ><DT
655 >8.3.1. <A
656 HREF="#AEN1562"
657 >Target Uses</A
658 ></DT
659 ></DL
660 ></DD
661 ><DT
662 >8.4. <A
663 HREF="#AEN1566"
664 >How Winbind Works</A
665 ></DT
666 ><DD
667 ><DL
668 ><DT
669 >8.4.1. <A
670 HREF="#AEN1571"
671 >Microsoft Remote Procedure Calls</A
672 ></DT
673 ><DT
674 >8.4.2. <A
675 HREF="#AEN1575"
676 >Name Service Switch</A
677 ></DT
678 ><DT
679 >8.4.3. <A
680 HREF="#AEN1591"
681 >Pluggable Authentication Modules</A
682 ></DT
683 ><DT
684 >8.4.4. <A
685 HREF="#AEN1599"
686 >User and Group ID Allocation</A
687 ></DT
688 ><DT
689 >8.4.5. <A
690 HREF="#AEN1603"
691 >Result Caching</A
692 ></DT
693 ></DL
694 ></DD
695 ><DT
696 >8.5. <A
697 HREF="#AEN1606"
698 >Installation and Configuration</A
699 ></DT
700 ><DT
701 >8.6. <A
702 HREF="#AEN1612"
703 >Limitations</A
704 ></DT
705 ><DT
706 >8.7. <A
707 HREF="#AEN1624"
708 >Conclusion</A
709 ></DT
710 ></DL
711 ></DD
712 ><DT
713 >9. <A
714 HREF="#AEN1627"
715 >UNIX Permission Bits and WIndows NT Access Control Lists</A
716 ></DT
717 ><DD
718 ><DL
719 ><DT
720 >9.1. <A
721 HREF="#AEN1638"
722 >Viewing and changing UNIX permissions using the NT
723 security dialogs</A
724 ></DT
725 ><DT
726 >9.2. <A
727 HREF="#AEN1647"
728 >How to view file security on a Samba share</A
729 ></DT
730 ><DT
731 >9.3. <A
732 HREF="#AEN1658"
733 >Viewing file ownership</A
734 ></DT
735 ><DT
736 >9.4. <A
737 HREF="#AEN1678"
738 >Viewing file or directory permissions</A
739 ></DT
740 ><DD
741 ><DL
742 ><DT
743 >9.4.1. <A
744 HREF="#AEN1693"
745 >File Permissions</A
746 ></DT
747 ><DT
748 >9.4.2. <A
749 HREF="#AEN1707"
750 >Directory Permissions</A
751 ></DT
752 ></DL
753 ></DD
754 ><DT
755 >9.5. <A
756 HREF="#AEN1714"
757 >Modifying file or directory permissions</A
758 ></DT
759 ><DT
760 >9.6. <A
761 HREF="#AEN1736"
762 >Interaction with the standard Samba create mask
763 parameters</A
764 ></DT
765 ><DT
766 >9.7. <A
767 HREF="#AEN1800"
768 >Interaction with the standard Samba file attribute
769 mapping</A
770 ></DT
771 ></DL
772 ></DD
773 ><DT
774 >10. <A
775 HREF="#AEN1810"
776 >OS2 Client HOWTO</A
777 ></DT
778 ><DD
779 ><DL
780 ><DT
781 >10.1. <A
782 HREF="#AEN1821"
783 >FAQs</A
784 ></DT
785 ><DD
786 ><DL
787 ><DT
788 >10.1.1. <A
789 HREF="#AEN1823"
790 >How can I configure OS/2 Warp Connect or
791 OS/2 Warp 4 as a client for Samba?</A
792 ></DT
793 ><DT
794 >10.1.2. <A
795 HREF="#AEN1838"
796 >How can I configure OS/2 Warp 3 (not Connect),
797 OS/2 1.2, 1.3 or 2.x for Samba?</A
798 ></DT
799 ><DT
800 >10.1.3. <A
801 HREF="#AEN1847"
802 >Are there any other issues when OS/2 (any version)
803 is used as a client?</A
804 ></DT
805 ><DT
806 >10.1.4. <A
807 HREF="#AEN1851"
808 >How do I get printer driver download working
809 for OS/2 clients?</A
810 ></DT
811 ></DL
812 ></DD
813 ></DL
814 ></DD
815 ><DT
816 >11. <A
817 HREF="#AEN1860"
818 >HOWTO Access Samba source code via CVS</A
819 ></DT
820 ><DD
821 ><DL
822 ><DT
823 >11.1. <A
824 HREF="#AEN1867"
825 >Introduction</A
826 ></DT
827 ><DT
828 >11.2. <A
829 HREF="#AEN1872"
830 >CVS Access to samba.org</A
831 ></DT
832 ><DD
833 ><DL
834 ><DT
835 >11.2.1. <A
836 HREF="#AEN1875"
837 >Access via CVSweb</A
838 ></DT
839 ><DT
840 >11.2.2. <A
841 HREF="#AEN1880"
842 >Access via cvs</A
843 ></DT
844 ></DL
845 ></DD
846 ></DL
847 ></DD
848 ></DL
849 ></DIV
850 ><DIV
851 CLASS="CHAPTER"
852 ><HR><H1
854 NAME="AEN15"
855 >Chapter 1. How to Install and Test SAMBA</A
856 ></H1
857 ><DIV
858 CLASS="SECT1"
859 ><H1
860 CLASS="SECT1"
862 NAME="AEN17"
863 >1.1. Step 0: Read the man pages</A
864 ></H1
866 >The man pages distributed with SAMBA contain
867 lots of useful info that will help to get you started.
868 If you don't know how to read man pages then try
869 something like:</P
871 ><TT
872 CLASS="PROMPT"
873 >$ </TT
874 ><TT
875 CLASS="USERINPUT"
877 >nroff -man smbd.8 | more
879 ></TT
880 ></P
882 >Other sources of information are pointed to
883 by the Samba web site,<A
884 HREF="http://www.samba.org/"
885 TARGET="_top"
886 > http://www.samba.org</A
887 ></P
888 ></DIV
889 ><DIV
890 CLASS="SECT1"
891 ><HR><H1
892 CLASS="SECT1"
894 NAME="AEN25"
895 >1.2. Step 1: Building the Binaries</A
896 ></H1
898 >To do this, first run the program <B
899 CLASS="COMMAND"
900 >./configure
902 > in the source directory. This should automatically
903 configure Samba for your operating system. If you have unusual
904 needs then you may wish to run</P
906 ><TT
907 CLASS="PROMPT"
908 >root# </TT
909 ><TT
910 CLASS="USERINPUT"
912 >./configure --help
914 ></TT
915 ></P
917 >first to see what special options you can enable.
918 Then exectuting</P
920 ><TT
921 CLASS="PROMPT"
922 >root# </TT
923 ><TT
924 CLASS="USERINPUT"
926 >make</B
927 ></TT
928 ></P
930 >will create the binaries. Once it's successfully
931 compiled you can use </P
933 ><TT
934 CLASS="PROMPT"
935 >root# </TT
936 ><TT
937 CLASS="USERINPUT"
939 >make install</B
940 ></TT
941 ></P
943 >to install the binaries and manual pages. You can
944 separately install the binaries and/or man pages using</P
946 ><TT
947 CLASS="PROMPT"
948 >root# </TT
949 ><TT
950 CLASS="USERINPUT"
952 >make installbin
954 ></TT
955 ></P
957 >and</P
959 ><TT
960 CLASS="PROMPT"
961 >root# </TT
962 ><TT
963 CLASS="USERINPUT"
965 >make installman
967 ></TT
968 ></P
970 >Note that if you are upgrading for a previous version
971 of Samba you might like to know that the old versions of
972 the binaries will be renamed with a ".old" extension. You
973 can go back to the previous version with</P
975 ><TT
976 CLASS="PROMPT"
977 >root# </TT
978 ><TT
979 CLASS="USERINPUT"
981 >make revert
983 ></TT
984 ></P
986 >if you find this version a disaster!</P
987 ></DIV
988 ><DIV
989 CLASS="SECT1"
990 ><HR><H1
991 CLASS="SECT1"
993 NAME="AEN53"
994 >1.3. Step 2: The all important step</A
995 ></H1
997 >At this stage you must fetch yourself a
998 coffee or other drink you find stimulating. Getting the rest
999 of the install right can sometimes be tricky, so you will
1000 probably need it.</P
1002 >If you have installed samba before then you can skip
1003 this step.</P
1004 ></DIV
1005 ><DIV
1006 CLASS="SECT1"
1007 ><HR><H1
1008 CLASS="SECT1"
1010 NAME="AEN57"
1011 >1.4. Step 3: Create the smb configuration file.</A
1012 ></H1
1014 >There are sample configuration files in the examples
1015 subdirectory in the distribution. I suggest you read them
1016 carefully so you can see how the options go together in
1017 practice. See the man page for all the options.</P
1019 >The simplest useful configuration file would be
1020 something like this:</P
1022 ><TABLE
1023 BORDER="0"
1024 BGCOLOR="#E0E0E0"
1025 WIDTH="100%"
1026 ><TR
1027 ><TD
1028 ><PRE
1029 CLASS="PROGRAMLISTING"
1030 > [global]
1031 workgroup = MYGROUP
1033 [homes]
1034 guest ok = no
1035 read only = no
1036 </PRE
1037 ></TD
1038 ></TR
1039 ></TABLE
1040 ></P
1042 >which would allow connections by anyone with an
1043 account on the server, using either their login name or
1044 "homes" as the service name. (Note that I also set the
1045 workgroup that Samba is part of. See BROWSING.txt for defails)</P
1047 >Note that <B
1048 CLASS="COMMAND"
1049 >make install</B
1050 > will not install
1051 a <TT
1052 CLASS="FILENAME"
1053 >smb.conf</TT
1054 > file. You need to create it
1055 yourself. </P
1057 >Make sure you put the smb.conf file in the same place
1058 you specified in the<TT
1059 CLASS="FILENAME"
1060 >Makefile</TT
1061 > (the default is to
1062 look for it in <TT
1063 CLASS="FILENAME"
1064 >/usr/local/samba/lib/</TT
1065 >).</P
1067 >For more information about security settings for the
1068 [homes] share please refer to the document UNIX_SECURITY.txt.</P
1069 ></DIV
1070 ><DIV
1071 CLASS="SECT1"
1072 ><HR><H1
1073 CLASS="SECT1"
1075 NAME="AEN71"
1076 >1.5. Step 4: Test your config file with
1078 CLASS="COMMAND"
1079 >testparm</B
1080 ></A
1081 ></H1
1083 >It's important that you test the validity of your
1085 CLASS="FILENAME"
1086 >smb.conf</TT
1087 > file using the testparm program.
1088 If testparm runs OK then it will list the loaded services. If
1089 not it will give an error message.</P
1091 >Make sure it runs OK and that the services look
1092 resonable before proceeding. </P
1093 ></DIV
1094 ><DIV
1095 CLASS="SECT1"
1096 ><HR><H1
1097 CLASS="SECT1"
1099 NAME="AEN77"
1100 >1.6. Step 5: Starting the smbd and nmbd</A
1101 ></H1
1103 >You must choose to start smbd and nmbd either
1104 as daemons or from <B
1105 CLASS="COMMAND"
1106 >inetd</B
1107 >. Don't try
1108 to do both! Either you can put them in <TT
1109 CLASS="FILENAME"
1110 > inetd.conf</TT
1111 > and have them started on demand
1112 by <B
1113 CLASS="COMMAND"
1114 >inetd</B
1115 >, or you can start them as
1116 daemons either from the command line or in <TT
1117 CLASS="FILENAME"
1118 > /etc/rc.local</TT
1119 >. See the man pages for details
1120 on the command line options. Take particular care to read
1121 the bit about what user you need to be in order to start
1122 Samba. In many cases you must be root.</P
1124 >The main advantage of starting <B
1125 CLASS="COMMAND"
1126 >smbd</B
1128 and <B
1129 CLASS="COMMAND"
1130 >nmbd</B
1131 > as a daemon is that they will
1132 respond slightly more quickly to an initial connection
1133 request. This is, however, unlikely to be a problem.</P
1134 ><DIV
1135 CLASS="SECT2"
1136 ><HR><H2
1137 CLASS="SECT2"
1139 NAME="AEN87"
1140 >1.6.1. Step 5a: Starting from inetd.conf</A
1141 ></H2
1143 >NOTE; The following will be different if
1144 you use NIS or NIS+ to distributed services maps.</P
1146 >Look at your <TT
1147 CLASS="FILENAME"
1148 >/etc/services</TT
1150 What is defined at port 139/tcp. If nothing is defined
1151 then add a line like this:</P
1153 ><TT
1154 CLASS="USERINPUT"
1156 >netbios-ssn 139/tcp</B
1157 ></TT
1158 ></P
1160 >similarly for 137/udp you should have an entry like:</P
1162 ><TT
1163 CLASS="USERINPUT"
1165 >netbios-ns 137/udp</B
1166 ></TT
1167 ></P
1169 >Next edit your <TT
1170 CLASS="FILENAME"
1171 >/etc/inetd.conf</TT
1173 and add two lines something like this:</P
1175 ><TABLE
1176 BORDER="0"
1177 BGCOLOR="#E0E0E0"
1178 WIDTH="100%"
1179 ><TR
1180 ><TD
1181 ><PRE
1182 CLASS="PROGRAMLISTING"
1183 > netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
1184 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
1185 </PRE
1186 ></TD
1187 ></TR
1188 ></TABLE
1189 ></P
1191 >The exact syntax of <TT
1192 CLASS="FILENAME"
1193 >/etc/inetd.conf</TT
1195 varies between unixes. Look at the other entries in inetd.conf
1196 for a guide.</P
1198 >NOTE: Some unixes already have entries like netbios_ns
1199 (note the underscore) in <TT
1200 CLASS="FILENAME"
1201 >/etc/services</TT
1203 You must either edit <TT
1204 CLASS="FILENAME"
1205 >/etc/services</TT
1206 > or
1208 CLASS="FILENAME"
1209 >/etc/inetd.conf</TT
1210 > to make them consistant.</P
1212 >NOTE: On many systems you may need to use the
1213 "interfaces" option in smb.conf to specify the IP address
1214 and netmask of your interfaces. Run <B
1215 CLASS="COMMAND"
1216 >ifconfig</B
1218 as root if you don't know what the broadcast is for your
1219 net. <B
1220 CLASS="COMMAND"
1221 >nmbd</B
1222 > tries to determine it at run
1223 time, but fails on somunixes. See the section on "testing nmbd"
1224 for a method of finding if you need to do this.</P
1226 >!!!WARNING!!! Many unixes only accept around 5
1227 parameters on the command line in <TT
1228 CLASS="FILENAME"
1229 >inetd.conf</TT
1231 This means you shouldn't use spaces between the options and
1232 arguments, or you should use a script, and start the script
1233 from <B
1234 CLASS="COMMAND"
1235 >inetd</B
1236 >.</P
1238 >Restart <B
1239 CLASS="COMMAND"
1240 >inetd</B
1241 >, perhaps just send
1242 it a HUP. If you have installed an earlier version of <B
1243 CLASS="COMMAND"
1244 > nmbd</B
1245 > then you may need to kill nmbd as well.</P
1246 ></DIV
1247 ><DIV
1248 CLASS="SECT2"
1249 ><HR><H2
1250 CLASS="SECT2"
1252 NAME="AEN116"
1253 >1.6.2. Step 5b. Alternative: starting it as a daemon</A
1254 ></H2
1256 >To start the server as a daemon you should create
1257 a script something like this one, perhaps calling
1258 it <TT
1259 CLASS="FILENAME"
1260 >startsmb</TT
1261 >.</P
1263 ><TABLE
1264 BORDER="0"
1265 BGCOLOR="#E0E0E0"
1266 WIDTH="100%"
1267 ><TR
1268 ><TD
1269 ><PRE
1270 CLASS="PROGRAMLISTING"
1271 > #!/bin/sh
1272 /usr/local/samba/bin/smbd -D
1273 /usr/local/samba/bin/nmbd -D
1274 </PRE
1275 ></TD
1276 ></TR
1277 ></TABLE
1278 ></P
1280 >then make it executable with <B
1281 CLASS="COMMAND"
1282 >chmod
1283 +x startsmb</B
1284 ></P
1286 >You can then run <B
1287 CLASS="COMMAND"
1288 >startsmb</B
1289 > by
1290 hand or execute it from <TT
1291 CLASS="FILENAME"
1292 >/etc/rc.local</TT
1296 >To kill it send a kill signal to the processes
1298 CLASS="COMMAND"
1299 >nmbd</B
1300 > and <B
1301 CLASS="COMMAND"
1302 >smbd</B
1303 >.</P
1305 >NOTE: If you use the SVR4 style init system then
1306 you may like to look at the <TT
1307 CLASS="FILENAME"
1308 >examples/svr4-startup</TT
1310 script to make Samba fit into that system.</P
1311 ></DIV
1312 ></DIV
1313 ><DIV
1314 CLASS="SECT1"
1315 ><HR><H1
1316 CLASS="SECT1"
1318 NAME="AEN132"
1319 >1.7. Step 6: Try listing the shares available on your
1320 server</A
1321 ></H1
1323 ><TT
1324 CLASS="PROMPT"
1325 >$ </TT
1326 ><TT
1327 CLASS="USERINPUT"
1329 >smbclient -L
1331 CLASS="REPLACEABLE"
1333 >yourhostname</I
1334 ></TT
1335 ></B
1336 ></TT
1337 ></P
1339 >Your should get back a list of shares available on
1340 your server. If you don't then something is incorrectly setup.
1341 Note that this method can also be used to see what shares
1342 are available on other LanManager clients (such as WfWg).</P
1344 >If you choose user level security then you may find
1345 that Samba requests a password before it will list the shares.
1346 See the <B
1347 CLASS="COMMAND"
1348 >smbclient</B
1349 > man page for details. (you
1350 can force it to list the shares without a password by
1351 adding the option -U% to the command line. This will not work
1352 with non-Samba servers)</P
1353 ></DIV
1354 ><DIV
1355 CLASS="SECT1"
1356 ><HR><H1
1357 CLASS="SECT1"
1359 NAME="AEN141"
1360 >1.8. Step 7: Try connecting with the unix client</A
1361 ></H1
1363 ><TT
1364 CLASS="PROMPT"
1365 >$ </TT
1366 ><TT
1367 CLASS="USERINPUT"
1369 >smbclient <TT
1370 CLASS="REPLACEABLE"
1372 > //yourhostname/aservice</I
1373 ></TT
1374 ></B
1375 ></TT
1376 ></P
1378 >Typically the <TT
1379 CLASS="REPLACEABLE"
1381 >yourhostname</I
1382 ></TT
1384 would be the name of the host where you installed <B
1385 CLASS="COMMAND"
1386 > smbd</B
1387 >. The <TT
1388 CLASS="REPLACEABLE"
1390 >aservice</I
1391 ></TT
1392 > is
1393 any service you have defined in the <TT
1394 CLASS="FILENAME"
1395 >smb.conf</TT
1397 file. Try your user name if you just have a [homes] section
1398 in <TT
1399 CLASS="FILENAME"
1400 >smb.conf</TT
1401 >.</P
1403 >For example if your unix host is bambi and your login
1404 name is fred you would type:</P
1406 ><TT
1407 CLASS="PROMPT"
1408 >$ </TT
1409 ><TT
1410 CLASS="USERINPUT"
1412 >smbclient //bambi/fred
1414 ></TT
1415 ></P
1416 ></DIV
1417 ><DIV
1418 CLASS="SECT1"
1419 ><HR><H1
1420 CLASS="SECT1"
1422 NAME="AEN157"
1423 >1.9. Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT,
1424 Win2k, OS/2, etc... client</A
1425 ></H1
1427 >Try mounting disks. eg:</P
1429 ><TT
1430 CLASS="PROMPT"
1431 >C:\WINDOWS\&#62; </TT
1432 ><TT
1433 CLASS="USERINPUT"
1435 >net use d: \\servername\service
1437 ></TT
1438 ></P
1440 >Try printing. eg:</P
1442 ><TT
1443 CLASS="PROMPT"
1444 >C:\WINDOWS\&#62; </TT
1445 ><TT
1446 CLASS="USERINPUT"
1448 >net use lpt1:
1449 \\servername\spoolservice</B
1450 ></TT
1451 ></P
1453 ><TT
1454 CLASS="PROMPT"
1455 >C:\WINDOWS\&#62; </TT
1456 ><TT
1457 CLASS="USERINPUT"
1459 >print filename
1461 ></TT
1462 ></P
1464 >Celebrate, or send me a bug report!</P
1465 ></DIV
1466 ><DIV
1467 CLASS="SECT1"
1468 ><HR><H1
1469 CLASS="SECT1"
1471 NAME="AEN171"
1472 >1.10. What If Things Don't Work?</A
1473 ></H1
1475 >If nothing works and you start to think "who wrote
1476 this pile of trash" then I suggest you do step 2 again (and
1477 again) till you calm down.</P
1479 >Then you might read the file DIAGNOSIS.txt and the
1480 FAQ. If you are still stuck then try the mailing list or
1481 newsgroup (look in the README for details). Samba has been
1482 successfully installed at thousands of sites worldwide, so maybe
1483 someone else has hit your problem and has overcome it. You could
1484 also use the WWW site to scan back issues of the samba-digest.</P
1486 >When you fix the problem PLEASE send me some updates to the
1487 documentation (or source code) so that the next person will find it
1488 easier. </P
1489 ><DIV
1490 CLASS="SECT2"
1491 ><HR><H2
1492 CLASS="SECT2"
1494 NAME="AEN176"
1495 >1.10.1. Diagnosing Problems</A
1496 ></H2
1498 >If you have instalation problems then go to
1500 CLASS="FILENAME"
1501 >DIAGNOSIS.txt</TT
1502 > to try to find the
1503 problem.</P
1504 ></DIV
1505 ><DIV
1506 CLASS="SECT2"
1507 ><HR><H2
1508 CLASS="SECT2"
1510 NAME="AEN180"
1511 >1.10.2. Scope IDs</A
1512 ></H2
1514 >By default Samba uses a blank scope ID. This means
1515 all your windows boxes must also have a blank scope ID.
1516 If you really want to use a non-blank scope ID then you will
1517 need to use the -i &#60;scope&#62; option to nmbd, smbd, and
1518 smbclient. All your PCs will need to have the same setting for
1519 this to work. I do not recommend scope IDs.</P
1520 ></DIV
1521 ><DIV
1522 CLASS="SECT2"
1523 ><HR><H2
1524 CLASS="SECT2"
1526 NAME="AEN183"
1527 >1.10.3. Choosing the Protocol Level</A
1528 ></H2
1530 >The SMB protocol has many dialects. Currently
1531 Samba supports 5, called CORE, COREPLUS, LANMAN1,
1532 LANMAN2 and NT1.</P
1534 >You can choose what maximum protocol to support
1535 in the <TT
1536 CLASS="FILENAME"
1537 >smb.conf</TT
1538 > file. The default is
1539 NT1 and that is the best for the vast majority of sites.</P
1541 >In older versions of Samba you may have found it
1542 necessary to use COREPLUS. The limitations that led to
1543 this have mostly been fixed. It is now less likely that you
1544 will want to use less than LANMAN1. The only remaining advantage
1545 of COREPLUS is that for some obscure reason WfWg preserves
1546 the case of passwords in this protocol, whereas under LANMAN1,
1547 LANMAN2 or NT1 it uppercases all passwords before sending them,
1548 forcing you to use the "password level=" option in some cases.</P
1550 >The main advantage of LANMAN2 and NT1 is support for
1551 long filenames with some clients (eg: smbclient, Windows NT
1552 or Win95). </P
1554 >See the smb.conf(5) manual page for more details.</P
1556 >Note: To support print queue reporting you may find
1557 that you have to use TCP/IP as the default protocol under
1558 WfWg. For some reason if you leave Netbeui as the default
1559 it may break the print queue reporting on some systems.
1560 It is presumably a WfWg bug.</P
1561 ></DIV
1562 ><DIV
1563 CLASS="SECT2"
1564 ><HR><H2
1565 CLASS="SECT2"
1567 NAME="AEN192"
1568 >1.10.4. Printing from UNIX to a Client PC</A
1569 ></H2
1571 >To use a printer that is available via a smb-based
1572 server from a unix host you will need to compile the
1573 smbclient program. You then need to install the script
1574 "smbprint". Read the instruction in smbprint for more details.
1577 >There is also a SYSV style script that does much
1578 the same thing called smbprint.sysv. It contains instructions.</P
1579 ></DIV
1580 ><DIV
1581 CLASS="SECT2"
1582 ><HR><H2
1583 CLASS="SECT2"
1585 NAME="AEN196"
1586 >1.10.5. Locking</A
1587 ></H2
1589 >One area which sometimes causes trouble is locking.</P
1591 >There are two types of locking which need to be
1592 performed by a SMB server. The first is "record locking"
1593 which allows a client to lock a range of bytes in a open file.
1594 The second is the "deny modes" that are specified when a file
1595 is open.</P
1597 >Samba supports "record locking" using the fcntl() unix system
1598 call. This is often implemented using rpc calls to a rpc.lockd process
1599 running on the system that owns the filesystem. Unfortunately many
1600 rpc.lockd implementations are very buggy, particularly when made to
1601 talk to versions from other vendors. It is not uncommon for the
1602 rpc.lockd to crash.</P
1604 >There is also a problem translating the 32 bit lock
1605 requests generated by PC clients to 31 bit requests supported
1606 by most unixes. Unfortunately many PC applications (typically
1607 OLE2 applications) use byte ranges with the top bit set
1608 as semaphore sets. Samba attempts translation to support
1609 these types of applications, and the translation has proved
1610 to be quite successful.</P
1612 >Strictly a SMB server should check for locks before
1613 every read and write call on a file. Unfortunately with the
1614 way fcntl() works this can be slow and may overstress the
1615 rpc.lockd. It is also almost always unnecessary as clients
1616 are supposed to independently make locking calls before reads
1617 and writes anyway if locking is important to them. By default
1618 Samba only makes locking calls when explicitly asked
1619 to by a client, but if you set "strict locking = yes" then it will
1620 make lock checking calls on every read and write. </P
1622 >You can also disable by range locking completely
1623 using "locking = no". This is useful for those shares that
1624 don't support locking or don't need it (such as cdroms). In
1625 this case Samba fakes the return codes of locking calls to
1626 tell clients that everything is OK.</P
1628 >The second class of locking is the "deny modes". These
1629 are set by an application when it opens a file to determine
1630 what types of access should be allowed simultaneously with
1631 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE
1632 or DENY_ALL. There are also special compatability modes called
1633 DENY_FCB and DENY_DOS.</P
1635 >You can disable share modes using "share modes = no".
1636 This may be useful on a heavily loaded server as the share
1637 modes code is very slow. See also the FAST_SHARE_MODES
1638 option in the Makefile for a way to do full share modes
1639 very fast using shared memory (if your OS supports it).</P
1640 ></DIV
1641 ><DIV
1642 CLASS="SECT2"
1643 ><HR><H2
1644 CLASS="SECT2"
1646 NAME="AEN206"
1647 >1.10.6. Mapping Usernames</A
1648 ></H2
1650 >If you have different usernames on the PCs and
1651 the unix server then take a look at the "username map" option.
1652 See the smb.conf man page for details.</P
1653 ></DIV
1654 ><DIV
1655 CLASS="SECT2"
1656 ><HR><H2
1657 CLASS="SECT2"
1659 NAME="AEN209"
1660 >1.10.7. Other Character Sets</A
1661 ></H2
1663 >If you have problems using filenames with accented
1664 characters in them (like the German, French or Scandinavian
1665 character sets) then I recommmend you look at the "valid chars"
1666 option in smb.conf and also take a look at the validchars
1667 package in the examples directory.</P
1668 ></DIV
1669 ></DIV
1670 ></DIV
1671 ><DIV
1672 CLASS="CHAPTER"
1673 ><HR><H1
1675 NAME="AEN212"
1676 >Chapter 2. Integrating MS Windows networks with Samba</A
1677 ></H1
1678 ><DIV
1679 CLASS="SECT1"
1680 ><H1
1681 CLASS="SECT1"
1683 NAME="AEN223"
1684 >2.1. Agenda</A
1685 ></H1
1687 >To identify the key functional mechanisms of MS Windows networking
1688 to enable the deployment of Samba as a means of extending and/or
1689 replacing MS Windows NT/2000 technology.</P
1691 >We will examine:</P
1693 ></P
1694 ><OL
1695 TYPE="1"
1696 ><LI
1698 >Name resolution in a pure Unix/Linux TCP/IP
1699 environment
1701 ></LI
1702 ><LI
1704 >Name resolution as used within MS Windows
1705 networking
1707 ></LI
1708 ><LI
1710 >How browsing functions and how to deploy stable
1711 and dependable browsing using Samba
1713 ></LI
1714 ><LI
1716 >MS Windows security options and how to
1717 configure Samba for seemless integration
1719 ></LI
1720 ><LI
1722 >Configuration of Samba as:</P
1724 ></P
1725 ><OL
1726 TYPE="a"
1727 ><LI
1729 >A stand-alone server</P
1730 ></LI
1731 ><LI
1733 >An MS Windows NT 3.x/4.0 security domain member
1735 ></LI
1736 ><LI
1738 >An alternative to an MS Windows NT 3.x/4.0 Domain Controller
1740 ></LI
1741 ></OL
1742 ></LI
1743 ></OL
1744 ></DIV
1745 ><DIV
1746 CLASS="SECT1"
1747 ><HR><H1
1748 CLASS="SECT1"
1750 NAME="AEN245"
1751 >2.2. Name Resolution in a pure Unix/Linux world</A
1752 ></H1
1754 >The key configuration files : </P
1755 ><DIV
1756 CLASS="SECT2"
1757 ><HR><H2
1758 CLASS="SECT2"
1760 NAME="AEN248"
1761 >2.2.1. <TT
1762 CLASS="FILENAME"
1763 >/etc/hosts</TT
1764 ></A
1765 ></H2
1767 >Contains a static list of IP Addresses and names.
1768 eg:</P
1770 ><TABLE
1771 BORDER="0"
1772 BGCOLOR="#E0E0E0"
1773 WIDTH="100%"
1774 ><TR
1775 ><TD
1776 ><PRE
1777 CLASS="PROGRAMLISTING"
1778 > 127.0.0.1 localhost localhost.localdomain
1779 192.168.1.1 bigbox.caldera.com bigbox alias4box</PRE
1780 ></TD
1781 ></TR
1782 ></TABLE
1783 ></P
1785 >The purpose of <TT
1786 CLASS="FILENAME"
1787 >/etc/hosts</TT
1788 > is to provide a
1789 name resolution mechanism so that uses do not need to remember
1790 IP addresses.</P
1792 >Network packets that are sent over the physical network transport
1793 layer communicate not via IP addresses but rather using the Media
1794 Access Control address, or MAC address. IP Addresses are currently
1795 32 bits in length and are typically presented as four (4) decimal
1796 numbers that are separated by a dot (or period). eg: 168.192.1.1</P
1798 >MAC Addresses use 48 bits (or 6 bytes) and are typically represented
1799 as two digit hexadecimal numbers separated by colons. eg:
1800 40:8e:0a:12:34:56</P
1802 >Every network interfrace must have an MAC address. Associated with
1803 a MAC address there may be one or more IP addresses. There is NO
1804 relationship between an IP address and a MAC address, all such assignments
1805 are arbitary or discretionary in nature. At the most basic level all
1806 network communications takes place using MAC addressing. Since MAC
1807 addresses must be globally unique, and generally remains fixed for
1808 any particular interface, the assignment of an IP address makes sense
1809 from a network management perspective. More than one IP address can
1810 be assigned per MAC address. One address must be the primary IP address,
1811 this is the address that will be returned in the ARP reply.</P
1813 >When a user or a process wants to communicate with another machine
1814 the protocol implementation ensures that the "machine name" or "host
1815 name" is resolved to an IP address in a manner that is controlled
1816 by the TCP/IP configuration control files. The file
1818 CLASS="FILENAME"
1819 >/etc/hosts</TT
1820 > is one such file.</P
1822 >When the IP address of the destination interface has been
1823 determined a protocol called ARP/RARP isused to identify
1824 the MAC address of the target interface. ARP stands for Address
1825 Resolution Protocol, and is a broadcast oriented method that
1826 uses UDP (User Datagram Protocol) to send a request to all
1827 interfaces on the local network segment using the all 1's MAC
1828 address. Network interfaces are programmed to respond to two
1829 MAC addresses only; their own unique address and the address
1830 ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will
1831 contain the MAC address and the primary IP address for each
1832 interface.</P
1834 >The <TT
1835 CLASS="FILENAME"
1836 >/etc/hosts</TT
1837 > file is foundational to all
1838 Unix/Linux TCP/IP installations and as a minumum will contain
1839 the localhost and local network interface IP addresses and the
1840 primary names by which they are known within the local machine.
1841 This file helps to prime the pump so that a basic level of name
1842 resolution can exist before any other method of name resolution
1843 becomes available.</P
1844 ></DIV
1845 ><DIV
1846 CLASS="SECT2"
1847 ><HR><H2
1848 CLASS="SECT2"
1850 NAME="AEN264"
1851 >2.2.2. <TT
1852 CLASS="FILENAME"
1853 >/etc/resolv.conf</TT
1854 ></A
1855 ></H2
1857 >This file tells the name resolution libraries:</P
1859 ></P
1860 ><UL
1861 ><LI
1863 >The name of the domain to which the machine
1864 belongs
1866 ></LI
1867 ><LI
1869 >The name(s) of any domains that should be
1870 automatically searched when trying to resolve unqualified
1871 host names to their IP address
1873 ></LI
1874 ><LI
1876 >The name or IP address of available Domain
1877 Name Servers that may be asked to perform name to address
1878 translation lookups
1880 ></LI
1881 ></UL
1882 ></DIV
1883 ><DIV
1884 CLASS="SECT2"
1885 ><HR><H2
1886 CLASS="SECT2"
1888 NAME="AEN275"
1889 >2.2.3. <TT
1890 CLASS="FILENAME"
1891 >/etc/host.conf</TT
1892 ></A
1893 ></H2
1895 ><TT
1896 CLASS="FILENAME"
1897 >/etc/host.conf</TT
1898 > is the primary means by
1899 which the setting in /etc/resolv.conf may be affected. It is a
1900 critical configuration file. This file controls the order by
1901 which name resolution may procede. The typical structure is:</P
1903 ><TABLE
1904 BORDER="0"
1905 BGCOLOR="#E0E0E0"
1906 WIDTH="100%"
1907 ><TR
1908 ><TD
1909 ><PRE
1910 CLASS="PROGRAMLISTING"
1911 > order hosts,bind
1912 multi on</PRE
1913 ></TD
1914 ></TR
1915 ></TABLE
1916 ></P
1918 >then both addresses should be returned. Please refer to the
1919 man page for host.conf for further details.</P
1920 ></DIV
1921 ><DIV
1922 CLASS="SECT2"
1923 ><HR><H2
1924 CLASS="SECT2"
1926 NAME="AEN283"
1927 >2.2.4. <TT
1928 CLASS="FILENAME"
1929 >/etc/nsswitch.conf</TT
1930 ></A
1931 ></H2
1933 >This file controls the actual name resolution targets. The
1934 file typically has resolver object specifications as follows:</P
1936 ><TABLE
1937 BORDER="0"
1938 BGCOLOR="#E0E0E0"
1939 WIDTH="100%"
1940 ><TR
1941 ><TD
1942 ><PRE
1943 CLASS="PROGRAMLISTING"
1944 > # /etc/nsswitch.conf
1946 # Name Service Switch configuration file.
1949 passwd: compat
1950 # Alternative entries for password authentication are:
1951 # passwd: compat files nis ldap winbind
1952 shadow: compat
1953 group: compat
1955 hosts: files nis dns
1956 # Alternative entries for host name resolution are:
1957 # hosts: files dns nis nis+ hesoid db compat ldap wins
1958 networks: nis files dns
1960 ethers: nis files
1961 protocols: nis files
1962 rpc: nis files
1963 services: nis files</PRE
1964 ></TD
1965 ></TR
1966 ></TABLE
1967 ></P
1969 >Of course, each of these mechanisms requires that the appropriate
1970 facilities and/or services are correctly configured.</P
1972 >It should be noted that unless a network request/message must be
1973 sent, TCP/IP networks are silent. All TCP/IP communications assumes a
1974 principal of speaking only when necessary.</P
1976 >Samba version 2.2.0 will add Linux support for extensions to
1977 the name service switch infrastructure so that linux clients will
1978 be able to obtain resolution of MS Windows NetBIOS names to IP
1979 Addresses. To gain this functionality Samba needs to be compiled
1980 with appropriate arguments to the make command (ie: <B
1981 CLASS="COMMAND"
1982 >make
1983 nsswitch/libnss_wins.so</B
1984 >). The resulting library should
1985 then be installed in the <TT
1986 CLASS="FILENAME"
1987 >/lib</TT
1988 > directory and
1989 the "wins" parameter needs to be added to the "hosts:" line in
1990 the <TT
1991 CLASS="FILENAME"
1992 >/etc/nsswitch.conf</TT
1993 > file. At this point it
1994 will be possible to ping any MS Windows machine by it's NetBIOS
1995 machine name, so long as that machine is within the workgroup to
1996 which both the samba machine and the MS Windows machine belong.</P
1997 ></DIV
1998 ></DIV
1999 ><DIV
2000 CLASS="SECT1"
2001 ><HR><H1
2002 CLASS="SECT1"
2004 NAME="AEN295"
2005 >2.3. Name resolution as used within MS Windows networking</A
2006 ></H1
2008 >MS Windows networking is predicated about the name each machine
2009 is given. This name is known variously (and inconsistently) as
2010 the "computer name", "machine name", "networking name", "netbios name",
2011 "SMB name". All terms mean the same thing with the exception of
2012 "netbios name" which can apply also to the name of the workgroup or the
2013 domain name. The terms "workgroup" and "domain" are really just a
2014 simply name with which the machine is associated. All NetBIOS names
2015 are exactly 16 characters in length. The 16th character is reserved.
2016 It is used to store a one byte value that indicates service level
2017 information for the NetBIOS name that is registered. A NetBIOS machine
2018 name is therefore registered for each service type that is provided by
2019 the client/server.</P
2021 >The following are typical NetBIOS name/service type registrations:</P
2023 ><TABLE
2024 BORDER="0"
2025 BGCOLOR="#E0E0E0"
2026 WIDTH="100%"
2027 ><TR
2028 ><TD
2029 ><PRE
2030 CLASS="PROGRAMLISTING"
2031 > Unique NetBIOS Names:
2032 MACHINENAME&#60;00&#62; = Server Service is running on MACHINENAME
2033 MACHINENAME&#60;03&#62; = Generic Machine Name (NetBIOS name)
2034 MACHINENAME&#60;20&#62; = LanMan Server service is running on MACHINENAME
2035 WORKGROUP&#60;1b&#62; = Domain Master Browser
2037 Group Names:
2038 WORKGROUP&#60;03&#62; = Generic Name registered by all members of WORKGROUP
2039 WORKGROUP&#60;1c&#62; = Domain Controllers / Netlogon Servers
2040 WORKGROUP&#60;1d&#62; = Local Master Browsers
2041 WORKGROUP&#60;1e&#62; = Internet Name Resolvers</PRE
2042 ></TD
2043 ></TR
2044 ></TABLE
2045 ></P
2047 >It should be noted that all NetBIOS machines register their own
2048 names as per the above. This is in vast contrast to TCP/IP
2049 installations where traditionally the system administrator will
2050 determine in the /etc/hosts or in the DNS database what names
2051 are associated with each IP address.</P
2053 >One further point of clarification should be noted, the <TT
2054 CLASS="FILENAME"
2055 >/etc/hosts</TT
2057 file and the DNS records do not provide the NetBIOS name type information
2058 that MS Windows clients depend on to locate the type of service that may
2059 be needed. An example of this is what happens when an MS Windows client
2060 wants to locate a domain logon server. It find this service and the IP
2061 address of a server that provides it by performing a lookup (via a
2062 NetBIOS broadcast) for enumeration of all machines that have
2063 registered the name type *&#60;1c&#62;. A logon request is then sent to each
2064 IP address that is returned in the enumerated list of IP addresses. Which
2065 ever machine first replies then ends up providing the logon services.</P
2067 >The name "workgroup" or "domain" really can be confusing since these
2068 have the added significance of indicating what is the security
2069 architecture of the MS Windows network. The term "workgroup" indicates
2070 that the primary nature of the network environment is that of a
2071 peer-to-peer design. In a WORKGROUP all machines are responsible for
2072 their own security, and generally such security is limited to use of
2073 just a password (known as SHARE MORE security). In most situations
2074 with peer-to-peer networking the users who control their own machines
2075 will simply opt to have no security at all. It is possible to have
2076 USER MODE security in a WORKGROUP environment, thus requiring use
2077 of a user name and a matching password.</P
2079 >MS Windows networking is thus predetermined to use machine names
2080 for all local and remote machine message passing. The protocol used is
2081 called Server Message Block (SMB) and this is implemented using
2082 the NetBIOS protocol (Network Basic Input Output System). NetBIOS can
2083 be encapsulated using LLC (Logical Link Control) protocol - in which case
2084 the resulting protocol is called NetBEUI (Network Basic Extended User
2085 Interface). NetBIOS can also be run over IPX (Internetworking Packet
2086 Exchange) protocol as used by Novell NetWare, and it can be run
2087 over TCP/IP protocols - in which case the resulting protocol is called
2088 NBT or NetBT, the NetBIOS over TCP/IP.</P
2090 >MS Windows machines use a complex array of name resolution mechanisms.
2091 Since we are primarily concerned with TCP/IP this demonstration is
2092 limited to this area.</P
2093 ><DIV
2094 CLASS="SECT2"
2095 ><HR><H2
2096 CLASS="SECT2"
2098 NAME="AEN307"
2099 >2.3.1. The NetBIOS Name Cache</A
2100 ></H2
2102 >All MS Windows machines employ an in memory buffer in which is
2103 stored the NetBIOS names and their IP addresses for all external
2104 machines that that the local machine has communicated with over the
2105 past 10-15 minutes. It is more efficient to obtain an IP address
2106 for a machine from the local cache than it is to go through all the
2107 configured name resolution mechanisms.</P
2109 >If a machine whose name is in the local name cache has been shut
2110 down before the name had been expired and flushed from the cache, then
2111 an attempt to exchange a message with that machine will be subject
2112 to time-out delays. ie: It's name is in the cache, so a name resolution
2113 lookup will succeed, but the machine can not respond. This can be
2114 frustrating for users - but it is a characteristic of the protocol.</P
2116 >The MS Windows utility that allows examination of the NetBIOS
2117 name cache is called "nbtstat". The Samba equivalent of this
2118 is called "nmblookup".</P
2119 ></DIV
2120 ><DIV
2121 CLASS="SECT2"
2122 ><HR><H2
2123 CLASS="SECT2"
2125 NAME="AEN312"
2126 >2.3.2. The LMHOSTS file</A
2127 ></H2
2129 >This file is usually located in MS Windows NT 4.0 or
2130 2000 in <TT
2131 CLASS="FILENAME"
2132 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2133 > and contains
2134 the IP Address and the machine name in matched pairs. The
2136 CLASS="FILENAME"
2137 >LMHOSTS</TT
2138 > file performs NetBIOS name
2139 to IP address mapping oriented.</P
2141 >It typically looks like:</P
2143 ><TABLE
2144 BORDER="0"
2145 BGCOLOR="#E0E0E0"
2146 WIDTH="100%"
2147 ><TR
2148 ><TD
2149 ><PRE
2150 CLASS="PROGRAMLISTING"
2151 > # Copyright (c) 1998 Microsoft Corp.
2153 # This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
2154 # over TCP/IP) stack for Windows98
2156 # This file contains the mappings of IP addresses to NT computernames
2157 # (NetBIOS) names. Each entry should be kept on an individual line.
2158 # The IP address should be placed in the first column followed by the
2159 # corresponding computername. The address and the comptername
2160 # should be separated by at least one space or tab. The "#" character
2161 # is generally used to denote the start of a comment (see the exceptions
2162 # below).
2164 # This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
2165 # files and offers the following extensions:
2167 # #PRE
2168 # #DOM:&#60;domain&#62;
2169 # #INCLUDE &#60;filename&#62;
2170 # #BEGIN_ALTERNATE
2171 # #END_ALTERNATE
2172 # \0xnn (non-printing character support)
2174 # Following any entry in the file with the characters "#PRE" will cause
2175 # the entry to be preloaded into the name cache. By default, entries are
2176 # not preloaded, but are parsed only after dynamic name resolution fails.
2178 # Following an entry with the "#DOM:&#60;domain&#62;" tag will associate the
2179 # entry with the domain specified by &#60;domain&#62;. This affects how the
2180 # browser and logon services behave in TCP/IP environments. To preload
2181 # the host name associated with #DOM entry, it is necessary to also add a
2182 # #PRE to the line. The &#60;domain&#62; is always preloaded although it will not
2183 # be shown when the name cache is viewed.
2185 # Specifying "#INCLUDE &#60;filename&#62;" will force the RFC NetBIOS (NBT)
2186 # software to seek the specified &#60;filename&#62; and parse it as if it were
2187 # local. &#60;filename&#62; is generally a UNC-based name, allowing a
2188 # centralized lmhosts file to be maintained on a server.
2189 # It is ALWAYS necessary to provide a mapping for the IP address of the
2190 # server prior to the #INCLUDE. This mapping must use the #PRE directive.
2191 # In addtion the share "public" in the example below must be in the
2192 # LanManServer list of "NullSessionShares" in order for client machines to
2193 # be able to read the lmhosts file successfully. This key is under
2194 # \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
2195 # in the registry. Simply add "public" to the list found there.
2197 # The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
2198 # statements to be grouped together. Any single successful include
2199 # will cause the group to succeed.
2201 # Finally, non-printing characters can be embedded in mappings by
2202 # first surrounding the NetBIOS name in quotations, then using the
2203 # \0xnn notation to specify a hex value for a non-printing character.
2205 # The following example illustrates all of these extensions:
2207 # 102.54.94.97 rhino #PRE #DOM:networking #net group's DC
2208 # 102.54.94.102 "appname \0x14" #special app server
2209 # 102.54.94.123 popular #PRE #source server
2210 # 102.54.94.117 localsrv #PRE #needed for the include
2212 # #BEGIN_ALTERNATE
2213 # #INCLUDE \\localsrv\public\lmhosts
2214 # #INCLUDE \\rhino\public\lmhosts
2215 # #END_ALTERNATE
2217 # In the above example, the "appname" server contains a special
2218 # character in its name, the "popular" and "localsrv" server names are
2219 # preloaded, and the "rhino" server name is specified so it can be used
2220 # to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
2221 # system is unavailable.
2223 # Note that the whole file is parsed including comments on each lookup,
2224 # so keeping the number of comments to a minimum will improve performance.
2225 # Therefore it is not advisable to simply add lmhosts file entries onto the
2226 # end of this file.</PRE
2227 ></TD
2228 ></TR
2229 ></TABLE
2230 ></P
2231 ></DIV
2232 ><DIV
2233 CLASS="SECT2"
2234 ><HR><H2
2235 CLASS="SECT2"
2237 NAME="AEN320"
2238 >2.3.3. HOSTS file</A
2239 ></H2
2241 >This file is usually located in MS Windows NT 4.0 or 2000 in
2243 CLASS="FILENAME"
2244 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2245 > and contains
2246 the IP Address and the IP hostname in matched pairs. It can be
2247 used by the name resolution infrastructure in MS Windows, depending
2248 on how the TCP/IP environment is configured. This file is in
2249 every way the equivalent of the Unix/Linux <TT
2250 CLASS="FILENAME"
2251 >/etc/hosts</TT
2252 > file.</P
2253 ></DIV
2254 ><DIV
2255 CLASS="SECT2"
2256 ><HR><H2
2257 CLASS="SECT2"
2259 NAME="AEN325"
2260 >2.3.4. DNS Lookup</A
2261 ></H2
2263 >This capability is configured in the TCP/IP setup area in the network
2264 configuration facility. If enabled an elaborate name resolution sequence
2265 is followed the precise nature of which isdependant on what the NetBIOS
2266 Node Type parameter is configured to. A Node Type of 0 means use
2267 NetBIOS broadcast (over UDP broadcast) is first used if the name
2268 that is the subject of a name lookup is not found in the NetBIOS name
2269 cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to
2270 Node Type 8, then a NetBIOS Unicast (over UDP Unicast) is sent to the
2271 WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast
2272 lookup is used.</P
2273 ></DIV
2274 ><DIV
2275 CLASS="SECT2"
2276 ><HR><H2
2277 CLASS="SECT2"
2279 NAME="AEN328"
2280 >2.3.5. WINS Lookup</A
2281 ></H2
2283 >Refer to above details for section <EM
2284 >DNS Lookups</EM
2285 >. A
2286 WINS (Windows Internet Name Server) service is the equivaent of the
2287 rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores
2288 the names and IP addresses that are registered by a Windows client
2289 if the TCP/IP setup has been given at least one WINS Server IP Address.</P
2291 >To configure Samba to be a WINS server the following parameter needs
2292 to be added to the <TT
2293 CLASS="FILENAME"
2294 >smb.conf</TT
2295 > file:</P
2297 ><TABLE
2298 BORDER="0"
2299 BGCOLOR="#E0E0E0"
2300 WIDTH="100%"
2301 ><TR
2302 ><TD
2303 ><PRE
2304 CLASS="PROGRAMLISTING"
2305 > wins support = Yes</PRE
2306 ></TD
2307 ></TR
2308 ></TABLE
2309 ></P
2311 >To configure Samba to use a WINS server the following parameters are
2312 needed in the smb.conf file:</P
2314 ><TABLE
2315 BORDER="0"
2316 BGCOLOR="#E0E0E0"
2317 WIDTH="100%"
2318 ><TR
2319 ><TD
2320 ><PRE
2321 CLASS="PROGRAMLISTING"
2322 > wins support = No
2323 wins server = <TT
2324 CLASS="REPLACEABLE"
2326 >xxx.xxx.xxx.xxx</I
2327 ></TT
2328 ></PRE
2329 ></TD
2330 ></TR
2331 ></TABLE
2332 ></P
2334 >where <TT
2335 CLASS="REPLACEABLE"
2337 >xxx.xxx.xxx.xxx</I
2338 ></TT
2339 > is the IP address
2340 of the WINS server.</P
2341 ></DIV
2342 ></DIV
2343 ><DIV
2344 CLASS="SECT1"
2345 ><HR><H1
2346 CLASS="SECT1"
2348 NAME="AEN342"
2349 >2.4. How browsing functions and how to deploy stable and
2350 dependable browsing using Samba</A
2351 ></H1
2353 >As stated above, MS Windows machines register their NetBIOS names
2354 (ie: the machine name for each service type in operation) on start
2355 up. Also, as stated above, the exact method by which this name registration
2356 takes place is determined by whether or not the MS Windows client/server
2357 has been given a WINS server address, whether or not LMHOSTS lookup
2358 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.</P
2360 >In the case where there is no WINS server all name registrations as
2361 well as name lookups are done by UDP broadcast. This isolates name
2362 resolution to the local subnet, unless LMHOSTS is used to list all
2363 names and IP addresses. In such situations Samba provides a means by
2364 which the samba server name may be forcibly injected into the browse
2365 list of a remote MS Windows network (using the "remote announce" parameter).</P
2367 >Where a WINS server is used, the MS Windows client will use UDP
2368 unicast to register with the WINS server. Such packets can be routed
2369 and thus WINS allows name resolution to function across routed networks.</P
2371 >During the startup process an election will take place to create a
2372 local master browser if one does not already exist. On each NetBIOS network
2373 one machine will be elected to function as the domain master browser. This
2374 domain browsing has nothing to do with MS security domain control.
2375 Instead, the domain master browser serves the role of contacting each local
2376 master browser (found by asking WINS or from LMHOSTS) and exchanging browse
2377 list contents. This way every master browser will eventually obtain a complete
2378 list of all machines that are on the network. Every 11-15 minutes an election
2379 is held to determine which machine will be the master browser. By nature of
2380 the election criteria used, the machine with the highest uptime, or the
2381 most senior protocol version, or other criteria, will win the election
2382 as domain master browser.</P
2384 >Clients wishing to browse the network make use of this list, but also depend
2385 on the availability of correct name resolution to the respective IP
2386 address/addresses. </P
2388 >Any configuration that breaks name resolution and/or browsing intrinsics
2389 will annoy users because they will have to put up with protracted
2390 inability to use the network services.</P
2392 >Samba supports a feature that allows forced synchonisation
2393 of browse lists across routed networks using the "remote
2394 browse sync" parameter in the smb.conf file. This causes Samba
2395 to contact the local master browser on a remote network and
2396 to request browse list synchronisation. This effectively bridges
2397 two networks that are separated by routers. The two remote
2398 networks may use either broadcast based name resolution or WINS
2399 based name resolution, but it should be noted that the "remote
2400 browse sync" parameter provides browse list synchronisation - and
2401 that is distinct from name to address resolution, in other
2402 words, for cross subnet browsing to function correctly it is
2403 essential that a name to address resolution mechanism be provided.
2404 This mechanism could be via DNS, <TT
2405 CLASS="FILENAME"
2406 >/etc/hosts</TT
2408 and so on.</P
2409 ></DIV
2410 ><DIV
2411 CLASS="SECT1"
2412 ><HR><H1
2413 CLASS="SECT1"
2415 NAME="AEN352"
2416 >2.5. MS Windows security options and how to configure
2417 Samba for seemless integration</A
2418 ></H1
2420 >MS Windows clients may use encrypted passwords alone, or encrypted
2421 as well as plain text passwords in the authentication process. It
2422 should be realized that with the SMB protocol the password is passed
2423 over the network either in plain text or encrypted. When encrypted
2424 passwords are used a password that has been entered by the user is
2425 encrypted in two ways:</P
2427 ></P
2428 ><UL
2429 ><LI
2431 >The case preserved password is encrypted
2432 using an MD5/DES one way hash
2434 ></LI
2435 ><LI
2437 >The case is converted to upper case and then
2438 encrypted using an MD5/DES one way hash</P
2439 ></LI
2440 ></UL
2442 >Both of these enrypted passwords are sent over the network
2443 in the one authentication datagram.</P
2445 >MS Windows 95 pre-service pack 1, MS Windows NT versions 3.x
2446 and version 4.0 pre-service pack 3 will use either mode of
2447 password authentication. All versions of MS Windows that follow
2448 these versions no longer support plain text passwords by default.</P
2450 >MS Windows clients have a habit of dropping network mappings that
2451 have been idle for 10 minutes or longer. When the user attempts to
2452 use the mapped drive connection that has been dropped the SMB protocol
2453 has a mechanism by which the connection can be re-established using
2454 a cached copy of the password.</P
2456 >When Microsoft changed the default password mode, they dropped support for
2457 caching of the plain text password. This means that when the registry
2458 parameter is changed to re-enable use of plain text passwords it appears to
2459 work, but when a dropped mapping attempts to revalidate it will fail if
2460 the remote authentication server does not support encrypted passwords.
2461 This means that it is definitely not a good idea to re-enable plain text
2462 password support in such clients.</P
2464 >It is recommended that the following parameters be added to the
2465 smb.conf file:</P
2467 ><TABLE
2468 BORDER="0"
2469 BGCOLOR="#E0E0E0"
2470 WIDTH="100%"
2471 ><TR
2472 ><TD
2473 ><PRE
2474 CLASS="PROGRAMLISTING"
2475 > passsword level = 8
2476 username level = 8</PRE
2477 ></TD
2478 ></TR
2479 ></TABLE
2480 ></P
2482 >these configuration parameters will compensate for the fact that
2483 in some circumstances MS Windows and MS DOS clients may twiddle the
2484 password that has been supplied by the user by converting characters to
2485 upper case. The above entries will try every combination of upper and
2486 lower case for the first 8 characters. Please refer to the man page
2487 for smb.conf for more information on use of these parameters.</P
2489 >The best option to adopt is to enable support for encrypted passwords
2490 where ever Samba is used. There are three configuration possibilities
2491 for support of encrypted passwords:</P
2492 ><DIV
2493 CLASS="SECT2"
2494 ><HR><H2
2495 CLASS="SECT2"
2497 NAME="AEN369"
2498 >2.5.1. Use MS Windows NT as an authentication server</A
2499 ></H2
2501 >This method involves the additions of the following parameters
2502 in the smb.conf file:</P
2504 ><TABLE
2505 BORDER="0"
2506 BGCOLOR="#E0E0E0"
2507 WIDTH="100%"
2508 ><TR
2509 ><TD
2510 ><PRE
2511 CLASS="PROGRAMLISTING"
2512 > encrypt passwords = Yes
2513 security = server
2514 password server = "NetBIOS_name_of_PDC"</PRE
2515 ></TD
2516 ></TR
2517 ></TABLE
2518 ></P
2520 >There are two ways of identifying whether or not a username and
2521 password pair was valid or not. One uses the reply information provided
2522 as part of the authentication messaging process, the other uses
2523 just and error code.</P
2525 >The down-side of this mode of configuration is the fact that
2526 for security reasons Samba will send the password server a bogus
2527 username and a bogus password and if the remote server fails to
2528 reject the username and password pair then an alternative mode
2529 of identification of validation is used. Where a site uses password
2530 lock out after a certain number of failed authentication attempts
2531 this will result in user lockouts.</P
2533 >Use of this mode of authentication does require there to be
2534 a standard Unix account for the user, this account can be blocked
2535 to prevent logons by other than MS Windows clients.</P
2536 ></DIV
2537 ><DIV
2538 CLASS="SECT2"
2539 ><HR><H2
2540 CLASS="SECT2"
2542 NAME="AEN377"
2543 >2.5.2. Make Samba a member of an MS Windows NT security domain</A
2544 ></H2
2546 >This method involves additon of the following paramters in the smb.conf file:</P
2548 ><TABLE
2549 BORDER="0"
2550 BGCOLOR="#E0E0E0"
2551 WIDTH="100%"
2552 ><TR
2553 ><TD
2554 ><PRE
2555 CLASS="PROGRAMLISTING"
2556 > encrypt passwords = Yes
2557 security = domain
2558 workgroup = "name of NT domain"
2559 password server = *</PRE
2560 ></TD
2561 ></TR
2562 ></TABLE
2563 ></P
2565 >The use of the "*" argument to "password server" will cause samba
2566 to locate the domain controller in a way analogous to the way
2567 this is done within MS Windows NT.</P
2569 >In order for this method to work the Samba server needs to join the
2570 MS Windows NT security domain. This is done as follows:</P
2572 ></P
2573 ><UL
2574 ><LI
2576 >On the MS Windows NT domain controller using
2577 the Server Manager add a machine account for the Samba server.
2579 ></LI
2580 ><LI
2582 >Next, on the Linux system execute:
2584 CLASS="COMMAND"
2585 >smbpasswd -r PDC_NAME -j DOMAIN_NAME</B
2588 ></LI
2589 ></UL
2591 >Use of this mode of authentication does require there to be
2592 a standard Unix account for the user, this account can be
2593 blocked to prevent logons by other than MS Windows clients.</P
2594 ></DIV
2595 ><DIV
2596 CLASS="SECT2"
2597 ><HR><H2
2598 CLASS="SECT2"
2600 NAME="AEN391"
2601 >2.5.3. Configure Samba as an authentication server</A
2602 ></H2
2604 >This mode of authentication demands that there be on the
2605 Unix/Linux system both a Unix style account as well as and
2606 smbpasswd entry for the user. The Unix system account can be
2607 locked if required as only the encrypted password will be
2608 used for SMB client authentication.</P
2610 >This method involves addition of the following parameters to
2611 the smb.conf file:</P
2613 ><TABLE
2614 BORDER="0"
2615 BGCOLOR="#E0E0E0"
2616 WIDTH="100%"
2617 ><TR
2618 ><TD
2619 ><PRE
2620 CLASS="PROGRAMLISTING"
2621 > encrypt passwords = Yes
2622 security = user</PRE
2623 ></TD
2624 ></TR
2625 ></TABLE
2626 ></P
2628 >in order for this method to work a Unix system account needs
2629 to be created for each user, as well as for each MS Windows NT/2000
2630 machine. The following structure is required.</P
2631 ><DIV
2632 CLASS="SECT3"
2633 ><HR><H3
2634 CLASS="SECT3"
2636 NAME="AEN398"
2637 >2.5.3.1. Users</A
2638 ></H3
2640 >A user account that may provide a home directory should be
2641 created. The following Linux system commands are typical of
2642 the procedure for creating an account.</P
2644 ><TABLE
2645 BORDER="0"
2646 BGCOLOR="#E0E0E0"
2647 WIDTH="100%"
2648 ><TR
2649 ><TD
2650 ><PRE
2651 CLASS="PROGRAMLISTING"
2652 > # useradd -s /bin/bash -d /home/"userid" -m
2653 # passwd "userid"
2654 Enter Password: <TT
2655 CLASS="USERINPUT"
2657 >pass</B
2658 ></TT
2661 # smbpasswd -a "userid"
2662 Enter Password: <TT
2663 CLASS="USERINPUT"
2665 >pass</B
2666 ></TT
2667 ></PRE
2668 ></TD
2669 ></TR
2670 ></TABLE
2671 ></P
2672 ></DIV
2673 ><DIV
2674 CLASS="SECT3"
2675 ><HR><H3
2676 CLASS="SECT3"
2678 NAME="AEN405"
2679 >2.5.3.2. MS Windows NT Machine Accounts</A
2680 ></H3
2682 >These are required only when Samba is used as a domain
2683 controller. Refer to the Samba-PDC-HOWTO for more details.</P
2685 ><TABLE
2686 BORDER="0"
2687 BGCOLOR="#E0E0E0"
2688 WIDTH="100%"
2689 ><TR
2690 ><TD
2691 ><PRE
2692 CLASS="PROGRAMLISTING"
2693 > # useradd -a /bin/false -d /dev/null "machine_name"\$
2694 # passwd -l "machine_name"\$
2695 # smbpasswd -a -m "machine_name"</PRE
2696 ></TD
2697 ></TR
2698 ></TABLE
2699 ></P
2700 ></DIV
2701 ></DIV
2702 ></DIV
2703 ><DIV
2704 CLASS="SECT1"
2705 ><HR><H1
2706 CLASS="SECT1"
2708 NAME="AEN410"
2709 >2.6. Configuration of Samba as ...</A
2710 ></H1
2712 ></P
2713 ><UL
2714 ><LI
2716 >A Stand-alone server - No special action is needed
2717 other than to create user accounts. Stand-alone servers do NOT
2718 provide network logon services, meaning that machines that use this
2719 server do NOT perform a domain logon but instead make use only of
2720 the MS Windows logon which is local to the MS Windows
2721 workstation/server.
2723 ></LI
2724 ><LI
2726 >An MS Windows NT 3.x/4.0 security domain member -
2727 Refer to the previous section(s) above.
2729 ></LI
2730 ><LI
2732 >An alternative to an MS Windows NT 3.x/4.0
2733 Domain Controller - In the smb.conf file the following parameters
2734 should be added:</P
2735 ></LI
2736 ></UL
2738 ><TABLE
2739 BORDER="0"
2740 BGCOLOR="#E0E0E0"
2741 WIDTH="100%"
2742 ><TR
2743 ><TD
2744 ><PRE
2745 CLASS="PROGRAMLISTING"
2746 >## please refer to the Samba PDC HOWTO chapter later in
2747 ## this collection for more details
2748 [global]
2749 domain logons = Yes
2750 ; an OS level of 33 or more is recommended
2751 os level = 33
2753 [NETLOGON]
2754 path = /somewhare/in/file/system
2755 read only = yes
2756 available = yes</PRE
2757 ></TD
2758 ></TR
2759 ></TABLE
2760 ></P
2761 ></DIV
2762 ></DIV
2763 ><DIV
2764 CLASS="CHAPTER"
2765 ><HR><H1
2767 NAME="AEN421"
2768 >Chapter 3. LanMan and NT Password Encryption in Samba 2.x</A
2769 ></H1
2770 ><DIV
2771 CLASS="SECT1"
2772 ><H1
2773 CLASS="SECT1"
2775 NAME="AEN432"
2776 >3.1. Introduction</A
2777 ></H1
2779 >With the development of LanManager and Windows NT
2780 compatible password encryption for Samba, it is now able
2781 to validate user connections in exactly the same way as
2782 a LanManager or Windows NT server.</P
2784 >This document describes how the SMB password encryption
2785 algorithm works and what issues there are in choosing whether
2786 you want to use it. You should read it carefully, especially
2787 the part about security and the "PROS and CONS" section.</P
2788 ></DIV
2789 ><DIV
2790 CLASS="SECT1"
2791 ><HR><H1
2792 CLASS="SECT1"
2794 NAME="AEN436"
2795 >3.2. How does it work?</A
2796 ></H1
2798 >LanManager encryption is somewhat similar to UNIX
2799 password encryption. The server uses a file containing a
2800 hashed value of a user's password. This is created by taking
2801 the user's plaintext password, capitalising it, and either
2802 truncating to 14 bytes or padding to 14 bytes with null bytes.
2803 This 14 byte value is used as two 56 bit DES keys to encrypt
2804 a 'magic' eight byte value, forming a 16 byte value which is
2805 stored by the server and client. Let this value be known as
2806 the "hashed password".</P
2808 >Windows NT encryption is a higher quality mechanism,
2809 consisting of doing an MD4 hash on a Unicode version of the user's
2810 password. This also produces a 16 byte hash value that is
2811 non-reversible.</P
2813 >When a client (LanManager, Windows for WorkGroups, Windows
2814 95 or Windows NT) wishes to mount a Samba drive (or use a Samba
2815 resource), it first requests a connection and negotiates the
2816 protocol that the client and server will use. In the reply to this
2817 request the Samba server generates and appends an 8 byte, random
2818 value - this is stored in the Samba server after the reply is sent
2819 and is known as the "challenge". The challenge is different for
2820 every client connection.</P
2822 >The client then uses the hashed password (16 byte values
2823 described above), appended with 5 null bytes, as three 56 bit
2824 DES keys, each of which is used to encrypt the challenge 8 byte
2825 value, forming a 24 byte value known as the "response".</P
2827 >In the SMB call SMBsessionsetupX (when user level security
2828 is selected) or the call SMBtconX (when share level security is
2829 selected), the 24 byte response is returned by the client to the
2830 Samba server. For Windows NT protocol levels the above calculation
2831 is done on both hashes of the user's password and both responses are
2832 returned in the SMB call, giving two 24 byte values.</P
2834 >The Samba server then reproduces the above calculation, using
2835 its own stored value of the 16 byte hashed password (read from the
2837 CLASS="FILENAME"
2838 >smbpasswd</TT
2839 > file - described later) and the challenge
2840 value that it kept from the negotiate protocol reply. It then checks
2841 to see if the 24 byte value it calculates matches the 24 byte value
2842 returned to it from the client.</P
2844 >If these values match exactly, then the client knew the
2845 correct password (or the 16 byte hashed value - see security note
2846 below) and is thus allowed access. If not, then the client did not
2847 know the correct password and is denied access.</P
2849 >Note that the Samba server never knows or stores the cleartext
2850 of the user's password - just the 16 byte hashed values derived from
2851 it. Also note that the cleartext password or 16 byte hashed values
2852 are never transmitted over the network - thus increasing security.</P
2853 ></DIV
2854 ><DIV
2855 CLASS="SECT1"
2856 ><HR><H1
2857 CLASS="SECT1"
2859 NAME="AEN447"
2860 >3.3. Important Notes About Security</A
2861 ></H1
2863 >The unix and SMB password encryption techniques seem similar
2864 on the surface. This similarity is, however, only skin deep. The unix
2865 scheme typically sends clear text passwords over the nextwork when
2866 logging in. This is bad. The SMB encryption scheme never sends the
2867 cleartext password over the network but it does store the 16 byte
2868 hashed values on disk. This is also bad. Why? Because the 16 byte hashed
2869 values are a "password equivalent". You cannot derive the user's
2870 password from them, but they could potentially be used in a modified
2871 client to gain access to a server. This would require considerable
2872 technical knowledge on behalf of the attacker but is perfectly possible.
2873 You should thus treat the smbpasswd file as though it contained the
2874 cleartext passwords of all your users. Its contents must be kept
2875 secret, and the file should be protected accordingly.</P
2877 >Ideally we would like a password scheme which neither requires
2878 plain text passwords on the net or on disk. Unfortunately this
2879 is not available as Samba is stuck with being compatible with
2880 other SMB systems (WinNT, WfWg, Win95 etc). </P
2881 ><DIV
2882 CLASS="WARNING"
2884 ></P
2885 ><TABLE
2886 CLASS="WARNING"
2887 BORDER="1"
2888 WIDTH="100%"
2889 ><TR
2890 ><TD
2891 ALIGN="CENTER"
2893 >Warning</B
2894 ></TD
2895 ></TR
2896 ><TR
2897 ><TD
2898 ALIGN="LEFT"
2900 >Note that Windows NT 4.0 Service pack 3 changed the
2901 default for permissible authentication so that plaintext
2902 passwords are <EM
2903 >never</EM
2904 > sent over the wire.
2905 The solution to this is either to switch to encrypted passwords
2906 with Samba or edit the Windows NT registry to re-enable plaintext
2907 passwords. See the document WinNT.txt for details on how to do
2908 this.</P
2910 >Other Microsoft operating systems which also exhibit
2911 this behavior includes</P
2913 ></P
2914 ><UL
2915 ><LI
2917 >MS DOS Network client 3.0 with
2918 the basic network redirector installed</P
2919 ></LI
2920 ><LI
2922 >Windows 95 with the network redirector
2923 update installed</P
2924 ></LI
2925 ><LI
2927 >Windows 98 [se]</P
2928 ></LI
2929 ><LI
2931 >Windows 2000</P
2932 ></LI
2933 ></UL
2935 ><EM
2936 >Note :</EM
2937 >All current release of
2938 Microsoft SMB/CIFS clients support authentication via the
2939 SMB Challenge/Response mechanism described here. Enabling
2940 clear text authentication does not disable the ability
2941 of the client to particpate in encrypted authentication.</P
2942 ></TD
2943 ></TR
2944 ></TABLE
2945 ></DIV
2946 ><DIV
2947 CLASS="SECT2"
2948 ><HR><H2
2949 CLASS="SECT2"
2951 NAME="AEN466"
2952 >3.3.1. Advantages of SMB Encryption</A
2953 ></H2
2955 ></P
2956 ><UL
2957 ><LI
2959 >plain text passwords are not passed across
2960 the network. Someone using a network sniffer cannot just
2961 record passwords going to the SMB server.</P
2962 ></LI
2963 ><LI
2965 >WinNT doesn't like talking to a server
2966 that isn't using SMB encrypted passwords. It will refuse
2967 to browse the server if the server is also in user level
2968 security mode. It will insist on prompting the user for the
2969 password on each connection, which is very annoying. The
2970 only things you can do to stop this is to use SMB encryption.
2972 ></LI
2973 ></UL
2974 ></DIV
2975 ><DIV
2976 CLASS="SECT2"
2977 ><HR><H2
2978 CLASS="SECT2"
2980 NAME="AEN473"
2981 >3.3.2. Advantages of non-encrypted passwords</A
2982 ></H2
2984 ></P
2985 ><UL
2986 ><LI
2988 >plain text passwords are not kept
2989 on disk. </P
2990 ></LI
2991 ><LI
2993 >uses same password file as other unix
2994 services such as login and ftp</P
2995 ></LI
2996 ><LI
2998 >you are probably already using other
2999 services (such as telnet and ftp) which send plain text
3000 passwords over the net, so sending them for SMB isn't
3001 such a big deal.</P
3002 ></LI
3003 ></UL
3004 ></DIV
3005 ></DIV
3006 ><DIV
3007 CLASS="SECT1"
3008 ><HR><H1
3009 CLASS="SECT1"
3011 NAME="AEN482"
3012 >3.4. <A
3013 NAME="SMBPASSWDFILEFORMAT"
3014 ></A
3015 >The smbpasswd file</A
3016 ></H1
3018 >In order for Samba to participate in the above protocol
3019 it must be able to look up the 16 byte hashed values given a user name.
3020 Unfortunately, as the UNIX password value is also a one way hash
3021 function (ie. it is impossible to retrieve the cleartext of the user's
3022 password given the UNIX hash of it), a separate password file
3023 containing this 16 byte value must be kept. To minimise problems with
3024 these two password files, getting out of sync, the UNIX <TT
3025 CLASS="FILENAME"
3026 > /etc/passwd</TT
3027 > and the <TT
3028 CLASS="FILENAME"
3029 >smbpasswd</TT
3030 > file,
3031 a utility, <B
3032 CLASS="COMMAND"
3033 >mksmbpasswd.sh</B
3034 >, is provided to generate
3035 a smbpasswd file from a UNIX <TT
3036 CLASS="FILENAME"
3037 >/etc/passwd</TT
3038 > file.
3041 >To generate the smbpasswd file from your <TT
3042 CLASS="FILENAME"
3043 >/etc/passwd
3044 </TT
3045 > file use the following command :</P
3047 ><TT
3048 CLASS="PROMPT"
3049 >$ </TT
3050 ><TT
3051 CLASS="USERINPUT"
3053 >cat /etc/passwd | mksmbpasswd.sh
3054 &#62; /usr/local/samba/private/smbpasswd</B
3055 ></TT
3056 ></P
3058 >If you are running on a system that uses NIS, use</P
3060 ><TT
3061 CLASS="PROMPT"
3062 >$ </TT
3063 ><TT
3064 CLASS="USERINPUT"
3066 >ypcat passwd | mksmbpasswd.sh
3067 &#62; /usr/local/samba/private/smbpasswd</B
3068 ></TT
3069 ></P
3071 >The <B
3072 CLASS="COMMAND"
3073 >mksmbpasswd.sh</B
3074 > program is found in
3075 the Samba source directory. By default, the smbpasswd file is
3076 stored in :</P
3078 ><TT
3079 CLASS="FILENAME"
3080 >/usr/local/samba/private/smbpasswd</TT
3081 ></P
3083 >The owner of the <TT
3084 CLASS="FILENAME"
3085 >/usr/local/samba/private/</TT
3087 directory should be set to root, and the permissions on it should
3088 be set to 0500 (<B
3089 CLASS="COMMAND"
3090 >chmod 500 /usr/local/samba/private</B
3094 >Likewise, the smbpasswd file inside the private directory should
3095 be owned by root and the permissions on is should be set to 0600
3097 CLASS="COMMAND"
3098 >chmod 600 smbpasswd</B
3099 >).</P
3101 >The format of the smbpasswd file is (The line has been
3102 wrapped here. It should appear as one entry per line in
3103 your smbpasswd file.)</P
3105 ><TABLE
3106 BORDER="0"
3107 BGCOLOR="#E0E0E0"
3108 WIDTH="100%"
3109 ><TR
3110 ><TD
3111 ><PRE
3112 CLASS="PROGRAMLISTING"
3113 >username:uid:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:
3114 [Account type]:LCT-&#60;last-change-time&#62;:Long name
3115 </PRE
3116 ></TD
3117 ></TR
3118 ></TABLE
3119 ></P
3121 >Although only the <TT
3122 CLASS="REPLACEABLE"
3124 >username</I
3125 ></TT
3128 CLASS="REPLACEABLE"
3130 >uid</I
3131 ></TT
3132 >, <TT
3133 CLASS="REPLACEABLE"
3135 > XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</I
3136 ></TT
3138 [<TT
3139 CLASS="REPLACEABLE"
3141 >Account type</I
3142 ></TT
3143 >] and <TT
3144 CLASS="REPLACEABLE"
3146 > last-change-time</I
3147 ></TT
3148 > sections are significant
3149 and are looked at in the Samba code.</P
3151 >It is <EM
3152 >VITALLY</EM
3153 > important that there by 32
3154 'X' characters between the two ':' characters in the XXX sections -
3155 the smbpasswd and Samba code will fail to validate any entries that
3156 do not have 32 characters between ':' characters. The first XXX
3157 section is for the Lanman password hash, the second is for the
3158 Windows NT version.</P
3160 >When the password file is created all users have password entries
3161 consisting of 32 'X' characters. By default this disallows any access
3162 as this user. When a user has a password set, the 'X' characters change
3163 to 32 ascii hexadecimal digits (0-9, A-F). These are an ascii
3164 representation of the 16 byte hashed value of a user's password.</P
3166 >To set a user to have no password (not recommended), edit the file
3167 using vi, and replace the first 11 characters with the ascii text
3169 CLASS="CONSTANT"
3170 >"NO PASSWORD"</TT
3171 > (minus the quotes).</P
3173 >For example, to clear the password for user bob, his smbpasswd file
3174 entry would look like :</P
3176 ><TABLE
3177 BORDER="0"
3178 BGCOLOR="#E0E0E0"
3179 WIDTH="100%"
3180 ><TR
3181 ><TD
3182 ><PRE
3183 CLASS="PROGRAMLISTING"
3184 > bob:100:NO PASSWORDXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:Bob's full name:/bobhome:/bobshell
3185 </PRE
3186 ></TD
3187 ></TR
3188 ></TABLE
3189 ></P
3191 >If you are allowing users to use the smbpasswd command to set
3192 their own passwords, you may want to give users NO PASSWORD initially
3193 so they do not have to enter a previous password when changing to their
3194 new password (not recommended). In order for you to allow this the
3196 CLASS="COMMAND"
3197 >smbpasswd</B
3198 > program must be able to connect to the
3200 CLASS="COMMAND"
3201 >smbd</B
3202 > daemon as that user with no password. Enable this
3203 by adding the line :</P
3206 CLASS="COMMAND"
3207 >null passwords = yes</B
3208 ></P
3210 >to the [global] section of the smb.conf file (this is why
3211 the above scenario is not recommended). Preferably, allocate your
3212 users a default password to begin with, so you do not have
3213 to enable this on your server.</P
3215 ><EM
3216 >Note : </EM
3217 >This file should be protected very
3218 carefully. Anyone with access to this file can (with enough knowledge of
3219 the protocols) gain access to your SMB server. The file is thus more
3220 sensitive than a normal unix <TT
3221 CLASS="FILENAME"
3222 >/etc/passwd</TT
3223 > file.</P
3224 ></DIV
3225 ><DIV
3226 CLASS="SECT1"
3227 ><HR><H1
3228 CLASS="SECT1"
3230 NAME="AEN534"
3231 >3.5. The smbpasswd Command</A
3232 ></H1
3234 >The smbpasswd command maintains the two 32 byte password fields
3235 in the smbpasswd file. If you wish to make it similar to the unix
3237 CLASS="COMMAND"
3238 >passwd</B
3239 > or <B
3240 CLASS="COMMAND"
3241 >yppasswd</B
3242 > programs,
3243 install it in <TT
3244 CLASS="FILENAME"
3245 >/usr/local/samba/bin/</TT
3246 > (or your
3247 main Samba binary directory).</P
3249 >Note that as of Samba 1.9.18p4 this program <EM
3250 >MUST NOT
3251 BE INSTALLED</EM
3252 > setuid root (the new <B
3253 CLASS="COMMAND"
3254 >smbpasswd</B
3256 code enforces this restriction so it cannot be run this way by
3257 accident).</P
3260 CLASS="COMMAND"
3261 >smbpasswd</B
3262 > now works in a client-server mode
3263 where it contacts the local smbd to change the user's password on its
3264 behalf. This has enormous benefits - as follows.</P
3266 ></P
3267 ><UL
3268 ><LI
3270 >smbpasswd no longer has to be setuid root -
3271 an enormous range of potential security problems is
3272 eliminated.</P
3273 ></LI
3274 ><LI
3277 CLASS="COMMAND"
3278 >smbpasswd</B
3279 > now has the capability
3280 to change passwords on Windows NT servers (this only works when
3281 the request is sent to the NT Primary Domain Controller if you
3282 are changing an NT Domain user's password).</P
3283 ></LI
3284 ></UL
3286 >To run smbpasswd as a normal user just type :</P
3288 ><TT
3289 CLASS="PROMPT"
3290 >$ </TT
3291 ><TT
3292 CLASS="USERINPUT"
3294 >smbpasswd</B
3295 ></TT
3296 ></P
3298 ><TT
3299 CLASS="PROMPT"
3300 >Old SMB password: </TT
3301 ><TT
3302 CLASS="USERINPUT"
3304 >&#60;type old value here -
3305 or hit return if there was no old password&#62;</B
3306 ></TT
3307 ></P
3309 ><TT
3310 CLASS="PROMPT"
3311 >New SMB Password: </TT
3312 ><TT
3313 CLASS="USERINPUT"
3315 >&#60;type new value&#62;
3317 ></TT
3318 ></P
3320 ><TT
3321 CLASS="PROMPT"
3322 >Repeat New SMB Password: </TT
3323 ><TT
3324 CLASS="USERINPUT"
3326 >&#60;re-type new value
3328 ></TT
3329 ></P
3331 >If the old value does not match the current value stored for
3332 that user, or the two new values do not match each other, then the
3333 password will not be changed.</P
3335 >If invoked by an ordinary user it will only allow the user
3336 to change his or her own Samba password.</P
3338 >If run by the root user smbpasswd may take an optional
3339 argument, specifying the user name whose SMB password you wish to
3340 change. Note that when run as root smbpasswd does not prompt for
3341 or check the old password value, thus allowing root to set passwords
3342 for users who have forgotten their passwords.</P
3345 CLASS="COMMAND"
3346 >smbpasswd</B
3347 > is designed to work in the same way
3348 and be familiar to UNIX users who use the <B
3349 CLASS="COMMAND"
3350 >passwd</B
3351 > or
3353 CLASS="COMMAND"
3354 >yppasswd</B
3355 > commands.</P
3357 >For more details on using <B
3358 CLASS="COMMAND"
3359 >smbpasswd</B
3360 > refer
3361 to the man page which will always be the definitive reference.</P
3362 ></DIV
3363 ><DIV
3364 CLASS="SECT1"
3365 ><HR><H1
3366 CLASS="SECT1"
3368 NAME="AEN573"
3369 >3.6. Setting up Samba to support LanManager Encryption</A
3370 ></H1
3372 >This is a very brief description on how to setup samba to
3373 support password encryption. </P
3375 ></P
3376 ><OL
3377 TYPE="1"
3378 ><LI
3380 >compile and install samba as usual</P
3381 ></LI
3382 ><LI
3384 >enable encrypted passwords in <TT
3385 CLASS="FILENAME"
3386 > smb.conf</TT
3387 > by adding the line <B
3388 CLASS="COMMAND"
3389 >encrypt
3390 passwords = yes</B
3391 > in the [global] section</P
3392 ></LI
3393 ><LI
3395 >create the initial <TT
3396 CLASS="FILENAME"
3397 >smbpasswd</TT
3399 password file in the place you specified in the Makefile
3400 (--prefix=&#60;dir&#62;). See the notes under the <A
3401 HREF="#SMBPASSWDFILEFORMAT"
3402 >The smbpasswd File</A
3404 section earlier in the document for details.</P
3405 ></LI
3406 ></OL
3408 >Note that you can test things using smbclient.</P
3409 ></DIV
3410 ></DIV
3411 ><DIV
3412 CLASS="CHAPTER"
3413 ><HR><H1
3415 NAME="AEN588"
3416 >Chapter 4. Hosting a Microsoft Distributed File System tree on Samba</A
3417 ></H1
3418 ><DIV
3419 CLASS="SECT1"
3420 ><H1
3421 CLASS="SECT1"
3423 NAME="AEN599"
3424 >4.1. Instructions</A
3425 ></H1
3427 >The Distributed File System (or Dfs) provides a means of
3428 separating the logical view of files and directories that users
3429 see from the actual physical locations of these resources on the
3430 network. It allows for higher availability, smoother storage expansion,
3431 load balancing etc. For more information about Dfs, refer to <A
3432 HREF="http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp"
3433 TARGET="_top"
3434 > Microsoft documentation</A
3435 >. </P
3437 >This document explains how to host a Dfs tree on a Unix
3438 machine (for Dfs-aware clients to browse) using Samba.</P
3440 >To enable SMB-based DFS for Samba, configure it with the
3442 CLASS="PARAMETER"
3444 >--with-msdfs</I
3445 ></TT
3446 > option. Once built, a
3447 Samba server can be made a Dfs server by setting the global
3448 boolean <A
3449 HREF="smb.conf.5.html#HOSTMSDFS"
3450 TARGET="_top"
3451 ><TT
3452 CLASS="PARAMETER"
3454 > host msdfs</I
3455 ></TT
3456 ></A
3457 > parameter in the <TT
3458 CLASS="FILENAME"
3459 >smb.conf
3460 </TT
3461 > file. You designate a share as a Dfs root using the share
3462 level boolean <A
3463 HREF="smb.conf.5.html#MSDFSROOT"
3464 TARGET="_top"
3465 ><TT
3466 CLASS="PARAMETER"
3468 > msdfs root</I
3469 ></TT
3470 ></A
3471 > parameter. A Dfs root directory on
3472 Samba hosts Dfs links in the form of symbolic links that point
3473 to other servers. For example, a symbolic link
3475 CLASS="FILENAME"
3476 >junction-&#62;msdfs:storage1\share1</TT
3477 > in
3478 the share directory acts as the Dfs junction. When Dfs-aware
3479 clients attempt to access the junction link, they are redirected
3480 to the storage location (in this case, \\storage1\share1).</P
3482 >Dfs trees on Samba work with all Dfs-aware clients ranging
3483 from Windows 95 to 2000.</P
3485 >Here's an example of setting up a Dfs tree on a Samba
3486 server.</P
3488 ><TABLE
3489 BORDER="0"
3490 BGCOLOR="#E0E0E0"
3491 WIDTH="100%"
3492 ><TR
3493 ><TD
3494 ><PRE
3495 CLASS="PROGRAMLISTING"
3496 ># The smb.conf file:
3497 [global]
3498 netbios name = SAMBA
3499 host msdfs = yes
3501 [dfs]
3502 path = /export/dfsroot
3503 msdfs root = yes
3504 </PRE
3505 ></TD
3506 ></TR
3507 ></TABLE
3508 ></P
3510 >In the /export/dfsroot directory we set up our dfs links to
3511 other servers on the network.</P
3513 ><TT
3514 CLASS="PROMPT"
3515 >root# </TT
3516 ><TT
3517 CLASS="USERINPUT"
3519 >cd /export/dfsroot</B
3520 ></TT
3521 ></P
3523 ><TT
3524 CLASS="PROMPT"
3525 >root# </TT
3526 ><TT
3527 CLASS="USERINPUT"
3529 >chown root /export/dfsroot</B
3530 ></TT
3531 ></P
3533 ><TT
3534 CLASS="PROMPT"
3535 >root# </TT
3536 ><TT
3537 CLASS="USERINPUT"
3539 >chmod 755 /export/dfsroot</B
3540 ></TT
3541 ></P
3543 ><TT
3544 CLASS="PROMPT"
3545 >root# </TT
3546 ><TT
3547 CLASS="USERINPUT"
3549 >ln -s msdfs:storageA\\shareA linka</B
3550 ></TT
3551 ></P
3553 ><TT
3554 CLASS="PROMPT"
3555 >root# </TT
3556 ><TT
3557 CLASS="USERINPUT"
3559 >ln -s msdfs:serverB\\share,serverC\\share linkb</B
3560 ></TT
3561 ></P
3563 >You should set up the permissions and ownership of
3564 the directory acting as the Dfs root such that only designated
3565 users can create, delete or modify the msdfs links. Also note
3566 that symlink names should be all lowercase. This limitation exists
3567 to have Samba avoid trying all the case combinations to get at
3568 the link name. Finally set up the symbolic links to point to the
3569 network shares you want, and start Samba.</P
3571 >Users on Dfs-aware clients can now browse the Dfs tree
3572 on the Samba server at \\samba\dfs. Accessing
3573 links linka or linkb (which appear as directories to the client)
3574 takes users directly to the appropriate shares on the network.</P
3575 ><DIV
3576 CLASS="SECT2"
3577 ><HR><H2
3578 CLASS="SECT2"
3580 NAME="AEN634"
3581 >4.1.1. Notes</A
3582 ></H2
3584 ></P
3585 ><UL
3586 ><LI
3588 >Windows clients need to be rebooted
3589 if a previously mounted non-dfs share is made a dfs
3590 root or vice versa. A better way is to introduce a
3591 new share and make it the dfs root.</P
3592 ></LI
3593 ><LI
3595 >Currently there's a restriction that msdfs
3596 symlink names should all be lowercase.</P
3597 ></LI
3598 ><LI
3600 >For security purposes, the directory
3601 acting as the root of the Dfs tree should have ownership
3602 and permissions set so that only designated users can
3603 modify the symbolic links in the directory.</P
3604 ></LI
3605 ></UL
3606 ></DIV
3607 ></DIV
3608 ></DIV
3609 ><DIV
3610 CLASS="CHAPTER"
3611 ><HR><H1
3613 NAME="AEN643"
3614 >Chapter 5. Printing Support in Samba 2.2.x</A
3615 ></H1
3616 ><DIV
3617 CLASS="SECT1"
3618 ><H1
3619 CLASS="SECT1"
3621 NAME="AEN654"
3622 >5.1. Introduction</A
3623 ></H1
3625 >Beginning with the 2.2.0 release, Samba supports
3626 the native Windows NT printing mechanisms implemented via
3627 MS-RPC (i.e. the SPOOLSS named pipe). Previous versions of
3628 Samba only supported LanMan printing calls.</P
3630 >The additional functionality provided by the new
3631 SPOOLSS support includes:</P
3633 ></P
3634 ><UL
3635 ><LI
3637 >Support for downloading printer driver
3638 files to Windows 95/98/NT/2000 clients upon demand.
3640 ></LI
3641 ><LI
3643 >Uploading of printer drivers via the
3644 Windows NT Add Printer Wizard (APW) or the
3645 Imprints tool set (refer to <A
3646 HREF="http://imprints.sourceforge.net"
3647 TARGET="_top"
3648 >http://imprints.sourceforge.net</A
3649 >).
3651 ></LI
3652 ><LI
3654 >Support for the native MS-RPC printing
3655 calls such as StartDocPrinter, EnumJobs(), etc... (See
3656 the MSDN documentation at <A
3657 HREF="http://msdn.microsoft.com/"
3658 TARGET="_top"
3659 >http://msdn.microsoft.com/</A
3661 for more information on the Win32 printing API)
3663 ></LI
3664 ><LI
3666 >Support for NT Access Control Lists (ACL)
3667 on printer objects</P
3668 ></LI
3669 ><LI
3671 >Improved support for printer queue manipulation
3672 through the use of an internal databases for spooled job
3673 information</P
3674 ></LI
3675 ></UL
3677 >There has been some initial confusion about what all this means
3678 and whether or not it is a requirement for printer drivers to be
3679 installed on a Samba host in order to support printing from Windows
3680 clients. A bug existed in Samba 2.2.0 which made Windows NT/2000 clients
3681 require that the Samba server possess a valid driver for the printer.
3682 This is fixed in Samba 2.2.1 and once again, Windows NT/2000 clients
3683 can use the local APW for installing drivers to be used with a Samba
3684 served printer. This is the same behavior exhibited by Windows 9x clients.
3685 As a side note, Samba does not use these drivers in any way to process
3686 spooled files. They are utilized entirely by the clients.</P
3688 >The following MS KB article, may be of some help if you are dealing with
3689 Windows 2000 clients: <EM
3690 >How to Add Printers with No User
3691 Interaction in Windows 2000</EM
3692 ></P
3695 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
3696 TARGET="_top"
3697 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
3698 ></P
3699 ></DIV
3700 ><DIV
3701 CLASS="SECT1"
3702 ><HR><H1
3703 CLASS="SECT1"
3705 NAME="AEN676"
3706 >5.2. Configuration</A
3707 ></H1
3708 ><DIV
3709 CLASS="WARNING"
3711 ></P
3712 ><TABLE
3713 CLASS="WARNING"
3714 BORDER="1"
3715 WIDTH="100%"
3716 ><TR
3717 ><TD
3718 ALIGN="CENTER"
3720 >[print$] vs. [printer$]</B
3721 ></TD
3722 ></TR
3723 ><TR
3724 ><TD
3725 ALIGN="LEFT"
3727 >Previous versions of Samba recommended using a share named [printer$].
3728 This name was taken from the printer$ service created by Windows 9x
3729 clients when a printer was shared. Windows 9x printer servers always have
3730 a printer$ service which provides read-only access via no
3731 password in order to support printer driver downloads.</P
3733 >However, the initial implementation allowed for a
3734 parameter named <TT
3735 CLASS="PARAMETER"
3737 >printer driver location</I
3738 ></TT
3740 to be used on a per share basis to specify the location of
3741 the driver files associated with that printer. Another
3742 parameter named <TT
3743 CLASS="PARAMETER"
3745 >printer driver</I
3746 ></TT
3747 > provided
3748 a means of defining the printer driver name to be sent to
3749 the client.</P
3751 >These parameters, including <TT
3752 CLASS="PARAMETER"
3754 >printer driver
3755 file</I
3756 ></TT
3757 > parameter, are being depreciated and should not
3758 be used in new installations. For more information on this change,
3759 you should refer to the <A
3760 HREF="#MIGRATION"
3761 >Migration section</A
3763 of this document.</P
3764 ></TD
3765 ></TR
3766 ></TABLE
3767 ></DIV
3768 ><DIV
3769 CLASS="SECT2"
3770 ><HR><H2
3771 CLASS="SECT2"
3773 NAME="AEN687"
3774 >5.2.1. Creating [print$]</A
3775 ></H2
3777 >In order to support the uploading of printer driver
3778 files, you must first configure a file share named [print$].
3779 The name of this share is hard coded in Samba's internals so
3780 the name is very important (print$ is the service used by
3781 Windows NT print servers to provide support for printer driver
3782 download).</P
3784 >You should modify the server's smb.conf file to create the
3785 following file share (of course, some of the parameter values,
3786 such as 'path' are arbitrary and should be replaced with
3787 appropriate values for your site):</P
3789 ><TABLE
3790 BORDER="0"
3791 BGCOLOR="#E0E0E0"
3792 WIDTH="100%"
3793 ><TR
3794 ><TD
3795 ><PRE
3796 CLASS="PROGRAMLISTING"
3797 >[print$]
3798 path = /usr/local/samba/printers
3799 guest ok = yes
3800 browseable = yes
3801 read only = yes
3802 ; since this share is configured as read only, then we need
3803 ; a 'write list'. Check the file system permissions to make
3804 ; sure this account can copy files to the share. If this
3805 ; is setup to a non-root account, then it should also exist
3806 ; as a 'printer admin'
3807 write list = ntadmin</PRE
3808 ></TD
3809 ></TR
3810 ></TABLE
3811 ></P
3813 >The <A
3814 HREF="smb.conf.5.html#WRITELIST"
3815 TARGET="_top"
3816 ><TT
3817 CLASS="PARAMETER"
3819 >write list</I
3820 ></TT
3821 ></A
3822 > is used to allow administrative
3823 level user accounts to have write access in order to update files
3824 on the share. See the <A
3825 HREF="smb./conf.5.html"
3826 TARGET="_top"
3827 >smb.conf(5)
3828 man page</A
3829 > for more information on configuring file shares.</P
3831 >The requirement for <A
3832 HREF="smb.conf.5.html#GUESTOK"
3833 TARGET="_top"
3835 CLASS="COMMAND"
3836 >guest
3837 ok = yes</B
3838 ></A
3839 > depends upon how your
3840 site is configured. If users will be guaranteed to have
3841 an account on the Samba host, then this is a non-issue.</P
3842 ><DIV
3843 CLASS="NOTE"
3844 ><BLOCKQUOTE
3845 CLASS="NOTE"
3848 >Author's Note: </B
3849 >The non-issue is that if all your Windows NT users are guaranteed to be
3850 authenticated by the Samba server (such as a domain member server and the NT
3851 user has already been validated by the Domain Controller in
3852 order to logon to the Windows NT console), then guest access
3853 is not necessary. Of course, in a workgroup environment where
3854 you just want to be able to print without worrying about
3855 silly accounts and security, then configure the share for
3856 guest access. You'll probably want to add <A
3857 HREF="smb.conf.5.html#MAPTOGUEST"
3858 TARGET="_top"
3860 CLASS="COMMAND"
3861 >map to guest = Bad User</B
3862 ></A
3863 > in the [global] section as well. Make sure
3864 you understand what this parameter does before using it
3865 though. --jerry</P
3866 ></BLOCKQUOTE
3867 ></DIV
3869 >In order for a Windows NT print server to support
3870 the downloading of driver files by multiple client architectures,
3871 it must create subdirectories within the [print$] service
3872 which correspond to each of the supported client architectures.
3873 Samba follows this model as well.</P
3875 >Next create the directory tree below the [print$] share
3876 for each architecture you wish to support.</P
3878 ><TABLE
3879 BORDER="0"
3880 BGCOLOR="#E0E0E0"
3881 WIDTH="100%"
3882 ><TR
3883 ><TD
3884 ><PRE
3885 CLASS="PROGRAMLISTING"
3886 >[print$]-----
3887 |-W32X86 ; "Windows NT x86"
3888 |-WIN40 ; "Windows 95/98"
3889 |-W32ALPHA ; "Windows NT Alpha_AXP"
3890 |-W32MIPS ; "Windows NT R4000"
3891 |-W32PPC ; "Windows NT PowerPC"</PRE
3892 ></TD
3893 ></TR
3894 ></TABLE
3895 ></P
3896 ><DIV
3897 CLASS="WARNING"
3899 ></P
3900 ><TABLE
3901 CLASS="WARNING"
3902 BORDER="1"
3903 WIDTH="100%"
3904 ><TR
3905 ><TD
3906 ALIGN="CENTER"
3908 >ATTENTION! REQUIRED PERMISSIONS</B
3909 ></TD
3910 ></TR
3911 ><TR
3912 ><TD
3913 ALIGN="LEFT"
3915 >In order to currently add a new driver to you Samba host,
3916 one of two conditions must hold true:</P
3918 ></P
3919 ><UL
3920 ><LI
3922 >The account used to connect to the Samba host
3923 must have a uid of 0 (i.e. a root account)</P
3924 ></LI
3925 ><LI
3927 >The account used to connect to the Samba host
3928 must be a member of the <A
3929 HREF="smb.conf.5.html#PRINTERADMIN"
3930 TARGET="_top"
3931 ><TT
3932 CLASS="PARAMETER"
3934 >printer
3935 admin</I
3936 ></TT
3937 ></A
3938 > list.</P
3939 ></LI
3940 ></UL
3942 >Of course, the connected account must still possess access
3943 to add files to the subdirectories beneath [print$]. Remember
3944 that all file shares are set to 'read only' by default.</P
3945 ></TD
3946 ></TR
3947 ></TABLE
3948 ></DIV
3950 >Once you have created the required [print$] service and
3951 associated subdirectories, simply log onto the Samba server using
3952 a root (or <TT
3953 CLASS="PARAMETER"
3955 >printer admin</I
3956 ></TT
3957 >) account
3958 from a Windows NT 4.0 client. Navigate to the "Printers" folder
3959 on the Samba server. You should see an initial listing of printers
3960 that matches the printer shares defined on your Samba host.</P
3961 ></DIV
3962 ><DIV
3963 CLASS="SECT2"
3964 ><HR><H2
3965 CLASS="SECT2"
3967 NAME="AEN722"
3968 >5.2.2. Setting Drivers for Existing Printers</A
3969 ></H2
3971 >The initial listing of printers in the Samba host's
3972 Printers folder will have no real printer driver assigned
3973 to them. By default, in Samba 2.2.0 this driver name was set to
3975 >NO PRINTER DRIVER AVAILABLE FOR THIS PRINTER</EM
3977 Later versions changed this to a NULL string to allow the use
3978 tof the local Add Printer Wizard on NT/2000 clients.
3979 Attempting to view the printer properties for a printer
3980 which has this default driver assigned will result in
3981 the error message:</P
3983 ><EM
3984 >Device settings cannot be displayed. The driver
3985 for the specified printer is not installed, only spooler
3986 properties will be displayed. Do you want to install the
3987 driver now?</EM
3988 ></P
3990 >Click "No" in the error dialog and you will be presented with
3991 the printer properties window. The way assign a driver to a
3992 printer is to either</P
3994 ></P
3995 ><UL
3996 ><LI
3998 >Use the "New Driver..." button to install
3999 a new printer driver, or</P
4000 ></LI
4001 ><LI
4003 >Select a driver from the popup list of
4004 installed drivers. Initially this list will be empty.</P
4005 ></LI
4006 ></UL
4008 >If you wish to install printer drivers for client
4009 operating systems other than "Windows NT x86", you will need
4010 to use the "Sharing" tab of the printer properties dialog.</P
4012 >Assuming you have connected with a root account, you
4013 will also be able modify other printer properties such as
4014 ACLs and device settings using this dialog box.</P
4016 >A few closing comments for this section, it is possible
4017 on a Windows NT print server to have printers
4018 listed in the Printers folder which are not shared. Samba does
4019 not make this distinction. By definition, the only printers of
4020 which Samba is aware are those which are specified as shares in
4022 CLASS="FILENAME"
4023 >smb.conf</TT
4024 >.</P
4026 >Another interesting side note is that Windows NT clients do
4027 not use the SMB printer share, but rather can print directly
4028 to any printer on another Windows NT host using MS-RPC. This
4029 of course assumes that the printing client has the necessary
4030 privileges on the remote host serving the printer. The default
4031 permissions assigned by Windows NT to a printer gives the "Print"
4032 permissions to the "Everyone" well-known group.</P
4033 ></DIV
4034 ><DIV
4035 CLASS="SECT2"
4036 ><HR><H2
4037 CLASS="SECT2"
4039 NAME="AEN739"
4040 >5.2.3. Support a large number of printers</A
4041 ></H2
4043 >One issue that has arisen during the development
4044 phase of Samba 2.2 is the need to support driver downloads for
4045 100's of printers. Using the Windows NT APW is somewhat
4046 awkward to say the list. If more than one printer are using the
4047 same driver, the <A
4048 HREF="rpcclient.1.html"
4049 TARGET="_top"
4051 CLASS="COMMAND"
4052 >rpcclient's
4053 setdriver command</B
4054 ></A
4055 > can be used to set the driver
4056 associated with an installed driver. The following is example
4057 of how this could be accomplished:</P
4059 ><TABLE
4060 BORDER="0"
4061 BGCOLOR="#E0E0E0"
4062 WIDTH="100%"
4063 ><TR
4064 ><TD
4065 ><PRE
4066 CLASS="PROGRAMLISTING"
4069 CLASS="PROMPT"
4070 >$ </TT
4071 >rpcclient pogo -U root%secret -c "enumdrivers"
4072 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4074 [Windows NT x86]
4075 Printer Driver Info 1:
4076 Driver Name: [HP LaserJet 4000 Series PS]
4078 Printer Driver Info 1:
4079 Driver Name: [HP LaserJet 2100 Series PS]
4081 Printer Driver Info 1:
4082 Driver Name: [HP LaserJet 4Si/4SiMX PS]
4085 CLASS="PROMPT"
4086 >$ </TT
4087 >rpcclient pogo -U root%secret -c "enumprinters"
4088 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4089 flags:[0x800000]
4090 name:[\\POGO\hp-print]
4091 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
4092 comment:[]
4095 CLASS="PROMPT"
4096 >$ </TT
4097 >rpcclient pogo -U root%secret \
4099 CLASS="PROMPT"
4100 >&#62; </TT
4101 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
4102 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4103 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
4104 ></TD
4105 ></TR
4106 ></TABLE
4107 ></P
4108 ></DIV
4109 ><DIV
4110 CLASS="SECT2"
4111 ><HR><H2
4112 CLASS="SECT2"
4114 NAME="AEN750"
4115 >5.2.4. Adding New Printers via the Windows NT APW</A
4116 ></H2
4118 >By default, Samba offers all printer shares defined in <TT
4119 CLASS="FILENAME"
4120 >smb.conf</TT
4122 in the "Printers..." folder. Also existing in this folder is the Windows NT
4123 Add Printer Wizard icon. The APW will be show only if</P
4125 ></P
4126 ><UL
4127 ><LI
4129 >The connected user is able to successfully
4130 execute an OpenPrinterEx(\\server) with administrative
4131 priviledges (i.e. root or <TT
4132 CLASS="PARAMETER"
4134 >printer admin</I
4135 ></TT
4138 ></LI
4139 ><LI
4142 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
4143 TARGET="_top"
4144 ><TT
4145 CLASS="PARAMETER"
4147 >show
4148 add printer wizard = yes</I
4149 ></TT
4150 ></A
4151 > (the default).
4153 ></LI
4154 ></UL
4156 >In order to be able to use the APW to successfully add a printer to a Samba
4157 server, the <A
4158 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
4159 TARGET="_top"
4160 ><TT
4161 CLASS="PARAMETER"
4163 >add
4164 printer command</I
4165 ></TT
4166 ></A
4167 > must have a defined value. The program
4168 hook must successfully add the printer to the system (i.e.
4170 CLASS="FILENAME"
4171 >/etc/printcap</TT
4172 > or appropriate files) and
4174 CLASS="FILENAME"
4175 >smb.conf</TT
4176 > if necessary.</P
4178 >When using the APW from a client, if the named printer share does
4179 not exist, <B
4180 CLASS="COMMAND"
4181 >smbd</B
4182 > will execute the <TT
4183 CLASS="PARAMETER"
4185 >add printer
4186 command</I
4187 ></TT
4188 > and reparse to the <TT
4189 CLASS="FILENAME"
4190 >smb.conf</TT
4192 to attempt to locate the new printer share. If the share is still not defined,
4193 an error of "Access Denied" is returned to the client. Note that the
4195 CLASS="PARAMETER"
4197 >add printer program</I
4198 ></TT
4199 > is executed under the context
4200 of the connected user, not necessarily a root account.</P
4202 >There is a complementing <A
4203 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
4204 TARGET="_top"
4205 ><TT
4206 CLASS="PARAMETER"
4208 >delete
4209 printer command</I
4210 ></TT
4211 ></A
4212 > for removing entries from the "Printers..."
4213 folder.</P
4214 ></DIV
4215 ><DIV
4216 CLASS="SECT2"
4217 ><HR><H2
4218 CLASS="SECT2"
4220 NAME="AEN775"
4221 >5.2.5. Samba and Printer Ports</A
4222 ></H2
4224 >Windows NT/2000 print servers associate a port with each printer. These normally
4225 take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the
4226 concept of ports associated with a printer. By default, only one printer port,
4227 named "Samba Printer Port", exists on a system. Samba does not really a port in
4228 order to print, rather it is a requirement of Windows clients. </P
4230 >Note that Samba does not support the concept of "Printer Pooling" internally
4231 either. This is when a logical printer is assigned to multiple ports as
4232 a form of load balancing or fail over.</P
4234 >If you require that multiple ports be defined for some reason,
4236 CLASS="FILENAME"
4237 >smb.conf</TT
4238 > possesses a <A
4239 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
4240 TARGET="_top"
4241 ><TT
4242 CLASS="PARAMETER"
4244 >enumports
4245 command</I
4246 ></TT
4247 ></A
4248 > which can be used to define an external program
4249 that generates a listing of ports on a system.</P
4250 ></DIV
4251 ></DIV
4252 ><DIV
4253 CLASS="SECT1"
4254 ><HR><H1
4255 CLASS="SECT1"
4257 NAME="AEN783"
4258 >5.3. The Imprints Toolset</A
4259 ></H1
4261 >The Imprints tool set provides a UNIX equivalent of the
4262 Windows NT Add Printer Wizard. For complete information, please
4263 refer to the Imprints web site at <A
4264 HREF="http://imprints.sourceforge.net/"
4265 TARGET="_top"
4266 > http://imprints.sourceforge.net/</A
4267 > as well as the documentation
4268 included with the imprints source distribution. This section will
4269 only provide a brief introduction to the features of Imprints.</P
4270 ><DIV
4271 CLASS="SECT2"
4272 ><HR><H2
4273 CLASS="SECT2"
4275 NAME="AEN787"
4276 >5.3.1. What is Imprints?</A
4277 ></H2
4279 >Imprints is a collection of tools for supporting the goals
4280 of</P
4282 ></P
4283 ><UL
4284 ><LI
4286 >Providing a central repository information
4287 regarding Windows NT and 95/98 printer driver packages</P
4288 ></LI
4289 ><LI
4291 >Providing the tools necessary for creating
4292 the Imprints printer driver packages.</P
4293 ></LI
4294 ><LI
4296 >Providing an installation client which
4297 will obtain and install printer drivers on remote Samba
4298 and Windows NT 4 print servers.</P
4299 ></LI
4300 ></UL
4301 ></DIV
4302 ><DIV
4303 CLASS="SECT2"
4304 ><HR><H2
4305 CLASS="SECT2"
4307 NAME="AEN797"
4308 >5.3.2. Creating Printer Driver Packages</A
4309 ></H2
4311 >The process of creating printer driver packages is beyond
4312 the scope of this document (refer to Imprints.txt also included
4313 with the Samba distribution for more information). In short,
4314 an Imprints driver package is a gzipped tarball containing the
4315 driver files, related INF files, and a control file needed by the
4316 installation client.</P
4317 ></DIV
4318 ><DIV
4319 CLASS="SECT2"
4320 ><HR><H2
4321 CLASS="SECT2"
4323 NAME="AEN800"
4324 >5.3.3. The Imprints server</A
4325 ></H2
4327 >The Imprints server is really a database server that
4328 may be queried via standard HTTP mechanisms. Each printer
4329 entry in the database has an associated URL for the actual
4330 downloading of the package. Each package is digitally signed
4331 via GnuPG which can be used to verify that package downloaded
4332 is actually the one referred in the Imprints database. It is
4334 >not</EM
4335 > recommended that this security check
4336 be disabled.</P
4337 ></DIV
4338 ><DIV
4339 CLASS="SECT2"
4340 ><HR><H2
4341 CLASS="SECT2"
4343 NAME="AEN804"
4344 >5.3.4. The Installation Client</A
4345 ></H2
4347 >More information regarding the Imprints installation client
4348 is available in the <TT
4349 CLASS="FILENAME"
4350 >Imprints-Client-HOWTO.ps</TT
4352 file included with the imprints source package.</P
4354 >The Imprints installation client comes in two forms.</P
4356 ></P
4357 ><UL
4358 ><LI
4360 >a set of command line Perl scripts</P
4361 ></LI
4362 ><LI
4364 >a GTK+ based graphical interface to
4365 the command line perl scripts</P
4366 ></LI
4367 ></UL
4369 >The installation client (in both forms) provides a means
4370 of querying the Imprints database server for a matching
4371 list of known printer model names as well as a means to
4372 download and install the drivers on remote Samba and Windows
4373 NT print servers.</P
4375 >The basic installation process is in four steps and
4376 perl code is wrapped around <B
4377 CLASS="COMMAND"
4378 >smbclient</B
4380 and <B
4381 CLASS="COMMAND"
4382 >rpcclient</B
4383 >.</P
4385 ><TABLE
4386 BORDER="0"
4387 BGCOLOR="#E0E0E0"
4388 WIDTH="100%"
4389 ><TR
4390 ><TD
4391 ><PRE
4392 CLASS="PROGRAMLISTING"
4394 foreach (supported architecture for a given driver)
4396 1. rpcclient: Get the appropriate upload directory
4397 on the remote server
4398 2. smbclient: Upload the driver files
4399 3. rpcclient: Issues an AddPrinterDriver() MS-RPC
4402 4. rpcclient: Issue an AddPrinterEx() MS-RPC to actually
4403 create the printer</PRE
4404 ></TD
4405 ></TR
4406 ></TABLE
4407 ></P
4409 >One of the problems encountered when implementing
4410 the Imprints tool set was the name space issues between
4411 various supported client architectures. For example, Windows
4412 NT includes a driver named "Apple LaserWriter II NTX v51.8"
4413 and Windows 95 callsits version of this driver "Apple
4414 LaserWriter II NTX"</P
4416 >The problem is how to know what client drivers have
4417 been uploaded for a printer. As astute reader will remember
4418 that the Windows NT Printer Properties dialog only includes
4419 space for one printer driver name. A quick look in the
4420 Windows NT 4.0 system registry at</P
4422 ><TT
4423 CLASS="FILENAME"
4424 >HKLM\System\CurrentControlSet\Control\Print\Environment
4425 </TT
4426 ></P
4428 >will reveal that Windows NT always uses the NT driver
4429 name. This is ok as Windows NT always requires that at least
4430 the Windows NT version of the printer driver is present.
4431 However, Samba does not have the requirement internally.
4432 Therefore, how can you use the NT driver name if is has not
4433 already been installed?</P
4435 >The way of sidestepping this limitation is to require
4436 that all Imprints printer driver packages include both the Intel
4437 Windows NT and 95/98 printer drivers and that NT driver is
4438 installed first.</P
4439 ></DIV
4440 ></DIV
4441 ><DIV
4442 CLASS="SECT1"
4443 ><HR><H1
4444 CLASS="SECT1"
4446 NAME="AEN826"
4447 >5.4. <A
4448 NAME="MIGRATION"
4449 ></A
4450 >Migration to from Samba 2.0.x to 2.2.x</A
4451 ></H1
4453 >Given that printer driver management has changed (we hope improved) in
4454 2.2 over prior releases, migration from an existing setup to 2.2 can
4455 follow several paths.</P
4457 >Windows clients have a tendency to remember things for quite a while.
4458 For example, if a Windows NT client has attached to a Samba 2.0 server,
4459 it will remember the server as a LanMan printer server. Upgrading
4460 the Samba host to 2.2 makes support for MSRPC printing possible, but
4461 the NT client will still remember the previous setting.</P
4463 >In order to give an NT client printing "amesia" (only necessary if you
4464 want to use the newer MSRPC printing functionality in Samba), delete
4465 the registry keys associated with the print server contained in
4467 CLASS="CONSTANT"
4468 >[HKLM\SYSTEM\CurrentControlSet\Control\Print]</TT
4469 >. The
4470 spooler service on the client should be stopped prior to doing this:</P
4472 ><TT
4473 CLASS="PROMPT"
4474 >C:\WINNT\ &#62;</TT
4475 > <TT
4476 CLASS="USERINPUT"
4478 >net stop spooler</B
4479 ></TT
4480 ></P
4482 ><EM
4483 >All the normal disclaimers about editing the registry go
4484 here.</EM
4485 > Be careful, and know what you are doing.</P
4487 >The spooler service should be restarted after you have finished
4488 removing the appropriate registry entries by replacing the
4490 CLASS="COMMAND"
4491 >stop</B
4492 > command above with <B
4493 CLASS="COMMAND"
4494 >start</B
4495 >.</P
4497 >Windows 9x clients will continue to use LanMan printing calls
4498 with a 2.2 Samba server so there is no need to perform any of these
4499 modifications on non-NT clients.</P
4500 ><DIV
4501 CLASS="WARNING"
4503 ></P
4504 ><TABLE
4505 CLASS="WARNING"
4506 BORDER="1"
4507 WIDTH="100%"
4508 ><TR
4509 ><TD
4510 ALIGN="CENTER"
4512 >Achtung!</B
4513 ></TD
4514 ></TR
4515 ><TR
4516 ><TD
4517 ALIGN="LEFT"
4519 >The following smb.conf parameters are considered to be depreciated and will
4520 be removed soon. Do not use them in new installations</P
4522 ></P
4523 ><UL
4524 ><LI
4526 ><TT
4527 CLASS="PARAMETER"
4529 >printer driver file (G)</I
4530 ></TT
4533 ></LI
4534 ><LI
4536 ><TT
4537 CLASS="PARAMETER"
4539 >printer driver (S)</I
4540 ></TT
4543 ></LI
4544 ><LI
4546 ><TT
4547 CLASS="PARAMETER"
4549 >printer driver location (S)</I
4550 ></TT
4553 ></LI
4554 ></UL
4555 ></TD
4556 ></TR
4557 ></TABLE
4558 ></DIV
4560 >Here are the possible scenarios for supporting migration:</P
4562 ></P
4563 ><UL
4564 ><LI
4566 >If you do not desire the new Windows NT
4567 print driver support, nothing needs to be done.
4568 All existing parameters work the same.</P
4569 ></LI
4570 ><LI
4572 >If you want to take advantage of NT printer
4573 driver support but do not want to migrate the
4574 9x drivers to the new setup, the leave the existing
4575 printers.def file. When smbd attempts to locate a
4576 9x driver for the printer in the TDB and fails it
4577 will drop down to using the printers.def (and all
4578 associated parameters). The <B
4579 CLASS="COMMAND"
4580 >make_printerdef</B
4582 tool will also remain for backwards compatibility but will
4583 be moved to the "this tool is the old way of doing it"
4584 pile.</P
4585 ></LI
4586 ><LI
4588 >If you install a Windows 9x driver for a printer
4589 on your Samba host (in the printing TDB), this information will
4590 take precedence and the three old printing parameters
4591 will be ignored (including print driver location).</P
4592 ></LI
4593 ><LI
4595 >If you want to migrate an existing <TT
4596 CLASS="FILENAME"
4597 >printers.def</TT
4599 file into the new setup, the current only solution is to use the Windows
4600 NT APW to install the NT drivers and the 9x drivers. This can be scripted
4601 using <B
4602 CLASS="COMMAND"
4603 >smbclient</B
4604 > and <B
4605 CLASS="COMMAND"
4606 >rpcclient</B
4607 >. See the
4608 Imprints installation client at <A
4609 HREF="http://imprints.sourceforge.net/"
4610 TARGET="_top"
4611 >http://imprints.sourceforge.net/</A
4613 for an example.
4615 ></LI
4616 ></UL
4617 ></DIV
4618 ></DIV
4619 ><DIV
4620 CLASS="CHAPTER"
4621 ><HR><H1
4623 NAME="AEN870"
4624 >Chapter 6. security = domain in Samba 2.x</A
4625 ></H1
4626 ><DIV
4627 CLASS="SECT1"
4628 ><H1
4629 CLASS="SECT1"
4631 NAME="AEN888"
4632 >6.1. Joining an NT Domain with Samba 2.2</A
4633 ></H1
4635 >In order for a Samba-2 server to join an NT domain,
4636 you must first add the NetBIOS name of the Samba server to the
4637 NT domain on the PDC using Server Manager for Domains. This creates
4638 the machine account in the domain (PDC) SAM. Note that you should
4639 add the Samba server as a "Windows NT Workstation or Server",
4641 >NOT</EM
4642 > as a Primary or backup domain controller.</P
4644 >Assume you have a Samba-2 server with a NetBIOS name of
4646 CLASS="CONSTANT"
4647 >SERV1</TT
4648 > and are joining an NT domain called
4650 CLASS="CONSTANT"
4651 >DOM</TT
4652 >, which has a PDC with a NetBIOS name
4653 of <TT
4654 CLASS="CONSTANT"
4655 >DOMPDC</TT
4656 > and two backup domain controllers
4657 with NetBIOS names <TT
4658 CLASS="CONSTANT"
4659 >DOMBDC1</TT
4660 > and <TT
4661 CLASS="CONSTANT"
4662 >DOMBDC2
4663 </TT
4664 >.</P
4666 >In order to join the domain, first stop all Samba daemons
4667 and run the command:</P
4669 ><TT
4670 CLASS="PROMPT"
4671 >root# </TT
4672 ><TT
4673 CLASS="USERINPUT"
4675 >smbpasswd -j DOM -r DOMPDC
4677 ></TT
4678 ></P
4680 >as we are joining the domain DOM and the PDC for that domain
4681 (the only machine that has write access to the domain SAM database)
4682 is DOMPDC. If this is successful you will see the message:</P
4684 ><TT
4685 CLASS="COMPUTEROUTPUT"
4686 >smbpasswd: Joined domain DOM.</TT
4690 >in your terminal window. See the <A
4691 HREF="smbpasswd.8.html"
4692 TARGET="_top"
4693 > smbpasswd(8)</A
4694 > man page for more details.</P
4696 >There is existing development code to join a domain
4697 without having to create the machine trust account on the PDC
4698 beforehand. This code will hopefully be available soon
4699 in release branches as well.</P
4701 >This command goes through the machine account password
4702 change protocol, then writes the new (random) machine account
4703 password for this Samba server into a file in the same directory
4704 in which an smbpasswd file would be stored - normally :</P
4706 ><TT
4707 CLASS="FILENAME"
4708 >/usr/local/samba/private</TT
4709 ></P
4711 >In Samba 2.0.x, the filename looks like this:</P
4713 ><TT
4714 CLASS="FILENAME"
4715 ><TT
4716 CLASS="REPLACEABLE"
4718 >&#60;NT DOMAIN NAME&#62;</I
4719 ></TT
4720 >.<TT
4721 CLASS="REPLACEABLE"
4723 >&#60;Samba
4724 Server Name&#62;</I
4725 ></TT
4726 >.mac</TT
4727 ></P
4729 >The <TT
4730 CLASS="FILENAME"
4731 >.mac</TT
4732 > suffix stands for machine account
4733 password file. So in our example above, the file would be called:</P
4735 ><TT
4736 CLASS="FILENAME"
4737 >DOM.SERV1.mac</TT
4738 ></P
4740 >In Samba 2.2, this file has been replaced with a TDB
4741 (Trivial Database) file named <TT
4742 CLASS="FILENAME"
4743 >secrets.tdb</TT
4747 >This file is created and owned by root and is not
4748 readable by any other user. It is the key to the domain-level
4749 security for your system, and should be treated as carefully
4750 as a shadow password file.</P
4752 >Now, before restarting the Samba daemons you must
4753 edit your <A
4754 HREF="smb.conf.5.html"
4755 TARGET="_top"
4756 ><TT
4757 CLASS="FILENAME"
4758 >smb.conf(5)</TT
4761 > file to tell Samba it should now use domain security.</P
4763 >Change (or add) your <A
4764 HREF="smb.conf.5.html#SECURITY"
4765 TARGET="_top"
4766 > <TT
4767 CLASS="PARAMETER"
4769 >security =</I
4770 ></TT
4771 ></A
4772 > line in the [global] section
4773 of your smb.conf to read:</P
4776 CLASS="COMMAND"
4777 >security = domain</B
4778 ></P
4780 >Next change the <A
4781 HREF="smb.conf.5.html#WORKGROUP"
4782 TARGET="_top"
4783 ><TT
4784 CLASS="PARAMETER"
4786 > workgroup =</I
4787 ></TT
4788 ></A
4789 > line in the [global] section to read: </P
4792 CLASS="COMMAND"
4793 >workgroup = DOM</B
4794 ></P
4796 >as this is the name of the domain we are joining. </P
4798 >You must also have the parameter <A
4799 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
4800 TARGET="_top"
4801 > <TT
4802 CLASS="PARAMETER"
4804 >encrypt passwords</I
4805 ></TT
4806 ></A
4807 > set to <TT
4808 CLASS="CONSTANT"
4809 >yes
4810 </TT
4811 > in order for your users to authenticate to the NT PDC.</P
4813 >Finally, add (or modify) a <A
4814 HREF="smb.conf.5.html#PASSWORDSERVER"
4815 TARGET="_top"
4816 > <TT
4817 CLASS="PARAMETER"
4819 >password server =</I
4820 ></TT
4821 ></A
4822 > line in the [global]
4823 section to read: </P
4826 CLASS="COMMAND"
4827 >password server = DOMPDC DOMBDC1 DOMBDC2</B
4828 ></P
4830 >These are the primary and backup domain controllers Samba
4831 will attempt to contact in order to authenticate users. Samba will
4832 try to contact each of these servers in order, so you may want to
4833 rearrange this list in order to spread out the authentication load
4834 among domain controllers.</P
4836 >Alternatively, if you want smbd to automatically determine
4837 the list of Domain controllers to use for authentication, you may
4838 set this line to be :</P
4841 CLASS="COMMAND"
4842 >password server = *</B
4843 ></P
4845 >This method, which was introduced in Samba 2.0.6,
4846 allows Samba to use exactly the same mechanism that NT does. This
4847 method either broadcasts or uses a WINS database in order to
4848 find domain controllers to authenticate against.</P
4850 >Finally, restart your Samba daemons and get ready for
4851 clients to begin using domain security!</P
4852 ></DIV
4853 ><DIV
4854 CLASS="SECT1"
4855 ><HR><H1
4856 CLASS="SECT1"
4858 NAME="AEN952"
4859 >6.2. Samba and Windows 2000 Domains</A
4860 ></H1
4862 >Many people have asked regarding the state of Samba's ability to participate in
4863 a Windows 2000 Domain. Samba 2.2 is able to act as a member server of a Windows
4864 2000 domain operating in mixed or native mode.</P
4866 >There is much confusion between the circumstances that require a "mixed" mode
4867 Win2k DC and a when this host can be switched to "native" mode. A "mixed" mode
4868 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
4869 domain. By default, a Win2k DC in "native" mode will still support
4870 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and
4871 NT 4.0. Samba has the same requirements as a Windows NT 4.0 member server.</P
4873 >The steps for adding a Samba 2.2 host to a Win2k domain are the same as those
4874 for adding a Samba server to a Windows NT 4.0 domain. The only exception is that
4875 the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and
4876 Computers" MMC (Microsoft Management Console) plugin.</P
4877 ></DIV
4878 ><DIV
4879 CLASS="SECT1"
4880 ><HR><H1
4881 CLASS="SECT1"
4883 NAME="AEN957"
4884 >6.3. Why is this better than security = server?</A
4885 ></H1
4887 >Currently, domain security in Samba doesn't free you from
4888 having to create local Unix users to represent the users attaching
4889 to your server. This means that if domain user <TT
4890 CLASS="CONSTANT"
4891 >DOM\fred
4892 </TT
4893 > attaches to your domain security Samba server, there needs
4894 to be a local Unix user fred to represent that user in the Unix
4895 filesystem. This is very similar to the older Samba security mode
4897 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
4898 TARGET="_top"
4899 >security = server</A
4901 where Samba would pass through the authentication request to a Windows
4902 NT server in the same way as a Windows 95 or Windows 98 server would.
4905 >Please refer to the <A
4906 HREF="winbind.html"
4907 TARGET="_top"
4908 >Winbind
4909 paper</A
4910 > for information on a system to automatically
4911 assign UNIX uids and gids to Windows NT Domain users and groups.
4912 This code is available in development branches only at the moment,
4913 but will be moved to release branches soon.</P
4915 >The advantage to domain-level security is that the
4916 authentication in domain-level security is passed down the authenticated
4917 RPC channel in exactly the same way that an NT server would do it. This
4918 means Samba servers now participate in domain trust relationships in
4919 exactly the same way NT servers do (i.e., you can add Samba servers into
4920 a resource domain and have the authentication passed on from a resource
4921 domain PDC to an account domain PDC.</P
4923 >In addition, with <B
4924 CLASS="COMMAND"
4925 >security = server</B
4926 > every Samba
4927 daemon on a server has to keep a connection open to the
4928 authenticating server for as long as that daemon lasts. This can drain
4929 the connection resources on a Microsoft NT server and cause it to run
4930 out of available connections. With <B
4931 CLASS="COMMAND"
4932 >security = domain</B
4934 however, the Samba daemons connect to the PDC/BDC only for as long
4935 as is necessary to authenticate the user, and then drop the connection,
4936 thus conserving PDC connection resources.</P
4938 >And finally, acting in the same manner as an NT server
4939 authenticating to a PDC means that as part of the authentication
4940 reply, the Samba server gets the user identification information such
4941 as the user SID, the list of NT groups the user belongs to, etc. All
4942 this information will allow Samba to be extended in the future into
4943 a mode the developers currently call appliance mode. In this mode,
4944 no local Unix users will be necessary, and Samba will generate Unix
4945 uids and gids from the information passed back from the PDC when a
4946 user is authenticated, making a Samba server truly plug and play
4947 in an NT domain environment. Watch for this code soon.</P
4949 ><EM
4950 >NOTE:</EM
4951 > Much of the text of this document
4952 was first published in the Web magazine <A
4953 HREF="http://www.linuxworld.com"
4954 TARGET="_top"
4956 LinuxWorld</A
4957 > as the article <A
4958 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
4959 TARGET="_top"
4960 >Doing
4961 the NIS/NT Samba</A
4962 >.</P
4963 ></DIV
4964 ></DIV
4965 ><DIV
4966 CLASS="CHAPTER"
4967 ><HR><H1
4969 NAME="AEN973"
4970 >Chapter 7. How to Configure Samba 2.2 as a Primary Domain Controller</A
4971 ></H1
4972 ><DIV
4973 CLASS="SECT1"
4974 ><H1
4975 CLASS="SECT1"
4977 NAME="AEN990"
4978 >7.1. Prerequisite Reading</A
4979 ></H1
4981 >Before you continue readingin this chapter, please make sure
4982 that you are comfortable with configuring basic files services
4983 in smb.conf and how to enable and administrate password
4984 encryption in Samba. Theses two topics are covered in the
4986 HREF="smb.conf.5.html"
4987 TARGET="_top"
4988 ><TT
4989 CLASS="FILENAME"
4990 >smb.conf(5)</TT
4991 ></A
4993 manpage and the <A
4994 HREF="EMCRYPTION.html"
4995 TARGET="_top"
4996 >Encryption chapter</A
4998 of this HOWTO Collection.</P
4999 ></DIV
5000 ><DIV
5001 CLASS="SECT1"
5002 ><HR><H1
5003 CLASS="SECT1"
5005 NAME="AEN996"
5006 >7.2. Background</A
5007 ></H1
5008 ><DIV
5009 CLASS="NOTE"
5010 ><BLOCKQUOTE
5011 CLASS="NOTE"
5014 >Note: </B
5015 ><EM
5016 >Author's Note :</EM
5017 > This document is a combination
5018 of David Bannon's Samba 2.2 PDC HOWTO and the Samba NT Domain FAQ.
5019 Both documents are superceeded by this one.</P
5020 ></BLOCKQUOTE
5021 ></DIV
5023 >Version of Samba prior to release 2.2 had marginal capabilities to
5024 act as a Windows NT 4.0 Primary Domain Controller (PDC). Beginning with
5025 Samba 2.2.0, we are proud to announce official support for Windows NT 4.0
5026 style domain logons from Windows NT 4.0 (through SP6) and Windows 2000 (through
5027 SP1) clients. This article outlines the steps necessary for configuring Samba
5028 as a PDC. It is necessary to have a working Samba server prior to implementing the
5029 PDC functionality. If you have not followed the steps outlined in
5031 HREF="UNIX_INSTALL.html"
5032 TARGET="_top"
5033 > UNIX_INSTALL.html</A
5034 >, please make sure
5035 that your server is configured correctly before proceeding. Another good
5036 resource in the <A
5037 HREF="smb.conf.5.html"
5038 TARGET="_top"
5039 >smb.conf(5) man
5040 page</A
5041 >. The following functionality should work in 2.2:</P
5043 ></P
5044 ><UL
5045 ><LI
5047 > domain logons for Windows NT 4.0/2000 clients.
5049 ></LI
5050 ><LI
5052 > placing a Windows 9x client in user level security
5054 ></LI
5055 ><LI
5057 > retrieving a list of users and groups from a Samba PDC to
5058 Windows 9x/NT/2000 clients
5060 ></LI
5061 ><LI
5063 > roving (roaming) user profiles
5065 ></LI
5066 ><LI
5068 > Windows NT 4.0 style system policies
5070 ></LI
5071 ></UL
5072 ><DIV
5073 CLASS="WARNING"
5075 ></P
5076 ><TABLE
5077 CLASS="WARNING"
5078 BORDER="1"
5079 WIDTH="100%"
5080 ><TR
5081 ><TD
5082 ALIGN="CENTER"
5084 >Windows 2000 Service Pack 2 Clients</B
5085 ></TD
5086 ></TR
5087 ><TR
5088 ><TD
5089 ALIGN="LEFT"
5091 > Samba 2.2.1 is required for PDC functionality when using Windows 2000
5092 SP2 clients.
5094 ></TD
5095 ></TR
5096 ></TABLE
5097 ></DIV
5099 >The following pieces of functionality are not included in the 2.2 release:</P
5101 ></P
5102 ><UL
5103 ><LI
5105 > Windows NT 4 domain trusts
5107 ></LI
5108 ><LI
5110 > SAM replication with Windows NT 4.0 Domain Controllers
5111 (i.e. a Samba PDC and a Windows NT BDC or vice versa)
5113 ></LI
5114 ><LI
5116 > Adding users via the User Manager for Domains
5118 ></LI
5119 ><LI
5121 > Acting as a Windows 2000 Domain Controller (i.e. Kerberos and
5122 Active Directory)
5124 ></LI
5125 ></UL
5127 >Please note that Windows 9x clients are not true members of a domain
5128 for reasons outlined in this article. Therefore the protocol for
5129 support Windows 9x style domain logons is completely different
5130 from NT4 domain logons and has been officially supported for some
5131 time.</P
5133 >Implementing a Samba PDC can basically be divided into 2 broad
5134 steps.</P
5136 ></P
5137 ><OL
5138 TYPE="1"
5139 ><LI
5141 > Configuring the Samba PDC
5143 ></LI
5144 ><LI
5146 > Creating machine trust accounts and joining clients
5147 to the domain
5149 ></LI
5150 ></OL
5152 >There are other minor details such as user profiles, system
5153 policies, etc... However, these are not necessarily specific
5154 to a Samba PDC as much as they are related to Windows NT networking
5155 concepts. They will be mentioned only briefly here.</P
5156 ></DIV
5157 ><DIV
5158 CLASS="SECT1"
5159 ><HR><H1
5160 CLASS="SECT1"
5162 NAME="AEN1036"
5163 >7.3. Configuring the Samba Domain Controller</A
5164 ></H1
5166 >The first step in creating a working Samba PDC is to
5167 understand the parameters necessary in smb.conf. I will not
5168 attempt to re-explain the parameters here as they are more that
5169 adequately covered in <A
5170 HREF="smb.conf.5.html"
5171 TARGET="_top"
5172 > the smb.conf
5173 man page</A
5174 >. For convenience, the parameters have been
5175 linked with the actual smb.conf description.</P
5177 >Here is an example smb.conf for acting as a PDC:</P
5179 ><TABLE
5180 BORDER="0"
5181 BGCOLOR="#E0E0E0"
5182 WIDTH="100%"
5183 ><TR
5184 ><TD
5185 ><PRE
5186 CLASS="PROGRAMLISTING"
5187 >[global]
5188 ; Basic server settings
5190 HREF="smb.conf.5.html#NETBIOSNAME"
5191 TARGET="_top"
5192 >netbios name</A
5193 > = <TT
5194 CLASS="REPLACEABLE"
5196 >POGO</I
5197 ></TT
5200 HREF="smb.conf.5.html#WORKGROUP"
5201 TARGET="_top"
5202 >workgroup</A
5203 > = <TT
5204 CLASS="REPLACEABLE"
5206 >NARNIA</I
5207 ></TT
5210 ; we should act as the domain and local master browser
5212 HREF="smb.conf.5.html#OSLEVEL"
5213 TARGET="_top"
5214 >os level</A
5215 > = 64
5217 HREF="smb.conf.5.html#PERFERREDMASTER"
5218 TARGET="_top"
5219 >preferred master</A
5220 > = yes
5222 HREF="smb.conf.5.html#DOMAINMASTER"
5223 TARGET="_top"
5224 >domain master</A
5225 > = yes
5227 HREF="smb.conf.5.html#LOCALMASTER"
5228 TARGET="_top"
5229 >local master</A
5230 > = yes
5232 ; security settings (must user security = user)
5234 HREF="smb.conf.5.html#SECURITYEQUALSUSER"
5235 TARGET="_top"
5236 >security</A
5237 > = user
5239 ; encrypted passwords are a requirement for a PDC
5241 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
5242 TARGET="_top"
5243 >encrypt passwords</A
5244 > = yes
5246 ; support domain logons
5248 HREF="smb.conf.5.html#DOMAINLOGONS"
5249 TARGET="_top"
5250 >domain logons</A
5251 > = yes
5253 ; where to store user profiles?
5255 HREF="smb.conf.5.html#LOGONPATH"
5256 TARGET="_top"
5257 >logon path</A
5258 > = \\%N\profiles\%u
5260 ; where is a user's home directory and where should it
5261 ; be mounted at?
5263 HREF="smb.conf.5.html#LOGONDRIVE"
5264 TARGET="_top"
5265 >logon drive</A
5266 > = H:
5268 HREF="smb.conf.5.html#LOGONHOME"
5269 TARGET="_top"
5270 >logon home</A
5271 > = \\homeserver\%u
5273 ; specify a generic logon script for all users
5274 ; this is a relative **DOS** path to the [netlogon] share
5276 HREF="smb.conf.5.html#LOGONSCRIPT"
5277 TARGET="_top"
5278 >logon script</A
5279 > = logon.cmd
5281 ; necessary share for domain controller
5282 [netlogon]
5284 HREF="smb.conf.5.html#PATH"
5285 TARGET="_top"
5286 >path</A
5287 > = /usr/local/samba/lib/netlogon
5289 HREF="smb.conf.5.html#WRITEABLE"
5290 TARGET="_top"
5291 >writeable</A
5292 > = no
5294 HREF="smb.conf.5.html#WRITELIST"
5295 TARGET="_top"
5296 >write list</A
5297 > = <TT
5298 CLASS="REPLACEABLE"
5300 >ntadmin</I
5301 ></TT
5304 ; share for storing user profiles
5305 [profiles]
5307 HREF="smb.conf.5.html#PATH"
5308 TARGET="_top"
5309 >path</A
5310 > = /export/smb/ntprofile
5312 HREF="smb.conf.5.html#WRITEABLE"
5313 TARGET="_top"
5314 >writeable</A
5315 > = yes
5317 HREF="smb.conf.5.html#CREATEMASK"
5318 TARGET="_top"
5319 >create mask</A
5320 > = 0600
5322 HREF="smb.conf.5.html#DIRECTORYMASK"
5323 TARGET="_top"
5324 >directory mask</A
5325 > = 0700</PRE
5326 ></TD
5327 ></TR
5328 ></TABLE
5329 ></P
5331 >There are a couple of points to emphasize in the above configuration.</P
5333 ></P
5334 ><UL
5335 ><LI
5337 > Encrypted passwords must be enabled. For more details on how
5338 to do this, refer to <A
5339 HREF="ENCRYPTION.html"
5340 TARGET="_top"
5341 >ENCRYPTION.html</A
5344 ></LI
5345 ><LI
5347 > The server must support domain logons and a
5349 CLASS="FILENAME"
5350 >[netlogon]</TT
5351 > share
5353 ></LI
5354 ><LI
5356 > The server must be the domain master browser in order for Windows
5357 client to locate the server as a DC. Please refer to the various
5358 Network Browsing documentation included with this distribution for
5359 details.
5361 ></LI
5362 ></UL
5364 >As Samba 2.2 does not offer a complete implementation of group mapping between
5365 Windows NT groups and UNIX groups (this is really quite complicated to explain
5366 in a short space), you should refer to the <A
5367 HREF="smb.conf.5.html#DOMAINADMINUSERS"
5368 TARGET="_top"
5369 >domain
5370 admin users</A
5371 > and <A
5372 HREF="smb.conf.5.html#DOMAINADMINGROUP"
5373 TARGET="_top"
5374 >domain
5375 admin group</A
5376 > smb.conf parameters for information of creating a Domain Admins
5377 style accounts.</P
5378 ></DIV
5379 ><DIV
5380 CLASS="SECT1"
5381 ><HR><H1
5382 CLASS="SECT1"
5384 NAME="AEN1079"
5385 >7.4. Creating Machine Trust Accounts and Joining Clients
5386 to the Domain</A
5387 ></H1
5389 >A machine trust account is a samba user account owned by a computer.
5390 The account password acts as the shared secret for secure
5391 communication with the Domain Controller. This is a security feature
5392 to prevent an unauthorized machine with the same netbios name from
5393 joining the domain and gaining access to domain user/group accounts.
5394 Hence a Windows 9x host is never a true member of a domain because it does
5395 not posses a machine trust account, and thus has no shared secret with the DC.</P
5397 >On a Windows NT PDC, these machine trust account passwords are stored
5398 in the registry. A Samba PDC stores these accounts in the same location
5399 as user LanMan and NT password hashes (currently <TT
5400 CLASS="FILENAME"
5401 >smbpasswd</TT
5403 However, machine trust accounts only possess and use the NT password hash.</P
5405 >Because Samba requires machine accounts to possess a UNIX uid from
5406 which an Windows NT SID can be generated, all of these accounts
5407 must have an entry in <TT
5408 CLASS="FILENAME"
5409 >/etc/passwd</TT
5410 > and smbpasswd.
5411 Future releases will alleviate the need to create
5413 CLASS="FILENAME"
5414 >/etc/passwd</TT
5415 > entries. </P
5417 >There are two means of creating machine trust accounts.</P
5419 ></P
5420 ><UL
5421 ><LI
5423 > Manual creation before joining the client to the domain. In this case,
5424 the password is set to a known value -- the lower case of the
5425 machine's netbios name.
5427 ></LI
5428 ><LI
5430 > Creation of the account at the time of joining the domain. In
5431 this case, the session key of the administrative account used to join
5432 the client to the domain acts as an encryption key for setting the
5433 password to a random value (This is the recommended method).
5435 ></LI
5436 ></UL
5437 ><DIV
5438 CLASS="SECT2"
5439 ><HR><H2
5440 CLASS="SECT2"
5442 NAME="AEN1093"
5443 >7.4.1. Manually creating machine trust accounts</A
5444 ></H2
5446 >The first step in creating a machine trust account by hand is to
5447 create an entry for the machine in /etc/passwd. This can be done
5448 using <B
5449 CLASS="COMMAND"
5450 >vipw</B
5451 > or any 'add userr' command which is normally
5452 used to create new UNIX accounts. The following is an example for a Linux
5453 based Samba server:</P
5455 ><TT
5456 CLASS="PROMPT"
5457 >root# </TT
5458 >/usr/sbin/useradd -g 100 -d /dev/null -c <TT
5459 CLASS="REPLACEABLE"
5461 >machine_nickname</I
5462 ></TT
5463 > -m -s /bin/false <TT
5464 CLASS="REPLACEABLE"
5466 >machine_name</I
5467 ></TT
5468 >$</P
5470 >The <TT
5471 CLASS="FILENAME"
5472 >/etc/passwd</TT
5473 > entry will list the machine name
5474 with a $ appended, won't have a passwd, will have a null shell and no
5475 home directory. For example a machine called 'doppy' would have an
5477 CLASS="FILENAME"
5478 >/etc/passwd</TT
5479 > entry like this :</P
5481 ><TABLE
5482 BORDER="0"
5483 BGCOLOR="#E0E0E0"
5484 WIDTH="100%"
5485 ><TR
5486 ><TD
5487 ><PRE
5488 CLASS="PROGRAMLISTING"
5489 >doppy$:x:505:501:<TT
5490 CLASS="REPLACEABLE"
5492 >machine_nickname</I
5493 ></TT
5494 >:/dev/null:/bin/false</PRE
5495 ></TD
5496 ></TR
5497 ></TABLE
5498 ></P
5500 >Above, <TT
5501 CLASS="REPLACEABLE"
5503 >machine_nickname</I
5504 ></TT
5505 > can be any descriptive name for the
5506 pc i.e. BasementComputer. The <TT
5507 CLASS="REPLACEABLE"
5509 >machine_name</I
5510 ></TT
5511 > absolutely must be
5512 the netbios name of the pc to be added to the domain. The "$" must append the netbios
5513 name of the pc or samba will not recognize this as a machine account</P
5515 >Now that the UNIX account has been created, the next step is to create
5516 the smbpasswd entry for the machine containing the well known initial
5517 trust account password. This can be done using the <A
5518 HREF="smbpasswd.6.html"
5519 TARGET="_top"
5521 CLASS="COMMAND"
5522 >smbpasswd(8)</B
5523 ></A
5524 > command
5525 as shown here:</P
5527 ><TT
5528 CLASS="PROMPT"
5529 >root# </TT
5530 > smbpasswd -a -m <TT
5531 CLASS="REPLACEABLE"
5533 >machine_name</I
5534 ></TT
5535 ></P
5537 >where <TT
5538 CLASS="REPLACEABLE"
5540 >machine_name</I
5541 ></TT
5542 > is the machine's netbios
5543 name. </P
5544 ><DIV
5545 CLASS="WARNING"
5547 ></P
5548 ><TABLE
5549 CLASS="WARNING"
5550 BORDER="1"
5551 WIDTH="100%"
5552 ><TR
5553 ><TD
5554 ALIGN="CENTER"
5556 >Join the client to the domain immediately</B
5557 ></TD
5558 ></TR
5559 ><TR
5560 ><TD
5561 ALIGN="LEFT"
5563 > Manually creating a machine trust account using this method is the
5564 equivalent of creating a machine account on a Windows NT PDC using
5565 the "Server Manager". From the time at which the account is created
5566 to the time which th client joins the domain and changes the password,
5567 your domain is vulnerable to an intruder joining your domain using a
5568 a machine with the same netbios name. A PDC inherently trusts
5569 members of the domain and will serve out a large degree of user
5570 information to such clients. You have been warned!
5572 ></TD
5573 ></TR
5574 ></TABLE
5575 ></DIV
5576 ></DIV
5577 ><DIV
5578 CLASS="SECT2"
5579 ><HR><H2
5580 CLASS="SECT2"
5582 NAME="AEN1121"
5583 >7.4.2. Creating machine trust accounts "on the fly"</A
5584 ></H2
5586 >The second, and most recommended way of creating machine trust accounts
5587 is to create them as needed at the time the client is joined to
5588 the domain. You will need to include a value for the <A
5589 HREF="smb.conf.5.html#ADDUSERSCRIPT"
5590 TARGET="_top"
5591 >add user script</A
5593 parameter. Below is an example from a RedHat 6.2 Linux system.</P
5595 ><TABLE
5596 BORDER="0"
5597 BGCOLOR="#E0E0E0"
5598 WIDTH="100%"
5599 ><TR
5600 ><TD
5601 ><PRE
5602 CLASS="PROGRAMLISTING"
5603 >add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u </PRE
5604 ></TD
5605 ></TR
5606 ></TABLE
5607 ></P
5609 >In Samba 2.2.1, <EM
5610 >only the root account</EM
5611 > can be used to create
5612 machine accounts like this. Therefore, it is required to create
5613 an entry in smbpasswd for <EM
5614 >root</EM
5615 >. The password
5617 >SHOULD</EM
5618 > be set to s different password that the
5619 associated <TT
5620 CLASS="FILENAME"
5621 >/etc/passwd</TT
5622 > entry for security reasons.</P
5623 ></DIV
5624 ></DIV
5625 ><DIV
5626 CLASS="SECT1"
5627 ><HR><H1
5628 CLASS="SECT1"
5630 NAME="AEN1132"
5631 >7.5. Common Problems and Errors</A
5632 ></H1
5634 ></P
5636 ></P
5637 ><UL
5638 ><LI
5640 > <EM
5641 >I cannot include a '$' in a machine name.</EM
5645 > A 'machine name' in (typically) <TT
5646 CLASS="FILENAME"
5647 >/etc/passwd</TT
5649 of the machine name with a '$' appended. FreeBSD (and other BSD
5650 systems ?) won't create a user with a '$' in their name.
5653 > The problem is only in the program used to make the entry, once
5654 made, it works perfectly. So create a user without the '$' and
5655 use <B
5656 CLASS="COMMAND"
5657 >vipw</B
5658 > to edit the entry, adding the '$'. Or create
5659 the whole entry with vipw if you like, make sure you use a
5660 unique uid !
5662 ></LI
5663 ><LI
5665 > <EM
5666 >I get told "You already have a connection to the Domain...."
5667 or "Cannot join domain, the credentials supplied conflict with an
5668 existing set.." when creating a machine account.</EM
5672 > This happens if you try to create a machine account from the
5673 machine itself and already have a connection (e.g. mapped drive)
5674 to a share (or IPC$) on the Samba PDC. The following command
5675 will remove all network drive connections:
5678 > <TT
5679 CLASS="PROMPT"
5680 >C:\WINNT\&#62;</TT
5681 > <B
5682 CLASS="COMMAND"
5683 >net use * /d</B
5687 > Further, if the machine is a already a 'member of a workgroup' that
5688 is the same name as the domain you are joining (bad idea) you will
5689 get this message. Change the workgroup name to something else, it
5690 does not matter what, reboot, and try again.
5692 ></LI
5693 ><LI
5695 > <EM
5696 >The system can not log you on (C000019B)....</EM
5700 >I joined the domain successfully but after upgrading
5701 to a newer version of the Samba code I get the message, "The system
5702 can not log you on (C000019B), Please try a gain or consult your
5703 system administrator" when attempting to logon.
5706 > This occurs when the domain SID stored in
5708 CLASS="FILENAME"
5709 >private/WORKGROUP.SID</TT
5710 > is
5711 changed. For example, you remove the file and <B
5712 CLASS="COMMAND"
5713 >smbd</B
5714 > automatically
5715 creates a new one. Or you are swapping back and forth between
5716 versions 2.0.7, TNG and the HEAD branch code (not recommended). The
5717 only way to correct the problem is to restore the original domain
5718 SID or remove the domain client from the domain and rejoin.
5720 ></LI
5721 ><LI
5723 > <EM
5724 >The machine account for this computer either does not
5725 exist or is not accessible.</EM
5729 > When I try to join the domain I get the message "The machine account
5730 for this computer either does not exist or is not accessible". Whats
5731 wrong?
5734 > This problem is caused by the PDC not having a suitable machine account.
5735 If you are using the <TT
5736 CLASS="PARAMETER"
5738 >add user script</I
5739 ></TT
5740 > method to create
5741 accounts then this would indicate that it has not worked. Ensure the domain
5742 admin user system is working.
5745 > Alternatively if you are creating account entries manually then they
5746 have not been created correctly. Make sure that you have the entry
5747 correct for the machine account in smbpasswd file on the Samba PDC.
5748 If you added the account using an editor rather than using the smbpasswd
5749 utility, make sure that the account name is the machine netbios name
5750 with a '$' appended to it ( ie. computer_name$ ). There must be an entry
5751 in both /etc/passwd and the smbpasswd file. Some people have reported
5752 that inconsistent subnet masks between the Samba server and the NT
5753 client have caused this problem. Make sure that these are consistent
5754 for both client and server.
5756 ></LI
5757 ><LI
5759 > <EM
5760 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
5761 I get a message about my account being disabled.</EM
5765 > This problem is caused by a PAM related bug in Samba 2.2.0. This bug is
5766 fixed in 2.2.1. Other symptoms could be unaccessible shares on
5767 NT/W2K member servers in the domain or the following error in your smbd.log:
5768 passdb/pampass.c:pam_account(268) PAM: UNKNOWN ERROR for User: %user%
5771 > At first be ensure to enable the useraccounts with <B
5772 CLASS="COMMAND"
5773 >smbpasswd -e
5774 %user%</B
5775 >, this is normaly done, when you create an account.
5778 > In order to work around this problem in 2.2.0, configure the
5780 CLASS="PARAMETER"
5782 >account</I
5783 ></TT
5784 > control flag in
5786 CLASS="FILENAME"
5787 >/etc/pam.d/samba</TT
5788 > file as follows:
5791 ><TABLE
5792 BORDER="0"
5793 BGCOLOR="#E0E0E0"
5794 WIDTH="90%"
5795 ><TR
5796 ><TD
5797 ><PRE
5798 CLASS="PROGRAMLISTING"
5799 > account required pam_permit.so
5800 </PRE
5801 ></TD
5802 ></TR
5803 ></TABLE
5804 ></P
5806 > If you want to remain backward compatibility to samba 2.0.x use
5808 CLASS="FILENAME"
5809 >pam_permit.so</TT
5810 >, it's also possible to use
5812 CLASS="FILENAME"
5813 >pam_pwdb.so</TT
5814 >. There are some bugs if you try to
5815 use <TT
5816 CLASS="FILENAME"
5817 >pam_unix.so</TT
5818 >, if you need this, be ensure to use
5819 the most recent version of this file.
5821 ></LI
5822 ></UL
5823 ></DIV
5824 ><DIV
5825 CLASS="SECT1"
5826 ><HR><H1
5827 CLASS="SECT1"
5829 NAME="AEN1180"
5830 >7.6. System Policies and Profiles</A
5831 ></H1
5833 >Much of the information necessary to implement System Policies and
5834 Roving User Profiles in a Samba domain is the same as that for
5835 implementing these same items in a Windows NT 4.0 domain.
5836 You should read the white paper <A
5837 HREF="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp"
5838 TARGET="_top"
5839 >Implementing
5840 Profiles and Policies in Windows NT 4.0</A
5841 > available from Microsoft.</P
5843 >Here are some additional details:</P
5845 ></P
5846 ><UL
5847 ><LI
5849 > <EM
5850 >What about Windows NT Policy Editor ?</EM
5854 > To create or edit <TT
5855 CLASS="FILENAME"
5856 >ntconfig.pol</TT
5857 > you must use
5858 the NT Server Policy Editor, <B
5859 CLASS="COMMAND"
5860 >poledit.exe</B
5861 > which
5862 is included with NT Server but <EM
5863 >not NT Workstation</EM
5865 There is a Policy Editor on a NTws
5866 but it is not suitable for creating <EM
5867 >Domain Policies</EM
5869 Further, although the Windows 95
5870 Policy Editor can be installed on an NT Workstation/Server, it will not
5871 work with NT policies because the registry key that are set by the policy templates.
5872 However, the files from the NT Server will run happily enough on an NTws.
5873 You need <TT
5874 CLASS="FILENAME"
5875 >poledit.exe, common.adm</TT
5876 > and <TT
5877 CLASS="FILENAME"
5878 >winnt.adm</TT
5879 >. It is convenient
5880 to put the two *.adm files in <TT
5881 CLASS="FILENAME"
5882 >c:\winnt\inf</TT
5883 > which is where
5884 the binary will look for them unless told otherwise. Note also that that
5885 directory is 'hidden'.
5888 > The Windows NT policy editor is also included with the Service Pack 3 (and
5889 later) for Windows NT 4.0. Extract the files using <B
5890 CLASS="COMMAND"
5891 >servicepackname /x</B
5893 ie thats <B
5894 CLASS="COMMAND"
5895 >Nt4sp6ai.exe /x</B
5896 > for service pack 6a. The policy editor,
5898 CLASS="COMMAND"
5899 >poledit.exe</B
5900 > and the associated template files (*.adm) should
5901 be extracted as well. It is also possible to downloaded the policy template
5902 files for Office97 and get a copy of the policy editor. Another possible
5903 location is with the Zero Administration Kit available for download from Microsoft.
5905 ></LI
5906 ><LI
5908 > <EM
5909 >Can Win95 do Policies ?</EM
5913 > Install the group policy handler for Win9x to pick up group
5914 policies. Look on the Win98 CD in <TT
5915 CLASS="FILENAME"
5916 >\tools\reskit\netadmin\poledit</TT
5918 Install group policies on a Win9x client by double-clicking
5920 CLASS="FILENAME"
5921 >grouppol.inf</TT
5922 >. Log off and on again a couple of
5923 times and see if Win98 picks up group policies. Unfortunately this needs
5924 to be done on every Win9x machine that uses group policies....
5927 > If group policies don't work one reports suggests getting the updated
5928 (read: working) grouppol.dll for Windows 9x. The group list is grabbed
5929 from /etc/group.
5931 ></LI
5932 ><LI
5934 > <EM
5935 >How do I get 'User Manager' and 'Server Manager'</EM
5939 > Since I don't need to buy an NT Server CD now, how do I get
5940 the 'User Manager for Domains', the 'Server Manager' ?
5943 > Microsoft distributes a version of these tools called nexus for
5944 installation on Windows 95 systems. The tools set includes
5947 ></P
5948 ><UL
5949 ><LI
5951 >Server Manager</P
5952 ></LI
5953 ><LI
5955 >User Manager for Domains</P
5956 ></LI
5957 ><LI
5959 >Event Viewer</P
5960 ></LI
5961 ></UL
5963 > Click here to download the archived file <A
5964 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE"
5965 TARGET="_top"
5966 >ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</A
5970 > The Windows NT 4.0 version of the 'User Manager for
5971 Domains' and 'Server Manager' are available from Microsoft via ftp
5972 from <A
5973 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE"
5974 TARGET="_top"
5975 >ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</A
5978 ></LI
5979 ></UL
5980 ></DIV
5981 ><DIV
5982 CLASS="SECT1"
5983 ><HR><H1
5984 CLASS="SECT1"
5986 NAME="AEN1224"
5987 >7.7. What other help can I get ?</A
5988 ></H1
5990 >There are many sources of information available in the form
5991 of mailing lists, RFC's and documentation. The docs that come
5992 with the samba distribution contain very good explanations of
5993 general SMB topics such as browsing.</P
5995 ></P
5996 ><UL
5997 ><LI
5999 > <EM
6000 >What are some diagnostics tools I can use to debug the domain logon
6001 process and where can I find them?</EM
6005 > One of the best diagnostic tools for debugging problems is Samba itself.
6006 You can use the -d option for both smbd and nmbd to specifiy what
6007 'debug level' at which to run. See the man pages on smbd, nmbd and
6008 smb.conf for more information on debugging options. The debug
6009 level can range from 1 (the default) to 10 (100 for debugging passwords).
6012 > Another helpful method of debugging is to compile samba using the
6014 CLASS="COMMAND"
6015 >gcc -g </B
6016 > flag. This will include debug
6017 information in the binaries and allow you to attach gdb to the
6018 running smbd / nmbd process. In order to attach gdb to an smbd
6019 process for an NT workstation, first get the workstation to make the
6020 connection. Pressing ctrl-alt-delete and going down to the domain box
6021 is sufficient (at least, on the first time you join the domain) to
6022 generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation
6023 maintains an open connection, and therefore there will be an smbd
6024 process running (assuming that you haven't set a really short smbd
6025 idle timeout) So, in between pressing ctrl alt delete, and actually
6026 typing in your password, you can gdb attach and continue.
6029 > Some useful samba commands worth investigating:
6032 ></P
6033 ><UL
6034 ><LI
6036 >testparam | more</P
6037 ></LI
6038 ><LI
6040 >smbclient -L //{netbios name of server}</P
6041 ></LI
6042 ></UL
6044 > An SMB enabled version of tcpdump is available from
6046 HREF="http://www.tcpdump.org/"
6047 TARGET="_top"
6048 >http://www.tcpdup.org/</A
6050 Ethereal, another good packet sniffer for UNIX and Win32
6051 hosts, can be downloaded from <A
6052 HREF="http://www.ethereal.com/"
6053 TARGET="_top"
6054 >http://www.ethereal.com</A
6058 > For tracing things on the Microsoft Windows NT, Network Monitor
6059 (aka. netmon) is available on the Microsoft Developer Network CD's,
6060 the Windows NT Server install CD and the SMS CD's. The version of
6061 netmon that ships with SMS allows for dumping packets between any two
6062 computers (ie. placing the network interface in promiscuous mode).
6063 The version on the NT Server install CD will only allow monitoring
6064 of network traffic directed to the local NT box and broadcasts on the
6065 local subnet. Be aware that Ethereal can read and write netmon
6066 formatted files.
6068 ></LI
6069 ><LI
6071 > <EM
6072 >How do I install 'Network Monitor' on an NT Workstation
6073 or a Windows 9x box?</EM
6077 > Installing netmon on an NT workstation requires a couple
6078 of steps. The following are for installing Netmon V4.00.349, which comes
6079 with Microsoft Windows NT Server 4.0, on Microsoft Windows NT
6080 Workstation 4.0. The process should be similar for other version of
6081 Windows NT / Netmon. You will need both the Microsoft Windows
6082 NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
6085 > Initially you will need to install 'Network Monitor Tools and Agent'
6086 on the NT Server. To do this
6089 ></P
6090 ><UL
6091 ><LI
6093 >Goto Start - Settings - Control Panel -
6094 Network - Services - Add </P
6095 ></LI
6096 ><LI
6098 >Select the 'Network Monitor Tools and Agent' and
6099 click on 'OK'.</P
6100 ></LI
6101 ><LI
6103 >Click 'OK' on the Network Control Panel.
6105 ></LI
6106 ><LI
6108 >Insert the Windows NT Server 4.0 install CD
6109 when prompted.</P
6110 ></LI
6111 ></UL
6113 > At this point the Netmon files should exist in
6115 CLASS="FILENAME"
6116 >%SYSTEMROOT%\System32\netmon\*.*</TT
6118 Two subdirectories exist as well, <TT
6119 CLASS="FILENAME"
6120 >parsers\</TT
6122 which contains the necessary DLL's for parsing the netmon packet
6123 dump, and <TT
6124 CLASS="FILENAME"
6125 >captures\</TT
6129 > In order to install the Netmon tools on an NT Workstation, you will
6130 first need to install the 'Network Monitor Agent' from the Workstation
6131 install CD.
6134 ></P
6135 ><UL
6136 ><LI
6138 >Goto Start - Settings - Control Panel -
6139 Network - Services - Add</P
6140 ></LI
6141 ><LI
6143 >Select the 'Network Monitor Agent' and click
6144 on 'OK'.</P
6145 ></LI
6146 ><LI
6148 >Click 'OK' on the Network Control Panel.
6150 ></LI
6151 ><LI
6153 >Insert the Windows NT Workstation 4.0 install
6154 CD when prompted.</P
6155 ></LI
6156 ></UL
6158 > Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.*
6159 to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set
6160 permissions as you deem appropriate for your site. You will need
6161 administrative rights on the NT box to run netmon.
6164 > To install Netmon on a Windows 9x box install the network monitor agent
6165 from the Windows 9x CD (\admin\nettools\netmon). There is a readme
6166 file located with the netmon driver files on the CD if you need
6167 information on how to do this. Copy the files from a working
6168 Netmon installation.
6170 ></LI
6171 ><LI
6173 > The following is a list if helpful URLs and other links:
6176 ></P
6177 ><UL
6178 ><LI
6180 >Home of Samba site <A
6181 HREF="http://samba.org"
6182 TARGET="_top"
6183 > http://samba.org</A
6184 >. We have a mirror near you !</P
6185 ></LI
6186 ><LI
6188 > The <EM
6189 >Development</EM
6190 > document
6191 on the Samba mirrors might mention your problem. If so,
6192 it might mean that the developers are working on it.</P
6193 ></LI
6194 ><LI
6196 >See how Scott Merrill simulates a BDC behavior at
6198 HREF="http://www.skippy.net/linux/smb-howto.html"
6199 TARGET="_top"
6200 > http://www.skippy.net/linux/smb-howto.html</A
6201 >. </P
6202 ></LI
6203 ><LI
6205 >Although 2.0.7 has almost had its day as a PDC, David Bannon will
6206 keep the 2.0.7 PDC pages at <A
6207 HREF="http://bioserve.latrobe.edu.au/samba"
6208 TARGET="_top"
6209 > http://bioserve.latrobe.edu.au/samba</A
6210 > going for a while yet.</P
6211 ></LI
6212 ><LI
6214 >Misc links to CIFS information
6216 HREF="http://samba.org/cifs/"
6217 TARGET="_top"
6218 >http://samba.org/cifs/</A
6219 ></P
6220 ></LI
6221 ><LI
6223 >NT Domains for Unix <A
6224 HREF="http://mailhost.cb1.com/~lkcl/ntdom/"
6225 TARGET="_top"
6226 > http://mailhost.cb1.com/~lkcl/ntdom/</A
6227 ></P
6228 ></LI
6229 ><LI
6231 >FTP site for older SMB specs:
6233 HREF="ftp://ftp.microsoft.com/developr/drg/CIFS/"
6234 TARGET="_top"
6235 > ftp://ftp.microsoft.com/developr/drg/CIFS/</A
6236 ></P
6237 ></LI
6238 ></UL
6239 ></LI
6240 ></UL
6242 ></P
6243 ><UL
6244 ><LI
6246 > <EM
6247 >How do I get help from the mailing lists ?</EM
6251 > There are a number of Samba related mailing lists. Go to <A
6252 HREF="http://samba.org"
6253 TARGET="_top"
6254 >http://samba.org</A
6255 >, click on your nearest mirror
6256 and then click on <B
6257 CLASS="COMMAND"
6258 >Support</B
6259 > and then click on <B
6260 CLASS="COMMAND"
6261 > Samba related mailing lists</B
6265 > For questions relating to Samba TNG go to
6267 HREF="http://www.samba-tng.org/"
6268 TARGET="_top"
6269 >http://www.samba-tng.org/</A
6271 It has been requested that you don't post questions about Samba-TNG to the
6272 main stream Samba lists.</P
6274 > If you post a message to one of the lists please observe the following guide lines :
6277 ></P
6278 ><UL
6279 ><LI
6281 > Always remember that the developers are volunteers, they are
6282 not paid and they never guarantee to produce a particular feature at
6283 a particular time. Any time lines are 'best guess' and nothing more.
6285 ></LI
6286 ><LI
6288 > Always mention what version of samba you are using and what
6289 operating system its running under. You should probably list the
6290 relevant sections of your smb.conf file, at least the options
6291 in [global] that affect PDC support.</P
6292 ></LI
6293 ><LI
6295 >In addition to the version, if you obtained Samba via
6296 CVS mention the date when you last checked it out.</P
6297 ></LI
6298 ><LI
6300 > Try and make your question clear and brief, lots of long,
6301 convoluted questions get deleted before they are completely read !
6302 Don't post html encoded messages (if you can select colour or font
6303 size its html).</P
6304 ></LI
6305 ><LI
6307 > If you run one of those nifty 'I'm on holidays' things when
6308 you are away, make sure its configured to not answer mailing lists.
6310 ></LI
6311 ><LI
6313 > Don't cross post. Work out which is the best list to post to
6314 and see what happens, ie don't post to both samba-ntdom and samba-technical.
6315 Many people active on the lists subscribe to more
6316 than one list and get annoyed to see the same message two or more times.
6317 Often someone will see a message and thinking it would be better dealt
6318 with on another, will forward it on for you.</P
6319 ></LI
6320 ><LI
6322 >You might include <EM
6323 >partial</EM
6325 log files written at a debug level set to as much as 20.
6326 Please don't send the entire log but enough to give the context of the
6327 error messages.</P
6328 ></LI
6329 ><LI
6331 >(Possibly) If you have a complete netmon trace ( from the opening of
6332 the pipe to the error ) you can send the *.CAP file as well.</P
6333 ></LI
6334 ><LI
6336 >Please think carefully before attaching a document to an email.
6337 Consider pasting the relevant parts into the body of the message. The samba
6338 mailing lists go to a huge number of people, do they all need a copy of your
6339 smb.conf in their attach directory ?</P
6340 ></LI
6341 ></UL
6342 ></LI
6343 ><LI
6345 > <EM
6346 >How do I get off the mailing lists ?</EM
6350 >To have your name removed from a samba mailing list, go to the
6351 same place you went to to get on it. Go to <A
6352 HREF="http://lists.samba.org/"
6353 TARGET="_top"
6354 >http://lists.samba.org</A
6356 click on your nearest mirror and then click on <B
6357 CLASS="COMMAND"
6358 >Support</B
6359 > and
6360 then click on <B
6361 CLASS="COMMAND"
6362 > Samba related mailing lists</B
6363 >. Or perhaps see
6365 HREF="http://lists.samba.org/mailman/roster/samba-ntdom"
6366 TARGET="_top"
6367 >here</A
6371 > Please don't post messages to the list asking to be removed, you will just
6372 be referred to the above address (unless that process failed in some way...)
6374 ></LI
6375 ></UL
6376 ></DIV
6377 ><DIV
6378 CLASS="SECT1"
6379 ><HR><H1
6380 CLASS="SECT1"
6382 NAME="AEN1338"
6383 >7.8. Domain Control for Windows 9x/ME</A
6384 ></H1
6385 ><DIV
6386 CLASS="NOTE"
6387 ><BLOCKQUOTE
6388 CLASS="NOTE"
6391 >Note: </B
6392 >The following section contains much of the original
6393 DOMAIN.txt file previously included with Samba. Much of
6394 the material is based on what went into the book Special
6395 Edition, Using Samba. (Richard Sharpe)</P
6396 ></BLOCKQUOTE
6397 ></DIV
6399 >A domain and a workgroup are exactly the same thing in terms of network
6400 browsing. The difference is that a distributable authentication
6401 database is associated with a domain, for secure login access to a
6402 network. Also, different access rights can be granted to users if they
6403 successfully authenticate against a domain logon server (NT server and
6404 other systems based on NT server support this, as does at least Samba TNG now).</P
6406 >The SMB client logging on to a domain has an expectation that every other
6407 server in the domain should accept the same authentication information.
6408 Network browsing functionality of domains and workgroups is
6409 identical and is explained in BROWSING.txt. It should be noted, that browsing
6410 is total orthogonal to logon support.</P
6412 >Issues related to the single-logon network model are discussed in this
6413 document. Samba supports domain logons, network logon scripts, and user
6414 profiles for MS Windows for workgroups and MS Windows 9X clients.</P
6416 >When an SMB client in a domain wishes to logon it broadcast requests for a
6417 logon server. The first one to reply gets the job, and validates its
6418 password using whatever mechanism the Samba administrator has installed.
6419 It is possible (but very stupid) to create a domain where the user
6420 database is not shared between servers, ie they are effectively workgroup
6421 servers advertising themselves as participating in a domain. This
6422 demonstrates how authentication is quite different from but closely
6423 involved with domains.</P
6425 >Another thing commonly associated with single-logon domains is remote
6426 administration over the SMB protocol. Again, there is no reason why this
6427 cannot be implemented with an underlying username database which is
6428 different from the Windows NT SAM. Support for the Remote Administration
6429 Protocol is planned for a future release of Samba.</P
6431 >Network logon support as discussed in this section is aimed at Window for
6432 Workgroups, and Windows 9X clients. </P
6434 >Support for profiles is confirmed as working for Win95, NT 4.0 and NT 3.51.
6435 It is possible to specify: the profile location; script file to be loaded
6436 on login; the user's home directory; and for NT a kick-off time could also
6437 now easily be supported. However, there are some differences between Win9X
6438 profile support and WinNT profile support. These are discussed below.</P
6440 >With NT Workstations, all this does not require the use or intervention of
6441 an NT 4.0 or NT 3.51 server: Samba can now replace the logon services
6442 provided by an NT server, to a limited and experimental degree (for example,
6443 running "User Manager for Domains" will not provide you with access to
6444 a domain created by a Samba Server).</P
6446 >With Win95, the help of an NT server can be enlisted, both for profile storage
6447 and for user authentication. For details on user authentication, see
6448 security_level.txt. For details on profile storage, see below.</P
6450 >Using these features you can make your clients verify their logon via
6451 the Samba server; make clients run a batch file when they logon to
6452 the network and download their preferences, desktop and start menu.</P
6454 >Before launching into the configuration instructions, it is worthwhile looking
6455 at how a Win9X client performs a logon:</P
6457 ></P
6458 ><OL
6459 TYPE="1"
6460 ><LI
6462 > The client broadcasts (to the IP broadcast address of the subnet it is in)
6463 a NetLogon request. This is sent to the NetBIOS address DOMAIN&#60;00&#62; at the
6464 NetBIOS layer. The client chooses the first response it receives, which
6465 contains the NetBIOS name of the logon server to use in the format of
6466 \\SERVER.
6468 ></LI
6469 ><LI
6471 > The client then connects to that server, logs on (does an SMBsessetupX) and
6472 then connects to the IPC$ share (using an SMBtconX).
6474 ></LI
6475 ><LI
6477 > The client then does a NetWkstaUserLogon request, which retrieves the name
6478 of the user's logon script.
6480 ></LI
6481 ><LI
6483 > The client then connects to the NetLogon share and searches for this
6484 and if it is found and can be read, is retrieved and executed by the client.
6485 After this, the client disconnects from the NetLogon share.
6487 ></LI
6488 ><LI
6490 > The client then sends a NetUserGetInfo request to the server, to retrieve
6491 the user's home share, which is used to search for profiles. Since the
6492 response to the NetUserGetInfo request does not contain much more
6493 the user's home share, profiles for Win9X clients MUST reside in the user
6494 home directory.
6496 ></LI
6497 ><LI
6499 > The client then connects to the user's home share and searches for the
6500 user's profile. As it turns out, you can specify the users home share as
6501 a sharename and path. For example, \\server\fred\.profile.
6502 If the profiles are found, they are implemented.
6504 ></LI
6505 ><LI
6507 > The client then disconnects from the user's home share, and reconnects to
6508 the NetLogon share and looks for CONFIG.POL, the policies file. If this is
6509 found, it is read and implemented.
6511 ></LI
6512 ></OL
6513 ><DIV
6514 CLASS="SECT2"
6515 ><HR><H2
6516 CLASS="SECT2"
6518 NAME="AEN1368"
6519 >7.8.1. Configuration Instructions: Network Logons</A
6520 ></H2
6522 >To use domain logons and profiles you need to do the following:</P
6524 ></P
6525 ><OL
6526 TYPE="1"
6527 ><LI
6529 > Create a share called [netlogon] in your smb.conf. This share should
6530 be readable by all users, and probably should not be writeable. This
6531 share will hold your network logon scripts, and the CONFIG.POL file
6532 (Note: for details on the CONFIG.POL file, how to use it, what it is,
6533 refer to the Microsoft Windows NT Administration documentation.
6534 The format of these files is not known, so you will need to use
6535 Microsoft tools).
6538 > For example I have used:
6541 ><TABLE
6542 BORDER="0"
6543 BGCOLOR="#E0E0E0"
6544 WIDTH="90%"
6545 ><TR
6546 ><TD
6547 ><PRE
6548 CLASS="PROGRAMLISTING"
6549 >[netlogon]
6550 path = /data/dos/netlogon
6551 writeable = no
6552 guest ok = no</PRE
6553 ></TD
6554 ></TR
6555 ></TABLE
6556 ></P
6558 > Note that it is important that this share is not writeable by ordinary
6559 users, in a secure environment: ordinary users should not be allowed
6560 to modify or add files that another user's computer would then download
6561 when they log in.
6563 ></LI
6564 ><LI
6566 > in the [global] section of smb.conf set the following:
6569 ><TABLE
6570 BORDER="0"
6571 BGCOLOR="#E0E0E0"
6572 WIDTH="90%"
6573 ><TR
6574 ><TD
6575 ><PRE
6576 CLASS="PROGRAMLISTING"
6577 >domain logons = yes
6578 logon script = %U.bat
6579 </PRE
6580 ></TD
6581 ></TR
6582 ></TABLE
6583 ></P
6585 > The choice of batch file is, of course, up to you. The above would
6586 give each user a separate batch file as the %U will be changed to
6587 their username automatically. The other standard % macros may also be
6588 used. You can make the batch files come from a subdirectory by using
6589 something like:
6592 ><TABLE
6593 BORDER="0"
6594 BGCOLOR="#E0E0E0"
6595 WIDTH="90%"
6596 ><TR
6597 ><TD
6598 ><PRE
6599 CLASS="PROGRAMLISTING"
6600 >logon script = scripts\%U.bat
6601 </PRE
6602 ></TD
6603 ></TR
6604 ></TABLE
6605 ></P
6606 ></LI
6607 ><LI
6609 > create the batch files to be run when the user logs in. If the batch
6610 file doesn't exist then no batch file will be run.
6613 > In the batch files you need to be careful to use DOS style cr/lf line
6614 endings. If you don't then DOS may get confused. I suggest you use a
6615 DOS editor to remotely edit the files if you don't know how to produce
6616 DOS style files under unix.
6618 ></LI
6619 ><LI
6621 > Use smbclient with the -U option for some users to make sure that
6622 the \\server\NETLOGON share is available, the batch files are
6623 visible and they are readable by the users.
6625 ></LI
6626 ><LI
6628 > you will probabaly find that your clients automatically mount the
6629 \\SERVER\NETLOGON share as drive z: while logging in. You can put
6630 some useful programs there to execute from the batch files.
6632 ></LI
6633 ></OL
6634 ><DIV
6635 CLASS="WARNING"
6637 ></P
6638 ><TABLE
6639 CLASS="WARNING"
6640 BORDER="1"
6641 WIDTH="100%"
6642 ><TR
6643 ><TD
6644 ALIGN="CENTER"
6646 >security mode and master browsers</B
6647 ></TD
6648 ></TR
6649 ><TR
6650 ><TD
6651 ALIGN="LEFT"
6653 >There are a few comments to make in order to tie up some
6654 loose ends. There has been much debate over the issue of whether
6655 or not it is ok to configure Samba as a Domain Controller in security
6656 modes other than <TT
6657 CLASS="CONSTANT"
6658 >USER</TT
6659 >. The only security mode
6660 which will not work due to technical reasons is <TT
6661 CLASS="CONSTANT"
6662 >SHARE</TT
6664 mode security. <TT
6665 CLASS="CONSTANT"
6666 >DOMAIN</TT
6667 > and <TT
6668 CLASS="CONSTANT"
6669 >SERVER</TT
6671 mode security is really just a variation on SMB user level security.</P
6673 >Actually, this issue is also closer tied to the debate on whether
6674 or not Samba must be the domain master browser for its workgroup
6675 when operating as a DC. While it may technically be possible
6676 to configure a server as such (after all, browsing and domain logons
6677 are two distinctly different functions), it is not a good idea to
6678 so. You should remember that the DC must register the DOMAIN#1b netbios
6679 name. This is the name used by Windows clients to locate the DC.
6680 Windows clients do not distinguish between the DC and the DMB.
6681 For this reason, it is very wise to configure the Samba DC as the DMB.</P
6683 >Now back to the issue of configuring a Samba DC to use a mode other
6684 than "security = user". If a Samba host is configured to use
6685 another SMB server or DC in order to validate user connection
6686 requests, then it is a fact that some other machine on the network
6687 (the "password server") knows more about user than the Samba host.
6688 99% of the time, this other host is a domain controller. Now
6689 in order to operate in domain mode security, the "workgroup" parameter
6690 must be set to the name of the Windows NT domain (which already
6691 has a domain controller, right?)</P
6693 >Therefore configuring a Samba box as a DC for a domain that
6694 already by definition has a PDC is asking for trouble.
6695 Therefore, you should always configure the Samba DC to be the DMB
6696 for its domain.</P
6697 ></TD
6698 ></TR
6699 ></TABLE
6700 ></DIV
6701 ></DIV
6702 ><DIV
6703 CLASS="SECT2"
6704 ><HR><H2
6705 CLASS="SECT2"
6707 NAME="AEN1402"
6708 >7.8.2. Configuration Instructions: Setting up Roaming User Profiles</A
6709 ></H2
6710 ><DIV
6711 CLASS="WARNING"
6713 ></P
6714 ><TABLE
6715 CLASS="WARNING"
6716 BORDER="1"
6717 WIDTH="100%"
6718 ><TR
6719 ><TD
6720 ALIGN="CENTER"
6722 >Warning</B
6723 ></TD
6724 ></TR
6725 ><TR
6726 ><TD
6727 ALIGN="LEFT"
6729 ><EM
6730 >NOTE!</EM
6731 > Roaming profiles support is different
6732 for Win9X and WinNT.</P
6733 ></TD
6734 ></TR
6735 ></TABLE
6736 ></DIV
6738 >Before discussing how to configure roaming profiles, it is useful to see how
6739 Win9X and WinNT clients implement these features.</P
6741 >Win9X clients send a NetUserGetInfo request to the server to get the user's
6742 profiles location. However, the response does not have room for a separate
6743 profiles location field, only the users home share. This means that Win9X
6744 profiles are restricted to being in the user's home directory.</P
6746 >WinNT clients send a NetSAMLogon RPC request, which contains many fields,
6747 including a separate field for the location of the user's profiles.
6748 This means that support for profiles is different for Win9X and WinNT.</P
6749 ><DIV
6750 CLASS="SECT3"
6751 ><HR><H3
6752 CLASS="SECT3"
6754 NAME="AEN1410"
6755 >7.8.2.1. Windows NT Configuration</A
6756 ></H3
6758 >To support WinNT clients, inn the [global] section of smb.conf set the
6759 following (for example):</P
6761 ><TABLE
6762 BORDER="0"
6763 BGCOLOR="#E0E0E0"
6764 WIDTH="100%"
6765 ><TR
6766 ><TD
6767 ><PRE
6768 CLASS="PROGRAMLISTING"
6769 >logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath</PRE
6770 ></TD
6771 ></TR
6772 ></TABLE
6773 ></P
6775 >The default for this option is \\%N\%U\profile, namely
6776 \\sambaserver\username\profile. The \\N%\%U service is created
6777 automatically by the [homes] service.
6778 If you are using a samba server for the profiles, you _must_ make the
6779 share specified in the logon path browseable. </P
6780 ><DIV
6781 CLASS="NOTE"
6782 ><BLOCKQUOTE
6783 CLASS="NOTE"
6786 >Note: </B
6787 >[lkcl 26aug96 - we have discovered a problem where Windows clients can
6788 maintain a connection to the [homes] share in between logins. The
6789 [homes] share must NOT therefore be used in a profile path.]</P
6790 ></BLOCKQUOTE
6791 ></DIV
6792 ></DIV
6793 ><DIV
6794 CLASS="SECT3"
6795 ><HR><H3
6796 CLASS="SECT3"
6798 NAME="AEN1418"
6799 >7.8.2.2. Windows 9X Configuration</A
6800 ></H3
6802 >To support Win9X clients, you must use the "logon home" parameter. Samba has
6803 now been fixed so that "net use/home" now works as well, and it, too, relies
6804 on the "logon home" parameter.</P
6806 >By using the logon home parameter, you are restricted to putting Win9X
6807 profiles in the user's home directory. But wait! There is a trick you
6808 can use. If you set the following in the [global] section of your
6809 smb.conf file:</P
6811 ><TABLE
6812 BORDER="0"
6813 BGCOLOR="#E0E0E0"
6814 WIDTH="100%"
6815 ><TR
6816 ><TD
6817 ><PRE
6818 CLASS="PROGRAMLISTING"
6819 >logon home = \\%L\%U\.profiles</PRE
6820 ></TD
6821 ></TR
6822 ></TABLE
6823 ></P
6825 >then your Win9X clients will dutifully put their clients in a subdirectory
6826 of your home directory called .profiles (thus making them hidden).</P
6828 >Not only that, but 'net use/home' will also work, because of a feature in
6829 Win9X. It removes any directory stuff off the end of the home directory area
6830 and only uses the server and share portion. That is, it looks like you
6831 specified \\%L\%U for "logon home".</P
6832 ></DIV
6833 ><DIV
6834 CLASS="SECT3"
6835 ><HR><H3
6836 CLASS="SECT3"
6838 NAME="AEN1426"
6839 >7.8.2.3. Win9X and WinNT Configuration</A
6840 ></H3
6842 >You can support profiles for both Win9X and WinNT clients by setting both the
6843 "logon home" and "logon path" parameters. For example:</P
6845 ><TABLE
6846 BORDER="0"
6847 BGCOLOR="#E0E0E0"
6848 WIDTH="100%"
6849 ><TR
6850 ><TD
6851 ><PRE
6852 CLASS="PROGRAMLISTING"
6853 >logon home = \\%L\%U\.profiles
6854 logon path = \\%L\profiles\%U</PRE
6855 ></TD
6856 ></TR
6857 ></TABLE
6858 ></P
6859 ><DIV
6860 CLASS="NOTE"
6861 ><BLOCKQUOTE
6862 CLASS="NOTE"
6865 >Note: </B
6866 >I have not checked what 'net use /home' does on NT when "logon home" is
6867 set as above.</P
6868 ></BLOCKQUOTE
6869 ></DIV
6870 ></DIV
6871 ><DIV
6872 CLASS="SECT3"
6873 ><HR><H3
6874 CLASS="SECT3"
6876 NAME="AEN1433"
6877 >7.8.2.4. Windows 9X Profile Setup</A
6878 ></H3
6880 >When a user first logs in on Windows 9X, the file user.DAT is created,
6881 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".
6882 These directories and their contents will be merged with the local
6883 versions stored in c:\windows\profiles\username on subsequent logins,
6884 taking the most recent from each. You will need to use the [global]
6885 options "preserve case = yes", "short case preserve = yes" and
6886 "case sensitive = no" in order to maintain capital letters in shortcuts
6887 in any of the profile folders.</P
6889 >The user.DAT file contains all the user's preferences. If you wish to
6890 enforce a set of preferences, rename their user.DAT file to user.MAN,
6891 and deny them write access to this file.</P
6893 ></P
6894 ><OL
6895 TYPE="1"
6896 ><LI
6898 > On the Windows 95 machine, go to Control Panel | Passwords and
6899 select the User Profiles tab. Select the required level of
6900 roaming preferences. Press OK, but do _not_ allow the computer
6901 to reboot.
6903 ></LI
6904 ><LI
6906 > On the Windows 95 machine, go to Control Panel | Network |
6907 Client for Microsoft Networks | Preferences. Select 'Log on to
6908 NT Domain'. Then, ensure that the Primary Logon is 'Client for
6909 Microsoft Networks'. Press OK, and this time allow the computer
6910 to reboot.
6912 ></LI
6913 ></OL
6915 >Under Windows 95, Profiles are downloaded from the Primary Logon.
6916 If you have the Primary Logon as 'Client for Novell Networks', then
6917 the profiles and logon script will be downloaded from your Novell
6918 Server. If you have the Primary Logon as 'Windows Logon', then the
6919 profiles will be loaded from the local machine - a bit against the
6920 concept of roaming profiles, if you ask me.</P
6922 >You will now find that the Microsoft Networks Login box contains
6923 [user, password, domain] instead of just [user, password]. Type in
6924 the samba server's domain name (or any other domain known to exist,
6925 but bear in mind that the user will be authenticated against this
6926 domain and profiles downloaded from it, if that domain logon server
6927 supports it), user name and user's password.</P
6929 >Once the user has been successfully validated, the Windows 95 machine
6930 will inform you that 'The user has not logged on before' and asks you
6931 if you wish to save the user's preferences? Select 'yes'.</P
6933 >Once the Windows 95 client comes up with the desktop, you should be able
6934 to examine the contents of the directory specified in the "logon path"
6935 on the samba server and verify that the "Desktop", "Start Menu",
6936 "Programs" and "Nethood" folders have been created.</P
6938 >These folders will be cached locally on the client, and updated when
6939 the user logs off (if you haven't made them read-only by then :-).
6940 You will find that if the user creates further folders or short-cuts,
6941 that the client will merge the profile contents downloaded with the
6942 contents of the profile directory already on the local client, taking
6943 the newest folders and short-cuts from each set.</P
6945 >If you have made the folders / files read-only on the samba server,
6946 then you will get errors from the w95 machine on logon and logout, as
6947 it attempts to merge the local and the remote profile. Basically, if
6948 you have any errors reported by the w95 machine, check the unix file
6949 permissions and ownership rights on the profile directory contents,
6950 on the samba server.</P
6952 >If you have problems creating user profiles, you can reset the user's
6953 local desktop cache, as shown below. When this user then next logs in,
6954 they will be told that they are logging in "for the first time".</P
6956 ></P
6957 ><OL
6958 TYPE="1"
6959 ><LI
6961 > instead of logging in under the [user, password, domain] dialog,
6962 press escape.
6964 ></LI
6965 ><LI
6967 > run the regedit.exe program, and look in:
6970 > HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
6973 > you will find an entry, for each user, of ProfilePath. Note the
6974 contents of this key (likely to be c:\windows\profiles\username),
6975 then delete the key ProfilePath for the required user.
6978 > [Exit the registry editor].
6980 ></LI
6981 ><LI
6983 > <EM
6984 >WARNING</EM
6985 > - before deleting the contents of the
6986 directory listed in
6987 the ProfilePath (this is likely to be c:\windows\profiles\username),
6988 ask them if they have any important files stored on their desktop
6989 or in their start menu. delete the contents of the directory
6990 ProfilePath (making a backup if any of the files are needed).
6993 > This will have the effect of removing the local (read-only hidden
6994 system file) user.DAT in their profile directory, as well as the
6995 local "desktop", "nethood", "start menu" and "programs" folders.
6997 ></LI
6998 ><LI
7000 > search for the user's .PWL password-cacheing file in the c:\windows
7001 directory, and delete it.
7003 ></LI
7004 ><LI
7006 > log off the windows 95 client.
7008 ></LI
7009 ><LI
7011 > check the contents of the profile path (see "logon path" described
7012 above), and delete the user.DAT or user.MAN file for the user,
7013 making a backup if required.
7015 ></LI
7016 ></OL
7018 >If all else fails, increase samba's debug log levels to between 3 and 10,
7019 and / or run a packet trace program such as tcpdump or netmon.exe, and
7020 look for any error reports.</P
7022 >If you have access to an NT server, then first set up roaming profiles
7023 and / or netlogons on the NT server. Make a packet trace, or examine
7024 the example packet traces provided with NT server, and see what the
7025 differences are with the equivalent samba trace.</P
7026 ></DIV
7027 ><DIV
7028 CLASS="SECT3"
7029 ><HR><H3
7030 CLASS="SECT3"
7032 NAME="AEN1469"
7033 >7.8.2.5. Windows NT Workstation 4.0</A
7034 ></H3
7036 >When a user first logs in to a Windows NT Workstation, the profile
7037 NTuser.DAT is created. The profile location can be now specified
7038 through the "logon path" parameter. </P
7039 ><DIV
7040 CLASS="NOTE"
7041 ><BLOCKQUOTE
7042 CLASS="NOTE"
7045 >Note: </B
7046 >[lkcl 10aug97 - i tried setting the path to
7047 \\samba-server\homes\profile, and discovered that this fails because
7048 a background process maintains the connection to the [homes] share
7049 which does _not_ close down in between user logins. you have to
7050 have \\samba-server\%L\profile, where user is the username created
7051 from the [homes] share].</P
7052 ></BLOCKQUOTE
7053 ></DIV
7055 >There is a parameter that is now available for use with NT Profiles:
7056 "logon drive". This should be set to "h:" or any other drive, and
7057 should be used in conjunction with the new "logon home" parameter.</P
7059 >The entry for the NT 4.0 profile is a _directory_ not a file. The NT
7060 help on profiles mentions that a directory is also created with a .PDS
7061 extension. The user, while logging in, must have write permission to
7062 create the full profile path (and the folder with the .PDS extension)
7063 [lkcl 10aug97 - i found that the creation of the .PDS directory failed,
7064 and had to create these manually for each user, with a shell script.
7065 also, i presume, but have not tested, that the full profile path must
7066 be browseable just as it is for w95, due to the manner in which they
7067 attempt to create the full profile path: test existence of each path
7068 component; create path component].</P
7070 >In the profile directory, NT creates more folders than 95. It creates
7071 "Application Data" and others, as well as "Desktop", "Nethood",
7072 "Start Menu" and "Programs". The profile itself is stored in a file
7073 NTuser.DAT. Nothing appears to be stored in the .PDS directory, and
7074 its purpose is currently unknown.</P
7076 >You can use the System Control Panel to copy a local profile onto
7077 a samba server (see NT Help on profiles: it is also capable of firing
7078 up the correct location in the System Control Panel for you). The
7079 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
7080 turns a profile into a mandatory one.</P
7081 ><DIV
7082 CLASS="NOTE"
7083 ><BLOCKQUOTE
7084 CLASS="NOTE"
7087 >Note: </B
7088 >[lkcl 10aug97 - i notice that NT Workstation tells me that it is
7089 downloading a profile from a slow link. whether this is actually the
7090 case, or whether there is some configuration issue, as yet unknown,
7091 that makes NT Workstation _think_ that the link is a slow one is a
7092 matter to be resolved].</P
7094 >[lkcl 20aug97 - after samba digest correspondance, one user found, and
7095 another confirmed, that profiles cannot be loaded from a samba server
7096 unless "security = user" and "encrypt passwords = yes" (see the file
7097 ENCRYPTION.txt) or "security = server" and "password server = ip.address.
7098 of.yourNTserver" are used. either of these options will allow the NT
7099 workstation to access the samba server using LAN manager encrypted
7100 passwords, without the user intervention normally required by NT
7101 workstation for clear-text passwords].</P
7103 >[lkcl 25aug97 - more comments received about NT profiles: the case of
7104 the profile _matters_. the file _must_ be called NTuser.DAT or, for
7105 a mandatory profile, NTuser.MAN].</P
7106 ></BLOCKQUOTE
7107 ></DIV
7108 ></DIV
7109 ><DIV
7110 CLASS="SECT3"
7111 ><HR><H3
7112 CLASS="SECT3"
7114 NAME="AEN1482"
7115 >7.8.2.6. Windows NT Server</A
7116 ></H3
7118 >There is nothing to stop you specifying any path that you like for the
7119 location of users' profiles. Therefore, you could specify that the
7120 profile be stored on a samba server, or any other SMB server, as long as
7121 that SMB server supports encrypted passwords.</P
7122 ></DIV
7123 ><DIV
7124 CLASS="SECT3"
7125 ><HR><H3
7126 CLASS="SECT3"
7128 NAME="AEN1485"
7129 >7.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0</A
7130 ></H3
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 >Potentially outdated or incorrect material follows</B
7144 ></TD
7145 ></TR
7146 ><TR
7147 ><TD
7148 ALIGN="LEFT"
7150 >I think this is all bogus, but have not deleted it. (Richard Sharpe)</P
7151 ></TD
7152 ></TR
7153 ></TABLE
7154 ></DIV
7156 >The default logon path is \\%N\U%. NT Workstation will attempt to create
7157 a directory "\\samba-server\username.PDS" if you specify the logon path
7158 as "\\samba-server\username" with the NT User Manager. Therefore, you
7159 will need to specify (for example) "\\samba-server\username\profile".
7160 NT 4.0 will attempt to create "\\samba-server\username\profile.PDS", which
7161 is more likely to succeed.</P
7163 >If you then want to share the same Start Menu / Desktop with W95, you will
7164 need to specify "logon path = \\samba-server\username\profile" [lkcl 10aug97
7165 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
7166 to run from the c:\winnt\system32 directory. this directory is obviously
7167 unlikely to exist on a Win95-only host].</P
7169 >&#13;If you have this set up correctly, you will find separate user.DAT and
7170 NTuser.DAT files in the same profile directory.</P
7171 ><DIV
7172 CLASS="NOTE"
7173 ><BLOCKQUOTE
7174 CLASS="NOTE"
7177 >Note: </B
7178 >[lkcl 25aug97 - there are some issues to resolve with downloading of
7179 NT profiles, probably to do with time/date stamps. i have found that
7180 NTuser.DAT is never updated on the workstation after the first time that
7181 it is copied to the local workstation profile directory. this is in
7182 contrast to w95, where it _does_ transfer / update profiles correctly].</P
7183 ></BLOCKQUOTE
7184 ></DIV
7185 ></DIV
7186 ></DIV
7187 ></DIV
7188 ><DIV
7189 CLASS="SECT1"
7190 ><HR><H1
7191 CLASS="SECT1"
7193 NAME="AEN1495"
7194 >7.9. DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
7195 ></H1
7196 ><DIV
7197 CLASS="WARNING"
7199 ></P
7200 ><TABLE
7201 CLASS="WARNING"
7202 BORDER="1"
7203 WIDTH="100%"
7204 ><TR
7205 ><TD
7206 ALIGN="CENTER"
7208 >Possibly Outdated Material</B
7209 ></TD
7210 ></TR
7211 ><TR
7212 ><TD
7213 ALIGN="LEFT"
7215 > This appendix was originally authored by John H Terpstra of
7216 the Samba Team and is included here for posterity.
7218 ></TD
7219 ></TR
7220 ></TABLE
7221 ></DIV
7223 ><EM
7224 >NOTE :</EM
7226 The term "Domain Controller" and those related to it refer to one specific
7227 method of authentication that can underly an SMB domain. Domain Controllers
7228 prior to Windows NT Server 3.1 were sold by various companies and based on
7229 private extensions to the LAN Manager 2.1 protocol. Windows NT introduced
7230 Microsoft-specific ways of distributing the user authentication database.
7231 See DOMAIN.txt for examples of how Samba can participate in or create
7232 SMB domains based on shared authentication database schemes other than the
7233 Windows NT SAM.</P
7235 >Windows NT Server can be installed as either a plain file and print server
7236 (WORKGROUP workstation or server) or as a server that participates in Domain
7237 Control (DOMAIN member, Primary Domain controller or Backup Domain controller).
7238 The same is true for OS/2 Warp Server, Digital Pathworks and other similar
7239 products, all of which can participate in Domain Control along with Windows NT.</P
7241 >To many people these terms can be confusing, so let's try to clear the air.</P
7243 >Every Windows NT system (workstation or server) has a registry database.
7244 The registry contains entries that describe the initialization information
7245 for all services (the equivalent of Unix Daemons) that run within the Windows
7246 NT environment. The registry also contains entries that tell application
7247 software where to find dynamically loadable libraries that they depend upon.
7248 In fact, the registry contains entries that describes everything that anything
7249 may need to know to interact with the rest of the system.</P
7251 >The registry files can be located on any Windows NT machine by opening a
7252 command prompt and typing:</P
7254 ><TT
7255 CLASS="PROMPT"
7256 >C:\WINNT\&#62;</TT
7257 > dir %SystemRoot%\System32\config</P
7259 >The environment variable %SystemRoot% value can be obtained by typing:</P
7261 ><TT
7262 CLASS="PROMPT"
7263 >C:\WINNT&#62;</TT
7264 >echo %SystemRoot%</P
7266 >The active parts of the registry that you may want to be familiar with are
7267 the files called: default, system, software, sam and security.</P
7269 >In a domain environment, Microsoft Windows NT domain controllers participate
7270 in replication of the SAM and SECURITY files so that all controllers within
7271 the domain have an exactly identical copy of each.</P
7273 >The Microsoft Windows NT system is structured within a security model that
7274 says that all applications and services must authenticate themselves before
7275 they can obtain permission from the security manager to do what they set out
7276 to do.</P
7278 >The Windows NT User database also resides within the registry. This part of
7279 the registry contains the user's security identifier, home directory, group
7280 memberships, desktop profile, and so on.</P
7282 >Every Windows NT system (workstation as well as server) will have its own
7283 registry. Windows NT Servers that participate in Domain Security control
7284 have a database that they share in common - thus they do NOT own an
7285 independent full registry database of their own, as do Workstations and
7286 plain Servers.</P
7288 >The User database is called the SAM (Security Access Manager) database and
7289 is used for all user authentication as well as for authentication of inter-
7290 process authentication (ie: to ensure that the service action a user has
7291 requested is permitted within the limits of that user's privileges).</P
7293 >The Samba team have produced a utility that can dump the Windows NT SAM into
7294 smbpasswd format: see ENCRYPTION.txt for information on smbpasswd and
7295 /pub/samba/pwdump on your nearest Samba mirror for the utility. This
7296 facility is useful but cannot be easily used to implement SAM replication
7297 to Samba systems.</P
7299 >Windows for Workgroups, Windows 95, and Windows NT Workstations and Servers
7300 can participate in a Domain security system that is controlled by Windows NT
7301 servers that have been correctly configured. At most every domain will have
7302 ONE Primary Domain Controller (PDC). It is desirable that each domain will
7303 have at least one Backup Domain Controller (BDC).</P
7305 >The PDC and BDCs then participate in replication of the SAM database so that
7306 each Domain Controlling participant will have an up to date SAM component
7307 within its registry.</P
7308 ></DIV
7309 ></DIV
7310 ><DIV
7311 CLASS="CHAPTER"
7312 ><HR><H1
7314 NAME="AEN1520"
7315 >Chapter 8. Unifed Logons between Windows NT and UNIX using Winbind</A
7316 ></H1
7317 ><DIV
7318 CLASS="SECT1"
7319 ><H1
7320 CLASS="SECT1"
7322 NAME="AEN1538"
7323 >8.1. Abstract</A
7324 ></H1
7326 >Integration of UNIX and Microsoft Windows NT through
7327 a unified logon has been considered a "holy grail" in heterogeneous
7328 computing environments for a long time. We present <EM
7329 >winbind
7330 </EM
7331 >, a component of the Samba suite of programs as a
7332 solution to the unied logon problem. Winbind uses a UNIX implementation
7333 of Microsoft RPC calls, Pluggable Authentication Modules, and the Name
7334 Service Switch to allow Windows NT domain users to appear and operate
7335 as UNIX users on a UNIX machine. This paper describes the winbind
7336 system, explaining the functionality it provides, how it is configured,
7337 and how it works internally.</P
7338 ></DIV
7339 ><DIV
7340 CLASS="SECT1"
7341 ><HR><H1
7342 CLASS="SECT1"
7344 NAME="AEN1542"
7345 >8.2. Introduction</A
7346 ></H1
7348 >It is well known that UNIX and Microsoft Windows NT have
7349 different models for representing user and group information and
7350 use different technologies for implementing them. This fact has
7351 made it difficult to integrate the two systems in a satisfactory
7352 manner.</P
7354 >One common solution in use today has been to create
7355 identically named user accounts on both the UNIX and Windows systems
7356 and use the Samba suite of programs to provide file and print services
7357 between the two. This solution is far from perfect however, as
7358 adding and deleting users on both sets of machines becomes a chore
7359 and two sets of passwords are required both of which which
7360 can lead to synchronization problems between the UNIX and Windows
7361 systems and confusion for users.</P
7363 >We divide the unifed logon problem for UNIX machines into
7364 three smaller problems:</P
7366 ></P
7367 ><UL
7368 ><LI
7370 >Obtaining Windows NT user and group information
7372 ></LI
7373 ><LI
7375 >Authenticating Windows NT users
7377 ></LI
7378 ><LI
7380 >Password changing for Windows NT users
7382 ></LI
7383 ></UL
7385 >Ideally, a prospective solution to the unified logon problem
7386 would satisfy all the above components without duplication of
7387 information on the UNIX machines and without creating additional
7388 tasks for the system administrator when maintaining users and
7389 groups on either system. The winbind system provides a simple
7390 and elegant solution to all three components of the unifed logon
7391 problem.</P
7392 ></DIV
7393 ><DIV
7394 CLASS="SECT1"
7395 ><HR><H1
7396 CLASS="SECT1"
7398 NAME="AEN1555"
7399 >8.3. What Winbind Provides</A
7400 ></H1
7402 >Winbind unifies UNIX and Windows NT account management by
7403 allowing a UNIX box to become a full member of a NT domain. Once
7404 this is done the UNIX box will see NT users and groups as if
7405 they were native UNIX users and groups, allowing the NT domain
7406 to be used in much the same manner that NIS+ is used within
7407 UNIX-only environments.</P
7409 >The end result is that whenever any
7410 program on the UNIX machine asks the operating system to lookup
7411 a user or group name, the query will be resolved by asking the
7412 NT domain controller for the specied domain to do the lookup.
7413 Because Winbind hooks into the operating system at a low level
7414 (via the NSS name resolution modules in the C library) this
7415 redirection to the NT domain controller is completely
7416 transparent.</P
7418 >Users on the UNIX machine can then use NT user and group
7419 names as they would use "native" UNIX names. They can chown files
7420 so that they are owned by NT domain users or even login to the
7421 UNIX machine and run a UNIX X-Window session as a domain user.</P
7423 >The only obvious indication that Winbind is being used is
7424 that user and group names take the form DOMAIN\user and
7425 DOMAIN\group. This is necessary as it allows Winbind to determine
7426 that redirection to a domain controller is wanted for a particular
7427 lookup and which trusted domain is being referenced.</P
7429 >Additionally, Winbind provides a authentication service
7430 that hooks into the Pluggable Authentication Modules (PAM) system
7431 to provide authentication via a NT domain to any PAM enabled
7432 applications. This capability solves the problem of synchronizing
7433 passwords between systems as all passwords are stored in a single
7434 location (on the domain controller).</P
7435 ><DIV
7436 CLASS="SECT2"
7437 ><HR><H2
7438 CLASS="SECT2"
7440 NAME="AEN1562"
7441 >8.3.1. Target Uses</A
7442 ></H2
7444 >Winbind is targeted at organizations that have an
7445 existing NT based domain infrastructure into which they wish
7446 to put UNIX workstations or servers. Winbind will allow these
7447 organizations to deploy UNIX workstations without having to
7448 maintain a separate account infrastructure. This greatly simplies
7449 the administrative overhead of deploying UNIX workstations into
7450 a NT based organization.</P
7452 >Another interesting way in which we expect Winbind to
7453 be used is as a central part of UNIX based appliances. Appliances
7454 that provide file and print services to Microsoft based networks
7455 will be able to use Winbind to provide seamless integration of
7456 the appliance into the domain.</P
7457 ></DIV
7458 ></DIV
7459 ><DIV
7460 CLASS="SECT1"
7461 ><HR><H1
7462 CLASS="SECT1"
7464 NAME="AEN1566"
7465 >8.4. How Winbind Works</A
7466 ></H1
7468 >The winbind system is designed around a client/server
7469 architecture. A long running <B
7470 CLASS="COMMAND"
7471 >winbindd</B
7472 > daemon
7473 listens on a UNIX domain socket waiting for requests
7474 to arrive. These requests are generated by the NSS and PAM
7475 clients and processed sequentially.</P
7477 >The technologies used to implement winbind are described
7478 in detail below.</P
7479 ><DIV
7480 CLASS="SECT2"
7481 ><HR><H2
7482 CLASS="SECT2"
7484 NAME="AEN1571"
7485 >8.4.1. Microsoft Remote Procedure Calls</A
7486 ></H2
7488 >Over the last two years, efforts have been underway
7489 by various Samba Team members to decode various aspects of
7490 the Microsoft Remote Procedure Call (MSRPC) system. This
7491 system is used for most network related operations between
7492 Windows NT machines including remote management, user authentication
7493 and print spooling. Although initially this work was done
7494 to aid the implementation of Primary Domain Controller (PDC)
7495 functionality in Samba, it has also yielded a body of code which
7496 can be used for other purposes.</P
7498 >Winbind uses various MSRPC calls to enumerate domain users
7499 and groups and to obtain detailed information about individual
7500 users or groups. Other MSRPC calls can be used to authenticate
7501 NT domain users and to change user passwords. By directly querying
7502 a Windows PDC for user and group information, winbind maps the
7503 NT account information onto UNIX user and group names.</P
7504 ></DIV
7505 ><DIV
7506 CLASS="SECT2"
7507 ><HR><H2
7508 CLASS="SECT2"
7510 NAME="AEN1575"
7511 >8.4.2. Name Service Switch</A
7512 ></H2
7514 >The Name Service Switch, or NSS, is a feature that is
7515 present in many UNIX operating systems. It allows system
7516 information such as hostnames, mail aliases and user information
7517 to be resolved from dierent sources. For example, a standalone
7518 UNIX workstation may resolve system information from a series of
7519 flat files stored on the local lesystem. A networked workstation
7520 may first attempt to resolve system information from local files,
7521 then consult a NIS database for user information or a DNS server
7522 for hostname information.</P
7524 >The NSS application programming interface allows winbind
7525 to present itself as a source of system information when
7526 resolving UNIX usernames and groups. Winbind uses this interface,
7527 and information obtained from a Windows NT server using MSRPC
7528 calls to provide a new source of account enumeration. Using standard
7529 UNIX library calls, one can enumerate the users and groups on
7530 a UNIX machine running winbind and see all users and groups in
7531 a NT domain plus any trusted domain as though they were local
7532 users and groups.</P
7534 >The primary control le for NSS is <TT
7535 CLASS="FILENAME"
7536 >/etc/nsswitch.conf
7537 </TT
7538 >. When a UNIX application makes a request to do a lookup
7539 the C library looks in <TT
7540 CLASS="FILENAME"
7541 >/etc/nsswitch.conf</TT
7543 for a line which matches the service type being requested, for
7544 example the "passwd" service type is used when user or group names
7545 are looked up. This config line species which implementations
7546 of that service should be tried andin what order. If the passwd
7547 config line is:</P
7550 CLASS="COMMAND"
7551 >passwd: files example</B
7552 ></P
7554 >then the C library will first load a module called
7556 CLASS="FILENAME"
7557 >/lib/libnss_files.so</TT
7558 > followed by
7559 the module <TT
7560 CLASS="FILENAME"
7561 >/lib/libnss_example.so</TT
7562 >. The
7563 C library will dynamically load each of these modules in turn
7564 and call resolver functions within the modules to try to resolve
7565 the request. Once the request is resolved the C library returns the
7566 result to the application.</P
7568 >This NSS interface provides a very easy way for Winbind
7569 to hook into the operating system. All that needs to be done
7570 is to put <TT
7571 CLASS="FILENAME"
7572 >libnss_winbind.so</TT
7573 > in <TT
7574 CLASS="FILENAME"
7575 >/lib/</TT
7577 then add "winbind" into <TT
7578 CLASS="FILENAME"
7579 >/etc/nsswitch.conf</TT
7580 > at
7581 the appropriate place. The C library will then call Winbind to
7582 resolve user and group names.</P
7583 ></DIV
7584 ><DIV
7585 CLASS="SECT2"
7586 ><HR><H2
7587 CLASS="SECT2"
7589 NAME="AEN1591"
7590 >8.4.3. Pluggable Authentication Modules</A
7591 ></H2
7593 >Pluggable Authentication Modules, also known as PAM,
7594 is a system for abstracting authentication and authorization
7595 technologies. With a PAM module it is possible to specify different
7596 authentication methods for dierent system applications without
7597 having to recompile these applications. PAM is also useful
7598 for implementing a particular policy for authorization. For example,
7599 a system administrator may only allow console logins from users
7600 stored in the local password file but only allow users resolved from
7601 a NIS database to log in over the network.</P
7603 >Winbind uses the authentication management and password
7604 management PAM interface to integrate Windows NT users into a
7605 UNIX system. This allows Windows NT users to log in to a UNIX
7606 machine and be authenticated against a suitable Primary Domain
7607 Controller. These users can also change their passwords and have
7608 this change take eect directly on the Primary Domain Controller.
7611 >PAM is congured by providing control files in the directory
7613 CLASS="FILENAME"
7614 >/etc/pam.d/</TT
7615 > for each of the services that
7616 require authentication. When an authentication request is made
7617 by an application the PAM code in the C library looks up this
7618 control file to determine what modules to load to do the
7619 authentication check and in what order. This interface makes adding
7620 a new authentication service for Winbind very easy, all that needs
7621 to be done is that the <TT
7622 CLASS="FILENAME"
7623 >pam_winbind.so</TT
7624 > module
7625 is copied to <TT
7626 CLASS="FILENAME"
7627 >/lib/security/</TT
7628 > and the pam
7629 control files for relevant services are updated to allow
7630 authentication via winbind. See the PAM documentation
7631 for more details.</P
7632 ></DIV
7633 ><DIV
7634 CLASS="SECT2"
7635 ><HR><H2
7636 CLASS="SECT2"
7638 NAME="AEN1599"
7639 >8.4.4. User and Group ID Allocation</A
7640 ></H2
7642 >When a user or group is created under Windows NT
7643 is it allocated a numerical relative identier (RID). This is
7644 slightly dierent to UNIX which has a range of numbers which are
7645 used to identify users, and the same range in which to identify
7646 groups. It is winbind's job to convert RIDs to UNIX id numbers and
7647 vice versa. When winbind is congured it is given part of the UNIX
7648 user id space and a part of the UNIX group id space in which to
7649 store Windows NT users and groups. If a Windows NT user is
7650 resolved for the first time, it is allocated the next UNIX id from
7651 the range. The same process applies for Windows NT groups. Over
7652 time, winbind will have mapped all Windows NT users and groups
7653 to UNIX user ids and group ids.</P
7655 >The results of this mapping are stored persistently in
7656 a ID mapping database held in a tdb database). This ensures that
7657 RIDs are mapped to UNIX IDs in a consistent way.</P
7658 ></DIV
7659 ><DIV
7660 CLASS="SECT2"
7661 ><HR><H2
7662 CLASS="SECT2"
7664 NAME="AEN1603"
7665 >8.4.5. Result Caching</A
7666 ></H2
7668 >An active system can generate a lot of user and group
7669 name lookups. To reduce the network cost of these lookups winbind
7670 uses a caching scheme based on the SAM sequence number supplied
7671 by NT domain controllers. User or group information returned
7672 by a PDC is cached by winbind along with a sequence number also
7673 returned by the PDC. This sequence number is incremented by
7674 Windows NT whenever any user or group information is modied. If
7675 a cached entry has expired, the sequence number is requested from
7676 the PDC and compared against the sequence number of the cached entry.
7677 If the sequence numbers do not match, then the cached information
7678 is discarded and up to date information is requested directly
7679 from the PDC.</P
7680 ></DIV
7681 ></DIV
7682 ><DIV
7683 CLASS="SECT1"
7684 ><HR><H1
7685 CLASS="SECT1"
7687 NAME="AEN1606"
7688 >8.5. Installation and Configuration</A
7689 ></H1
7691 >The easiest way to install winbind is by using the packages
7692 provided in the <TT
7693 CLASS="FILENAME"
7694 >pub/samba/appliance/</TT
7696 directory on your nearest
7697 Samba mirror. These packages provide snapshots of the Samba source
7698 code and binaries already setup to provide the full functionality
7699 of winbind. This setup is a little more complex than a normal Samba
7700 build as winbind needs a small amount of functionality from a
7701 development code branch called SAMBA_TNG.</P
7703 >Once you have installed the packages you should read
7704 the <B
7705 CLASS="COMMAND"
7706 >winbindd(8)</B
7707 > man page which will provide you
7708 with conguration information and give you sample conguration files.
7709 You may also wish to update the main Samba daemons smbd and nmbd)
7710 with a more recent development release, such as the recently
7711 announced Samba 2.2 alpha release.</P
7712 ></DIV
7713 ><DIV
7714 CLASS="SECT1"
7715 ><HR><H1
7716 CLASS="SECT1"
7718 NAME="AEN1612"
7719 >8.6. Limitations</A
7720 ></H1
7722 >Winbind has a number of limitations in its current
7723 released version which we hope to overcome in future
7724 releases:</P
7726 ></P
7727 ><UL
7728 ><LI
7730 >Winbind is currently only available for
7731 the Linux operating system, although ports to other operating
7732 systems are certainly possible. For such ports to be feasible,
7733 we require the C library of the target operating system to
7734 support the Name Service Switch and Pluggable Authentication
7735 Modules systems. This is becoming more common as NSS and
7736 PAM gain support among UNIX vendors.</P
7737 ></LI
7738 ><LI
7740 >The mappings of Windows NT RIDs to UNIX ids
7741 is not made algorithmically and depends on the order in which
7742 unmapped users or groups are seen by winbind. It may be difficult
7743 to recover the mappings of rid to UNIX id mapping if the file
7744 containing this information is corrupted or destroyed.</P
7745 ></LI
7746 ><LI
7748 >Currently the winbind PAM module does not take
7749 into account possible workstation and logon time restrictions
7750 that may be been set for Windows NT users.</P
7751 ></LI
7752 ><LI
7754 >Building winbind from source is currently
7755 quite tedious as it requires combining source code from two Samba
7756 branches. Work is underway to solve this by providing all
7757 the necessary functionality in the main Samba code branch.</P
7758 ></LI
7759 ></UL
7760 ></DIV
7761 ><DIV
7762 CLASS="SECT1"
7763 ><HR><H1
7764 CLASS="SECT1"
7766 NAME="AEN1624"
7767 >8.7. Conclusion</A
7768 ></H1
7770 >The winbind system, through the use of the Name Service
7771 Switch, Pluggable Authentication Modules, and appropriate
7772 Microsoft RPC calls have allowed us to provide seamless
7773 integration of Microsoft Windows NT domain users on a
7774 UNIX system. The result is a great reduction in the administrative
7775 cost of running a mixed UNIX and NT network.</P
7776 ></DIV
7777 ></DIV
7778 ><DIV
7779 CLASS="CHAPTER"
7780 ><HR><H1
7782 NAME="AEN1627"
7783 >Chapter 9. UNIX Permission Bits and WIndows NT Access Control Lists</A
7784 ></H1
7785 ><DIV
7786 CLASS="SECT1"
7787 ><H1
7788 CLASS="SECT1"
7790 NAME="AEN1638"
7791 >9.1. Viewing and changing UNIX permissions using the NT
7792 security dialogs</A
7793 ></H1
7795 >New in the Samba 2.0.4 release is the ability for Windows
7796 NT clients to use their native security settings dialog box to
7797 view and modify the underlying UNIX permissions.</P
7799 >Note that this ability is careful not to compromise
7800 the security of the UNIX host Samba is running on, and
7801 still obeys all the file permission rules that a Samba
7802 administrator can set.</P
7804 >In Samba 2.0.4 and above the default value of the
7805 parameter <A
7806 HREF="smb.conf.5.html#NTACLSUPPORT"
7807 TARGET="_top"
7808 ><TT
7809 CLASS="PARAMETER"
7811 > nt acl support</I
7812 ></TT
7813 ></A
7814 > has been changed from
7816 CLASS="CONSTANT"
7817 >false</TT
7818 > to <TT
7819 CLASS="CONSTANT"
7820 >true</TT
7821 >, so
7822 manipulation of permissions is turned on by default.</P
7823 ></DIV
7824 ><DIV
7825 CLASS="SECT1"
7826 ><HR><H1
7827 CLASS="SECT1"
7829 NAME="AEN1647"
7830 >9.2. How to view file security on a Samba share</A
7831 ></H1
7833 >From an NT 4.0 client, single-click with the right
7834 mouse button on any file or directory in a Samba mounted
7835 drive letter or UNC path. When the menu pops-up, click
7836 on the <EM
7837 >Properties</EM
7838 > entry at the bottom of
7839 the menu. This brings up the normal file properties dialog
7840 box, but with Samba 2.0.4 this will have a new tab along the top
7841 marked <EM
7842 >Security</EM
7843 >. Click on this tab and you
7844 will see three buttons, <EM
7845 >Permissions</EM
7848 >Auditing</EM
7849 >, and <EM
7850 >Ownership</EM
7852 The <EM
7853 >Auditing</EM
7854 > button will cause either
7855 an error message <SPAN
7856 CLASS="ERRORNAME"
7857 >A requested privilege is not held
7858 by the client</SPAN
7859 > to appear if the user is not the
7860 NT Administrator, or a dialog which is intended to allow an
7861 Administrator to add auditing requirements to a file if the
7862 user is logged on as the NT Administrator. This dialog is
7863 non-functional with a Samba share at this time, as the only
7864 useful button, the <B
7865 CLASS="COMMAND"
7866 >Add</B
7867 > button will not currently
7868 allow a list of users to be seen.</P
7869 ></DIV
7870 ><DIV
7871 CLASS="SECT1"
7872 ><HR><H1
7873 CLASS="SECT1"
7875 NAME="AEN1658"
7876 >9.3. Viewing file ownership</A
7877 ></H1
7879 >Clicking on the <B
7880 CLASS="COMMAND"
7881 >"Ownership"</B
7882 > button
7883 brings up a dialog box telling you who owns the given file. The
7884 owner name will be of the form :</P
7887 CLASS="COMMAND"
7888 >"SERVER\user (Long name)"</B
7889 ></P
7891 >Where <TT
7892 CLASS="REPLACEABLE"
7894 >SERVER</I
7895 ></TT
7896 > is the NetBIOS name of
7897 the Samba server, <TT
7898 CLASS="REPLACEABLE"
7900 >user</I
7901 ></TT
7902 > is the user name of
7903 the UNIX user who owns the file, and <TT
7904 CLASS="REPLACEABLE"
7906 >(Long name)</I
7907 ></TT
7909 is the discriptive string identifying the user (normally found in the
7910 GECOS field of the UNIX password database). Click on the <B
7911 CLASS="COMMAND"
7912 >Close
7914 > button to remove this dialog.</P
7916 >If the parameter <TT
7917 CLASS="PARAMETER"
7919 >nt acl support</I
7920 ></TT
7922 is set to <TT
7923 CLASS="CONSTANT"
7924 >false</TT
7925 > then the file owner will
7926 be shown as the NT user <B
7927 CLASS="COMMAND"
7928 >"Everyone"</B
7929 >.</P
7931 >The <B
7932 CLASS="COMMAND"
7933 >Take Ownership</B
7934 > button will not allow
7935 you to change the ownership of this file to yourself (clicking on
7936 it will display a dialog box complaining that the user you are
7937 currently logged onto the NT client cannot be found). The reason
7938 for this is that changing the ownership of a file is a privilaged
7939 operation in UNIX, available only to the <EM
7940 >root</EM
7942 user. As clicking on this button causes NT to attempt to change
7943 the ownership of a file to the current user logged into the NT
7944 client this will not work with Samba at this time.</P
7946 >There is an NT chown command that will work with Samba
7947 and allow a user with Administrator privillage connected
7948 to a Samba 2.0.4 server as root to change the ownership of
7949 files on both a local NTFS filesystem or remote mounted NTFS
7950 or Samba drive. This is available as part of the <EM
7951 >Seclib
7952 </EM
7953 > NT security library written by Jeremy Allison of
7954 the Samba Team, available from the main Samba ftp site.</P
7955 ></DIV
7956 ><DIV
7957 CLASS="SECT1"
7958 ><HR><H1
7959 CLASS="SECT1"
7961 NAME="AEN1678"
7962 >9.4. Viewing file or directory permissions</A
7963 ></H1
7965 >The third button is the <B
7966 CLASS="COMMAND"
7967 >"Permissions"</B
7969 button. Clicking on this brings up a dialog box that shows both
7970 the permissions and the UNIX owner of the file or directory.
7971 The owner is displayed in the form :</P
7974 CLASS="COMMAND"
7975 >"SERVER\user (Long name)"</B
7976 ></P
7978 >Where <TT
7979 CLASS="REPLACEABLE"
7981 >SERVER</I
7982 ></TT
7983 > is the NetBIOS name of
7984 the Samba server, <TT
7985 CLASS="REPLACEABLE"
7987 >user</I
7988 ></TT
7989 > is the user name of
7990 the UNIX user who owns the file, and <TT
7991 CLASS="REPLACEABLE"
7993 >(Long name)</I
7994 ></TT
7996 is the discriptive string identifying the user (normally found in the
7997 GECOS field of the UNIX password database).</P
7999 >If the parameter <TT
8000 CLASS="PARAMETER"
8002 >nt acl support</I
8003 ></TT
8005 is set to <TT
8006 CLASS="CONSTANT"
8007 >false</TT
8008 > then the file owner will
8009 be shown as the NT user <B
8010 CLASS="COMMAND"
8011 >"Everyone"</B
8012 > and the
8013 permissions will be shown as NT "Full Control".</P
8015 >The permissions field is displayed differently for files
8016 and directories, so I'll describe the way file permissions
8017 are displayed first.</P
8018 ><DIV
8019 CLASS="SECT2"
8020 ><HR><H2
8021 CLASS="SECT2"
8023 NAME="AEN1693"
8024 >9.4.1. File Permissions</A
8025 ></H2
8027 >The standard UNIX user/group/world triple and
8028 the correspinding "read", "write", "execute" permissions
8029 triples are mapped by Samba into a three element NT ACL
8030 with the 'r', 'w', and 'x' bits mapped into the corresponding
8031 NT permissions. The UNIX world permissions are mapped into
8032 the global NT group <B
8033 CLASS="COMMAND"
8034 >Everyone</B
8035 >, followed
8036 by the list of permissions allowed for UNIX world. The UNIX
8037 owner and group permissions are displayed as an NT
8039 CLASS="COMMAND"
8040 >user</B
8041 > icon and an NT <B
8042 CLASS="COMMAND"
8043 >local
8044 group</B
8045 > icon respectively followed by the list
8046 of permissions allowed for the UNIX user and group.</P
8048 >As many UNIX permission sets don't map into common
8049 NT names such as <B
8050 CLASS="COMMAND"
8051 >"read"</B
8052 >, <B
8053 CLASS="COMMAND"
8054 > "change"</B
8055 > or <B
8056 CLASS="COMMAND"
8057 >"full control"</B
8058 > then
8059 usually the permissions will be prefixed by the words <B
8060 CLASS="COMMAND"
8061 > "Special Access"</B
8062 > in the NT display list.</P
8064 >But what happens if the file has no permissions allowed
8065 for a particular UNIX user group or world component ? In order
8066 to allow "no permissions" to be seen and modified then Samba
8067 overloads the NT <B
8068 CLASS="COMMAND"
8069 >"Take Ownership"</B
8070 > ACL attribute
8071 (which has no meaning in UNIX) and reports a component with
8072 no permissions as having the NT <B
8073 CLASS="COMMAND"
8074 >"O"</B
8075 > bit set.
8076 This was chosen of course to make it look like a zero, meaning
8077 zero permissions. More details on the decision behind this will
8078 be given below.</P
8079 ></DIV
8080 ><DIV
8081 CLASS="SECT2"
8082 ><HR><H2
8083 CLASS="SECT2"
8085 NAME="AEN1707"
8086 >9.4.2. Directory Permissions</A
8087 ></H2
8089 >Directories on an NT NTFS file system have two
8090 different sets of permissions. The first set of permissions
8091 is the ACL set on the directory itself, this is usually displayed
8092 in the first set of parentheses in the normal <B
8093 CLASS="COMMAND"
8094 >"RW"</B
8096 NT style. This first set of permissions is created by Samba in
8097 exactly the same way as normal file permissions are, described
8098 above, and is displayed in the same way.</P
8100 >The second set of directory permissions has no real meaning
8101 in the UNIX permissions world and represents the <B
8102 CLASS="COMMAND"
8103 > "inherited"</B
8104 > permissions that any file created within
8105 this directory would inherit.</P
8107 >Samba synthesises these inherited permissions for NT by
8108 returning as an NT ACL the UNIX permission mode that a new file
8109 created by Samba on this share would receive.</P
8110 ></DIV
8111 ></DIV
8112 ><DIV
8113 CLASS="SECT1"
8114 ><HR><H1
8115 CLASS="SECT1"
8117 NAME="AEN1714"
8118 >9.5. Modifying file or directory permissions</A
8119 ></H1
8121 >Modifying file and directory permissions is as simple
8122 as changing the displayed permissions in the dialog box, and
8123 clicking the <B
8124 CLASS="COMMAND"
8125 >OK</B
8126 > button. However, there are
8127 limitations that a user needs to be aware of, and also interactions
8128 with the standard Samba permission masks and mapping of DOS
8129 attributes that need to also be taken into account.</P
8131 >If the parameter <TT
8132 CLASS="PARAMETER"
8134 >nt acl support</I
8135 ></TT
8137 is set to <TT
8138 CLASS="CONSTANT"
8139 >false</TT
8140 > then any attempt to set
8141 security permissions will fail with an <B
8142 CLASS="COMMAND"
8143 >"Access Denied"
8145 > message.</P
8147 >The first thing to note is that the <B
8148 CLASS="COMMAND"
8149 >"Add"</B
8151 button will not return a list of users in Samba 2.0.4 (it will give
8152 an error message of <B
8153 CLASS="COMMAND"
8154 >"The remote proceedure call failed
8155 and did not execute"</B
8156 >). This means that you can only
8157 manipulate the current user/group/world permissions listed in
8158 the dialog box. This actually works quite well as these are the
8159 only permissions that UNIX actually has.</P
8161 >If a permission triple (either user, group, or world)
8162 is removed from the list of permissions in the NT dialog box,
8163 then when the <B
8164 CLASS="COMMAND"
8165 >"OK"</B
8166 > button is pressed it will
8167 be applied as "no permissions" on the UNIX side. If you then
8168 view the permissions again the "no permissions" entry will appear
8169 as the NT <B
8170 CLASS="COMMAND"
8171 >"O"</B
8172 > flag, as described above. This
8173 allows you to add permissions back to a file or directory once
8174 you have removed them from a triple component.</P
8176 >As UNIX supports only the "r", "w" and "x" bits of
8177 an NT ACL then if other NT security attributes such as "Delete
8178 access" are selected then they will be ignored when applied on
8179 the Samba server.</P
8181 >When setting permissions on a directory the second
8182 set of permissions (in the second set of parentheses) is
8183 by default applied to all files within that directory. If this
8184 is not what you want you must uncheck the <B
8185 CLASS="COMMAND"
8186 >"Replace
8187 permissions on existing files"</B
8188 > checkbox in the NT
8189 dialog before clicking <B
8190 CLASS="COMMAND"
8191 >"OK"</B
8192 >.</P
8194 >If you wish to remove all permissions from a
8195 user/group/world component then you may either highlight the
8196 component and click the <B
8197 CLASS="COMMAND"
8198 >"Remove"</B
8199 > button,
8200 or set the component to only have the special <B
8201 CLASS="COMMAND"
8202 >"Take
8203 Ownership"</B
8204 > permission (dsplayed as <B
8205 CLASS="COMMAND"
8206 >"O"
8208 >) highlighted.</P
8209 ></DIV
8210 ><DIV
8211 CLASS="SECT1"
8212 ><HR><H1
8213 CLASS="SECT1"
8215 NAME="AEN1736"
8216 >9.6. Interaction with the standard Samba create mask
8217 parameters</A
8218 ></H1
8220 >Note that with Samba 2.0.5 there are four new parameters
8221 to control this interaction. These are :</P
8223 ><TT
8224 CLASS="PARAMETER"
8226 >security mask</I
8227 ></TT
8228 ></P
8230 ><TT
8231 CLASS="PARAMETER"
8233 >force security mode</I
8234 ></TT
8235 ></P
8237 ><TT
8238 CLASS="PARAMETER"
8240 >directory security mask</I
8241 ></TT
8242 ></P
8244 ><TT
8245 CLASS="PARAMETER"
8247 >force directory security mode</I
8248 ></TT
8249 ></P
8251 >Once a user clicks <B
8252 CLASS="COMMAND"
8253 >"OK"</B
8254 > to apply the
8255 permissions Samba maps the given permissions into a user/group/world
8256 r/w/x triple set, and then will check the changed permissions for a
8257 file against the bits set in the <A
8258 HREF="smb.conf.5.html#SECURITYMASK"
8259 TARGET="_top"
8262 CLASS="PARAMETER"
8264 >security mask</I
8265 ></TT
8266 ></A
8267 > parameter. Any bits that
8268 were changed that are not set to '1' in this parameter are left alone
8269 in the file permissions.</P
8271 >Essentially, zero bits in the <TT
8272 CLASS="PARAMETER"
8274 >security mask</I
8275 ></TT
8277 mask may be treated as a set of bits the user is <EM
8278 >not</EM
8280 allowed to change, and one bits are those the user is allowed to change.
8283 >If not set explicitly this parameter is set to the same value as
8284 the <A
8285 HREF="smb.conf.5.html#CREATEMASK"
8286 TARGET="_top"
8287 ><TT
8288 CLASS="PARAMETER"
8290 >create mask
8292 ></TT
8293 ></A
8294 > parameter to provide compatibility with Samba 2.0.4
8295 where this permission change facility was introduced. To allow a user to
8296 modify all the user/group/world permissions on a file, set this parameter
8297 to 0777.</P
8299 >Next Samba checks the changed permissions for a file against
8300 the bits set in the <A
8301 HREF="smb.conf.5.html#FORCESECURITYMODE"
8302 TARGET="_top"
8303 > <TT
8304 CLASS="PARAMETER"
8306 >force security mode</I
8307 ></TT
8308 ></A
8309 > parameter. Any bits
8310 that were changed that correspond to bits set to '1' in this parameter
8311 are forced to be set.</P
8313 >Essentially, bits set in the <TT
8314 CLASS="PARAMETER"
8316 >force security mode
8318 ></TT
8319 > parameter may be treated as a set of bits that, when
8320 modifying security on a file, the user has always set to be 'on'.</P
8322 >If not set explicitly this parameter is set to the same value
8323 as the <A
8324 HREF="smb.conf.5.html#FORCECREATEMODE"
8325 TARGET="_top"
8326 ><TT
8327 CLASS="PARAMETER"
8329 >force
8330 create mode</I
8331 ></TT
8332 ></A
8333 > parameter to provide compatibility
8334 with Samba 2.0.4 where the permission change facility was introduced.
8335 To allow a user to modify all the user/group/world permissions on a file,
8336 with no restrictions set this parameter to 000.</P
8338 >The <TT
8339 CLASS="PARAMETER"
8341 >security mask</I
8342 ></TT
8343 > and <TT
8344 CLASS="PARAMETER"
8346 >force
8347 security mode</I
8348 ></TT
8349 > parameters are applied to the change
8350 request in that order.</P
8352 >For a directory Samba will perform the same operations as
8353 described above for a file except using the parameter <TT
8354 CLASS="PARAMETER"
8356 > directory security mask</I
8357 ></TT
8358 > instead of <TT
8359 CLASS="PARAMETER"
8361 >security
8362 mask</I
8363 ></TT
8364 >, and <TT
8365 CLASS="PARAMETER"
8367 >force directory security mode
8369 ></TT
8370 > parameter instead of <TT
8371 CLASS="PARAMETER"
8373 >force security mode
8375 ></TT
8376 >.</P
8378 >The <TT
8379 CLASS="PARAMETER"
8381 >directory security mask</I
8382 ></TT
8383 > parameter
8384 by default is set to the same value as the <TT
8385 CLASS="PARAMETER"
8387 >directory mask
8389 ></TT
8390 > parameter and the <TT
8391 CLASS="PARAMETER"
8393 >force directory security
8394 mode</I
8395 ></TT
8396 > parameter by default is set to the same value as
8397 the <TT
8398 CLASS="PARAMETER"
8400 >force directory mode</I
8401 ></TT
8402 > parameter to provide
8403 compatibility with Samba 2.0.4 where the permission change facility
8404 was introduced.</P
8406 >In this way Samba enforces the permission restrictions that
8407 an administrator can set on a Samba share, whilst still allowing users
8408 to modify the permission bits within that restriction.</P
8410 >If you want to set up a share that allows users full control
8411 in modifying the permission bits on their files and directories and
8412 doesn't force any particular bits to be set 'on', then set the following
8413 parameters in the <A
8414 HREF="smb.conf.5.html"
8415 TARGET="_top"
8416 ><TT
8417 CLASS="FILENAME"
8418 >smb.conf(5)
8419 </TT
8420 ></A
8421 > file in that share specific section :</P
8423 ><TT
8424 CLASS="PARAMETER"
8426 >security mask = 0777</I
8427 ></TT
8428 ></P
8430 ><TT
8431 CLASS="PARAMETER"
8433 >force security mode = 0</I
8434 ></TT
8435 ></P
8437 ><TT
8438 CLASS="PARAMETER"
8440 >directory security mask = 0777</I
8441 ></TT
8442 ></P
8444 ><TT
8445 CLASS="PARAMETER"
8447 >force directory security mode = 0</I
8448 ></TT
8449 ></P
8451 >As described, in Samba 2.0.4 the parameters :</P
8453 ><TT
8454 CLASS="PARAMETER"
8456 >create mask</I
8457 ></TT
8458 ></P
8460 ><TT
8461 CLASS="PARAMETER"
8463 >force create mode</I
8464 ></TT
8465 ></P
8467 ><TT
8468 CLASS="PARAMETER"
8470 >directory mask</I
8471 ></TT
8472 ></P
8474 ><TT
8475 CLASS="PARAMETER"
8477 >force directory mode</I
8478 ></TT
8479 ></P
8481 >were used instead of the parameters discussed here.</P
8482 ></DIV
8483 ><DIV
8484 CLASS="SECT1"
8485 ><HR><H1
8486 CLASS="SECT1"
8488 NAME="AEN1800"
8489 >9.7. Interaction with the standard Samba file attribute
8490 mapping</A
8491 ></H1
8493 >Samba maps some of the DOS attribute bits (such as "read
8494 only") into the UNIX permissions of a file. This means there can
8495 be a conflict between the permission bits set via the security
8496 dialog and the permission bits set by the file attribute mapping.
8499 >One way this can show up is if a file has no UNIX read access
8500 for the owner it will show up as "read only" in the standard
8501 file attributes tabbed dialog. Unfortunately this dialog is
8502 the same one that contains the security info in another tab.</P
8504 >What this can mean is that if the owner changes the permissions
8505 to allow themselves read access using the security dialog, clicks
8507 CLASS="COMMAND"
8508 >"OK"</B
8509 > to get back to the standard attributes tab
8510 dialog, and then clicks <B
8511 CLASS="COMMAND"
8512 >"OK"</B
8513 > on that dialog, then
8514 NT will set the file permissions back to read-only (as that is what
8515 the attributes still say in the dialog). This means that after setting
8516 permissions and clicking <B
8517 CLASS="COMMAND"
8518 >"OK"</B
8519 > to get back to the
8520 attributes dialog you should always hit <B
8521 CLASS="COMMAND"
8522 >"Cancel"</B
8524 rather than <B
8525 CLASS="COMMAND"
8526 >"OK"</B
8527 > to ensure that your changes
8528 are not overridden.</P
8529 ></DIV
8530 ></DIV
8531 ><DIV
8532 CLASS="CHAPTER"
8533 ><HR><H1
8535 NAME="AEN1810"
8536 >Chapter 10. OS2 Client HOWTO</A
8537 ></H1
8538 ><DIV
8539 CLASS="SECT1"
8540 ><H1
8541 CLASS="SECT1"
8543 NAME="AEN1821"
8544 >10.1. FAQs</A
8545 ></H1
8546 ><DIV
8547 CLASS="SECT2"
8548 ><H2
8549 CLASS="SECT2"
8551 NAME="AEN1823"
8552 >10.1.1. How can I configure OS/2 Warp Connect or
8553 OS/2 Warp 4 as a client for Samba?</A
8554 ></H2
8556 >A more complete answer to this question can be
8557 found on <A
8558 HREF="http://carol.wins.uva.nl/~leeuw/samba/warp.html"
8559 TARGET="_top"
8560 > http://carol.wins.uva.nl/~leeuw/samba/warp.html</A
8561 >.</P
8563 >Basically, you need three components:</P
8565 ></P
8566 ><UL
8567 ><LI
8569 >The File and Print Client ('IBM Peer')
8571 ></LI
8572 ><LI
8574 >TCP/IP ('Internet support')
8576 ></LI
8577 ><LI
8579 >The "NetBIOS over TCP/IP" driver ('TCPBEUI')
8581 ></LI
8582 ></UL
8584 >Installing the first two together with the base operating
8585 system on a blank system is explained in the Warp manual. If Warp
8586 has already been installed, but you now want to install the
8587 networking support, use the "Selective Install for Networking"
8588 object in the "System Setup" folder.</P
8590 >Adding the "NetBIOS over TCP/IP" driver is not described
8591 in the manual and just barely in the online documentation. Start
8592 MPTS.EXE, click on OK, click on "Configure LAPS" and click
8593 on "IBM OS/2 NETBIOS OVER TCP/IP" in 'Protocols'. This line
8594 is then moved to 'Current Configuration'. Select that line,
8595 click on "Change number" and increase it from 0 to 1. Save this
8596 configuration.</P
8598 >If the Samba server(s) is not on your local subnet, you
8599 can optionally add IP names and addresses of these servers
8600 to the "Names List", or specify a WINS server ('NetBIOS
8601 Nameserver' in IBM and RFC terminology). For Warp Connect you
8602 may need to download an update for 'IBM Peer' to bring it on
8603 the same level as Warp 4. See the webpage mentioned above.</P
8604 ></DIV
8605 ><DIV
8606 CLASS="SECT2"
8607 ><HR><H2
8608 CLASS="SECT2"
8610 NAME="AEN1838"
8611 >10.1.2. How can I configure OS/2 Warp 3 (not Connect),
8612 OS/2 1.2, 1.3 or 2.x for Samba?</A
8613 ></H2
8615 >You can use the free Microsoft LAN Manager 2.2c Client
8616 for OS/2 from
8618 HREF="ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/"
8619 TARGET="_top"
8620 > ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/</A
8622 See <A
8623 HREF="http://carol.wins.uva.nl/~leeuw/lanman.html"
8624 TARGET="_top"
8625 > http://carol.wins.uva.nl/~leeuw/lanman.html</A
8626 > for
8627 more information on how to install and use this client. In
8628 a nutshell, edit the file \OS2VER in the root directory of
8629 the OS/2 boot partition and add the lines:</P
8631 ><TABLE
8632 BORDER="0"
8633 BGCOLOR="#E0E0E0"
8634 WIDTH="100%"
8635 ><TR
8636 ><TD
8637 ><PRE
8638 CLASS="PROGRAMLISTING"
8639 > 20=setup.exe
8640 20=netwksta.sys
8641 20=netvdd.sys
8642 </PRE
8643 ></TD
8644 ></TR
8645 ></TABLE
8646 ></P
8648 >before you install the client. Also, don't use the
8649 included NE2000 driver because it is buggy. Try the NE2000
8650 or NS2000 driver from
8652 HREF="ftp://ftp.cdrom.com/pub/os2/network/ndis/"
8653 TARGET="_top"
8654 > ftp://ftp.cdrom.com/pub/os2/network/ndis/</A
8655 > instead.
8657 ></DIV
8658 ><DIV
8659 CLASS="SECT2"
8660 ><HR><H2
8661 CLASS="SECT2"
8663 NAME="AEN1847"
8664 >10.1.3. Are there any other issues when OS/2 (any version)
8665 is used as a client?</A
8666 ></H2
8668 >When you do a NET VIEW or use the "File and Print
8669 Client Resource Browser", no Samba servers show up. This can
8670 be fixed by a patch from <A
8671 HREF="http://carol.wins.uva.nl/~leeuw/samba/fix.html"
8672 TARGET="_top"
8673 > http://carol.wins.uva.nl/~leeuw/samba/fix.html</A
8675 The patch will be included in a later version of Samba. It also
8676 fixes a couple of other problems, such as preserving long
8677 filenames when objects are dragged from the Workplace Shell
8678 to the Samba server. </P
8679 ></DIV
8680 ><DIV
8681 CLASS="SECT2"
8682 ><HR><H2
8683 CLASS="SECT2"
8685 NAME="AEN1851"
8686 >10.1.4. How do I get printer driver download working
8687 for OS/2 clients?</A
8688 ></H2
8690 >First, create a share called [PRINTDRV] that is
8691 world-readable. Copy your OS/2 driver files there. Note
8692 that the .EA_ files must still be separate, so you will need
8693 to use the original install files, and not copy an installed
8694 driver from an OS/2 system.</P
8696 >Install the NT driver first for that printer. Then,
8697 add to your smb.conf a paramater, "os2 driver map =
8699 CLASS="REPLACEABLE"
8701 >filename</I
8702 ></TT
8703 >". Then, in the file
8704 specified by <TT
8705 CLASS="REPLACEABLE"
8707 >filename</I
8708 ></TT
8709 >, map the
8710 name of the NT driver name to the OS/2 driver name as
8711 follows:</P
8713 >&#60;nt driver name&#62; = &#60;os2 driver
8714 name&#62;.&#60;device name&#62;, e.g.:
8715 HP LaserJet 5L = LASERJET.HP LaserJet 5L</P
8717 >You can have multiple drivers mapped in this file.</P
8719 >If you only specify the OS/2 driver name, and not the
8720 device name, the first attempt to download the driver will
8721 actually download the files, but the OS/2 client will tell
8722 you the driver is not available. On the second attempt, it
8723 will work. This is fixed simply by adding the device name
8724 to the mapping, after which it will work on the first attempt.
8726 ></DIV
8727 ></DIV
8728 ></DIV
8729 ><DIV
8730 CLASS="CHAPTER"
8731 ><HR><H1
8733 NAME="AEN1860"
8734 >Chapter 11. HOWTO Access Samba source code via CVS</A
8735 ></H1
8736 ><DIV
8737 CLASS="SECT1"
8738 ><H1
8739 CLASS="SECT1"
8741 NAME="AEN1867"
8742 >11.1. Introduction</A
8743 ></H1
8745 >Samba is developed in an open environnment. Developers use CVS
8746 (Concurrent Versioning System) to "checkin" (also known as
8747 "commit") new source code. Samba's various CVS branches can
8748 be accessed via anonymouns CVS using the instructions
8749 detailed in this chapter.</P
8751 >This document is a modified version of the instructions found at
8753 HREF="http://samba.org/samba/cvs.html"
8754 TARGET="_top"
8755 >http://samba.org/samba/cvs.html</A
8756 ></P
8757 ></DIV
8758 ><DIV
8759 CLASS="SECT1"
8760 ><HR><H1
8761 CLASS="SECT1"
8763 NAME="AEN1872"
8764 >11.2. CVS Access to samba.org</A
8765 ></H1
8767 >The machine samba.org runs a publicly accessible CVS
8768 repository for access to the source code of several packages,
8769 including samba, rsync and jitterbug. There are two main ways of
8770 accessing the CVS server on this host.</P
8771 ><DIV
8772 CLASS="SECT2"
8773 ><HR><H2
8774 CLASS="SECT2"
8776 NAME="AEN1875"
8777 >11.2.1. Access via CVSweb</A
8778 ></H2
8780 >You can access the source code via your
8781 favourite WWW browser. This allows you to access the contents of
8782 individual files in the repository and also to look at the revision
8783 history and commit logs of individual files. You can also ask for a diff
8784 listing between any two versions on the repository.</P
8786 >Use the URL : <A
8787 HREF="http://samba.org/cgi-bin/cvsweb"
8788 TARGET="_top"
8789 >http://samba.org/cgi-bin/cvsweb</A
8790 ></P
8791 ></DIV
8792 ><DIV
8793 CLASS="SECT2"
8794 ><HR><H2
8795 CLASS="SECT2"
8797 NAME="AEN1880"
8798 >11.2.2. Access via cvs</A
8799 ></H2
8801 >You can also access the source code via a
8802 normal cvs client. This gives you much more control over you can
8803 do with the repository and allows you to checkout whole source trees
8804 and keep them uptodate via normal cvs commands. This is the
8805 preferred method of access if you are a developer and not
8806 just a casual browser.</P
8808 >To download the latest cvs source code, point your
8809 browser at the URL : <A
8810 HREF="http://www.cyclic.com/"
8811 TARGET="_top"
8812 >http://www.cyclic.com/</A
8814 and click on the 'How to get cvs' link. CVS is free software under
8815 the GNU GPL (as is Samba). Note that there are several graphical CVS clients
8816 which provide a graphical interface to the sometimes mundane CVS commands.
8817 Links to theses clients are also available from http://www.cyclic.com.</P
8819 >To gain access via anonymous cvs use the following steps.
8820 For this example it is assumed that you want a copy of the
8821 samba source code. For the other source code repositories
8822 on this system just substitute the correct package name</P
8824 ></P
8825 ><OL
8826 TYPE="1"
8827 ><LI
8829 > Install a recent copy of cvs. All you really need is a
8830 copy of the cvs client binary.
8832 ></LI
8833 ><LI
8835 > Run the command
8838 > <B
8839 CLASS="COMMAND"
8840 >cvs -d :pserver:cvs@samba.org:/cvsroot login</B
8844 > When it asks you for a password type <TT
8845 CLASS="USERINPUT"
8847 >cvs</B
8848 ></TT
8851 ></LI
8852 ><LI
8854 > Run the command
8857 > <B
8858 CLASS="COMMAND"
8859 >cvs -d :pserver:cvs@samba.org:/cvsroot co samba</B
8863 > This will create a directory called samba containing the
8864 latest samba source code (i.e. the HEAD tagged cvs branch). This
8865 currently corresponds to the 3.0 development tree.
8868 > CVS branches other HEAD can be obtained by using the <TT
8869 CLASS="PARAMETER"
8871 >-r</I
8872 ></TT
8874 and defining a tag name. A list of branch tag names can be found on the
8875 "Development" page of the samba web site. A common request is to obtain the
8876 latest 2.2 release code. This could be done by using the following command.
8879 > <B
8880 CLASS="COMMAND"
8881 >cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_2_2 samba</B
8884 ></LI
8885 ><LI
8887 > Whenever you want to merge in the latest code changes use
8888 the following command from within the samba directory:
8891 > <B
8892 CLASS="COMMAND"
8893 >cvs update -d -P</B
8896 ></LI
8897 ></OL
8898 ></DIV
8899 ></DIV
8900 ></DIV
8901 ></DIV
8902 ></BODY
8903 ></HTML