syncing up with SAMBA_2_2
[Samba/gbeck.git] / docs / htmldocs / Samba-HOWTO-Collection.html
blobacfb1a7a3c172c8d534f18c6e4248d1b6fa5e3ee
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 >LanMan and NT Password Encryption in Samba 2.x</A
185 ></DT
186 ><DD
187 ><DL
188 ><DT
189 >2.1. <A
190 HREF="#AEN223"
191 >Introduction</A
192 ></DT
193 ><DT
194 >2.2. <A
195 HREF="#AEN227"
196 >How does it work?</A
197 ></DT
198 ><DT
199 >2.3. <A
200 HREF="#AEN238"
201 >Important Notes About Security</A
202 ></DT
203 ><DD
204 ><DL
205 ><DT
206 >2.3.1. <A
207 HREF="#AEN257"
208 >Advantages of SMB Encryption</A
209 ></DT
210 ><DT
211 >2.3.2. <A
212 HREF="#AEN264"
213 >Advantages of non-encrypted passwords</A
214 ></DT
215 ></DL
216 ></DD
217 ><DT
218 >2.4. <A
219 HREF="#AEN273"
221 NAME="SMBPASSWDFILEFORMAT"
222 ></A
223 >The smbpasswd file</A
224 ></DT
225 ><DT
226 >2.5. <A
227 HREF="#AEN325"
228 >The smbpasswd Command</A
229 ></DT
230 ><DT
231 >2.6. <A
232 HREF="#AEN364"
233 >Setting up Samba to support LanManager Encryption</A
234 ></DT
235 ></DL
236 ></DD
237 ><DT
238 >3. <A
239 HREF="#AEN379"
240 >Hosting a Microsoft Distributed File System tree on Samba</A
241 ></DT
242 ><DD
243 ><DL
244 ><DT
245 >3.1. <A
246 HREF="#AEN390"
247 >Instructions</A
248 ></DT
249 ><DD
250 ><DL
251 ><DT
252 >3.1.1. <A
253 HREF="#AEN425"
254 >Notes</A
255 ></DT
256 ></DL
257 ></DD
258 ></DL
259 ></DD
260 ><DT
261 >4. <A
262 HREF="#AEN434"
263 >Printing Support in Samba 2.2.x</A
264 ></DT
265 ><DD
266 ><DL
267 ><DT
268 >4.1. <A
269 HREF="#AEN445"
270 >Introduction</A
271 ></DT
272 ><DT
273 >4.2. <A
274 HREF="#AEN467"
275 >Configuration</A
276 ></DT
277 ><DD
278 ><DL
279 ><DT
280 >4.2.1. <A
281 HREF="#AEN478"
282 >Creating [print$]</A
283 ></DT
284 ><DT
285 >4.2.2. <A
286 HREF="#AEN513"
287 >Setting Drivers for Existing Printers</A
288 ></DT
289 ><DT
290 >4.2.3. <A
291 HREF="#AEN530"
292 >Support a large number of printers</A
293 ></DT
294 ><DT
295 >4.2.4. <A
296 HREF="#AEN541"
297 >Adding New Printers via the Windows NT APW</A
298 ></DT
299 ><DT
300 >4.2.5. <A
301 HREF="#AEN566"
302 >Samba and Printer Ports</A
303 ></DT
304 ></DL
305 ></DD
306 ><DT
307 >4.3. <A
308 HREF="#AEN574"
309 >The Imprints Toolset</A
310 ></DT
311 ><DD
312 ><DL
313 ><DT
314 >4.3.1. <A
315 HREF="#AEN578"
316 >What is Imprints?</A
317 ></DT
318 ><DT
319 >4.3.2. <A
320 HREF="#AEN588"
321 >Creating Printer Driver Packages</A
322 ></DT
323 ><DT
324 >4.3.3. <A
325 HREF="#AEN591"
326 >The Imprints server</A
327 ></DT
328 ><DT
329 >4.3.4. <A
330 HREF="#AEN595"
331 >The Installation Client</A
332 ></DT
333 ></DL
334 ></DD
335 ><DT
336 >4.4. <A
337 HREF="#AEN617"
339 NAME="MIGRATION"
340 ></A
341 >Migration to from Samba 2.0.x to 2.2.x</A
342 ></DT
343 ></DL
344 ></DD
345 ><DT
346 >5. <A
347 HREF="#AEN661"
348 >security = domain in Samba 2.x</A
349 ></DT
350 ><DD
351 ><DL
352 ><DT
353 >5.1. <A
354 HREF="#AEN679"
355 >Joining an NT Domain with Samba 2.2</A
356 ></DT
357 ><DT
358 >5.2. <A
359 HREF="#AEN743"
360 >Samba and Windows 2000 Domains</A
361 ></DT
362 ><DT
363 >5.3. <A
364 HREF="#AEN748"
365 >Why is this better than security = server?</A
366 ></DT
367 ></DL
368 ></DD
369 ><DT
370 >6. <A
371 HREF="#AEN764"
372 >How to Configure Samba 2.2 as a Primary Domain Controller</A
373 ></DT
374 ><DD
375 ><DL
376 ><DT
377 >6.1. <A
378 HREF="#AEN781"
379 >Prerequisite Reading</A
380 ></DT
381 ><DT
382 >6.2. <A
383 HREF="#AEN787"
384 >Background</A
385 ></DT
386 ><DT
387 >6.3. <A
388 HREF="#AEN827"
389 >Configuring the Samba Domain Controller</A
390 ></DT
391 ><DT
392 >6.4. <A
393 HREF="#AEN870"
394 >Creating Machine Trust Accounts and Joining Clients
395 to the Domain</A
396 ></DT
397 ><DD
398 ><DL
399 ><DT
400 >6.4.1. <A
401 HREF="#AEN884"
402 >Manually creating machine trust accounts</A
403 ></DT
404 ><DT
405 >6.4.2. <A
406 HREF="#AEN912"
407 >Creating machine trust accounts "on the fly"</A
408 ></DT
409 ></DL
410 ></DD
411 ><DT
412 >6.5. <A
413 HREF="#AEN923"
414 >Common Problems and Errors</A
415 ></DT
416 ><DT
417 >6.6. <A
418 HREF="#AEN971"
419 >System Policies and Profiles</A
420 ></DT
421 ><DT
422 >6.7. <A
423 HREF="#AEN1015"
424 >What other help can I get ?</A
425 ></DT
426 ><DT
427 >6.8. <A
428 HREF="#AEN1129"
429 >Domain Control for Windows 9x/ME</A
430 ></DT
431 ><DD
432 ><DL
433 ><DT
434 >6.8.1. <A
435 HREF="#AEN1159"
436 >Configuration Instructions: Network Logons</A
437 ></DT
438 ><DT
439 >6.8.2. <A
440 HREF="#AEN1193"
441 >Configuration Instructions: Setting up Roaming User Profiles</A
442 ></DT
443 ><DD
444 ><DL
445 ><DT
446 >6.8.2.1. <A
447 HREF="#AEN1201"
448 >Windows NT Configuration</A
449 ></DT
450 ><DT
451 >6.8.2.2. <A
452 HREF="#AEN1209"
453 >Windows 9X Configuration</A
454 ></DT
455 ><DT
456 >6.8.2.3. <A
457 HREF="#AEN1217"
458 >Win9X and WinNT Configuration</A
459 ></DT
460 ><DT
461 >6.8.2.4. <A
462 HREF="#AEN1224"
463 >Windows 9X Profile Setup</A
464 ></DT
465 ><DT
466 >6.8.2.5. <A
467 HREF="#AEN1260"
468 >Windows NT Workstation 4.0</A
469 ></DT
470 ><DT
471 >6.8.2.6. <A
472 HREF="#AEN1273"
473 >Windows NT Server</A
474 ></DT
475 ><DT
476 >6.8.2.7. <A
477 HREF="#AEN1276"
478 >Sharing Profiles between W95 and NT Workstation 4.0</A
479 ></DT
480 ></DL
481 ></DD
482 ></DL
483 ></DD
484 ><DT
485 >6.9. <A
486 HREF="#AEN1286"
487 >DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
488 ></DT
489 ></DL
490 ></DD
491 ><DT
492 >7. <A
493 HREF="#AEN1311"
494 >Unifed Logons between Windows NT and UNIX using Winbind</A
495 ></DT
496 ><DD
497 ><DL
498 ><DT
499 >7.1. <A
500 HREF="#AEN1329"
501 >Abstract</A
502 ></DT
503 ><DT
504 >7.2. <A
505 HREF="#AEN1333"
506 >Introduction</A
507 ></DT
508 ><DT
509 >7.3. <A
510 HREF="#AEN1346"
511 >What Winbind Provides</A
512 ></DT
513 ><DD
514 ><DL
515 ><DT
516 >7.3.1. <A
517 HREF="#AEN1353"
518 >Target Uses</A
519 ></DT
520 ></DL
521 ></DD
522 ><DT
523 >7.4. <A
524 HREF="#AEN1357"
525 >How Winbind Works</A
526 ></DT
527 ><DD
528 ><DL
529 ><DT
530 >7.4.1. <A
531 HREF="#AEN1362"
532 >Microsoft Remote Procedure Calls</A
533 ></DT
534 ><DT
535 >7.4.2. <A
536 HREF="#AEN1366"
537 >Name Service Switch</A
538 ></DT
539 ><DT
540 >7.4.3. <A
541 HREF="#AEN1382"
542 >Pluggable Authentication Modules</A
543 ></DT
544 ><DT
545 >7.4.4. <A
546 HREF="#AEN1390"
547 >User and Group ID Allocation</A
548 ></DT
549 ><DT
550 >7.4.5. <A
551 HREF="#AEN1394"
552 >Result Caching</A
553 ></DT
554 ></DL
555 ></DD
556 ><DT
557 >7.5. <A
558 HREF="#AEN1397"
559 >Installation and Configuration</A
560 ></DT
561 ><DT
562 >7.6. <A
563 HREF="#AEN1403"
564 >Limitations</A
565 ></DT
566 ><DT
567 >7.7. <A
568 HREF="#AEN1415"
569 >Conclusion</A
570 ></DT
571 ></DL
572 ></DD
573 ><DT
574 >8. <A
575 HREF="#AEN1418"
576 >UNIX Permission Bits and WIndows NT Access Control Lists</A
577 ></DT
578 ><DD
579 ><DL
580 ><DT
581 >8.1. <A
582 HREF="#AEN1429"
583 >Viewing and changing UNIX permissions using the NT
584 security dialogs</A
585 ></DT
586 ><DT
587 >8.2. <A
588 HREF="#AEN1438"
589 >How to view file security on a Samba share</A
590 ></DT
591 ><DT
592 >8.3. <A
593 HREF="#AEN1449"
594 >Viewing file ownership</A
595 ></DT
596 ><DT
597 >8.4. <A
598 HREF="#AEN1469"
599 >Viewing file or directory permissions</A
600 ></DT
601 ><DD
602 ><DL
603 ><DT
604 >8.4.1. <A
605 HREF="#AEN1484"
606 >File Permissions</A
607 ></DT
608 ><DT
609 >8.4.2. <A
610 HREF="#AEN1498"
611 >Directory Permissions</A
612 ></DT
613 ></DL
614 ></DD
615 ><DT
616 >8.5. <A
617 HREF="#AEN1505"
618 >Modifying file or directory permissions</A
619 ></DT
620 ><DT
621 >8.6. <A
622 HREF="#AEN1527"
623 >Interaction with the standard Samba create mask
624 parameters</A
625 ></DT
626 ><DT
627 >8.7. <A
628 HREF="#AEN1591"
629 >Interaction with the standard Samba file attribute
630 mapping</A
631 ></DT
632 ></DL
633 ></DD
634 ><DT
635 >9. <A
636 HREF="#AEN1601"
637 >OS2 Client HOWTO</A
638 ></DT
639 ><DD
640 ><DL
641 ><DT
642 >9.1. <A
643 HREF="#AEN1612"
644 >FAQs</A
645 ></DT
646 ><DD
647 ><DL
648 ><DT
649 >9.1.1. <A
650 HREF="#AEN1614"
651 >How can I configure OS/2 Warp Connect or
652 OS/2 Warp 4 as a client for Samba?</A
653 ></DT
654 ><DT
655 >9.1.2. <A
656 HREF="#AEN1629"
657 >How can I configure OS/2 Warp 3 (not Connect),
658 OS/2 1.2, 1.3 or 2.x for Samba?</A
659 ></DT
660 ><DT
661 >9.1.3. <A
662 HREF="#AEN1638"
663 >Are there any other issues when OS/2 (any version)
664 is used as a client?</A
665 ></DT
666 ><DT
667 >9.1.4. <A
668 HREF="#AEN1642"
669 >How do I get printer driver download working
670 for OS/2 clients?</A
671 ></DT
672 ></DL
673 ></DD
674 ></DL
675 ></DD
676 ><DT
677 >10. <A
678 HREF="#AEN1651"
679 >HOWTO Access Samba source code via CVS</A
680 ></DT
681 ><DD
682 ><DL
683 ><DT
684 >10.1. <A
685 HREF="#AEN1658"
686 >Introduction</A
687 ></DT
688 ><DT
689 >10.2. <A
690 HREF="#AEN1663"
691 >CVS Access to samba.org</A
692 ></DT
693 ><DD
694 ><DL
695 ><DT
696 >10.2.1. <A
697 HREF="#AEN1666"
698 >Access via CVSweb</A
699 ></DT
700 ><DT
701 >10.2.2. <A
702 HREF="#AEN1671"
703 >Access via cvs</A
704 ></DT
705 ></DL
706 ></DD
707 ></DL
708 ></DD
709 ></DL
710 ></DIV
711 ><DIV
712 CLASS="CHAPTER"
713 ><HR><H1
715 NAME="AEN15"
716 >Chapter 1. How to Install and Test SAMBA</A
717 ></H1
718 ><DIV
719 CLASS="SECT1"
720 ><H1
721 CLASS="SECT1"
723 NAME="AEN17"
724 >1.1. Step 0: Read the man pages</A
725 ></H1
727 >The man pages distributed with SAMBA contain
728 lots of useful info that will help to get you started.
729 If you don't know how to read man pages then try
730 something like:</P
732 ><TT
733 CLASS="PROMPT"
734 >$ </TT
735 ><TT
736 CLASS="USERINPUT"
738 >nroff -man smbd.8 | more
740 ></TT
741 ></P
743 >Other sources of information are pointed to
744 by the Samba web site,<A
745 HREF="http://www.samba.org/"
746 TARGET="_top"
747 > http://www.samba.org</A
748 ></P
749 ></DIV
750 ><DIV
751 CLASS="SECT1"
752 ><HR><H1
753 CLASS="SECT1"
755 NAME="AEN25"
756 >1.2. Step 1: Building the Binaries</A
757 ></H1
759 >To do this, first run the program <B
760 CLASS="COMMAND"
761 >./configure
763 > in the source directory. This should automatically
764 configure Samba for your operating system. If you have unusual
765 needs then you may wish to run</P
767 ><TT
768 CLASS="PROMPT"
769 >root# </TT
770 ><TT
771 CLASS="USERINPUT"
773 >./configure --help
775 ></TT
776 ></P
778 >first to see what special options you can enable.
779 Then exectuting</P
781 ><TT
782 CLASS="PROMPT"
783 >root# </TT
784 ><TT
785 CLASS="USERINPUT"
787 >make</B
788 ></TT
789 ></P
791 >will create the binaries. Once it's successfully
792 compiled you can use </P
794 ><TT
795 CLASS="PROMPT"
796 >root# </TT
797 ><TT
798 CLASS="USERINPUT"
800 >make install</B
801 ></TT
802 ></P
804 >to install the binaries and manual pages. You can
805 separately install the binaries and/or man pages using</P
807 ><TT
808 CLASS="PROMPT"
809 >root# </TT
810 ><TT
811 CLASS="USERINPUT"
813 >make installbin
815 ></TT
816 ></P
818 >and</P
820 ><TT
821 CLASS="PROMPT"
822 >root# </TT
823 ><TT
824 CLASS="USERINPUT"
826 >make installman
828 ></TT
829 ></P
831 >Note that if you are upgrading for a previous version
832 of Samba you might like to know that the old versions of
833 the binaries will be renamed with a ".old" extension. You
834 can go back to the previous version with</P
836 ><TT
837 CLASS="PROMPT"
838 >root# </TT
839 ><TT
840 CLASS="USERINPUT"
842 >make revert
844 ></TT
845 ></P
847 >if you find this version a disaster!</P
848 ></DIV
849 ><DIV
850 CLASS="SECT1"
851 ><HR><H1
852 CLASS="SECT1"
854 NAME="AEN53"
855 >1.3. Step 2: The all important step</A
856 ></H1
858 >At this stage you must fetch yourself a
859 coffee or other drink you find stimulating. Getting the rest
860 of the install right can sometimes be tricky, so you will
861 probably need it.</P
863 >If you have installed samba before then you can skip
864 this step.</P
865 ></DIV
866 ><DIV
867 CLASS="SECT1"
868 ><HR><H1
869 CLASS="SECT1"
871 NAME="AEN57"
872 >1.4. Step 3: Create the smb configuration file.</A
873 ></H1
875 >There are sample configuration files in the examples
876 subdirectory in the distribution. I suggest you read them
877 carefully so you can see how the options go together in
878 practice. See the man page for all the options.</P
880 >The simplest useful configuration file would be
881 something like this:</P
883 ><TABLE
884 BORDER="0"
885 BGCOLOR="#E0E0E0"
886 WIDTH="100%"
887 ><TR
888 ><TD
889 ><PRE
890 CLASS="PROGRAMLISTING"
891 > [global]
892 workgroup = MYGROUP
894 [homes]
895 guest ok = no
896 read only = no
897 </PRE
898 ></TD
899 ></TR
900 ></TABLE
901 ></P
903 >which would allow connections by anyone with an
904 account on the server, using either their login name or
905 "homes" as the service name. (Note that I also set the
906 workgroup that Samba is part of. See BROWSING.txt for defails)</P
908 >Note that <B
909 CLASS="COMMAND"
910 >make install</B
911 > will not install
912 a <TT
913 CLASS="FILENAME"
914 >smb.conf</TT
915 > file. You need to create it
916 yourself. </P
918 >Make sure you put the smb.conf file in the same place
919 you specified in the<TT
920 CLASS="FILENAME"
921 >Makefile</TT
922 > (the default is to
923 look for it in <TT
924 CLASS="FILENAME"
925 >/usr/local/samba/lib/</TT
926 >).</P
928 >For more information about security settings for the
929 [homes] share please refer to the document UNIX_SECURITY.txt.</P
930 ></DIV
931 ><DIV
932 CLASS="SECT1"
933 ><HR><H1
934 CLASS="SECT1"
936 NAME="AEN71"
937 >1.5. Step 4: Test your config file with
939 CLASS="COMMAND"
940 >testparm</B
941 ></A
942 ></H1
944 >It's important that you test the validity of your
946 CLASS="FILENAME"
947 >smb.conf</TT
948 > file using the testparm program.
949 If testparm runs OK then it will list the loaded services. If
950 not it will give an error message.</P
952 >Make sure it runs OK and that the services look
953 resonable before proceeding. </P
954 ></DIV
955 ><DIV
956 CLASS="SECT1"
957 ><HR><H1
958 CLASS="SECT1"
960 NAME="AEN77"
961 >1.6. Step 5: Starting the smbd and nmbd</A
962 ></H1
964 >You must choose to start smbd and nmbd either
965 as daemons or from <B
966 CLASS="COMMAND"
967 >inetd</B
968 >. Don't try
969 to do both! Either you can put them in <TT
970 CLASS="FILENAME"
971 > inetd.conf</TT
972 > and have them started on demand
973 by <B
974 CLASS="COMMAND"
975 >inetd</B
976 >, or you can start them as
977 daemons either from the command line or in <TT
978 CLASS="FILENAME"
979 > /etc/rc.local</TT
980 >. See the man pages for details
981 on the command line options. Take particular care to read
982 the bit about what user you need to be in order to start
983 Samba. In many cases you must be root.</P
985 >The main advantage of starting <B
986 CLASS="COMMAND"
987 >smbd</B
989 and <B
990 CLASS="COMMAND"
991 >nmbd</B
992 > as a daemon is that they will
993 respond slightly more quickly to an initial connection
994 request. This is, however, unlikely to be a problem.</P
995 ><DIV
996 CLASS="SECT2"
997 ><HR><H2
998 CLASS="SECT2"
1000 NAME="AEN87"
1001 >1.6.1. Step 5a: Starting from inetd.conf</A
1002 ></H2
1004 >NOTE; The following will be different if
1005 you use NIS or NIS+ to distributed services maps.</P
1007 >Look at your <TT
1008 CLASS="FILENAME"
1009 >/etc/services</TT
1011 What is defined at port 139/tcp. If nothing is defined
1012 then add a line like this:</P
1014 ><TT
1015 CLASS="USERINPUT"
1017 >netbios-ssn 139/tcp</B
1018 ></TT
1019 ></P
1021 >similarly for 137/udp you should have an entry like:</P
1023 ><TT
1024 CLASS="USERINPUT"
1026 >netbios-ns 137/udp</B
1027 ></TT
1028 ></P
1030 >Next edit your <TT
1031 CLASS="FILENAME"
1032 >/etc/inetd.conf</TT
1034 and add two lines something like this:</P
1036 ><TABLE
1037 BORDER="0"
1038 BGCOLOR="#E0E0E0"
1039 WIDTH="100%"
1040 ><TR
1041 ><TD
1042 ><PRE
1043 CLASS="PROGRAMLISTING"
1044 > netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
1045 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
1046 </PRE
1047 ></TD
1048 ></TR
1049 ></TABLE
1050 ></P
1052 >The exact syntax of <TT
1053 CLASS="FILENAME"
1054 >/etc/inetd.conf</TT
1056 varies between unixes. Look at the other entries in inetd.conf
1057 for a guide.</P
1059 >NOTE: Some unixes already have entries like netbios_ns
1060 (note the underscore) in <TT
1061 CLASS="FILENAME"
1062 >/etc/services</TT
1064 You must either edit <TT
1065 CLASS="FILENAME"
1066 >/etc/services</TT
1067 > or
1069 CLASS="FILENAME"
1070 >/etc/inetd.conf</TT
1071 > to make them consistant.</P
1073 >NOTE: On many systems you may need to use the
1074 "interfaces" option in smb.conf to specify the IP address
1075 and netmask of your interfaces. Run <B
1076 CLASS="COMMAND"
1077 >ifconfig</B
1079 as root if you don't know what the broadcast is for your
1080 net. <B
1081 CLASS="COMMAND"
1082 >nmbd</B
1083 > tries to determine it at run
1084 time, but fails on somunixes. See the section on "testing nmbd"
1085 for a method of finding if you need to do this.</P
1087 >!!!WARNING!!! Many unixes only accept around 5
1088 parameters on the command line in <TT
1089 CLASS="FILENAME"
1090 >inetd.conf</TT
1092 This means you shouldn't use spaces between the options and
1093 arguments, or you should use a script, and start the script
1094 from <B
1095 CLASS="COMMAND"
1096 >inetd</B
1097 >.</P
1099 >Restart <B
1100 CLASS="COMMAND"
1101 >inetd</B
1102 >, perhaps just send
1103 it a HUP. If you have installed an earlier version of <B
1104 CLASS="COMMAND"
1105 > nmbd</B
1106 > then you may need to kill nmbd as well.</P
1107 ></DIV
1108 ><DIV
1109 CLASS="SECT2"
1110 ><HR><H2
1111 CLASS="SECT2"
1113 NAME="AEN116"
1114 >1.6.2. Step 5b. Alternative: starting it as a daemon</A
1115 ></H2
1117 >To start the server as a daemon you should create
1118 a script something like this one, perhaps calling
1119 it <TT
1120 CLASS="FILENAME"
1121 >startsmb</TT
1122 >.</P
1124 ><TABLE
1125 BORDER="0"
1126 BGCOLOR="#E0E0E0"
1127 WIDTH="100%"
1128 ><TR
1129 ><TD
1130 ><PRE
1131 CLASS="PROGRAMLISTING"
1132 > #!/bin/sh
1133 /usr/local/samba/bin/smbd -D
1134 /usr/local/samba/bin/nmbd -D
1135 </PRE
1136 ></TD
1137 ></TR
1138 ></TABLE
1139 ></P
1141 >then make it executable with <B
1142 CLASS="COMMAND"
1143 >chmod
1144 +x startsmb</B
1145 ></P
1147 >You can then run <B
1148 CLASS="COMMAND"
1149 >startsmb</B
1150 > by
1151 hand or execute it from <TT
1152 CLASS="FILENAME"
1153 >/etc/rc.local</TT
1157 >To kill it send a kill signal to the processes
1159 CLASS="COMMAND"
1160 >nmbd</B
1161 > and <B
1162 CLASS="COMMAND"
1163 >smbd</B
1164 >.</P
1166 >NOTE: If you use the SVR4 style init system then
1167 you may like to look at the <TT
1168 CLASS="FILENAME"
1169 >examples/svr4-startup</TT
1171 script to make Samba fit into that system.</P
1172 ></DIV
1173 ></DIV
1174 ><DIV
1175 CLASS="SECT1"
1176 ><HR><H1
1177 CLASS="SECT1"
1179 NAME="AEN132"
1180 >1.7. Step 6: Try listing the shares available on your
1181 server</A
1182 ></H1
1184 ><TT
1185 CLASS="PROMPT"
1186 >$ </TT
1187 ><TT
1188 CLASS="USERINPUT"
1190 >smbclient -L
1192 CLASS="REPLACEABLE"
1194 >yourhostname</I
1195 ></TT
1196 ></B
1197 ></TT
1198 ></P
1200 >Your should get back a list of shares available on
1201 your server. If you don't then something is incorrectly setup.
1202 Note that this method can also be used to see what shares
1203 are available on other LanManager clients (such as WfWg).</P
1205 >If you choose user level security then you may find
1206 that Samba requests a password before it will list the shares.
1207 See the <B
1208 CLASS="COMMAND"
1209 >smbclient</B
1210 > man page for details. (you
1211 can force it to list the shares without a password by
1212 adding the option -U% to the command line. This will not work
1213 with non-Samba servers)</P
1214 ></DIV
1215 ><DIV
1216 CLASS="SECT1"
1217 ><HR><H1
1218 CLASS="SECT1"
1220 NAME="AEN141"
1221 >1.8. Step 7: Try connecting with the unix client</A
1222 ></H1
1224 ><TT
1225 CLASS="PROMPT"
1226 >$ </TT
1227 ><TT
1228 CLASS="USERINPUT"
1230 >smbclient <TT
1231 CLASS="REPLACEABLE"
1233 > //yourhostname/aservice</I
1234 ></TT
1235 ></B
1236 ></TT
1237 ></P
1239 >Typically the <TT
1240 CLASS="REPLACEABLE"
1242 >yourhostname</I
1243 ></TT
1245 would be the name of the host where you installed <B
1246 CLASS="COMMAND"
1247 > smbd</B
1248 >. The <TT
1249 CLASS="REPLACEABLE"
1251 >aservice</I
1252 ></TT
1253 > is
1254 any service you have defined in the <TT
1255 CLASS="FILENAME"
1256 >smb.conf</TT
1258 file. Try your user name if you just have a [homes] section
1259 in <TT
1260 CLASS="FILENAME"
1261 >smb.conf</TT
1262 >.</P
1264 >For example if your unix host is bambi and your login
1265 name is fred you would type:</P
1267 ><TT
1268 CLASS="PROMPT"
1269 >$ </TT
1270 ><TT
1271 CLASS="USERINPUT"
1273 >smbclient //bambi/fred
1275 ></TT
1276 ></P
1277 ></DIV
1278 ><DIV
1279 CLASS="SECT1"
1280 ><HR><H1
1281 CLASS="SECT1"
1283 NAME="AEN157"
1284 >1.9. Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT,
1285 Win2k, OS/2, etc... client</A
1286 ></H1
1288 >Try mounting disks. eg:</P
1290 ><TT
1291 CLASS="PROMPT"
1292 >C:\WINDOWS\&#62; </TT
1293 ><TT
1294 CLASS="USERINPUT"
1296 >net use d: \\servername\service
1298 ></TT
1299 ></P
1301 >Try printing. eg:</P
1303 ><TT
1304 CLASS="PROMPT"
1305 >C:\WINDOWS\&#62; </TT
1306 ><TT
1307 CLASS="USERINPUT"
1309 >net use lpt1:
1310 \\servername\spoolservice</B
1311 ></TT
1312 ></P
1314 ><TT
1315 CLASS="PROMPT"
1316 >C:\WINDOWS\&#62; </TT
1317 ><TT
1318 CLASS="USERINPUT"
1320 >print filename
1322 ></TT
1323 ></P
1325 >Celebrate, or send me a bug report!</P
1326 ></DIV
1327 ><DIV
1328 CLASS="SECT1"
1329 ><HR><H1
1330 CLASS="SECT1"
1332 NAME="AEN171"
1333 >1.10. What If Things Don't Work?</A
1334 ></H1
1336 >If nothing works and you start to think "who wrote
1337 this pile of trash" then I suggest you do step 2 again (and
1338 again) till you calm down.</P
1340 >Then you might read the file DIAGNOSIS.txt and the
1341 FAQ. If you are still stuck then try the mailing list or
1342 newsgroup (look in the README for details). Samba has been
1343 successfully installed at thousands of sites worldwide, so maybe
1344 someone else has hit your problem and has overcome it. You could
1345 also use the WWW site to scan back issues of the samba-digest.</P
1347 >When you fix the problem PLEASE send me some updates to the
1348 documentation (or source code) so that the next person will find it
1349 easier. </P
1350 ><DIV
1351 CLASS="SECT2"
1352 ><HR><H2
1353 CLASS="SECT2"
1355 NAME="AEN176"
1356 >1.10.1. Diagnosing Problems</A
1357 ></H2
1359 >If you have instalation problems then go to
1361 CLASS="FILENAME"
1362 >DIAGNOSIS.txt</TT
1363 > to try to find the
1364 problem.</P
1365 ></DIV
1366 ><DIV
1367 CLASS="SECT2"
1368 ><HR><H2
1369 CLASS="SECT2"
1371 NAME="AEN180"
1372 >1.10.2. Scope IDs</A
1373 ></H2
1375 >By default Samba uses a blank scope ID. This means
1376 all your windows boxes must also have a blank scope ID.
1377 If you really want to use a non-blank scope ID then you will
1378 need to use the -i &#60;scope&#62; option to nmbd, smbd, and
1379 smbclient. All your PCs will need to have the same setting for
1380 this to work. I do not recommend scope IDs.</P
1381 ></DIV
1382 ><DIV
1383 CLASS="SECT2"
1384 ><HR><H2
1385 CLASS="SECT2"
1387 NAME="AEN183"
1388 >1.10.3. Choosing the Protocol Level</A
1389 ></H2
1391 >The SMB protocol has many dialects. Currently
1392 Samba supports 5, called CORE, COREPLUS, LANMAN1,
1393 LANMAN2 and NT1.</P
1395 >You can choose what maximum protocol to support
1396 in the <TT
1397 CLASS="FILENAME"
1398 >smb.conf</TT
1399 > file. The default is
1400 NT1 and that is the best for the vast majority of sites.</P
1402 >In older versions of Samba you may have found it
1403 necessary to use COREPLUS. The limitations that led to
1404 this have mostly been fixed. It is now less likely that you
1405 will want to use less than LANMAN1. The only remaining advantage
1406 of COREPLUS is that for some obscure reason WfWg preserves
1407 the case of passwords in this protocol, whereas under LANMAN1,
1408 LANMAN2 or NT1 it uppercases all passwords before sending them,
1409 forcing you to use the "password level=" option in some cases.</P
1411 >The main advantage of LANMAN2 and NT1 is support for
1412 long filenames with some clients (eg: smbclient, Windows NT
1413 or Win95). </P
1415 >See the smb.conf(5) manual page for more details.</P
1417 >Note: To support print queue reporting you may find
1418 that you have to use TCP/IP as the default protocol under
1419 WfWg. For some reason if you leave Netbeui as the default
1420 it may break the print queue reporting on some systems.
1421 It is presumably a WfWg bug.</P
1422 ></DIV
1423 ><DIV
1424 CLASS="SECT2"
1425 ><HR><H2
1426 CLASS="SECT2"
1428 NAME="AEN192"
1429 >1.10.4. Printing from UNIX to a Client PC</A
1430 ></H2
1432 >To use a printer that is available via a smb-based
1433 server from a unix host you will need to compile the
1434 smbclient program. You then need to install the script
1435 "smbprint". Read the instruction in smbprint for more details.
1438 >There is also a SYSV style script that does much
1439 the same thing called smbprint.sysv. It contains instructions.</P
1440 ></DIV
1441 ><DIV
1442 CLASS="SECT2"
1443 ><HR><H2
1444 CLASS="SECT2"
1446 NAME="AEN196"
1447 >1.10.5. Locking</A
1448 ></H2
1450 >One area which sometimes causes trouble is locking.</P
1452 >There are two types of locking which need to be
1453 performed by a SMB server. The first is "record locking"
1454 which allows a client to lock a range of bytes in a open file.
1455 The second is the "deny modes" that are specified when a file
1456 is open.</P
1458 >Samba supports "record locking" using the fcntl() unix system
1459 call. This is often implemented using rpc calls to a rpc.lockd process
1460 running on the system that owns the filesystem. Unfortunately many
1461 rpc.lockd implementations are very buggy, particularly when made to
1462 talk to versions from other vendors. It is not uncommon for the
1463 rpc.lockd to crash.</P
1465 >There is also a problem translating the 32 bit lock
1466 requests generated by PC clients to 31 bit requests supported
1467 by most unixes. Unfortunately many PC applications (typically
1468 OLE2 applications) use byte ranges with the top bit set
1469 as semaphore sets. Samba attempts translation to support
1470 these types of applications, and the translation has proved
1471 to be quite successful.</P
1473 >Strictly a SMB server should check for locks before
1474 every read and write call on a file. Unfortunately with the
1475 way fcntl() works this can be slow and may overstress the
1476 rpc.lockd. It is also almost always unnecessary as clients
1477 are supposed to independently make locking calls before reads
1478 and writes anyway if locking is important to them. By default
1479 Samba only makes locking calls when explicitly asked
1480 to by a client, but if you set "strict locking = yes" then it will
1481 make lock checking calls on every read and write. </P
1483 >You can also disable by range locking completely
1484 using "locking = no". This is useful for those shares that
1485 don't support locking or don't need it (such as cdroms). In
1486 this case Samba fakes the return codes of locking calls to
1487 tell clients that everything is OK.</P
1489 >The second class of locking is the "deny modes". These
1490 are set by an application when it opens a file to determine
1491 what types of access should be allowed simultaneously with
1492 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE
1493 or DENY_ALL. There are also special compatability modes called
1494 DENY_FCB and DENY_DOS.</P
1496 >You can disable share modes using "share modes = no".
1497 This may be useful on a heavily loaded server as the share
1498 modes code is very slow. See also the FAST_SHARE_MODES
1499 option in the Makefile for a way to do full share modes
1500 very fast using shared memory (if your OS supports it).</P
1501 ></DIV
1502 ><DIV
1503 CLASS="SECT2"
1504 ><HR><H2
1505 CLASS="SECT2"
1507 NAME="AEN206"
1508 >1.10.6. Mapping Usernames</A
1509 ></H2
1511 >If you have different usernames on the PCs and
1512 the unix server then take a look at the "username map" option.
1513 See the smb.conf man page for details.</P
1514 ></DIV
1515 ><DIV
1516 CLASS="SECT2"
1517 ><HR><H2
1518 CLASS="SECT2"
1520 NAME="AEN209"
1521 >1.10.7. Other Character Sets</A
1522 ></H2
1524 >If you have problems using filenames with accented
1525 characters in them (like the German, French or Scandinavian
1526 character sets) then I recommmend you look at the "valid chars"
1527 option in smb.conf and also take a look at the validchars
1528 package in the examples directory.</P
1529 ></DIV
1530 ></DIV
1531 ></DIV
1532 ><DIV
1533 CLASS="CHAPTER"
1534 ><HR><H1
1536 NAME="AEN212"
1537 >Chapter 2. LanMan and NT Password Encryption in Samba 2.x</A
1538 ></H1
1539 ><DIV
1540 CLASS="SECT1"
1541 ><H1
1542 CLASS="SECT1"
1544 NAME="AEN223"
1545 >2.1. Introduction</A
1546 ></H1
1548 >With the development of LanManager and Windows NT
1549 compatible password encryption for Samba, it is now able
1550 to validate user connections in exactly the same way as
1551 a LanManager or Windows NT server.</P
1553 >This document describes how the SMB password encryption
1554 algorithm works and what issues there are in choosing whether
1555 you want to use it. You should read it carefully, especially
1556 the part about security and the "PROS and CONS" section.</P
1557 ></DIV
1558 ><DIV
1559 CLASS="SECT1"
1560 ><HR><H1
1561 CLASS="SECT1"
1563 NAME="AEN227"
1564 >2.2. How does it work?</A
1565 ></H1
1567 >LanManager encryption is somewhat similar to UNIX
1568 password encryption. The server uses a file containing a
1569 hashed value of a user's password. This is created by taking
1570 the user's plaintext password, capitalising it, and either
1571 truncating to 14 bytes or padding to 14 bytes with null bytes.
1572 This 14 byte value is used as two 56 bit DES keys to encrypt
1573 a 'magic' eight byte value, forming a 16 byte value which is
1574 stored by the server and client. Let this value be known as
1575 the "hashed password".</P
1577 >Windows NT encryption is a higher quality mechanism,
1578 consisting of doing an MD4 hash on a Unicode version of the user's
1579 password. This also produces a 16 byte hash value that is
1580 non-reversible.</P
1582 >When a client (LanManager, Windows for WorkGroups, Windows
1583 95 or Windows NT) wishes to mount a Samba drive (or use a Samba
1584 resource), it first requests a connection and negotiates the
1585 protocol that the client and server will use. In the reply to this
1586 request the Samba server generates and appends an 8 byte, random
1587 value - this is stored in the Samba server after the reply is sent
1588 and is known as the "challenge". The challenge is different for
1589 every client connection.</P
1591 >The client then uses the hashed password (16 byte values
1592 described above), appended with 5 null bytes, as three 56 bit
1593 DES keys, each of which is used to encrypt the challenge 8 byte
1594 value, forming a 24 byte value known as the "response".</P
1596 >In the SMB call SMBsessionsetupX (when user level security
1597 is selected) or the call SMBtconX (when share level security is
1598 selected), the 24 byte response is returned by the client to the
1599 Samba server. For Windows NT protocol levels the above calculation
1600 is done on both hashes of the user's password and both responses are
1601 returned in the SMB call, giving two 24 byte values.</P
1603 >The Samba server then reproduces the above calculation, using
1604 its own stored value of the 16 byte hashed password (read from the
1606 CLASS="FILENAME"
1607 >smbpasswd</TT
1608 > file - described later) and the challenge
1609 value that it kept from the negotiate protocol reply. It then checks
1610 to see if the 24 byte value it calculates matches the 24 byte value
1611 returned to it from the client.</P
1613 >If these values match exactly, then the client knew the
1614 correct password (or the 16 byte hashed value - see security note
1615 below) and is thus allowed access. If not, then the client did not
1616 know the correct password and is denied access.</P
1618 >Note that the Samba server never knows or stores the cleartext
1619 of the user's password - just the 16 byte hashed values derived from
1620 it. Also note that the cleartext password or 16 byte hashed values
1621 are never transmitted over the network - thus increasing security.</P
1622 ></DIV
1623 ><DIV
1624 CLASS="SECT1"
1625 ><HR><H1
1626 CLASS="SECT1"
1628 NAME="AEN238"
1629 >2.3. Important Notes About Security</A
1630 ></H1
1632 >The unix and SMB password encryption techniques seem similar
1633 on the surface. This similarity is, however, only skin deep. The unix
1634 scheme typically sends clear text passwords over the nextwork when
1635 logging in. This is bad. The SMB encryption scheme never sends the
1636 cleartext password over the network but it does store the 16 byte
1637 hashed values on disk. This is also bad. Why? Because the 16 byte hashed
1638 values are a "password equivalent". You cannot derive the user's
1639 password from them, but they could potentially be used in a modified
1640 client to gain access to a server. This would require considerable
1641 technical knowledge on behalf of the attacker but is perfectly possible.
1642 You should thus treat the smbpasswd file as though it contained the
1643 cleartext passwords of all your users. Its contents must be kept
1644 secret, and the file should be protected accordingly.</P
1646 >Ideally we would like a password scheme which neither requires
1647 plain text passwords on the net or on disk. Unfortunately this
1648 is not available as Samba is stuck with being compatible with
1649 other SMB systems (WinNT, WfWg, Win95 etc). </P
1650 ><DIV
1651 CLASS="WARNING"
1653 ></P
1654 ><TABLE
1655 CLASS="WARNING"
1656 BORDER="1"
1657 WIDTH="100%"
1658 ><TR
1659 ><TD
1660 ALIGN="CENTER"
1662 >Warning</B
1663 ></TD
1664 ></TR
1665 ><TR
1666 ><TD
1667 ALIGN="LEFT"
1669 >Note that Windows NT 4.0 Service pack 3 changed the
1670 default for permissible authentication so that plaintext
1671 passwords are <EM
1672 >never</EM
1673 > sent over the wire.
1674 The solution to this is either to switch to encrypted passwords
1675 with Samba or edit the Windows NT registry to re-enable plaintext
1676 passwords. See the document WinNT.txt for details on how to do
1677 this.</P
1679 >Other Microsoft operating systems which also exhibit
1680 this behavior includes</P
1682 ></P
1683 ><UL
1684 ><LI
1686 >MS DOS Network client 3.0 with
1687 the basic network redirector installed</P
1688 ></LI
1689 ><LI
1691 >Windows 95 with the network redirector
1692 update installed</P
1693 ></LI
1694 ><LI
1696 >Windows 98 [se]</P
1697 ></LI
1698 ><LI
1700 >Windows 2000</P
1701 ></LI
1702 ></UL
1704 ><EM
1705 >Note :</EM
1706 >All current release of
1707 Microsoft SMB/CIFS clients support authentication via the
1708 SMB Challenge/Response mechanism described here. Enabling
1709 clear text authentication does not disable the ability
1710 of the client to particpate in encrypted authentication.</P
1711 ></TD
1712 ></TR
1713 ></TABLE
1714 ></DIV
1715 ><DIV
1716 CLASS="SECT2"
1717 ><HR><H2
1718 CLASS="SECT2"
1720 NAME="AEN257"
1721 >2.3.1. Advantages of SMB Encryption</A
1722 ></H2
1724 ></P
1725 ><UL
1726 ><LI
1728 >plain text passwords are not passed across
1729 the network. Someone using a network sniffer cannot just
1730 record passwords going to the SMB server.</P
1731 ></LI
1732 ><LI
1734 >WinNT doesn't like talking to a server
1735 that isn't using SMB encrypted passwords. It will refuse
1736 to browse the server if the server is also in user level
1737 security mode. It will insist on prompting the user for the
1738 password on each connection, which is very annoying. The
1739 only things you can do to stop this is to use SMB encryption.
1741 ></LI
1742 ></UL
1743 ></DIV
1744 ><DIV
1745 CLASS="SECT2"
1746 ><HR><H2
1747 CLASS="SECT2"
1749 NAME="AEN264"
1750 >2.3.2. Advantages of non-encrypted passwords</A
1751 ></H2
1753 ></P
1754 ><UL
1755 ><LI
1757 >plain text passwords are not kept
1758 on disk. </P
1759 ></LI
1760 ><LI
1762 >uses same password file as other unix
1763 services such as login and ftp</P
1764 ></LI
1765 ><LI
1767 >you are probably already using other
1768 services (such as telnet and ftp) which send plain text
1769 passwords over the net, so sending them for SMB isn't
1770 such a big deal.</P
1771 ></LI
1772 ></UL
1773 ></DIV
1774 ></DIV
1775 ><DIV
1776 CLASS="SECT1"
1777 ><HR><H1
1778 CLASS="SECT1"
1780 NAME="AEN273"
1781 >2.4. <A
1782 NAME="SMBPASSWDFILEFORMAT"
1783 ></A
1784 >The smbpasswd file</A
1785 ></H1
1787 >In order for Samba to participate in the above protocol
1788 it must be able to look up the 16 byte hashed values given a user name.
1789 Unfortunately, as the UNIX password value is also a one way hash
1790 function (ie. it is impossible to retrieve the cleartext of the user's
1791 password given the UNIX hash of it), a separate password file
1792 containing this 16 byte value must be kept. To minimise problems with
1793 these two password files, getting out of sync, the UNIX <TT
1794 CLASS="FILENAME"
1795 > /etc/passwd</TT
1796 > and the <TT
1797 CLASS="FILENAME"
1798 >smbpasswd</TT
1799 > file,
1800 a utility, <B
1801 CLASS="COMMAND"
1802 >mksmbpasswd.sh</B
1803 >, is provided to generate
1804 a smbpasswd file from a UNIX <TT
1805 CLASS="FILENAME"
1806 >/etc/passwd</TT
1807 > file.
1810 >To generate the smbpasswd file from your <TT
1811 CLASS="FILENAME"
1812 >/etc/passwd
1813 </TT
1814 > file use the following command :</P
1816 ><TT
1817 CLASS="PROMPT"
1818 >$ </TT
1819 ><TT
1820 CLASS="USERINPUT"
1822 >cat /etc/passwd | mksmbpasswd.sh
1823 &#62; /usr/local/samba/private/smbpasswd</B
1824 ></TT
1825 ></P
1827 >If you are running on a system that uses NIS, use</P
1829 ><TT
1830 CLASS="PROMPT"
1831 >$ </TT
1832 ><TT
1833 CLASS="USERINPUT"
1835 >ypcat passwd | mksmbpasswd.sh
1836 &#62; /usr/local/samba/private/smbpasswd</B
1837 ></TT
1838 ></P
1840 >The <B
1841 CLASS="COMMAND"
1842 >mksmbpasswd.sh</B
1843 > program is found in
1844 the Samba source directory. By default, the smbpasswd file is
1845 stored in :</P
1847 ><TT
1848 CLASS="FILENAME"
1849 >/usr/local/samba/private/smbpasswd</TT
1850 ></P
1852 >The owner of the <TT
1853 CLASS="FILENAME"
1854 >/usr/local/samba/private/</TT
1856 directory should be set to root, and the permissions on it should
1857 be set to 0500 (<B
1858 CLASS="COMMAND"
1859 >chmod 500 /usr/local/samba/private</B
1863 >Likewise, the smbpasswd file inside the private directory should
1864 be owned by root and the permissions on is should be set to 0600
1866 CLASS="COMMAND"
1867 >chmod 600 smbpasswd</B
1868 >).</P
1870 >The format of the smbpasswd file is (The line has been
1871 wrapped here. It should appear as one entry per line in
1872 your smbpasswd file.)</P
1874 ><TABLE
1875 BORDER="0"
1876 BGCOLOR="#E0E0E0"
1877 WIDTH="100%"
1878 ><TR
1879 ><TD
1880 ><PRE
1881 CLASS="PROGRAMLISTING"
1882 >username:uid:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:
1883 [Account type]:LCT-&#60;last-change-time&#62;:Long name
1884 </PRE
1885 ></TD
1886 ></TR
1887 ></TABLE
1888 ></P
1890 >Although only the <TT
1891 CLASS="REPLACEABLE"
1893 >username</I
1894 ></TT
1897 CLASS="REPLACEABLE"
1899 >uid</I
1900 ></TT
1901 >, <TT
1902 CLASS="REPLACEABLE"
1904 > XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</I
1905 ></TT
1907 [<TT
1908 CLASS="REPLACEABLE"
1910 >Account type</I
1911 ></TT
1912 >] and <TT
1913 CLASS="REPLACEABLE"
1915 > last-change-time</I
1916 ></TT
1917 > sections are significant
1918 and are looked at in the Samba code.</P
1920 >It is <EM
1921 >VITALLY</EM
1922 > important that there by 32
1923 'X' characters between the two ':' characters in the XXX sections -
1924 the smbpasswd and Samba code will fail to validate any entries that
1925 do not have 32 characters between ':' characters. The first XXX
1926 section is for the Lanman password hash, the second is for the
1927 Windows NT version.</P
1929 >When the password file is created all users have password entries
1930 consisting of 32 'X' characters. By default this disallows any access
1931 as this user. When a user has a password set, the 'X' characters change
1932 to 32 ascii hexadecimal digits (0-9, A-F). These are an ascii
1933 representation of the 16 byte hashed value of a user's password.</P
1935 >To set a user to have no password (not recommended), edit the file
1936 using vi, and replace the first 11 characters with the ascii text
1938 CLASS="CONSTANT"
1939 >"NO PASSWORD"</TT
1940 > (minus the quotes).</P
1942 >For example, to clear the password for user bob, his smbpasswd file
1943 entry would look like :</P
1945 ><TABLE
1946 BORDER="0"
1947 BGCOLOR="#E0E0E0"
1948 WIDTH="100%"
1949 ><TR
1950 ><TD
1951 ><PRE
1952 CLASS="PROGRAMLISTING"
1953 > bob:100:NO PASSWORDXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:Bob's full name:/bobhome:/bobshell
1954 </PRE
1955 ></TD
1956 ></TR
1957 ></TABLE
1958 ></P
1960 >If you are allowing users to use the smbpasswd command to set
1961 their own passwords, you may want to give users NO PASSWORD initially
1962 so they do not have to enter a previous password when changing to their
1963 new password (not recommended). In order for you to allow this the
1965 CLASS="COMMAND"
1966 >smbpasswd</B
1967 > program must be able to connect to the
1969 CLASS="COMMAND"
1970 >smbd</B
1971 > daemon as that user with no password. Enable this
1972 by adding the line :</P
1975 CLASS="COMMAND"
1976 >null passwords = yes</B
1977 ></P
1979 >to the [global] section of the smb.conf file (this is why
1980 the above scenario is not recommended). Preferably, allocate your
1981 users a default password to begin with, so you do not have
1982 to enable this on your server.</P
1984 ><EM
1985 >Note : </EM
1986 >This file should be protected very
1987 carefully. Anyone with access to this file can (with enough knowledge of
1988 the protocols) gain access to your SMB server. The file is thus more
1989 sensitive than a normal unix <TT
1990 CLASS="FILENAME"
1991 >/etc/passwd</TT
1992 > file.</P
1993 ></DIV
1994 ><DIV
1995 CLASS="SECT1"
1996 ><HR><H1
1997 CLASS="SECT1"
1999 NAME="AEN325"
2000 >2.5. The smbpasswd Command</A
2001 ></H1
2003 >The smbpasswd command maintains the two 32 byte password fields
2004 in the smbpasswd file. If you wish to make it similar to the unix
2006 CLASS="COMMAND"
2007 >passwd</B
2008 > or <B
2009 CLASS="COMMAND"
2010 >yppasswd</B
2011 > programs,
2012 install it in <TT
2013 CLASS="FILENAME"
2014 >/usr/local/samba/bin/</TT
2015 > (or your
2016 main Samba binary directory).</P
2018 >Note that as of Samba 1.9.18p4 this program <EM
2019 >MUST NOT
2020 BE INSTALLED</EM
2021 > setuid root (the new <B
2022 CLASS="COMMAND"
2023 >smbpasswd</B
2025 code enforces this restriction so it cannot be run this way by
2026 accident).</P
2029 CLASS="COMMAND"
2030 >smbpasswd</B
2031 > now works in a client-server mode
2032 where it contacts the local smbd to change the user's password on its
2033 behalf. This has enormous benefits - as follows.</P
2035 ></P
2036 ><UL
2037 ><LI
2039 >smbpasswd no longer has to be setuid root -
2040 an enormous range of potential security problems is
2041 eliminated.</P
2042 ></LI
2043 ><LI
2046 CLASS="COMMAND"
2047 >smbpasswd</B
2048 > now has the capability
2049 to change passwords on Windows NT servers (this only works when
2050 the request is sent to the NT Primary Domain Controller if you
2051 are changing an NT Domain user's password).</P
2052 ></LI
2053 ></UL
2055 >To run smbpasswd as a normal user just type :</P
2057 ><TT
2058 CLASS="PROMPT"
2059 >$ </TT
2060 ><TT
2061 CLASS="USERINPUT"
2063 >smbpasswd</B
2064 ></TT
2065 ></P
2067 ><TT
2068 CLASS="PROMPT"
2069 >Old SMB password: </TT
2070 ><TT
2071 CLASS="USERINPUT"
2073 >&#60;type old value here -
2074 or hit return if there was no old password&#62;</B
2075 ></TT
2076 ></P
2078 ><TT
2079 CLASS="PROMPT"
2080 >New SMB Password: </TT
2081 ><TT
2082 CLASS="USERINPUT"
2084 >&#60;type new value&#62;
2086 ></TT
2087 ></P
2089 ><TT
2090 CLASS="PROMPT"
2091 >Repeat New SMB Password: </TT
2092 ><TT
2093 CLASS="USERINPUT"
2095 >&#60;re-type new value
2097 ></TT
2098 ></P
2100 >If the old value does not match the current value stored for
2101 that user, or the two new values do not match each other, then the
2102 password will not be changed.</P
2104 >If invoked by an ordinary user it will only allow the user
2105 to change his or her own Samba password.</P
2107 >If run by the root user smbpasswd may take an optional
2108 argument, specifying the user name whose SMB password you wish to
2109 change. Note that when run as root smbpasswd does not prompt for
2110 or check the old password value, thus allowing root to set passwords
2111 for users who have forgotten their passwords.</P
2114 CLASS="COMMAND"
2115 >smbpasswd</B
2116 > is designed to work in the same way
2117 and be familiar to UNIX users who use the <B
2118 CLASS="COMMAND"
2119 >passwd</B
2120 > or
2122 CLASS="COMMAND"
2123 >yppasswd</B
2124 > commands.</P
2126 >For more details on using <B
2127 CLASS="COMMAND"
2128 >smbpasswd</B
2129 > refer
2130 to the man page which will always be the definitive reference.</P
2131 ></DIV
2132 ><DIV
2133 CLASS="SECT1"
2134 ><HR><H1
2135 CLASS="SECT1"
2137 NAME="AEN364"
2138 >2.6. Setting up Samba to support LanManager Encryption</A
2139 ></H1
2141 >This is a very brief description on how to setup samba to
2142 support password encryption. </P
2144 ></P
2145 ><OL
2146 TYPE="1"
2147 ><LI
2149 >compile and install samba as usual</P
2150 ></LI
2151 ><LI
2153 >enable encrypted passwords in <TT
2154 CLASS="FILENAME"
2155 > smb.conf</TT
2156 > by adding the line <B
2157 CLASS="COMMAND"
2158 >encrypt
2159 passwords = yes</B
2160 > in the [global] section</P
2161 ></LI
2162 ><LI
2164 >create the initial <TT
2165 CLASS="FILENAME"
2166 >smbpasswd</TT
2168 password file in the place you specified in the Makefile
2169 (--prefix=&#60;dir&#62;). See the notes under the <A
2170 HREF="#SMBPASSWDFILEFORMAT"
2171 >The smbpasswd File</A
2173 section earlier in the document for details.</P
2174 ></LI
2175 ></OL
2177 >Note that you can test things using smbclient.</P
2178 ></DIV
2179 ></DIV
2180 ><DIV
2181 CLASS="CHAPTER"
2182 ><HR><H1
2184 NAME="AEN379"
2185 >Chapter 3. Hosting a Microsoft Distributed File System tree on Samba</A
2186 ></H1
2187 ><DIV
2188 CLASS="SECT1"
2189 ><H1
2190 CLASS="SECT1"
2192 NAME="AEN390"
2193 >3.1. Instructions</A
2194 ></H1
2196 >The Distributed File System (or Dfs) provides a means of
2197 separating the logical view of files and directories that users
2198 see from the actual physical locations of these resources on the
2199 network. It allows for higher availability, smoother storage expansion,
2200 load balancing etc. For more information about Dfs, refer to <A
2201 HREF="http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp"
2202 TARGET="_top"
2203 > Microsoft documentation</A
2204 >. </P
2206 >This document explains how to host a Dfs tree on a Unix
2207 machine (for Dfs-aware clients to browse) using Samba.</P
2209 >To enable SMB-based DFS for Samba, configure it with the
2211 CLASS="PARAMETER"
2213 >--with-msdfs</I
2214 ></TT
2215 > option. Once built, a
2216 Samba server can be made a Dfs server by setting the global
2217 boolean <A
2218 HREF="smb.conf.5.html#HOSTMSDFS"
2219 TARGET="_top"
2220 ><TT
2221 CLASS="PARAMETER"
2223 > host msdfs</I
2224 ></TT
2225 ></A
2226 > parameter in the <TT
2227 CLASS="FILENAME"
2228 >smb.conf
2229 </TT
2230 > file. You designate a share as a Dfs root using the share
2231 level boolean <A
2232 HREF="smb.conf.5.html#MSDFSROOT"
2233 TARGET="_top"
2234 ><TT
2235 CLASS="PARAMETER"
2237 > msdfs root</I
2238 ></TT
2239 ></A
2240 > parameter. A Dfs root directory on
2241 Samba hosts Dfs links in the form of symbolic links that point
2242 to other servers. For example, a symbolic link
2244 CLASS="FILENAME"
2245 >junction-&#62;msdfs:storage1\share1</TT
2246 > in
2247 the share directory acts as the Dfs junction. When Dfs-aware
2248 clients attempt to access the junction link, they are redirected
2249 to the storage location (in this case, \\storage1\share1).</P
2251 >Dfs trees on Samba work with all Dfs-aware clients ranging
2252 from Windows 95 to 2000.</P
2254 >Here's an example of setting up a Dfs tree on a Samba
2255 server.</P
2257 ><TABLE
2258 BORDER="0"
2259 BGCOLOR="#E0E0E0"
2260 WIDTH="100%"
2261 ><TR
2262 ><TD
2263 ><PRE
2264 CLASS="PROGRAMLISTING"
2265 ># The smb.conf file:
2266 [global]
2267 netbios name = SAMBA
2268 host msdfs = yes
2270 [dfs]
2271 path = /export/dfsroot
2272 msdfs root = yes
2273 </PRE
2274 ></TD
2275 ></TR
2276 ></TABLE
2277 ></P
2279 >In the /export/dfsroot directory we set up our dfs links to
2280 other servers on the network.</P
2282 ><TT
2283 CLASS="PROMPT"
2284 >root# </TT
2285 ><TT
2286 CLASS="USERINPUT"
2288 >cd /export/dfsroot</B
2289 ></TT
2290 ></P
2292 ><TT
2293 CLASS="PROMPT"
2294 >root# </TT
2295 ><TT
2296 CLASS="USERINPUT"
2298 >chown root /export/dfsroot</B
2299 ></TT
2300 ></P
2302 ><TT
2303 CLASS="PROMPT"
2304 >root# </TT
2305 ><TT
2306 CLASS="USERINPUT"
2308 >chmod 755 /export/dfsroot</B
2309 ></TT
2310 ></P
2312 ><TT
2313 CLASS="PROMPT"
2314 >root# </TT
2315 ><TT
2316 CLASS="USERINPUT"
2318 >ln -s msdfs:storageA\\shareA linka</B
2319 ></TT
2320 ></P
2322 ><TT
2323 CLASS="PROMPT"
2324 >root# </TT
2325 ><TT
2326 CLASS="USERINPUT"
2328 >ln -s msdfs:serverB\\share,serverC\\share linkb</B
2329 ></TT
2330 ></P
2332 >You should set up the permissions and ownership of
2333 the directory acting as the Dfs root such that only designated
2334 users can create, delete or modify the msdfs links. Also note
2335 that symlink names should be all lowercase. This limitation exists
2336 to have Samba avoid trying all the case combinations to get at
2337 the link name. Finally set up the symbolic links to point to the
2338 network shares you want, and start Samba.</P
2340 >Users on Dfs-aware clients can now browse the Dfs tree
2341 on the Samba server at \\samba\dfs. Accessing
2342 links linka or linkb (which appear as directories to the client)
2343 takes users directly to the appropriate shares on the network.</P
2344 ><DIV
2345 CLASS="SECT2"
2346 ><HR><H2
2347 CLASS="SECT2"
2349 NAME="AEN425"
2350 >3.1.1. Notes</A
2351 ></H2
2353 ></P
2354 ><UL
2355 ><LI
2357 >Windows clients need to be rebooted
2358 if a previously mounted non-dfs share is made a dfs
2359 root or vice versa. A better way is to introduce a
2360 new share and make it the dfs root.</P
2361 ></LI
2362 ><LI
2364 >Currently there's a restriction that msdfs
2365 symlink names should all be lowercase.</P
2366 ></LI
2367 ><LI
2369 >For security purposes, the directory
2370 acting as the root of the Dfs tree should have ownership
2371 and permissions set so that only designated users can
2372 modify the symbolic links in the directory.</P
2373 ></LI
2374 ></UL
2375 ></DIV
2376 ></DIV
2377 ></DIV
2378 ><DIV
2379 CLASS="CHAPTER"
2380 ><HR><H1
2382 NAME="AEN434"
2383 >Chapter 4. Printing Support in Samba 2.2.x</A
2384 ></H1
2385 ><DIV
2386 CLASS="SECT1"
2387 ><H1
2388 CLASS="SECT1"
2390 NAME="AEN445"
2391 >4.1. Introduction</A
2392 ></H1
2394 >Beginning with the 2.2.0 release, Samba supports
2395 the native Windows NT printing mechanisms implemented via
2396 MS-RPC (i.e. the SPOOLSS named pipe). Previous versions of
2397 Samba only supported LanMan printing calls.</P
2399 >The additional functionality provided by the new
2400 SPOOLSS support includes:</P
2402 ></P
2403 ><UL
2404 ><LI
2406 >Support for downloading printer driver
2407 files to Windows 95/98/NT/2000 clients upon demand.
2409 ></LI
2410 ><LI
2412 >Uploading of printer drivers via the
2413 Windows NT Add Printer Wizard (APW) or the
2414 Imprints tool set (refer to <A
2415 HREF="http://imprints.sourceforge.net"
2416 TARGET="_top"
2417 >http://imprints.sourceforge.net</A
2418 >).
2420 ></LI
2421 ><LI
2423 >Support for the native MS-RPC printing
2424 calls such as StartDocPrinter, EnumJobs(), etc... (See
2425 the MSDN documentation at <A
2426 HREF="http://msdn.microsoft.com/"
2427 TARGET="_top"
2428 >http://msdn.microsoft.com/</A
2430 for more information on the Win32 printing API)
2432 ></LI
2433 ><LI
2435 >Support for NT Access Control Lists (ACL)
2436 on printer objects</P
2437 ></LI
2438 ><LI
2440 >Improved support for printer queue manipulation
2441 through the use of an internal databases for spooled job
2442 information</P
2443 ></LI
2444 ></UL
2446 >There has been some initial confusion about what all this means
2447 and whether or not it is a requirement for printer drivers to be
2448 installed on a Samba host in order to support printing from Windows
2449 clients. A bug existed in Samba 2.2.0 which made Windows NT/2000 clients
2450 require that the Samba server possess a valid driver for the printer.
2451 This is fixed in Samba 2.2.1 and once again, Windows NT/2000 clients
2452 can use the local APW for installing drivers to be used with a Samba
2453 served printer. This is the same behavior exhibited by Windows 9x clients.
2454 As a side note, Samba does not use these drivers in any way to process
2455 spooled files. They are utilized entirely by the clients.</P
2457 >The following MS KB article, may be of some help if you are dealing with
2458 Windows 2000 clients: <EM
2459 >How to Add Printers with No User
2460 Interaction in Windows 2000</EM
2461 ></P
2464 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
2465 TARGET="_top"
2466 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
2467 ></P
2468 ></DIV
2469 ><DIV
2470 CLASS="SECT1"
2471 ><HR><H1
2472 CLASS="SECT1"
2474 NAME="AEN467"
2475 >4.2. Configuration</A
2476 ></H1
2477 ><DIV
2478 CLASS="WARNING"
2480 ></P
2481 ><TABLE
2482 CLASS="WARNING"
2483 BORDER="1"
2484 WIDTH="100%"
2485 ><TR
2486 ><TD
2487 ALIGN="CENTER"
2489 >[print$] vs. [printer$]</B
2490 ></TD
2491 ></TR
2492 ><TR
2493 ><TD
2494 ALIGN="LEFT"
2496 >Previous versions of Samba recommended using a share named [printer$].
2497 This name was taken from the printer$ service created by Windows 9x
2498 clients when a printer was shared. Windows 9x printer servers always have
2499 a printer$ service which provides read-only access via no
2500 password in order to support printer driver downloads.</P
2502 >However, the initial implementation allowed for a
2503 parameter named <TT
2504 CLASS="PARAMETER"
2506 >printer driver location</I
2507 ></TT
2509 to be used on a per share basis to specify the location of
2510 the driver files associated with that printer. Another
2511 parameter named <TT
2512 CLASS="PARAMETER"
2514 >printer driver</I
2515 ></TT
2516 > provided
2517 a means of defining the printer driver name to be sent to
2518 the client.</P
2520 >These parameters, including <TT
2521 CLASS="PARAMETER"
2523 >printer driver
2524 file</I
2525 ></TT
2526 > parameter, are being depreciated and should not
2527 be used in new installations. For more information on this change,
2528 you should refer to the <A
2529 HREF="#MIGRATION"
2530 >Migration section</A
2532 of this document.</P
2533 ></TD
2534 ></TR
2535 ></TABLE
2536 ></DIV
2537 ><DIV
2538 CLASS="SECT2"
2539 ><HR><H2
2540 CLASS="SECT2"
2542 NAME="AEN478"
2543 >4.2.1. Creating [print$]</A
2544 ></H2
2546 >In order to support the uploading of printer driver
2547 files, you must first configure a file share named [print$].
2548 The name of this share is hard coded in Samba's internals so
2549 the name is very important (print$ is the service used by
2550 Windows NT print servers to provide support for printer driver
2551 download).</P
2553 >You should modify the server's smb.conf file to create the
2554 following file share (of course, some of the parameter values,
2555 such as 'path' are arbitrary and should be replaced with
2556 appropriate values for your site):</P
2558 ><TABLE
2559 BORDER="0"
2560 BGCOLOR="#E0E0E0"
2561 WIDTH="100%"
2562 ><TR
2563 ><TD
2564 ><PRE
2565 CLASS="PROGRAMLISTING"
2566 >[print$]
2567 path = /usr/local/samba/printers
2568 guest ok = yes
2569 browseable = yes
2570 read only = yes
2571 ; since this share is configured as read only, then we need
2572 ; a 'write list'. Check the file system permissions to make
2573 ; sure this account can copy files to the share. If this
2574 ; is setup to a non-root account, then it should also exist
2575 ; as a 'printer admin'
2576 write list = ntadmin</PRE
2577 ></TD
2578 ></TR
2579 ></TABLE
2580 ></P
2582 >The <A
2583 HREF="smb.conf.5.html#WRITELIST"
2584 TARGET="_top"
2585 ><TT
2586 CLASS="PARAMETER"
2588 >write list</I
2589 ></TT
2590 ></A
2591 > is used to allow administrative
2592 level user accounts to have write access in order to update files
2593 on the share. See the <A
2594 HREF="smb./conf.5.html"
2595 TARGET="_top"
2596 >smb.conf(5)
2597 man page</A
2598 > for more information on configuring file shares.</P
2600 >The requirement for <A
2601 HREF="smb.conf.5.html#GUESTOK"
2602 TARGET="_top"
2604 CLASS="COMMAND"
2605 >guest
2606 ok = yes</B
2607 ></A
2608 > depends upon how your
2609 site is configured. If users will be guaranteed to have
2610 an account on the Samba host, then this is a non-issue.</P
2611 ><DIV
2612 CLASS="NOTE"
2613 ><BLOCKQUOTE
2614 CLASS="NOTE"
2617 >Author's Note: </B
2618 >The non-issue is that if all your Windows NT users are guaranteed to be
2619 authenticated by the Samba server (such as a domain member server and the NT
2620 user has already been validated by the Domain Controller in
2621 order to logon to the Windows NT console), then guest access
2622 is not necessary. Of course, in a workgroup environment where
2623 you just want to be able to print without worrying about
2624 silly accounts and security, then configure the share for
2625 guest access. You'll probably want to add <A
2626 HREF="smb.conf.5.html#MAPTOGUEST"
2627 TARGET="_top"
2629 CLASS="COMMAND"
2630 >map to guest = Bad User</B
2631 ></A
2632 > in the [global] section as well. Make sure
2633 you understand what this parameter does before using it
2634 though. --jerry</P
2635 ></BLOCKQUOTE
2636 ></DIV
2638 >In order for a Windows NT print server to support
2639 the downloading of driver files by multiple client architectures,
2640 it must create subdirectories within the [print$] service
2641 which correspond to each of the supported client architectures.
2642 Samba follows this model as well.</P
2644 >Next create the directory tree below the [print$] share
2645 for each architecture you wish to support.</P
2647 ><TABLE
2648 BORDER="0"
2649 BGCOLOR="#E0E0E0"
2650 WIDTH="100%"
2651 ><TR
2652 ><TD
2653 ><PRE
2654 CLASS="PROGRAMLISTING"
2655 >[print$]-----
2656 |-W32X86 ; "Windows NT x86"
2657 |-WIN40 ; "Windows 95/98"
2658 |-W32ALPHA ; "Windows NT Alpha_AXP"
2659 |-W32MIPS ; "Windows NT R4000"
2660 |-W32PPC ; "Windows NT PowerPC"</PRE
2661 ></TD
2662 ></TR
2663 ></TABLE
2664 ></P
2665 ><DIV
2666 CLASS="WARNING"
2668 ></P
2669 ><TABLE
2670 CLASS="WARNING"
2671 BORDER="1"
2672 WIDTH="100%"
2673 ><TR
2674 ><TD
2675 ALIGN="CENTER"
2677 >ATTENTION! REQUIRED PERMISSIONS</B
2678 ></TD
2679 ></TR
2680 ><TR
2681 ><TD
2682 ALIGN="LEFT"
2684 >In order to currently add a new driver to you Samba host,
2685 one of two conditions must hold true:</P
2687 ></P
2688 ><UL
2689 ><LI
2691 >The account used to connect to the Samba host
2692 must have a uid of 0 (i.e. a root account)</P
2693 ></LI
2694 ><LI
2696 >The account used to connect to the Samba host
2697 must be a member of the <A
2698 HREF="smb.conf.5.html#PRINTERADMIN"
2699 TARGET="_top"
2700 ><TT
2701 CLASS="PARAMETER"
2703 >printer
2704 admin</I
2705 ></TT
2706 ></A
2707 > list.</P
2708 ></LI
2709 ></UL
2711 >Of course, the connected account must still possess access
2712 to add files to the subdirectories beneath [print$]. Remember
2713 that all file shares are set to 'read only' by default.</P
2714 ></TD
2715 ></TR
2716 ></TABLE
2717 ></DIV
2719 >Once you have created the required [print$] service and
2720 associated subdirectories, simply log onto the Samba server using
2721 a root (or <TT
2722 CLASS="PARAMETER"
2724 >printer admin</I
2725 ></TT
2726 >) account
2727 from a Windows NT 4.0 client. Navigate to the "Printers" folder
2728 on the Samba server. You should see an initial listing of printers
2729 that matches the printer shares defined on your Samba host.</P
2730 ></DIV
2731 ><DIV
2732 CLASS="SECT2"
2733 ><HR><H2
2734 CLASS="SECT2"
2736 NAME="AEN513"
2737 >4.2.2. Setting Drivers for Existing Printers</A
2738 ></H2
2740 >The initial listing of printers in the Samba host's
2741 Printers folder will have no real printer driver assigned
2742 to them. By default, in Samba 2.2.0 this driver name was set to
2744 >NO PRINTER DRIVER AVAILABLE FOR THIS PRINTER</EM
2746 Later versions changed this to a NULL string to allow the use
2747 tof the local Add Printer Wizard on NT/2000 clients.
2748 Attempting to view the printer properties for a printer
2749 which has this default driver assigned will result in
2750 the error message:</P
2752 ><EM
2753 >Device settings cannot be displayed. The driver
2754 for the specified printer is not installed, only spooler
2755 properties will be displayed. Do you want to install the
2756 driver now?</EM
2757 ></P
2759 >Click "No" in the error dialog and you will be presented with
2760 the printer properties window. The way assign a driver to a
2761 printer is to either</P
2763 ></P
2764 ><UL
2765 ><LI
2767 >Use the "New Driver..." button to install
2768 a new printer driver, or</P
2769 ></LI
2770 ><LI
2772 >Select a driver from the popup list of
2773 installed drivers. Initially this list will be empty.</P
2774 ></LI
2775 ></UL
2777 >If you wish to install printer drivers for client
2778 operating systems other than "Windows NT x86", you will need
2779 to use the "Sharing" tab of the printer properties dialog.</P
2781 >Assuming you have connected with a root account, you
2782 will also be able modify other printer properties such as
2783 ACLs and device settings using this dialog box.</P
2785 >A few closing comments for this section, it is possible
2786 on a Windows NT print server to have printers
2787 listed in the Printers folder which are not shared. Samba does
2788 not make this distinction. By definition, the only printers of
2789 which Samba is aware are those which are specified as shares in
2791 CLASS="FILENAME"
2792 >smb.conf</TT
2793 >.</P
2795 >Another interesting side note is that Windows NT clients do
2796 not use the SMB printer share, but rather can print directly
2797 to any printer on another Windows NT host using MS-RPC. This
2798 of course assumes that the printing client has the necessary
2799 privileges on the remote host serving the printer. The default
2800 permissions assigned by Windows NT to a printer gives the "Print"
2801 permissions to the "Everyone" well-known group.</P
2802 ></DIV
2803 ><DIV
2804 CLASS="SECT2"
2805 ><HR><H2
2806 CLASS="SECT2"
2808 NAME="AEN530"
2809 >4.2.3. Support a large number of printers</A
2810 ></H2
2812 >One issue that has arisen during the development
2813 phase of Samba 2.2 is the need to support driver downloads for
2814 100's of printers. Using the Windows NT APW is somewhat
2815 awkward to say the list. If more than one printer are using the
2816 same driver, the <A
2817 HREF="rpcclient.1.html"
2818 TARGET="_top"
2820 CLASS="COMMAND"
2821 >rpcclient's
2822 setdriver command</B
2823 ></A
2824 > can be used to set the driver
2825 associated with an installed driver. The following is example
2826 of how this could be accomplished:</P
2828 ><TABLE
2829 BORDER="0"
2830 BGCOLOR="#E0E0E0"
2831 WIDTH="100%"
2832 ><TR
2833 ><TD
2834 ><PRE
2835 CLASS="PROGRAMLISTING"
2838 CLASS="PROMPT"
2839 >$ </TT
2840 >rpcclient pogo -U root%secret -c "enumdrivers"
2841 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
2843 [Windows NT x86]
2844 Printer Driver Info 1:
2845 Driver Name: [HP LaserJet 4000 Series PS]
2847 Printer Driver Info 1:
2848 Driver Name: [HP LaserJet 2100 Series PS]
2850 Printer Driver Info 1:
2851 Driver Name: [HP LaserJet 4Si/4SiMX PS]
2854 CLASS="PROMPT"
2855 >$ </TT
2856 >rpcclient pogo -U root%secret -c "enumprinters"
2857 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
2858 flags:[0x800000]
2859 name:[\\POGO\hp-print]
2860 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
2861 comment:[]
2864 CLASS="PROMPT"
2865 >$ </TT
2866 >rpcclient pogo -U root%secret \
2868 CLASS="PROMPT"
2869 >&#62; </TT
2870 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
2871 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
2872 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
2873 ></TD
2874 ></TR
2875 ></TABLE
2876 ></P
2877 ></DIV
2878 ><DIV
2879 CLASS="SECT2"
2880 ><HR><H2
2881 CLASS="SECT2"
2883 NAME="AEN541"
2884 >4.2.4. Adding New Printers via the Windows NT APW</A
2885 ></H2
2887 >By default, Samba offers all printer shares defined in <TT
2888 CLASS="FILENAME"
2889 >smb.conf</TT
2891 in the "Printers..." folder. Also existing in this folder is the Windows NT
2892 Add Printer Wizard icon. The APW will be show only if</P
2894 ></P
2895 ><UL
2896 ><LI
2898 >The connected user is able to successfully
2899 execute an OpenPrinterEx(\\server) with administrative
2900 priviledges (i.e. root or <TT
2901 CLASS="PARAMETER"
2903 >printer admin</I
2904 ></TT
2907 ></LI
2908 ><LI
2911 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
2912 TARGET="_top"
2913 ><TT
2914 CLASS="PARAMETER"
2916 >show
2917 add printer wizard = yes</I
2918 ></TT
2919 ></A
2920 > (the default).
2922 ></LI
2923 ></UL
2925 >In order to be able to use the APW to successfully add a printer to a Samba
2926 server, the <A
2927 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
2928 TARGET="_top"
2929 ><TT
2930 CLASS="PARAMETER"
2932 >add
2933 printer command</I
2934 ></TT
2935 ></A
2936 > must have a defined value. The program
2937 hook must successfully add the printer to the system (i.e.
2939 CLASS="FILENAME"
2940 >/etc/printcap</TT
2941 > or appropriate files) and
2943 CLASS="FILENAME"
2944 >smb.conf</TT
2945 > if necessary.</P
2947 >When using the APW from a client, if the named printer share does
2948 not exist, <B
2949 CLASS="COMMAND"
2950 >smbd</B
2951 > will execute the <TT
2952 CLASS="PARAMETER"
2954 >add printer
2955 command</I
2956 ></TT
2957 > and reparse to the <TT
2958 CLASS="FILENAME"
2959 >smb.conf</TT
2961 to attempt to locate the new printer share. If the share is still not defined,
2962 an error of "Access Denied" is returned to the client. Note that the
2964 CLASS="PARAMETER"
2966 >add printer program</I
2967 ></TT
2968 > is executed under the context
2969 of the connected user, not necessarily a root account.</P
2971 >There is a complementing <A
2972 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
2973 TARGET="_top"
2974 ><TT
2975 CLASS="PARAMETER"
2977 >delete
2978 printer command</I
2979 ></TT
2980 ></A
2981 > for removing entries from the "Printers..."
2982 folder.</P
2983 ></DIV
2984 ><DIV
2985 CLASS="SECT2"
2986 ><HR><H2
2987 CLASS="SECT2"
2989 NAME="AEN566"
2990 >4.2.5. Samba and Printer Ports</A
2991 ></H2
2993 >Windows NT/2000 print servers associate a port with each printer. These normally
2994 take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the
2995 concept of ports associated with a printer. By default, only one printer port,
2996 named "Samba Printer Port", exists on a system. Samba does not really a port in
2997 order to print, rather it is a requirement of Windows clients. </P
2999 >Note that Samba does not support the concept of "Printer Pooling" internally
3000 either. This is when a logical printer is assigned to multiple ports as
3001 a form of load balancing or fail over.</P
3003 >If you require that multiple ports be defined for some reason,
3005 CLASS="FILENAME"
3006 >smb.conf</TT
3007 > possesses a <A
3008 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
3009 TARGET="_top"
3010 ><TT
3011 CLASS="PARAMETER"
3013 >enumports
3014 command</I
3015 ></TT
3016 ></A
3017 > which can be used to define an external program
3018 that generates a listing of ports on a system.</P
3019 ></DIV
3020 ></DIV
3021 ><DIV
3022 CLASS="SECT1"
3023 ><HR><H1
3024 CLASS="SECT1"
3026 NAME="AEN574"
3027 >4.3. The Imprints Toolset</A
3028 ></H1
3030 >The Imprints tool set provides a UNIX equivalent of the
3031 Windows NT Add Printer Wizard. For complete information, please
3032 refer to the Imprints web site at <A
3033 HREF="http://imprints.sourceforge.net/"
3034 TARGET="_top"
3035 > http://imprints.sourceforge.net/</A
3036 > as well as the documentation
3037 included with the imprints source distribution. This section will
3038 only provide a brief introduction to the features of Imprints.</P
3039 ><DIV
3040 CLASS="SECT2"
3041 ><HR><H2
3042 CLASS="SECT2"
3044 NAME="AEN578"
3045 >4.3.1. What is Imprints?</A
3046 ></H2
3048 >Imprints is a collection of tools for supporting the goals
3049 of</P
3051 ></P
3052 ><UL
3053 ><LI
3055 >Providing a central repository information
3056 regarding Windows NT and 95/98 printer driver packages</P
3057 ></LI
3058 ><LI
3060 >Providing the tools necessary for creating
3061 the Imprints printer driver packages.</P
3062 ></LI
3063 ><LI
3065 >Providing an installation client which
3066 will obtain and install printer drivers on remote Samba
3067 and Windows NT 4 print servers.</P
3068 ></LI
3069 ></UL
3070 ></DIV
3071 ><DIV
3072 CLASS="SECT2"
3073 ><HR><H2
3074 CLASS="SECT2"
3076 NAME="AEN588"
3077 >4.3.2. Creating Printer Driver Packages</A
3078 ></H2
3080 >The process of creating printer driver packages is beyond
3081 the scope of this document (refer to Imprints.txt also included
3082 with the Samba distribution for more information). In short,
3083 an Imprints driver package is a gzipped tarball containing the
3084 driver files, related INF files, and a control file needed by the
3085 installation client.</P
3086 ></DIV
3087 ><DIV
3088 CLASS="SECT2"
3089 ><HR><H2
3090 CLASS="SECT2"
3092 NAME="AEN591"
3093 >4.3.3. The Imprints server</A
3094 ></H2
3096 >The Imprints server is really a database server that
3097 may be queried via standard HTTP mechanisms. Each printer
3098 entry in the database has an associated URL for the actual
3099 downloading of the package. Each package is digitally signed
3100 via GnuPG which can be used to verify that package downloaded
3101 is actually the one referred in the Imprints database. It is
3103 >not</EM
3104 > recommended that this security check
3105 be disabled.</P
3106 ></DIV
3107 ><DIV
3108 CLASS="SECT2"
3109 ><HR><H2
3110 CLASS="SECT2"
3112 NAME="AEN595"
3113 >4.3.4. The Installation Client</A
3114 ></H2
3116 >More information regarding the Imprints installation client
3117 is available in the <TT
3118 CLASS="FILENAME"
3119 >Imprints-Client-HOWTO.ps</TT
3121 file included with the imprints source package.</P
3123 >The Imprints installation client comes in two forms.</P
3125 ></P
3126 ><UL
3127 ><LI
3129 >a set of command line Perl scripts</P
3130 ></LI
3131 ><LI
3133 >a GTK+ based graphical interface to
3134 the command line perl scripts</P
3135 ></LI
3136 ></UL
3138 >The installation client (in both forms) provides a means
3139 of querying the Imprints database server for a matching
3140 list of known printer model names as well as a means to
3141 download and install the drivers on remote Samba and Windows
3142 NT print servers.</P
3144 >The basic installation process is in four steps and
3145 perl code is wrapped around <B
3146 CLASS="COMMAND"
3147 >smbclient</B
3149 and <B
3150 CLASS="COMMAND"
3151 >rpcclient</B
3152 >.</P
3154 ><TABLE
3155 BORDER="0"
3156 BGCOLOR="#E0E0E0"
3157 WIDTH="100%"
3158 ><TR
3159 ><TD
3160 ><PRE
3161 CLASS="PROGRAMLISTING"
3163 foreach (supported architecture for a given driver)
3165 1. rpcclient: Get the appropriate upload directory
3166 on the remote server
3167 2. smbclient: Upload the driver files
3168 3. rpcclient: Issues an AddPrinterDriver() MS-RPC
3171 4. rpcclient: Issue an AddPrinterEx() MS-RPC to actually
3172 create the printer</PRE
3173 ></TD
3174 ></TR
3175 ></TABLE
3176 ></P
3178 >One of the problems encountered when implementing
3179 the Imprints tool set was the name space issues between
3180 various supported client architectures. For example, Windows
3181 NT includes a driver named "Apple LaserWriter II NTX v51.8"
3182 and Windows 95 callsits version of this driver "Apple
3183 LaserWriter II NTX"</P
3185 >The problem is how to know what client drivers have
3186 been uploaded for a printer. As astute reader will remember
3187 that the Windows NT Printer Properties dialog only includes
3188 space for one printer driver name. A quick look in the
3189 Windows NT 4.0 system registry at</P
3191 ><TT
3192 CLASS="FILENAME"
3193 >HKLM\System\CurrentControlSet\Control\Print\Environment
3194 </TT
3195 ></P
3197 >will reveal that Windows NT always uses the NT driver
3198 name. This is ok as Windows NT always requires that at least
3199 the Windows NT version of the printer driver is present.
3200 However, Samba does not have the requirement internally.
3201 Therefore, how can you use the NT driver name if is has not
3202 already been installed?</P
3204 >The way of sidestepping this limitation is to require
3205 that all Imprints printer driver packages include both the Intel
3206 Windows NT and 95/98 printer drivers and that NT driver is
3207 installed first.</P
3208 ></DIV
3209 ></DIV
3210 ><DIV
3211 CLASS="SECT1"
3212 ><HR><H1
3213 CLASS="SECT1"
3215 NAME="AEN617"
3216 >4.4. <A
3217 NAME="MIGRATION"
3218 ></A
3219 >Migration to from Samba 2.0.x to 2.2.x</A
3220 ></H1
3222 >Given that printer driver management has changed (we hope improved) in
3223 2.2 over prior releases, migration from an existing setup to 2.2 can
3224 follow several paths.</P
3226 >Windows clients have a tendency to remember things for quite a while.
3227 For example, if a Windows NT client has attached to a Samba 2.0 server,
3228 it will remember the server as a LanMan printer server. Upgrading
3229 the Samba host to 2.2 makes support for MSRPC printing possible, but
3230 the NT client will still remember the previous setting.</P
3232 >In order to give an NT client printing "amesia" (only necessary if you
3233 want to use the newer MSRPC printing functionality in Samba), delete
3234 the registry keys associated with the print server contained in
3236 CLASS="CONSTANT"
3237 >[HKLM\SYSTEM\CurrentControlSet\Control\Print]</TT
3238 >. The
3239 spooler service on the client should be stopped prior to doing this:</P
3241 ><TT
3242 CLASS="PROMPT"
3243 >C:\WINNT\ &#62;</TT
3244 > <TT
3245 CLASS="USERINPUT"
3247 >net stop spooler</B
3248 ></TT
3249 ></P
3251 ><EM
3252 >All the normal disclaimers about editing the registry go
3253 here.</EM
3254 > Be careful, and know what you are doing.</P
3256 >The spooler service should be restarted after you have finished
3257 removing the appropriate registry entries by replacing the
3259 CLASS="COMMAND"
3260 >stop</B
3261 > command above with <B
3262 CLASS="COMMAND"
3263 >start</B
3264 >.</P
3266 >Windows 9x clients will continue to use LanMan printing calls
3267 with a 2.2 Samba server so there is no need to perform any of these
3268 modifications on non-NT clients.</P
3269 ><DIV
3270 CLASS="WARNING"
3272 ></P
3273 ><TABLE
3274 CLASS="WARNING"
3275 BORDER="1"
3276 WIDTH="100%"
3277 ><TR
3278 ><TD
3279 ALIGN="CENTER"
3281 >Achtung!</B
3282 ></TD
3283 ></TR
3284 ><TR
3285 ><TD
3286 ALIGN="LEFT"
3288 >The following smb.conf parameters are considered to be depreciated and will
3289 be removed soon. Do not use them in new installations</P
3291 ></P
3292 ><UL
3293 ><LI
3295 ><TT
3296 CLASS="PARAMETER"
3298 >printer driver file (G)</I
3299 ></TT
3302 ></LI
3303 ><LI
3305 ><TT
3306 CLASS="PARAMETER"
3308 >printer driver (S)</I
3309 ></TT
3312 ></LI
3313 ><LI
3315 ><TT
3316 CLASS="PARAMETER"
3318 >printer driver location (S)</I
3319 ></TT
3322 ></LI
3323 ></UL
3324 ></TD
3325 ></TR
3326 ></TABLE
3327 ></DIV
3329 >Here are the possible scenarios for supporting migration:</P
3331 ></P
3332 ><UL
3333 ><LI
3335 >If you do not desire the new Windows NT
3336 print driver support, nothing needs to be done.
3337 All existing parameters work the same.</P
3338 ></LI
3339 ><LI
3341 >If you want to take advantage of NT printer
3342 driver support but do not want to migrate the
3343 9x drivers to the new setup, the leave the existing
3344 printers.def file. When smbd attempts to locate a
3345 9x driver for the printer in the TDB and fails it
3346 will drop down to using the printers.def (and all
3347 associated parameters). The <B
3348 CLASS="COMMAND"
3349 >make_printerdef</B
3351 tool will also remain for backwards compatibility but will
3352 be moved to the "this tool is the old way of doing it"
3353 pile.</P
3354 ></LI
3355 ><LI
3357 >If you install a Windows 9x driver for a printer
3358 on your Samba host (in the printing TDB), this information will
3359 take precedence and the three old printing parameters
3360 will be ignored (including print driver location).</P
3361 ></LI
3362 ><LI
3364 >If you want to migrate an existing <TT
3365 CLASS="FILENAME"
3366 >printers.def</TT
3368 file into the new setup, the current only solution is to use the Windows
3369 NT APW to install the NT drivers and the 9x drivers. This can be scripted
3370 using <B
3371 CLASS="COMMAND"
3372 >smbclient</B
3373 > and <B
3374 CLASS="COMMAND"
3375 >rpcclient</B
3376 >. See the
3377 Imprints installation client at <A
3378 HREF="http://imprints.sourceforge.net/"
3379 TARGET="_top"
3380 >http://imprints.sourceforge.net/</A
3382 for an example.
3384 ></LI
3385 ></UL
3386 ></DIV
3387 ></DIV
3388 ><DIV
3389 CLASS="CHAPTER"
3390 ><HR><H1
3392 NAME="AEN661"
3393 >Chapter 5. security = domain in Samba 2.x</A
3394 ></H1
3395 ><DIV
3396 CLASS="SECT1"
3397 ><H1
3398 CLASS="SECT1"
3400 NAME="AEN679"
3401 >5.1. Joining an NT Domain with Samba 2.2</A
3402 ></H1
3404 >In order for a Samba-2 server to join an NT domain,
3405 you must first add the NetBIOS name of the Samba server to the
3406 NT domain on the PDC using Server Manager for Domains. This creates
3407 the machine account in the domain (PDC) SAM. Note that you should
3408 add the Samba server as a "Windows NT Workstation or Server",
3410 >NOT</EM
3411 > as a Primary or backup domain controller.</P
3413 >Assume you have a Samba-2 server with a NetBIOS name of
3415 CLASS="CONSTANT"
3416 >SERV1</TT
3417 > and are joining an NT domain called
3419 CLASS="CONSTANT"
3420 >DOM</TT
3421 >, which has a PDC with a NetBIOS name
3422 of <TT
3423 CLASS="CONSTANT"
3424 >DOMPDC</TT
3425 > and two backup domain controllers
3426 with NetBIOS names <TT
3427 CLASS="CONSTANT"
3428 >DOMBDC1</TT
3429 > and <TT
3430 CLASS="CONSTANT"
3431 >DOMBDC2
3432 </TT
3433 >.</P
3435 >In order to join the domain, first stop all Samba daemons
3436 and run the command:</P
3438 ><TT
3439 CLASS="PROMPT"
3440 >root# </TT
3441 ><TT
3442 CLASS="USERINPUT"
3444 >smbpasswd -j DOM -r DOMPDC
3446 ></TT
3447 ></P
3449 >as we are joining the domain DOM and the PDC for that domain
3450 (the only machine that has write access to the domain SAM database)
3451 is DOMPDC. If this is successful you will see the message:</P
3453 ><TT
3454 CLASS="COMPUTEROUTPUT"
3455 >smbpasswd: Joined domain DOM.</TT
3459 >in your terminal window. See the <A
3460 HREF="smbpasswd.8.html"
3461 TARGET="_top"
3462 > smbpasswd(8)</A
3463 > man page for more details.</P
3465 >There is existing development code to join a domain
3466 without having to create the machine trust account on the PDC
3467 beforehand. This code will hopefully be available soon
3468 in release branches as well.</P
3470 >This command goes through the machine account password
3471 change protocol, then writes the new (random) machine account
3472 password for this Samba server into a file in the same directory
3473 in which an smbpasswd file would be stored - normally :</P
3475 ><TT
3476 CLASS="FILENAME"
3477 >/usr/local/samba/private</TT
3478 ></P
3480 >In Samba 2.0.x, the filename looks like this:</P
3482 ><TT
3483 CLASS="FILENAME"
3484 ><TT
3485 CLASS="REPLACEABLE"
3487 >&#60;NT DOMAIN NAME&#62;</I
3488 ></TT
3489 >.<TT
3490 CLASS="REPLACEABLE"
3492 >&#60;Samba
3493 Server Name&#62;</I
3494 ></TT
3495 >.mac</TT
3496 ></P
3498 >The <TT
3499 CLASS="FILENAME"
3500 >.mac</TT
3501 > suffix stands for machine account
3502 password file. So in our example above, the file would be called:</P
3504 ><TT
3505 CLASS="FILENAME"
3506 >DOM.SERV1.mac</TT
3507 ></P
3509 >In Samba 2.2, this file has been replaced with a TDB
3510 (Trivial Database) file named <TT
3511 CLASS="FILENAME"
3512 >secrets.tdb</TT
3516 >This file is created and owned by root and is not
3517 readable by any other user. It is the key to the domain-level
3518 security for your system, and should be treated as carefully
3519 as a shadow password file.</P
3521 >Now, before restarting the Samba daemons you must
3522 edit your <A
3523 HREF="smb.conf.5.html"
3524 TARGET="_top"
3525 ><TT
3526 CLASS="FILENAME"
3527 >smb.conf(5)</TT
3530 > file to tell Samba it should now use domain security.</P
3532 >Change (or add) your <A
3533 HREF="smb.conf.5.html#SECURITY"
3534 TARGET="_top"
3535 > <TT
3536 CLASS="PARAMETER"
3538 >security =</I
3539 ></TT
3540 ></A
3541 > line in the [global] section
3542 of your smb.conf to read:</P
3545 CLASS="COMMAND"
3546 >security = domain</B
3547 ></P
3549 >Next change the <A
3550 HREF="smb.conf.5.html#WORKGROUP"
3551 TARGET="_top"
3552 ><TT
3553 CLASS="PARAMETER"
3555 > workgroup =</I
3556 ></TT
3557 ></A
3558 > line in the [global] section to read: </P
3561 CLASS="COMMAND"
3562 >workgroup = DOM</B
3563 ></P
3565 >as this is the name of the domain we are joining. </P
3567 >You must also have the parameter <A
3568 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
3569 TARGET="_top"
3570 > <TT
3571 CLASS="PARAMETER"
3573 >encrypt passwords</I
3574 ></TT
3575 ></A
3576 > set to <TT
3577 CLASS="CONSTANT"
3578 >yes
3579 </TT
3580 > in order for your users to authenticate to the NT PDC.</P
3582 >Finally, add (or modify) a <A
3583 HREF="smb.conf.5.html#PASSWORDSERVER"
3584 TARGET="_top"
3585 > <TT
3586 CLASS="PARAMETER"
3588 >password server =</I
3589 ></TT
3590 ></A
3591 > line in the [global]
3592 section to read: </P
3595 CLASS="COMMAND"
3596 >password server = DOMPDC DOMBDC1 DOMBDC2</B
3597 ></P
3599 >These are the primary and backup domain controllers Samba
3600 will attempt to contact in order to authenticate users. Samba will
3601 try to contact each of these servers in order, so you may want to
3602 rearrange this list in order to spread out the authentication load
3603 among domain controllers.</P
3605 >Alternatively, if you want smbd to automatically determine
3606 the list of Domain controllers to use for authentication, you may
3607 set this line to be :</P
3610 CLASS="COMMAND"
3611 >password server = *</B
3612 ></P
3614 >This method, which was introduced in Samba 2.0.6,
3615 allows Samba to use exactly the same mechanism that NT does. This
3616 method either broadcasts or uses a WINS database in order to
3617 find domain controllers to authenticate against.</P
3619 >Finally, restart your Samba daemons and get ready for
3620 clients to begin using domain security!</P
3621 ></DIV
3622 ><DIV
3623 CLASS="SECT1"
3624 ><HR><H1
3625 CLASS="SECT1"
3627 NAME="AEN743"
3628 >5.2. Samba and Windows 2000 Domains</A
3629 ></H1
3631 >Many people have asked regarding the state of Samba's ability to participate in
3632 a Windows 2000 Domain. Samba 2.2 is able to act as a member server of a Windows
3633 2000 domain operating in mixed or native mode.</P
3635 >There is much confusion between the circumstances that require a "mixed" mode
3636 Win2k DC and a when this host can be switched to "native" mode. A "mixed" mode
3637 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
3638 domain. By default, a Win2k DC in "native" mode will still support
3639 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and
3640 NT 4.0. Samba has the same requirements as a Windows NT 4.0 member server.</P
3642 >The steps for adding a Samba 2.2 host to a Win2k domain are the same as those
3643 for adding a Samba server to a Windows NT 4.0 domain. The only exception is that
3644 the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and
3645 Computers" MMC (Microsoft Management Console) plugin.</P
3646 ></DIV
3647 ><DIV
3648 CLASS="SECT1"
3649 ><HR><H1
3650 CLASS="SECT1"
3652 NAME="AEN748"
3653 >5.3. Why is this better than security = server?</A
3654 ></H1
3656 >Currently, domain security in Samba doesn't free you from
3657 having to create local Unix users to represent the users attaching
3658 to your server. This means that if domain user <TT
3659 CLASS="CONSTANT"
3660 >DOM\fred
3661 </TT
3662 > attaches to your domain security Samba server, there needs
3663 to be a local Unix user fred to represent that user in the Unix
3664 filesystem. This is very similar to the older Samba security mode
3666 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
3667 TARGET="_top"
3668 >security = server</A
3670 where Samba would pass through the authentication request to a Windows
3671 NT server in the same way as a Windows 95 or Windows 98 server would.
3674 >Please refer to the <A
3675 HREF="winbind.html"
3676 TARGET="_top"
3677 >Winbind
3678 paper</A
3679 > for information on a system to automatically
3680 assign UNIX uids and gids to Windows NT Domain users and groups.
3681 This code is available in development branches only at the moment,
3682 but will be moved to release branches soon.</P
3684 >The advantage to domain-level security is that the
3685 authentication in domain-level security is passed down the authenticated
3686 RPC channel in exactly the same way that an NT server would do it. This
3687 means Samba servers now participate in domain trust relationships in
3688 exactly the same way NT servers do (i.e., you can add Samba servers into
3689 a resource domain and have the authentication passed on from a resource
3690 domain PDC to an account domain PDC.</P
3692 >In addition, with <B
3693 CLASS="COMMAND"
3694 >security = server</B
3695 > every Samba
3696 daemon on a server has to keep a connection open to the
3697 authenticating server for as long as that daemon lasts. This can drain
3698 the connection resources on a Microsoft NT server and cause it to run
3699 out of available connections. With <B
3700 CLASS="COMMAND"
3701 >security = domain</B
3703 however, the Samba daemons connect to the PDC/BDC only for as long
3704 as is necessary to authenticate the user, and then drop the connection,
3705 thus conserving PDC connection resources.</P
3707 >And finally, acting in the same manner as an NT server
3708 authenticating to a PDC means that as part of the authentication
3709 reply, the Samba server gets the user identification information such
3710 as the user SID, the list of NT groups the user belongs to, etc. All
3711 this information will allow Samba to be extended in the future into
3712 a mode the developers currently call appliance mode. In this mode,
3713 no local Unix users will be necessary, and Samba will generate Unix
3714 uids and gids from the information passed back from the PDC when a
3715 user is authenticated, making a Samba server truly plug and play
3716 in an NT domain environment. Watch for this code soon.</P
3718 ><EM
3719 >NOTE:</EM
3720 > Much of the text of this document
3721 was first published in the Web magazine <A
3722 HREF="http://www.linuxworld.com"
3723 TARGET="_top"
3725 LinuxWorld</A
3726 > as the article <A
3727 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
3728 TARGET="_top"
3729 >Doing
3730 the NIS/NT Samba</A
3731 >.</P
3732 ></DIV
3733 ></DIV
3734 ><DIV
3735 CLASS="CHAPTER"
3736 ><HR><H1
3738 NAME="AEN764"
3739 >Chapter 6. How to Configure Samba 2.2 as a Primary Domain Controller</A
3740 ></H1
3741 ><DIV
3742 CLASS="SECT1"
3743 ><H1
3744 CLASS="SECT1"
3746 NAME="AEN781"
3747 >6.1. Prerequisite Reading</A
3748 ></H1
3750 >Before you continue readingin this chapter, please make sure
3751 that you are comfortable with configuring basic files services
3752 in smb.conf and how to enable and administrate password
3753 encryption in Samba. Theses two topics are covered in the
3755 HREF="smb.conf.5.html"
3756 TARGET="_top"
3757 ><TT
3758 CLASS="FILENAME"
3759 >smb.conf(5)</TT
3760 ></A
3762 manpage and the <A
3763 HREF="EMCRYPTION.html"
3764 TARGET="_top"
3765 >Encryption chapter</A
3767 of this HOWTO Collection.</P
3768 ></DIV
3769 ><DIV
3770 CLASS="SECT1"
3771 ><HR><H1
3772 CLASS="SECT1"
3774 NAME="AEN787"
3775 >6.2. Background</A
3776 ></H1
3777 ><DIV
3778 CLASS="NOTE"
3779 ><BLOCKQUOTE
3780 CLASS="NOTE"
3783 >Note: </B
3784 ><EM
3785 >Author's Note :</EM
3786 > This document is a combination
3787 of David Bannon's Samba 2.2 PDC HOWTO and the Samba NT Domain FAQ.
3788 Both documents are superceeded by this one.</P
3789 ></BLOCKQUOTE
3790 ></DIV
3792 >Version of Samba prior to release 2.2 had marginal capabilities to
3793 act as a Windows NT 4.0 Primary Domain Controller (PDC). Beginning with
3794 Samba 2.2.0, we are proud to announce official support for Windows NT 4.0
3795 style domain logons from Windows NT 4.0 (through SP6) and Windows 2000 (through
3796 SP1) clients. This article outlines the steps necessary for configuring Samba
3797 as a PDC. It is necessary to have a working Samba server prior to implementing the
3798 PDC functionality. If you have not followed the steps outlined in
3800 HREF="UNIX_INSTALL.html"
3801 TARGET="_top"
3802 > UNIX_INSTALL.html</A
3803 >, please make sure
3804 that your server is configured correctly before proceeding. Another good
3805 resource in the <A
3806 HREF="smb.conf.5.html"
3807 TARGET="_top"
3808 >smb.conf(5) man
3809 page</A
3810 >. The following functionality should work in 2.2:</P
3812 ></P
3813 ><UL
3814 ><LI
3816 > domain logons for Windows NT 4.0/2000 clients.
3818 ></LI
3819 ><LI
3821 > placing a Windows 9x client in user level security
3823 ></LI
3824 ><LI
3826 > retrieving a list of users and groups from a Samba PDC to
3827 Windows 9x/NT/2000 clients
3829 ></LI
3830 ><LI
3832 > roving (roaming) user profiles
3834 ></LI
3835 ><LI
3837 > Windows NT 4.0 style system policies
3839 ></LI
3840 ></UL
3841 ><DIV
3842 CLASS="WARNING"
3844 ></P
3845 ><TABLE
3846 CLASS="WARNING"
3847 BORDER="1"
3848 WIDTH="100%"
3849 ><TR
3850 ><TD
3851 ALIGN="CENTER"
3853 >Windows 2000 Service Pack 2 Clients</B
3854 ></TD
3855 ></TR
3856 ><TR
3857 ><TD
3858 ALIGN="LEFT"
3860 > Samba 2.2.1 is required for PDC functionality when using Windows 2000
3861 SP2 clients.
3863 ></TD
3864 ></TR
3865 ></TABLE
3866 ></DIV
3868 >The following pieces of functionality are not included in the 2.2 release:</P
3870 ></P
3871 ><UL
3872 ><LI
3874 > Windows NT 4 domain trusts
3876 ></LI
3877 ><LI
3879 > SAM replication with Windows NT 4.0 Domain Controllers
3880 (i.e. a Samba PDC and a Windows NT BDC or vice versa)
3882 ></LI
3883 ><LI
3885 > Adding users via the User Manager for Domains
3887 ></LI
3888 ><LI
3890 > Acting as a Windows 2000 Domain Controller (i.e. Kerberos and
3891 Active Directory)
3893 ></LI
3894 ></UL
3896 >Please note that Windows 9x clients are not true members of a domain
3897 for reasons outlined in this article. Therefore the protocol for
3898 support Windows 9x style domain logons is completely different
3899 from NT4 domain logons and has been officially supported for some
3900 time.</P
3902 >Implementing a Samba PDC can basically be divided into 2 broad
3903 steps.</P
3905 ></P
3906 ><OL
3907 TYPE="1"
3908 ><LI
3910 > Configuring the Samba PDC
3912 ></LI
3913 ><LI
3915 > Creating machine trust accounts and joining clients
3916 to the domain
3918 ></LI
3919 ></OL
3921 >There are other minor details such as user profiles, system
3922 policies, etc... However, these are not necessarily specific
3923 to a Samba PDC as much as they are related to Windows NT networking
3924 concepts. They will be mentioned only briefly here.</P
3925 ></DIV
3926 ><DIV
3927 CLASS="SECT1"
3928 ><HR><H1
3929 CLASS="SECT1"
3931 NAME="AEN827"
3932 >6.3. Configuring the Samba Domain Controller</A
3933 ></H1
3935 >The first step in creating a working Samba PDC is to
3936 understand the parameters necessary in smb.conf. I will not
3937 attempt to re-explain the parameters here as they are more that
3938 adequately covered in <A
3939 HREF="smb.conf.5.html"
3940 TARGET="_top"
3941 > the smb.conf
3942 man page</A
3943 >. For convenience, the parameters have been
3944 linked with the actual smb.conf description.</P
3946 >Here is an example smb.conf for acting as a PDC:</P
3948 ><TABLE
3949 BORDER="0"
3950 BGCOLOR="#E0E0E0"
3951 WIDTH="100%"
3952 ><TR
3953 ><TD
3954 ><PRE
3955 CLASS="PROGRAMLISTING"
3956 >[global]
3957 ; Basic server settings
3959 HREF="smb.conf.5.html#NETBIOSNAME"
3960 TARGET="_top"
3961 >netbios name</A
3962 > = <TT
3963 CLASS="REPLACEABLE"
3965 >POGO</I
3966 ></TT
3969 HREF="smb.conf.5.html#WORKGROUP"
3970 TARGET="_top"
3971 >workgroup</A
3972 > = <TT
3973 CLASS="REPLACEABLE"
3975 >NARNIA</I
3976 ></TT
3979 ; we should act as the domain and local master browser
3981 HREF="smb.conf.5.html#OSLEVEL"
3982 TARGET="_top"
3983 >os level</A
3984 > = 64
3986 HREF="smb.conf.5.html#PERFERREDMASTER"
3987 TARGET="_top"
3988 >preferred master</A
3989 > = yes
3991 HREF="smb.conf.5.html#DOMAINMASTER"
3992 TARGET="_top"
3993 >domain master</A
3994 > = yes
3996 HREF="smb.conf.5.html#LOCALMASTER"
3997 TARGET="_top"
3998 >local master</A
3999 > = yes
4001 ; security settings (must user security = user)
4003 HREF="smb.conf.5.html#SECURITYEQUALSUSER"
4004 TARGET="_top"
4005 >security</A
4006 > = user
4008 ; encrypted passwords are a requirement for a PDC
4010 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
4011 TARGET="_top"
4012 >encrypt passwords</A
4013 > = yes
4015 ; support domain logons
4017 HREF="smb.conf.5.html#DOMAINLOGONS"
4018 TARGET="_top"
4019 >domain logons</A
4020 > = yes
4022 ; where to store user profiles?
4024 HREF="smb.conf.5.html#LOGONPATH"
4025 TARGET="_top"
4026 >logon path</A
4027 > = \\%N\profiles\%u
4029 ; where is a user's home directory and where should it
4030 ; be mounted at?
4032 HREF="smb.conf.5.html#LOGONDRIVE"
4033 TARGET="_top"
4034 >logon drive</A
4035 > = H:
4037 HREF="smb.conf.5.html#LOGONHOME"
4038 TARGET="_top"
4039 >logon home</A
4040 > = \\homeserver\%u
4042 ; specify a generic logon script for all users
4043 ; this is a relative **DOS** path to the [netlogon] share
4045 HREF="smb.conf.5.html#LOGONSCRIPT"
4046 TARGET="_top"
4047 >logon script</A
4048 > = logon.cmd
4050 ; necessary share for domain controller
4051 [netlogon]
4053 HREF="smb.conf.5.html#PATH"
4054 TARGET="_top"
4055 >path</A
4056 > = /usr/local/samba/lib/netlogon
4058 HREF="smb.conf.5.html#WRITEABLE"
4059 TARGET="_top"
4060 >writeable</A
4061 > = no
4063 HREF="smb.conf.5.html#WRITELIST"
4064 TARGET="_top"
4065 >write list</A
4066 > = <TT
4067 CLASS="REPLACEABLE"
4069 >ntadmin</I
4070 ></TT
4073 ; share for storing user profiles
4074 [profiles]
4076 HREF="smb.conf.5.html#PATH"
4077 TARGET="_top"
4078 >path</A
4079 > = /export/smb/ntprofile
4081 HREF="smb.conf.5.html#WRITEABLE"
4082 TARGET="_top"
4083 >writeable</A
4084 > = yes
4086 HREF="smb.conf.5.html#CREATEMASK"
4087 TARGET="_top"
4088 >create mask</A
4089 > = 0600
4091 HREF="smb.conf.5.html#DIRECTORYMASK"
4092 TARGET="_top"
4093 >directory mask</A
4094 > = 0700</PRE
4095 ></TD
4096 ></TR
4097 ></TABLE
4098 ></P
4100 >There are a couple of points to emphasize in the above configuration.</P
4102 ></P
4103 ><UL
4104 ><LI
4106 > Encrypted passwords must be enabled. For more details on how
4107 to do this, refer to <A
4108 HREF="ENCRYPTION.html"
4109 TARGET="_top"
4110 >ENCRYPTION.html</A
4113 ></LI
4114 ><LI
4116 > The server must support domain logons and a
4118 CLASS="FILENAME"
4119 >[netlogon]</TT
4120 > share
4122 ></LI
4123 ><LI
4125 > The server must be the domain master browser in order for Windows
4126 client to locate the server as a DC. Please refer to the various
4127 Network Browsing documentation included with this distribution for
4128 details.
4130 ></LI
4131 ></UL
4133 >As Samba 2.2 does not offer a complete implementation of group mapping between
4134 Windows NT groups and UNIX groups (this is really quite complicated to explain
4135 in a short space), you should refer to the <A
4136 HREF="smb.conf.5.html#DOMAINADMINUSERS"
4137 TARGET="_top"
4138 >domain
4139 admin users</A
4140 > and <A
4141 HREF="smb.conf.5.html#DOMAINADMINGROUP"
4142 TARGET="_top"
4143 >domain
4144 admin group</A
4145 > smb.conf parameters for information of creating a Domain Admins
4146 style accounts.</P
4147 ></DIV
4148 ><DIV
4149 CLASS="SECT1"
4150 ><HR><H1
4151 CLASS="SECT1"
4153 NAME="AEN870"
4154 >6.4. Creating Machine Trust Accounts and Joining Clients
4155 to the Domain</A
4156 ></H1
4158 >A machine trust account is a samba user account owned by a computer.
4159 The account password acts as the shared secret for secure
4160 communication with the Domain Controller. This is a security feature
4161 to prevent an unauthorized machine with the same netbios name from
4162 joining the domain and gaining access to domain user/group accounts.
4163 Hence a Windows 9x host is never a true member of a domain because it does
4164 not posses a machine trust account, and thus has no shared secret with the DC.</P
4166 >On a Windows NT PDC, these machine trust account passwords are stored
4167 in the registry. A Samba PDC stores these accounts in the same location
4168 as user LanMan and NT password hashes (currently <TT
4169 CLASS="FILENAME"
4170 >smbpasswd</TT
4172 However, machine trust accounts only possess and use the NT password hash.</P
4174 >Because Samba requires machine accounts to possess a UNIX uid from
4175 which an Windows NT SID can be generated, all of these accounts
4176 must have an entry in <TT
4177 CLASS="FILENAME"
4178 >/etc/passwd</TT
4179 > and smbpasswd.
4180 Future releases will alleviate the need to create
4182 CLASS="FILENAME"
4183 >/etc/passwd</TT
4184 > entries. </P
4186 >There are two means of creating machine trust accounts.</P
4188 ></P
4189 ><UL
4190 ><LI
4192 > Manual creation before joining the client to the domain. In this case,
4193 the password is set to a known value -- the lower case of the
4194 machine's netbios name.
4196 ></LI
4197 ><LI
4199 > Creation of the account at the time of joining the domain. In
4200 this case, the session key of the administrative account used to join
4201 the client to the domain acts as an encryption key for setting the
4202 password to a random value (This is the recommended method).
4204 ></LI
4205 ></UL
4206 ><DIV
4207 CLASS="SECT2"
4208 ><HR><H2
4209 CLASS="SECT2"
4211 NAME="AEN884"
4212 >6.4.1. Manually creating machine trust accounts</A
4213 ></H2
4215 >The first step in creating a machine trust account by hand is to
4216 create an entry for the machine in /etc/passwd. This can be done
4217 using <B
4218 CLASS="COMMAND"
4219 >vipw</B
4220 > or any 'add userr' command which is normally
4221 used to create new UNIX accounts. The following is an example for a Linux
4222 based Samba server:</P
4224 ><TT
4225 CLASS="PROMPT"
4226 >root# </TT
4227 >/usr/sbin/useradd -g 100 -d /dev/null -c <TT
4228 CLASS="REPLACEABLE"
4230 >machine_nickname</I
4231 ></TT
4232 > -m -s /bin/false <TT
4233 CLASS="REPLACEABLE"
4235 >machine_name</I
4236 ></TT
4237 >$</P
4239 >The <TT
4240 CLASS="FILENAME"
4241 >/etc/passwd</TT
4242 > entry will list the machine name
4243 with a $ appended, won't have a passwd, will have a null shell and no
4244 home directory. For example a machine called 'doppy' would have an
4246 CLASS="FILENAME"
4247 >/etc/passwd</TT
4248 > entry like this :</P
4250 ><TABLE
4251 BORDER="0"
4252 BGCOLOR="#E0E0E0"
4253 WIDTH="100%"
4254 ><TR
4255 ><TD
4256 ><PRE
4257 CLASS="PROGRAMLISTING"
4258 >doppy$:x:505:501:<TT
4259 CLASS="REPLACEABLE"
4261 >machine_nickname</I
4262 ></TT
4263 >:/dev/null:/bin/false</PRE
4264 ></TD
4265 ></TR
4266 ></TABLE
4267 ></P
4269 >Above, <TT
4270 CLASS="REPLACEABLE"
4272 >machine_nickname</I
4273 ></TT
4274 > can be any descriptive name for the
4275 pc i.e. BasementComputer. The <TT
4276 CLASS="REPLACEABLE"
4278 >machine_name</I
4279 ></TT
4280 > absolutely must be
4281 the netbios name of the pc to be added to the domain. The "$" must append the netbios
4282 name of the pc or samba will not recognize this as a machine account</P
4284 >Now that the UNIX account has been created, the next step is to create
4285 the smbpasswd entry for the machine containing the well known initial
4286 trust account password. This can be done using the <A
4287 HREF="smbpasswd.6.html"
4288 TARGET="_top"
4290 CLASS="COMMAND"
4291 >smbpasswd(8)</B
4292 ></A
4293 > command
4294 as shown here:</P
4296 ><TT
4297 CLASS="PROMPT"
4298 >root# </TT
4299 > smbpasswd -a -m <TT
4300 CLASS="REPLACEABLE"
4302 >machine_name</I
4303 ></TT
4304 ></P
4306 >where <TT
4307 CLASS="REPLACEABLE"
4309 >machine_name</I
4310 ></TT
4311 > is the machine's netbios
4312 name. </P
4313 ><DIV
4314 CLASS="WARNING"
4316 ></P
4317 ><TABLE
4318 CLASS="WARNING"
4319 BORDER="1"
4320 WIDTH="100%"
4321 ><TR
4322 ><TD
4323 ALIGN="CENTER"
4325 >Join the client to the domain immediately</B
4326 ></TD
4327 ></TR
4328 ><TR
4329 ><TD
4330 ALIGN="LEFT"
4332 > Manually creating a machine trust account using this method is the
4333 equivalent of creating a machine account on a Windows NT PDC using
4334 the "Server Manager". From the time at which the account is created
4335 to the time which th client joins the domain and changes the password,
4336 your domain is vulnerable to an intruder joining your domain using a
4337 a machine with the same netbios name. A PDC inherently trusts
4338 members of the domain and will serve out a large degree of user
4339 information to such clients. You have been warned!
4341 ></TD
4342 ></TR
4343 ></TABLE
4344 ></DIV
4345 ></DIV
4346 ><DIV
4347 CLASS="SECT2"
4348 ><HR><H2
4349 CLASS="SECT2"
4351 NAME="AEN912"
4352 >6.4.2. Creating machine trust accounts "on the fly"</A
4353 ></H2
4355 >The second, and most recommended way of creating machine trust accounts
4356 is to create them as needed at the time the client is joined to
4357 the domain. You will need to include a value for the <A
4358 HREF="smb.conf.5.html#ADDUSERSCRIPT"
4359 TARGET="_top"
4360 >add user script</A
4362 parameter. Below is an example from a RedHat 6.2 Linux system.</P
4364 ><TABLE
4365 BORDER="0"
4366 BGCOLOR="#E0E0E0"
4367 WIDTH="100%"
4368 ><TR
4369 ><TD
4370 ><PRE
4371 CLASS="PROGRAMLISTING"
4372 >add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u </PRE
4373 ></TD
4374 ></TR
4375 ></TABLE
4376 ></P
4378 >In Samba 2.2.1, <EM
4379 >only the root account</EM
4380 > can be used to create
4381 machine accounts like this. Therefore, it is required to create
4382 an entry in smbpasswd for <EM
4383 >root</EM
4384 >. The password
4386 >SHOULD</EM
4387 > be set to s different password that the
4388 associated <TT
4389 CLASS="FILENAME"
4390 >/etc/passwd</TT
4391 > entry for security reasons.</P
4392 ></DIV
4393 ></DIV
4394 ><DIV
4395 CLASS="SECT1"
4396 ><HR><H1
4397 CLASS="SECT1"
4399 NAME="AEN923"
4400 >6.5. Common Problems and Errors</A
4401 ></H1
4403 ></P
4405 ></P
4406 ><UL
4407 ><LI
4409 > <EM
4410 >I cannot include a '$' in a machine name.</EM
4414 > A 'machine name' in (typically) <TT
4415 CLASS="FILENAME"
4416 >/etc/passwd</TT
4418 of the machine name with a '$' appended. FreeBSD (and other BSD
4419 systems ?) won't create a user with a '$' in their name.
4422 > The problem is only in the program used to make the entry, once
4423 made, it works perfectly. So create a user without the '$' and
4424 use <B
4425 CLASS="COMMAND"
4426 >vipw</B
4427 > to edit the entry, adding the '$'. Or create
4428 the whole entry with vipw if you like, make sure you use a
4429 unique uid !
4431 ></LI
4432 ><LI
4434 > <EM
4435 >I get told "You already have a connection to the Domain...."
4436 or "Cannot join domain, the credentials supplied conflict with an
4437 existing set.." when creating a machine account.</EM
4441 > This happens if you try to create a machine account from the
4442 machine itself and already have a connection (e.g. mapped drive)
4443 to a share (or IPC$) on the Samba PDC. The following command
4444 will remove all network drive connections:
4447 > <TT
4448 CLASS="PROMPT"
4449 >C:\WINNT\&#62;</TT
4450 > <B
4451 CLASS="COMMAND"
4452 >net use * /d</B
4456 > Further, if the machine is a already a 'member of a workgroup' that
4457 is the same name as the domain you are joining (bad idea) you will
4458 get this message. Change the workgroup name to something else, it
4459 does not matter what, reboot, and try again.
4461 ></LI
4462 ><LI
4464 > <EM
4465 >The system can not log you on (C000019B)....</EM
4469 >I joined the domain successfully but after upgrading
4470 to a newer version of the Samba code I get the message, "The system
4471 can not log you on (C000019B), Please try a gain or consult your
4472 system administrator" when attempting to logon.
4475 > This occurs when the domain SID stored in
4477 CLASS="FILENAME"
4478 >private/WORKGROUP.SID</TT
4479 > is
4480 changed. For example, you remove the file and <B
4481 CLASS="COMMAND"
4482 >smbd</B
4483 > automatically
4484 creates a new one. Or you are swapping back and forth between
4485 versions 2.0.7, TNG and the HEAD branch code (not recommended). The
4486 only way to correct the problem is to restore the original domain
4487 SID or remove the domain client from the domain and rejoin.
4489 ></LI
4490 ><LI
4492 > <EM
4493 >The machine account for this computer either does not
4494 exist or is not accessible.</EM
4498 > When I try to join the domain I get the message "The machine account
4499 for this computer either does not exist or is not accessible". Whats
4500 wrong?
4503 > This problem is caused by the PDC not having a suitable machine account.
4504 If you are using the <TT
4505 CLASS="PARAMETER"
4507 >add user script</I
4508 ></TT
4509 > method to create
4510 accounts then this would indicate that it has not worked. Ensure the domain
4511 admin user system is working.
4514 > Alternatively if you are creating account entries manually then they
4515 have not been created correctly. Make sure that you have the entry
4516 correct for the machine account in smbpasswd file on the Samba PDC.
4517 If you added the account using an editor rather than using the smbpasswd
4518 utility, make sure that the account name is the machine netbios name
4519 with a '$' appended to it ( ie. computer_name$ ). There must be an entry
4520 in both /etc/passwd and the smbpasswd file. Some people have reported
4521 that inconsistent subnet masks between the Samba server and the NT
4522 client have caused this problem. Make sure that these are consistent
4523 for both client and server.
4525 ></LI
4526 ><LI
4528 > <EM
4529 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
4530 I get a message about my account being disabled.</EM
4534 > This problem is caused by a PAM related bug in Samba 2.2.0. This bug is
4535 fixed in 2.2.1. Other symptoms could be unaccessible shares on
4536 NT/W2K member servers in the domain or the following error in your smbd.log:
4537 passdb/pampass.c:pam_account(268) PAM: UNKNOWN ERROR for User: %user%
4540 > At first be ensure to enable the useraccounts with <B
4541 CLASS="COMMAND"
4542 >smbpasswd -e
4543 %user%</B
4544 >, this is normaly done, when you create an account.
4547 > In order to work around this problem in 2.2.0, configure the
4549 CLASS="PARAMETER"
4551 >account</I
4552 ></TT
4553 > control flag in
4555 CLASS="FILENAME"
4556 >/etc/pam.d/samba</TT
4557 > file as follows:
4560 ><TABLE
4561 BORDER="0"
4562 BGCOLOR="#E0E0E0"
4563 WIDTH="90%"
4564 ><TR
4565 ><TD
4566 ><PRE
4567 CLASS="PROGRAMLISTING"
4568 > account required pam_permit.so
4569 </PRE
4570 ></TD
4571 ></TR
4572 ></TABLE
4573 ></P
4575 > If you want to remain backward compatibility to samba 2.0.x use
4577 CLASS="FILENAME"
4578 >pam_permit.so</TT
4579 >, it's also possible to use
4581 CLASS="FILENAME"
4582 >pam_pwdb.so</TT
4583 >. There are some bugs if you try to
4584 use <TT
4585 CLASS="FILENAME"
4586 >pam_unix.so</TT
4587 >, if you need this, be ensure to use
4588 the most recent version of this file.
4590 ></LI
4591 ></UL
4592 ></DIV
4593 ><DIV
4594 CLASS="SECT1"
4595 ><HR><H1
4596 CLASS="SECT1"
4598 NAME="AEN971"
4599 >6.6. System Policies and Profiles</A
4600 ></H1
4602 >Much of the information necessary to implement System Policies and
4603 Roving User Profiles in a Samba domain is the same as that for
4604 implementing these same items in a Windows NT 4.0 domain.
4605 You should read the white paper <A
4606 HREF="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp"
4607 TARGET="_top"
4608 >Implementing
4609 Profiles and Policies in Windows NT 4.0</A
4610 > available from Microsoft.</P
4612 >Here are some additional details:</P
4614 ></P
4615 ><UL
4616 ><LI
4618 > <EM
4619 >What about Windows NT Policy Editor ?</EM
4623 > To create or edit <TT
4624 CLASS="FILENAME"
4625 >ntconfig.pol</TT
4626 > you must use
4627 the NT Server Policy Editor, <B
4628 CLASS="COMMAND"
4629 >poledit.exe</B
4630 > which
4631 is included with NT Server but <EM
4632 >not NT Workstation</EM
4634 There is a Policy Editor on a NTws
4635 but it is not suitable for creating <EM
4636 >Domain Policies</EM
4638 Further, although the Windows 95
4639 Policy Editor can be installed on an NT Workstation/Server, it will not
4640 work with NT policies because the registry key that are set by the policy templates.
4641 However, the files from the NT Server will run happily enough on an NTws.
4642 You need <TT
4643 CLASS="FILENAME"
4644 >poledit.exe, common.adm</TT
4645 > and <TT
4646 CLASS="FILENAME"
4647 >winnt.adm</TT
4648 >. It is convenient
4649 to put the two *.adm files in <TT
4650 CLASS="FILENAME"
4651 >c:\winnt\inf</TT
4652 > which is where
4653 the binary will look for them unless told otherwise. Note also that that
4654 directory is 'hidden'.
4657 > The Windows NT policy editor is also included with the Service Pack 3 (and
4658 later) for Windows NT 4.0. Extract the files using <B
4659 CLASS="COMMAND"
4660 >servicepackname /x</B
4662 ie thats <B
4663 CLASS="COMMAND"
4664 >Nt4sp6ai.exe /x</B
4665 > for service pack 6a. The policy editor,
4667 CLASS="COMMAND"
4668 >poledit.exe</B
4669 > and the associated template files (*.adm) should
4670 be extracted as well. It is also possible to downloaded the policy template
4671 files for Office97 and get a copy of the policy editor. Another possible
4672 location is with the Zero Administration Kit available for download from Microsoft.
4674 ></LI
4675 ><LI
4677 > <EM
4678 >Can Win95 do Policies ?</EM
4682 > Install the group policy handler for Win9x to pick up group
4683 policies. Look on the Win98 CD in <TT
4684 CLASS="FILENAME"
4685 >\tools\reskit\netadmin\poledit</TT
4687 Install group policies on a Win9x client by double-clicking
4689 CLASS="FILENAME"
4690 >grouppol.inf</TT
4691 >. Log off and on again a couple of
4692 times and see if Win98 picks up group policies. Unfortunately this needs
4693 to be done on every Win9x machine that uses group policies....
4696 > If group policies don't work one reports suggests getting the updated
4697 (read: working) grouppol.dll for Windows 9x. The group list is grabbed
4698 from /etc/group.
4700 ></LI
4701 ><LI
4703 > <EM
4704 >How do I get 'User Manager' and 'Server Manager'</EM
4708 > Since I don't need to buy an NT Server CD now, how do I get
4709 the 'User Manager for Domains', the 'Server Manager' ?
4712 > Microsoft distributes a version of these tools called nexus for
4713 installation on Windows 95 systems. The tools set includes
4716 ></P
4717 ><UL
4718 ><LI
4720 >Server Manager</P
4721 ></LI
4722 ><LI
4724 >User Manager for Domains</P
4725 ></LI
4726 ><LI
4728 >Event Viewer</P
4729 ></LI
4730 ></UL
4732 > Click here to download the archived file <A
4733 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE"
4734 TARGET="_top"
4735 >ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</A
4739 > The Windows NT 4.0 version of the 'User Manager for
4740 Domains' and 'Server Manager' are available from Microsoft via ftp
4741 from <A
4742 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE"
4743 TARGET="_top"
4744 >ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</A
4747 ></LI
4748 ></UL
4749 ></DIV
4750 ><DIV
4751 CLASS="SECT1"
4752 ><HR><H1
4753 CLASS="SECT1"
4755 NAME="AEN1015"
4756 >6.7. What other help can I get ?</A
4757 ></H1
4759 >There are many sources of information available in the form
4760 of mailing lists, RFC's and documentation. The docs that come
4761 with the samba distribution contain very good explanations of
4762 general SMB topics such as browsing.</P
4764 ></P
4765 ><UL
4766 ><LI
4768 > <EM
4769 >What are some diagnostics tools I can use to debug the domain logon
4770 process and where can I find them?</EM
4774 > One of the best diagnostic tools for debugging problems is Samba itself.
4775 You can use the -d option for both smbd and nmbd to specifiy what
4776 'debug level' at which to run. See the man pages on smbd, nmbd and
4777 smb.conf for more information on debugging options. The debug
4778 level can range from 1 (the default) to 10 (100 for debugging passwords).
4781 > Another helpful method of debugging is to compile samba using the
4783 CLASS="COMMAND"
4784 >gcc -g </B
4785 > flag. This will include debug
4786 information in the binaries and allow you to attach gdb to the
4787 running smbd / nmbd process. In order to attach gdb to an smbd
4788 process for an NT workstation, first get the workstation to make the
4789 connection. Pressing ctrl-alt-delete and going down to the domain box
4790 is sufficient (at least, on the first time you join the domain) to
4791 generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation
4792 maintains an open connection, and therefore there will be an smbd
4793 process running (assuming that you haven't set a really short smbd
4794 idle timeout) So, in between pressing ctrl alt delete, and actually
4795 typing in your password, you can gdb attach and continue.
4798 > Some useful samba commands worth investigating:
4801 ></P
4802 ><UL
4803 ><LI
4805 >testparam | more</P
4806 ></LI
4807 ><LI
4809 >smbclient -L //{netbios name of server}</P
4810 ></LI
4811 ></UL
4813 > An SMB enabled version of tcpdump is available from
4815 HREF="http://www.tcpdump.org/"
4816 TARGET="_top"
4817 >http://www.tcpdup.org/</A
4819 Ethereal, another good packet sniffer for UNIX and Win32
4820 hosts, can be downloaded from <A
4821 HREF="http://www.ethereal.com/"
4822 TARGET="_top"
4823 >http://www.ethereal.com</A
4827 > For tracing things on the Microsoft Windows NT, Network Monitor
4828 (aka. netmon) is available on the Microsoft Developer Network CD's,
4829 the Windows NT Server install CD and the SMS CD's. The version of
4830 netmon that ships with SMS allows for dumping packets between any two
4831 computers (ie. placing the network interface in promiscuous mode).
4832 The version on the NT Server install CD will only allow monitoring
4833 of network traffic directed to the local NT box and broadcasts on the
4834 local subnet. Be aware that Ethereal can read and write netmon
4835 formatted files.
4837 ></LI
4838 ><LI
4840 > <EM
4841 >How do I install 'Network Monitor' on an NT Workstation
4842 or a Windows 9x box?</EM
4846 > Installing netmon on an NT workstation requires a couple
4847 of steps. The following are for installing Netmon V4.00.349, which comes
4848 with Microsoft Windows NT Server 4.0, on Microsoft Windows NT
4849 Workstation 4.0. The process should be similar for other version of
4850 Windows NT / Netmon. You will need both the Microsoft Windows
4851 NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
4854 > Initially you will need to install 'Network Monitor Tools and Agent'
4855 on the NT Server. To do this
4858 ></P
4859 ><UL
4860 ><LI
4862 >Goto Start - Settings - Control Panel -
4863 Network - Services - Add </P
4864 ></LI
4865 ><LI
4867 >Select the 'Network Monitor Tools and Agent' and
4868 click on 'OK'.</P
4869 ></LI
4870 ><LI
4872 >Click 'OK' on the Network Control Panel.
4874 ></LI
4875 ><LI
4877 >Insert the Windows NT Server 4.0 install CD
4878 when prompted.</P
4879 ></LI
4880 ></UL
4882 > At this point the Netmon files should exist in
4884 CLASS="FILENAME"
4885 >%SYSTEMROOT%\System32\netmon\*.*</TT
4887 Two subdirectories exist as well, <TT
4888 CLASS="FILENAME"
4889 >parsers\</TT
4891 which contains the necessary DLL's for parsing the netmon packet
4892 dump, and <TT
4893 CLASS="FILENAME"
4894 >captures\</TT
4898 > In order to install the Netmon tools on an NT Workstation, you will
4899 first need to install the 'Network Monitor Agent' from the Workstation
4900 install CD.
4903 ></P
4904 ><UL
4905 ><LI
4907 >Goto Start - Settings - Control Panel -
4908 Network - Services - Add</P
4909 ></LI
4910 ><LI
4912 >Select the 'Network Monitor Agent' and click
4913 on 'OK'.</P
4914 ></LI
4915 ><LI
4917 >Click 'OK' on the Network Control Panel.
4919 ></LI
4920 ><LI
4922 >Insert the Windows NT Workstation 4.0 install
4923 CD when prompted.</P
4924 ></LI
4925 ></UL
4927 > Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.*
4928 to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set
4929 permissions as you deem appropriate for your site. You will need
4930 administrative rights on the NT box to run netmon.
4933 > To install Netmon on a Windows 9x box install the network monitor agent
4934 from the Windows 9x CD (\admin\nettools\netmon). There is a readme
4935 file located with the netmon driver files on the CD if you need
4936 information on how to do this. Copy the files from a working
4937 Netmon installation.
4939 ></LI
4940 ><LI
4942 > The following is a list if helpful URLs and other links:
4945 ></P
4946 ><UL
4947 ><LI
4949 >Home of Samba site <A
4950 HREF="http://samba.org"
4951 TARGET="_top"
4952 > http://samba.org</A
4953 >. We have a mirror near you !</P
4954 ></LI
4955 ><LI
4957 > The <EM
4958 >Development</EM
4959 > document
4960 on the Samba mirrors might mention your problem. If so,
4961 it might mean that the developers are working on it.</P
4962 ></LI
4963 ><LI
4965 >See how Scott Merrill simulates a BDC behavior at
4967 HREF="http://www.skippy.net/linux/smb-howto.html"
4968 TARGET="_top"
4969 > http://www.skippy.net/linux/smb-howto.html</A
4970 >. </P
4971 ></LI
4972 ><LI
4974 >Although 2.0.7 has almost had its day as a PDC, David Bannon will
4975 keep the 2.0.7 PDC pages at <A
4976 HREF="http://bioserve.latrobe.edu.au/samba"
4977 TARGET="_top"
4978 > http://bioserve.latrobe.edu.au/samba</A
4979 > going for a while yet.</P
4980 ></LI
4981 ><LI
4983 >Misc links to CIFS information
4985 HREF="http://samba.org/cifs/"
4986 TARGET="_top"
4987 >http://samba.org/cifs/</A
4988 ></P
4989 ></LI
4990 ><LI
4992 >NT Domains for Unix <A
4993 HREF="http://mailhost.cb1.com/~lkcl/ntdom/"
4994 TARGET="_top"
4995 > http://mailhost.cb1.com/~lkcl/ntdom/</A
4996 ></P
4997 ></LI
4998 ><LI
5000 >FTP site for older SMB specs:
5002 HREF="ftp://ftp.microsoft.com/developr/drg/CIFS/"
5003 TARGET="_top"
5004 > ftp://ftp.microsoft.com/developr/drg/CIFS/</A
5005 ></P
5006 ></LI
5007 ></UL
5008 ></LI
5009 ></UL
5011 ></P
5012 ><UL
5013 ><LI
5015 > <EM
5016 >How do I get help from the mailing lists ?</EM
5020 > There are a number of Samba related mailing lists. Go to <A
5021 HREF="http://samba.org"
5022 TARGET="_top"
5023 >http://samba.org</A
5024 >, click on your nearest mirror
5025 and then click on <B
5026 CLASS="COMMAND"
5027 >Support</B
5028 > and then click on <B
5029 CLASS="COMMAND"
5030 > Samba related mailing lists</B
5034 > For questions relating to Samba TNG go to
5036 HREF="http://www.samba-tng.org/"
5037 TARGET="_top"
5038 >http://www.samba-tng.org/</A
5040 It has been requested that you don't post questions about Samba-TNG to the
5041 main stream Samba lists.</P
5043 > If you post a message to one of the lists please observe the following guide lines :
5046 ></P
5047 ><UL
5048 ><LI
5050 > Always remember that the developers are volunteers, they are
5051 not paid and they never guarantee to produce a particular feature at
5052 a particular time. Any time lines are 'best guess' and nothing more.
5054 ></LI
5055 ><LI
5057 > Always mention what version of samba you are using and what
5058 operating system its running under. You should probably list the
5059 relevant sections of your smb.conf file, at least the options
5060 in [global] that affect PDC support.</P
5061 ></LI
5062 ><LI
5064 >In addition to the version, if you obtained Samba via
5065 CVS mention the date when you last checked it out.</P
5066 ></LI
5067 ><LI
5069 > Try and make your question clear and brief, lots of long,
5070 convoluted questions get deleted before they are completely read !
5071 Don't post html encoded messages (if you can select colour or font
5072 size its html).</P
5073 ></LI
5074 ><LI
5076 > If you run one of those nifty 'I'm on holidays' things when
5077 you are away, make sure its configured to not answer mailing lists.
5079 ></LI
5080 ><LI
5082 > Don't cross post. Work out which is the best list to post to
5083 and see what happens, ie don't post to both samba-ntdom and samba-technical.
5084 Many people active on the lists subscribe to more
5085 than one list and get annoyed to see the same message two or more times.
5086 Often someone will see a message and thinking it would be better dealt
5087 with on another, will forward it on for you.</P
5088 ></LI
5089 ><LI
5091 >You might include <EM
5092 >partial</EM
5094 log files written at a debug level set to as much as 20.
5095 Please don't send the entire log but enough to give the context of the
5096 error messages.</P
5097 ></LI
5098 ><LI
5100 >(Possibly) If you have a complete netmon trace ( from the opening of
5101 the pipe to the error ) you can send the *.CAP file as well.</P
5102 ></LI
5103 ><LI
5105 >Please think carefully before attaching a document to an email.
5106 Consider pasting the relevant parts into the body of the message. The samba
5107 mailing lists go to a huge number of people, do they all need a copy of your
5108 smb.conf in their attach directory ?</P
5109 ></LI
5110 ></UL
5111 ></LI
5112 ><LI
5114 > <EM
5115 >How do I get off the mailing lists ?</EM
5119 >To have your name removed from a samba mailing list, go to the
5120 same place you went to to get on it. Go to <A
5121 HREF="http://lists.samba.org/"
5122 TARGET="_top"
5123 >http://lists.samba.org</A
5125 click on your nearest mirror and then click on <B
5126 CLASS="COMMAND"
5127 >Support</B
5128 > and
5129 then click on <B
5130 CLASS="COMMAND"
5131 > Samba related mailing lists</B
5132 >. Or perhaps see
5134 HREF="http://lists.samba.org/mailman/roster/samba-ntdom"
5135 TARGET="_top"
5136 >here</A
5140 > Please don't post messages to the list asking to be removed, you will just
5141 be referred to the above address (unless that process failed in some way...)
5143 ></LI
5144 ></UL
5145 ></DIV
5146 ><DIV
5147 CLASS="SECT1"
5148 ><HR><H1
5149 CLASS="SECT1"
5151 NAME="AEN1129"
5152 >6.8. Domain Control for Windows 9x/ME</A
5153 ></H1
5154 ><DIV
5155 CLASS="NOTE"
5156 ><BLOCKQUOTE
5157 CLASS="NOTE"
5160 >Note: </B
5161 >The following section contains much of the original
5162 DOMAIN.txt file previously included with Samba. Much of
5163 the material is based on what went into the book Special
5164 Edition, Using Samba. (Richard Sharpe)</P
5165 ></BLOCKQUOTE
5166 ></DIV
5168 >A domain and a workgroup are exactly the same thing in terms of network
5169 browsing. The difference is that a distributable authentication
5170 database is associated with a domain, for secure login access to a
5171 network. Also, different access rights can be granted to users if they
5172 successfully authenticate against a domain logon server (NT server and
5173 other systems based on NT server support this, as does at least Samba TNG now).</P
5175 >The SMB client logging on to a domain has an expectation that every other
5176 server in the domain should accept the same authentication information.
5177 Network browsing functionality of domains and workgroups is
5178 identical and is explained in BROWSING.txt. It should be noted, that browsing
5179 is total orthogonal to logon support.</P
5181 >Issues related to the single-logon network model are discussed in this
5182 document. Samba supports domain logons, network logon scripts, and user
5183 profiles for MS Windows for workgroups and MS Windows 9X clients.</P
5185 >When an SMB client in a domain wishes to logon it broadcast requests for a
5186 logon server. The first one to reply gets the job, and validates its
5187 password using whatever mechanism the Samba administrator has installed.
5188 It is possible (but very stupid) to create a domain where the user
5189 database is not shared between servers, ie they are effectively workgroup
5190 servers advertising themselves as participating in a domain. This
5191 demonstrates how authentication is quite different from but closely
5192 involved with domains.</P
5194 >Another thing commonly associated with single-logon domains is remote
5195 administration over the SMB protocol. Again, there is no reason why this
5196 cannot be implemented with an underlying username database which is
5197 different from the Windows NT SAM. Support for the Remote Administration
5198 Protocol is planned for a future release of Samba.</P
5200 >Network logon support as discussed in this section is aimed at Window for
5201 Workgroups, and Windows 9X clients. </P
5203 >Support for profiles is confirmed as working for Win95, NT 4.0 and NT 3.51.
5204 It is possible to specify: the profile location; script file to be loaded
5205 on login; the user's home directory; and for NT a kick-off time could also
5206 now easily be supported. However, there are some differences between Win9X
5207 profile support and WinNT profile support. These are discussed below.</P
5209 >With NT Workstations, all this does not require the use or intervention of
5210 an NT 4.0 or NT 3.51 server: Samba can now replace the logon services
5211 provided by an NT server, to a limited and experimental degree (for example,
5212 running "User Manager for Domains" will not provide you with access to
5213 a domain created by a Samba Server).</P
5215 >With Win95, the help of an NT server can be enlisted, both for profile storage
5216 and for user authentication. For details on user authentication, see
5217 security_level.txt. For details on profile storage, see below.</P
5219 >Using these features you can make your clients verify their logon via
5220 the Samba server; make clients run a batch file when they logon to
5221 the network and download their preferences, desktop and start menu.</P
5223 >Before launching into the configuration instructions, it is worthwhile looking
5224 at how a Win9X client performs a logon:</P
5226 ></P
5227 ><OL
5228 TYPE="1"
5229 ><LI
5231 > The client broadcasts (to the IP broadcast address of the subnet it is in)
5232 a NetLogon request. This is sent to the NetBIOS address DOMAIN&#60;00&#62; at the
5233 NetBIOS layer. The client chooses the first response it receives, which
5234 contains the NetBIOS name of the logon server to use in the format of
5235 \\SERVER.
5237 ></LI
5238 ><LI
5240 > The client then connects to that server, logs on (does an SMBsessetupX) and
5241 then connects to the IPC$ share (using an SMBtconX).
5243 ></LI
5244 ><LI
5246 > The client then does a NetWkstaUserLogon request, which retrieves the name
5247 of the user's logon script.
5249 ></LI
5250 ><LI
5252 > The client then connects to the NetLogon share and searches for this
5253 and if it is found and can be read, is retrieved and executed by the client.
5254 After this, the client disconnects from the NetLogon share.
5256 ></LI
5257 ><LI
5259 > The client then sends a NetUserGetInfo request to the server, to retrieve
5260 the user's home share, which is used to search for profiles. Since the
5261 response to the NetUserGetInfo request does not contain much more
5262 the user's home share, profiles for Win9X clients MUST reside in the user
5263 home directory.
5265 ></LI
5266 ><LI
5268 > The client then connects to the user's home share and searches for the
5269 user's profile. As it turns out, you can specify the users home share as
5270 a sharename and path. For example, \\server\fred\.profile.
5271 If the profiles are found, they are implemented.
5273 ></LI
5274 ><LI
5276 > The client then disconnects from the user's home share, and reconnects to
5277 the NetLogon share and looks for CONFIG.POL, the policies file. If this is
5278 found, it is read and implemented.
5280 ></LI
5281 ></OL
5282 ><DIV
5283 CLASS="SECT2"
5284 ><HR><H2
5285 CLASS="SECT2"
5287 NAME="AEN1159"
5288 >6.8.1. Configuration Instructions: Network Logons</A
5289 ></H2
5291 >To use domain logons and profiles you need to do the following:</P
5293 ></P
5294 ><OL
5295 TYPE="1"
5296 ><LI
5298 > Create a share called [netlogon] in your smb.conf. This share should
5299 be readable by all users, and probably should not be writeable. This
5300 share will hold your network logon scripts, and the CONFIG.POL file
5301 (Note: for details on the CONFIG.POL file, how to use it, what it is,
5302 refer to the Microsoft Windows NT Administration documentation.
5303 The format of these files is not known, so you will need to use
5304 Microsoft tools).
5307 > For example I have used:
5310 ><TABLE
5311 BORDER="0"
5312 BGCOLOR="#E0E0E0"
5313 WIDTH="90%"
5314 ><TR
5315 ><TD
5316 ><PRE
5317 CLASS="PROGRAMLISTING"
5318 >[netlogon]
5319 path = /data/dos/netlogon
5320 writeable = no
5321 guest ok = no</PRE
5322 ></TD
5323 ></TR
5324 ></TABLE
5325 ></P
5327 > Note that it is important that this share is not writeable by ordinary
5328 users, in a secure environment: ordinary users should not be allowed
5329 to modify or add files that another user's computer would then download
5330 when they log in.
5332 ></LI
5333 ><LI
5335 > in the [global] section of smb.conf set the following:
5338 ><TABLE
5339 BORDER="0"
5340 BGCOLOR="#E0E0E0"
5341 WIDTH="90%"
5342 ><TR
5343 ><TD
5344 ><PRE
5345 CLASS="PROGRAMLISTING"
5346 >domain logons = yes
5347 logon script = %U.bat
5348 </PRE
5349 ></TD
5350 ></TR
5351 ></TABLE
5352 ></P
5354 > The choice of batch file is, of course, up to you. The above would
5355 give each user a separate batch file as the %U will be changed to
5356 their username automatically. The other standard % macros may also be
5357 used. You can make the batch files come from a subdirectory by using
5358 something like:
5361 ><TABLE
5362 BORDER="0"
5363 BGCOLOR="#E0E0E0"
5364 WIDTH="90%"
5365 ><TR
5366 ><TD
5367 ><PRE
5368 CLASS="PROGRAMLISTING"
5369 >logon script = scripts\%U.bat
5370 </PRE
5371 ></TD
5372 ></TR
5373 ></TABLE
5374 ></P
5375 ></LI
5376 ><LI
5378 > create the batch files to be run when the user logs in. If the batch
5379 file doesn't exist then no batch file will be run.
5382 > In the batch files you need to be careful to use DOS style cr/lf line
5383 endings. If you don't then DOS may get confused. I suggest you use a
5384 DOS editor to remotely edit the files if you don't know how to produce
5385 DOS style files under unix.
5387 ></LI
5388 ><LI
5390 > Use smbclient with the -U option for some users to make sure that
5391 the \\server\NETLOGON share is available, the batch files are
5392 visible and they are readable by the users.
5394 ></LI
5395 ><LI
5397 > you will probabaly find that your clients automatically mount the
5398 \\SERVER\NETLOGON share as drive z: while logging in. You can put
5399 some useful programs there to execute from the batch files.
5401 ></LI
5402 ></OL
5403 ><DIV
5404 CLASS="WARNING"
5406 ></P
5407 ><TABLE
5408 CLASS="WARNING"
5409 BORDER="1"
5410 WIDTH="100%"
5411 ><TR
5412 ><TD
5413 ALIGN="CENTER"
5415 >security mode and master browsers</B
5416 ></TD
5417 ></TR
5418 ><TR
5419 ><TD
5420 ALIGN="LEFT"
5422 >There are a few comments to make in order to tie up some
5423 loose ends. There has been much debate over the issue of whether
5424 or not it is ok to configure Samba as a Domain Controller in security
5425 modes other than <TT
5426 CLASS="CONSTANT"
5427 >USER</TT
5428 >. The only security mode
5429 which will not work due to technical reasons is <TT
5430 CLASS="CONSTANT"
5431 >SHARE</TT
5433 mode security. <TT
5434 CLASS="CONSTANT"
5435 >DOMAIN</TT
5436 > and <TT
5437 CLASS="CONSTANT"
5438 >SERVER</TT
5440 mode security is really just a variation on SMB user level security.</P
5442 >Actually, this issue is also closer tied to the debate on whether
5443 or not Samba must be the domain master browser for its workgroup
5444 when operating as a DC. While it may technically be possible
5445 to configure a server as such (after all, browsing and domain logons
5446 are two distinctly different functions), it is not a good idea to
5447 so. You should remember that the DC must register the DOMAIN#1b netbios
5448 name. This is the name used by Windows clients to locate the DC.
5449 Windows clients do not distinguish between the DC and the DMB.
5450 For this reason, it is very wise to configure the Samba DC as the DMB.</P
5452 >Now back to the issue of configuring a Samba DC to use a mode other
5453 than "security = user". If a Samba host is configured to use
5454 another SMB server or DC in order to validate user connection
5455 requests, then it is a fact that some other machine on the network
5456 (the "password server") knows more about user than the Samba host.
5457 99% of the time, this other host is a domain controller. Now
5458 in order to operate in domain mode security, the "workgroup" parameter
5459 must be set to the name of the Windows NT domain (which already
5460 has a domain controller, right?)</P
5462 >Therefore configuring a Samba box as a DC for a domain that
5463 already by definition has a PDC is asking for trouble.
5464 Therefore, you should always configure the Samba DC to be the DMB
5465 for its domain.</P
5466 ></TD
5467 ></TR
5468 ></TABLE
5469 ></DIV
5470 ></DIV
5471 ><DIV
5472 CLASS="SECT2"
5473 ><HR><H2
5474 CLASS="SECT2"
5476 NAME="AEN1193"
5477 >6.8.2. Configuration Instructions: Setting up Roaming User Profiles</A
5478 ></H2
5479 ><DIV
5480 CLASS="WARNING"
5482 ></P
5483 ><TABLE
5484 CLASS="WARNING"
5485 BORDER="1"
5486 WIDTH="100%"
5487 ><TR
5488 ><TD
5489 ALIGN="CENTER"
5491 >Warning</B
5492 ></TD
5493 ></TR
5494 ><TR
5495 ><TD
5496 ALIGN="LEFT"
5498 ><EM
5499 >NOTE!</EM
5500 > Roaming profiles support is different
5501 for Win9X and WinNT.</P
5502 ></TD
5503 ></TR
5504 ></TABLE
5505 ></DIV
5507 >Before discussing how to configure roaming profiles, it is useful to see how
5508 Win9X and WinNT clients implement these features.</P
5510 >Win9X clients send a NetUserGetInfo request to the server to get the user's
5511 profiles location. However, the response does not have room for a separate
5512 profiles location field, only the users home share. This means that Win9X
5513 profiles are restricted to being in the user's home directory.</P
5515 >WinNT clients send a NetSAMLogon RPC request, which contains many fields,
5516 including a separate field for the location of the user's profiles.
5517 This means that support for profiles is different for Win9X and WinNT.</P
5518 ><DIV
5519 CLASS="SECT3"
5520 ><HR><H3
5521 CLASS="SECT3"
5523 NAME="AEN1201"
5524 >6.8.2.1. Windows NT Configuration</A
5525 ></H3
5527 >To support WinNT clients, inn the [global] section of smb.conf set the
5528 following (for example):</P
5530 ><TABLE
5531 BORDER="0"
5532 BGCOLOR="#E0E0E0"
5533 WIDTH="100%"
5534 ><TR
5535 ><TD
5536 ><PRE
5537 CLASS="PROGRAMLISTING"
5538 >logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath</PRE
5539 ></TD
5540 ></TR
5541 ></TABLE
5542 ></P
5544 >The default for this option is \\%N\%U\profile, namely
5545 \\sambaserver\username\profile. The \\N%\%U service is created
5546 automatically by the [homes] service.
5547 If you are using a samba server for the profiles, you _must_ make the
5548 share specified in the logon path browseable. </P
5549 ><DIV
5550 CLASS="NOTE"
5551 ><BLOCKQUOTE
5552 CLASS="NOTE"
5555 >Note: </B
5556 >[lkcl 26aug96 - we have discovered a problem where Windows clients can
5557 maintain a connection to the [homes] share in between logins. The
5558 [homes] share must NOT therefore be used in a profile path.]</P
5559 ></BLOCKQUOTE
5560 ></DIV
5561 ></DIV
5562 ><DIV
5563 CLASS="SECT3"
5564 ><HR><H3
5565 CLASS="SECT3"
5567 NAME="AEN1209"
5568 >6.8.2.2. Windows 9X Configuration</A
5569 ></H3
5571 >To support Win9X clients, you must use the "logon home" parameter. Samba has
5572 now been fixed so that "net use/home" now works as well, and it, too, relies
5573 on the "logon home" parameter.</P
5575 >By using the logon home parameter, you are restricted to putting Win9X
5576 profiles in the user's home directory. But wait! There is a trick you
5577 can use. If you set the following in the [global] section of your
5578 smb.conf file:</P
5580 ><TABLE
5581 BORDER="0"
5582 BGCOLOR="#E0E0E0"
5583 WIDTH="100%"
5584 ><TR
5585 ><TD
5586 ><PRE
5587 CLASS="PROGRAMLISTING"
5588 >logon home = \\%L\%U\.profiles</PRE
5589 ></TD
5590 ></TR
5591 ></TABLE
5592 ></P
5594 >then your Win9X clients will dutifully put their clients in a subdirectory
5595 of your home directory called .profiles (thus making them hidden).</P
5597 >Not only that, but 'net use/home' will also work, because of a feature in
5598 Win9X. It removes any directory stuff off the end of the home directory area
5599 and only uses the server and share portion. That is, it looks like you
5600 specified \\%L\%U for "logon home".</P
5601 ></DIV
5602 ><DIV
5603 CLASS="SECT3"
5604 ><HR><H3
5605 CLASS="SECT3"
5607 NAME="AEN1217"
5608 >6.8.2.3. Win9X and WinNT Configuration</A
5609 ></H3
5611 >You can support profiles for both Win9X and WinNT clients by setting both the
5612 "logon home" and "logon path" parameters. For example:</P
5614 ><TABLE
5615 BORDER="0"
5616 BGCOLOR="#E0E0E0"
5617 WIDTH="100%"
5618 ><TR
5619 ><TD
5620 ><PRE
5621 CLASS="PROGRAMLISTING"
5622 >logon home = \\%L\%U\.profiles
5623 logon path = \\%L\profiles\%U</PRE
5624 ></TD
5625 ></TR
5626 ></TABLE
5627 ></P
5628 ><DIV
5629 CLASS="NOTE"
5630 ><BLOCKQUOTE
5631 CLASS="NOTE"
5634 >Note: </B
5635 >I have not checked what 'net use /home' does on NT when "logon home" is
5636 set as above.</P
5637 ></BLOCKQUOTE
5638 ></DIV
5639 ></DIV
5640 ><DIV
5641 CLASS="SECT3"
5642 ><HR><H3
5643 CLASS="SECT3"
5645 NAME="AEN1224"
5646 >6.8.2.4. Windows 9X Profile Setup</A
5647 ></H3
5649 >When a user first logs in on Windows 9X, the file user.DAT is created,
5650 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".
5651 These directories and their contents will be merged with the local
5652 versions stored in c:\windows\profiles\username on subsequent logins,
5653 taking the most recent from each. You will need to use the [global]
5654 options "preserve case = yes", "short case preserve = yes" and
5655 "case sensitive = no" in order to maintain capital letters in shortcuts
5656 in any of the profile folders.</P
5658 >The user.DAT file contains all the user's preferences. If you wish to
5659 enforce a set of preferences, rename their user.DAT file to user.MAN,
5660 and deny them write access to this file.</P
5662 ></P
5663 ><OL
5664 TYPE="1"
5665 ><LI
5667 > On the Windows 95 machine, go to Control Panel | Passwords and
5668 select the User Profiles tab. Select the required level of
5669 roaming preferences. Press OK, but do _not_ allow the computer
5670 to reboot.
5672 ></LI
5673 ><LI
5675 > On the Windows 95 machine, go to Control Panel | Network |
5676 Client for Microsoft Networks | Preferences. Select 'Log on to
5677 NT Domain'. Then, ensure that the Primary Logon is 'Client for
5678 Microsoft Networks'. Press OK, and this time allow the computer
5679 to reboot.
5681 ></LI
5682 ></OL
5684 >Under Windows 95, Profiles are downloaded from the Primary Logon.
5685 If you have the Primary Logon as 'Client for Novell Networks', then
5686 the profiles and logon script will be downloaded from your Novell
5687 Server. If you have the Primary Logon as 'Windows Logon', then the
5688 profiles will be loaded from the local machine - a bit against the
5689 concept of roaming profiles, if you ask me.</P
5691 >You will now find that the Microsoft Networks Login box contains
5692 [user, password, domain] instead of just [user, password]. Type in
5693 the samba server's domain name (or any other domain known to exist,
5694 but bear in mind that the user will be authenticated against this
5695 domain and profiles downloaded from it, if that domain logon server
5696 supports it), user name and user's password.</P
5698 >Once the user has been successfully validated, the Windows 95 machine
5699 will inform you that 'The user has not logged on before' and asks you
5700 if you wish to save the user's preferences? Select 'yes'.</P
5702 >Once the Windows 95 client comes up with the desktop, you should be able
5703 to examine the contents of the directory specified in the "logon path"
5704 on the samba server and verify that the "Desktop", "Start Menu",
5705 "Programs" and "Nethood" folders have been created.</P
5707 >These folders will be cached locally on the client, and updated when
5708 the user logs off (if you haven't made them read-only by then :-).
5709 You will find that if the user creates further folders or short-cuts,
5710 that the client will merge the profile contents downloaded with the
5711 contents of the profile directory already on the local client, taking
5712 the newest folders and short-cuts from each set.</P
5714 >If you have made the folders / files read-only on the samba server,
5715 then you will get errors from the w95 machine on logon and logout, as
5716 it attempts to merge the local and the remote profile. Basically, if
5717 you have any errors reported by the w95 machine, check the unix file
5718 permissions and ownership rights on the profile directory contents,
5719 on the samba server.</P
5721 >If you have problems creating user profiles, you can reset the user's
5722 local desktop cache, as shown below. When this user then next logs in,
5723 they will be told that they are logging in "for the first time".</P
5725 ></P
5726 ><OL
5727 TYPE="1"
5728 ><LI
5730 > instead of logging in under the [user, password, domain] dialog,
5731 press escape.
5733 ></LI
5734 ><LI
5736 > run the regedit.exe program, and look in:
5739 > HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
5742 > you will find an entry, for each user, of ProfilePath. Note the
5743 contents of this key (likely to be c:\windows\profiles\username),
5744 then delete the key ProfilePath for the required user.
5747 > [Exit the registry editor].
5749 ></LI
5750 ><LI
5752 > <EM
5753 >WARNING</EM
5754 > - before deleting the contents of the
5755 directory listed in
5756 the ProfilePath (this is likely to be c:\windows\profiles\username),
5757 ask them if they have any important files stored on their desktop
5758 or in their start menu. delete the contents of the directory
5759 ProfilePath (making a backup if any of the files are needed).
5762 > This will have the effect of removing the local (read-only hidden
5763 system file) user.DAT in their profile directory, as well as the
5764 local "desktop", "nethood", "start menu" and "programs" folders.
5766 ></LI
5767 ><LI
5769 > search for the user's .PWL password-cacheing file in the c:\windows
5770 directory, and delete it.
5772 ></LI
5773 ><LI
5775 > log off the windows 95 client.
5777 ></LI
5778 ><LI
5780 > check the contents of the profile path (see "logon path" described
5781 above), and delete the user.DAT or user.MAN file for the user,
5782 making a backup if required.
5784 ></LI
5785 ></OL
5787 >If all else fails, increase samba's debug log levels to between 3 and 10,
5788 and / or run a packet trace program such as tcpdump or netmon.exe, and
5789 look for any error reports.</P
5791 >If you have access to an NT server, then first set up roaming profiles
5792 and / or netlogons on the NT server. Make a packet trace, or examine
5793 the example packet traces provided with NT server, and see what the
5794 differences are with the equivalent samba trace.</P
5795 ></DIV
5796 ><DIV
5797 CLASS="SECT3"
5798 ><HR><H3
5799 CLASS="SECT3"
5801 NAME="AEN1260"
5802 >6.8.2.5. Windows NT Workstation 4.0</A
5803 ></H3
5805 >When a user first logs in to a Windows NT Workstation, the profile
5806 NTuser.DAT is created. The profile location can be now specified
5807 through the "logon path" parameter. </P
5808 ><DIV
5809 CLASS="NOTE"
5810 ><BLOCKQUOTE
5811 CLASS="NOTE"
5814 >Note: </B
5815 >[lkcl 10aug97 - i tried setting the path to
5816 \\samba-server\homes\profile, and discovered that this fails because
5817 a background process maintains the connection to the [homes] share
5818 which does _not_ close down in between user logins. you have to
5819 have \\samba-server\%L\profile, where user is the username created
5820 from the [homes] share].</P
5821 ></BLOCKQUOTE
5822 ></DIV
5824 >There is a parameter that is now available for use with NT Profiles:
5825 "logon drive". This should be set to "h:" or any other drive, and
5826 should be used in conjunction with the new "logon home" parameter.</P
5828 >The entry for the NT 4.0 profile is a _directory_ not a file. The NT
5829 help on profiles mentions that a directory is also created with a .PDS
5830 extension. The user, while logging in, must have write permission to
5831 create the full profile path (and the folder with the .PDS extension)
5832 [lkcl 10aug97 - i found that the creation of the .PDS directory failed,
5833 and had to create these manually for each user, with a shell script.
5834 also, i presume, but have not tested, that the full profile path must
5835 be browseable just as it is for w95, due to the manner in which they
5836 attempt to create the full profile path: test existence of each path
5837 component; create path component].</P
5839 >In the profile directory, NT creates more folders than 95. It creates
5840 "Application Data" and others, as well as "Desktop", "Nethood",
5841 "Start Menu" and "Programs". The profile itself is stored in a file
5842 NTuser.DAT. Nothing appears to be stored in the .PDS directory, and
5843 its purpose is currently unknown.</P
5845 >You can use the System Control Panel to copy a local profile onto
5846 a samba server (see NT Help on profiles: it is also capable of firing
5847 up the correct location in the System Control Panel for you). The
5848 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
5849 turns a profile into a mandatory one.</P
5850 ><DIV
5851 CLASS="NOTE"
5852 ><BLOCKQUOTE
5853 CLASS="NOTE"
5856 >Note: </B
5857 >[lkcl 10aug97 - i notice that NT Workstation tells me that it is
5858 downloading a profile from a slow link. whether this is actually the
5859 case, or whether there is some configuration issue, as yet unknown,
5860 that makes NT Workstation _think_ that the link is a slow one is a
5861 matter to be resolved].</P
5863 >[lkcl 20aug97 - after samba digest correspondance, one user found, and
5864 another confirmed, that profiles cannot be loaded from a samba server
5865 unless "security = user" and "encrypt passwords = yes" (see the file
5866 ENCRYPTION.txt) or "security = server" and "password server = ip.address.
5867 of.yourNTserver" are used. either of these options will allow the NT
5868 workstation to access the samba server using LAN manager encrypted
5869 passwords, without the user intervention normally required by NT
5870 workstation for clear-text passwords].</P
5872 >[lkcl 25aug97 - more comments received about NT profiles: the case of
5873 the profile _matters_. the file _must_ be called NTuser.DAT or, for
5874 a mandatory profile, NTuser.MAN].</P
5875 ></BLOCKQUOTE
5876 ></DIV
5877 ></DIV
5878 ><DIV
5879 CLASS="SECT3"
5880 ><HR><H3
5881 CLASS="SECT3"
5883 NAME="AEN1273"
5884 >6.8.2.6. Windows NT Server</A
5885 ></H3
5887 >There is nothing to stop you specifying any path that you like for the
5888 location of users' profiles. Therefore, you could specify that the
5889 profile be stored on a samba server, or any other SMB server, as long as
5890 that SMB server supports encrypted passwords.</P
5891 ></DIV
5892 ><DIV
5893 CLASS="SECT3"
5894 ><HR><H3
5895 CLASS="SECT3"
5897 NAME="AEN1276"
5898 >6.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0</A
5899 ></H3
5900 ><DIV
5901 CLASS="WARNING"
5903 ></P
5904 ><TABLE
5905 CLASS="WARNING"
5906 BORDER="1"
5907 WIDTH="100%"
5908 ><TR
5909 ><TD
5910 ALIGN="CENTER"
5912 >Potentially outdated or incorrect material follows</B
5913 ></TD
5914 ></TR
5915 ><TR
5916 ><TD
5917 ALIGN="LEFT"
5919 >I think this is all bogus, but have not deleted it. (Richard Sharpe)</P
5920 ></TD
5921 ></TR
5922 ></TABLE
5923 ></DIV
5925 >The default logon path is \\%N\U%. NT Workstation will attempt to create
5926 a directory "\\samba-server\username.PDS" if you specify the logon path
5927 as "\\samba-server\username" with the NT User Manager. Therefore, you
5928 will need to specify (for example) "\\samba-server\username\profile".
5929 NT 4.0 will attempt to create "\\samba-server\username\profile.PDS", which
5930 is more likely to succeed.</P
5932 >If you then want to share the same Start Menu / Desktop with W95, you will
5933 need to specify "logon path = \\samba-server\username\profile" [lkcl 10aug97
5934 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
5935 to run from the c:\winnt\system32 directory. this directory is obviously
5936 unlikely to exist on a Win95-only host].</P
5938 >&#13;If you have this set up correctly, you will find separate user.DAT and
5939 NTuser.DAT files in the same profile directory.</P
5940 ><DIV
5941 CLASS="NOTE"
5942 ><BLOCKQUOTE
5943 CLASS="NOTE"
5946 >Note: </B
5947 >[lkcl 25aug97 - there are some issues to resolve with downloading of
5948 NT profiles, probably to do with time/date stamps. i have found that
5949 NTuser.DAT is never updated on the workstation after the first time that
5950 it is copied to the local workstation profile directory. this is in
5951 contrast to w95, where it _does_ transfer / update profiles correctly].</P
5952 ></BLOCKQUOTE
5953 ></DIV
5954 ></DIV
5955 ></DIV
5956 ></DIV
5957 ><DIV
5958 CLASS="SECT1"
5959 ><HR><H1
5960 CLASS="SECT1"
5962 NAME="AEN1286"
5963 >6.9. DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
5964 ></H1
5965 ><DIV
5966 CLASS="WARNING"
5968 ></P
5969 ><TABLE
5970 CLASS="WARNING"
5971 BORDER="1"
5972 WIDTH="100%"
5973 ><TR
5974 ><TD
5975 ALIGN="CENTER"
5977 >Possibly Outdated Material</B
5978 ></TD
5979 ></TR
5980 ><TR
5981 ><TD
5982 ALIGN="LEFT"
5984 > This appendix was originally authored by John H Terpstra of
5985 the Samba Team and is included here for posterity.
5987 ></TD
5988 ></TR
5989 ></TABLE
5990 ></DIV
5992 ><EM
5993 >NOTE :</EM
5995 The term "Domain Controller" and those related to it refer to one specific
5996 method of authentication that can underly an SMB domain. Domain Controllers
5997 prior to Windows NT Server 3.1 were sold by various companies and based on
5998 private extensions to the LAN Manager 2.1 protocol. Windows NT introduced
5999 Microsoft-specific ways of distributing the user authentication database.
6000 See DOMAIN.txt for examples of how Samba can participate in or create
6001 SMB domains based on shared authentication database schemes other than the
6002 Windows NT SAM.</P
6004 >Windows NT Server can be installed as either a plain file and print server
6005 (WORKGROUP workstation or server) or as a server that participates in Domain
6006 Control (DOMAIN member, Primary Domain controller or Backup Domain controller).
6007 The same is true for OS/2 Warp Server, Digital Pathworks and other similar
6008 products, all of which can participate in Domain Control along with Windows NT.</P
6010 >To many people these terms can be confusing, so let's try to clear the air.</P
6012 >Every Windows NT system (workstation or server) has a registry database.
6013 The registry contains entries that describe the initialization information
6014 for all services (the equivalent of Unix Daemons) that run within the Windows
6015 NT environment. The registry also contains entries that tell application
6016 software where to find dynamically loadable libraries that they depend upon.
6017 In fact, the registry contains entries that describes everything that anything
6018 may need to know to interact with the rest of the system.</P
6020 >The registry files can be located on any Windows NT machine by opening a
6021 command prompt and typing:</P
6023 ><TT
6024 CLASS="PROMPT"
6025 >C:\WINNT\&#62;</TT
6026 > dir %SystemRoot%\System32\config</P
6028 >The environment variable %SystemRoot% value can be obtained by typing:</P
6030 ><TT
6031 CLASS="PROMPT"
6032 >C:\WINNT&#62;</TT
6033 >echo %SystemRoot%</P
6035 >The active parts of the registry that you may want to be familiar with are
6036 the files called: default, system, software, sam and security.</P
6038 >In a domain environment, Microsoft Windows NT domain controllers participate
6039 in replication of the SAM and SECURITY files so that all controllers within
6040 the domain have an exactly identical copy of each.</P
6042 >The Microsoft Windows NT system is structured within a security model that
6043 says that all applications and services must authenticate themselves before
6044 they can obtain permission from the security manager to do what they set out
6045 to do.</P
6047 >The Windows NT User database also resides within the registry. This part of
6048 the registry contains the user's security identifier, home directory, group
6049 memberships, desktop profile, and so on.</P
6051 >Every Windows NT system (workstation as well as server) will have its own
6052 registry. Windows NT Servers that participate in Domain Security control
6053 have a database that they share in common - thus they do NOT own an
6054 independent full registry database of their own, as do Workstations and
6055 plain Servers.</P
6057 >The User database is called the SAM (Security Access Manager) database and
6058 is used for all user authentication as well as for authentication of inter-
6059 process authentication (ie: to ensure that the service action a user has
6060 requested is permitted within the limits of that user's privileges).</P
6062 >The Samba team have produced a utility that can dump the Windows NT SAM into
6063 smbpasswd format: see ENCRYPTION.txt for information on smbpasswd and
6064 /pub/samba/pwdump on your nearest Samba mirror for the utility. This
6065 facility is useful but cannot be easily used to implement SAM replication
6066 to Samba systems.</P
6068 >Windows for Workgroups, Windows 95, and Windows NT Workstations and Servers
6069 can participate in a Domain security system that is controlled by Windows NT
6070 servers that have been correctly configured. At most every domain will have
6071 ONE Primary Domain Controller (PDC). It is desirable that each domain will
6072 have at least one Backup Domain Controller (BDC).</P
6074 >The PDC and BDCs then participate in replication of the SAM database so that
6075 each Domain Controlling participant will have an up to date SAM component
6076 within its registry.</P
6077 ></DIV
6078 ></DIV
6079 ><DIV
6080 CLASS="CHAPTER"
6081 ><HR><H1
6083 NAME="AEN1311"
6084 >Chapter 7. Unifed Logons between Windows NT and UNIX using Winbind</A
6085 ></H1
6086 ><DIV
6087 CLASS="SECT1"
6088 ><H1
6089 CLASS="SECT1"
6091 NAME="AEN1329"
6092 >7.1. Abstract</A
6093 ></H1
6095 >Integration of UNIX and Microsoft Windows NT through
6096 a unified logon has been considered a "holy grail" in heterogeneous
6097 computing environments for a long time. We present <EM
6098 >winbind
6099 </EM
6100 >, a component of the Samba suite of programs as a
6101 solution to the unied logon problem. Winbind uses a UNIX implementation
6102 of Microsoft RPC calls, Pluggable Authentication Modules, and the Name
6103 Service Switch to allow Windows NT domain users to appear and operate
6104 as UNIX users on a UNIX machine. This paper describes the winbind
6105 system, explaining the functionality it provides, how it is configured,
6106 and how it works internally.</P
6107 ></DIV
6108 ><DIV
6109 CLASS="SECT1"
6110 ><HR><H1
6111 CLASS="SECT1"
6113 NAME="AEN1333"
6114 >7.2. Introduction</A
6115 ></H1
6117 >It is well known that UNIX and Microsoft Windows NT have
6118 different models for representing user and group information and
6119 use different technologies for implementing them. This fact has
6120 made it difficult to integrate the two systems in a satisfactory
6121 manner.</P
6123 >One common solution in use today has been to create
6124 identically named user accounts on both the UNIX and Windows systems
6125 and use the Samba suite of programs to provide file and print services
6126 between the two. This solution is far from perfect however, as
6127 adding and deleting users on both sets of machines becomes a chore
6128 and two sets of passwords are required both of which which
6129 can lead to synchronization problems between the UNIX and Windows
6130 systems and confusion for users.</P
6132 >We divide the unifed logon problem for UNIX machines into
6133 three smaller problems:</P
6135 ></P
6136 ><UL
6137 ><LI
6139 >Obtaining Windows NT user and group information
6141 ></LI
6142 ><LI
6144 >Authenticating Windows NT users
6146 ></LI
6147 ><LI
6149 >Password changing for Windows NT users
6151 ></LI
6152 ></UL
6154 >Ideally, a prospective solution to the unified logon problem
6155 would satisfy all the above components without duplication of
6156 information on the UNIX machines and without creating additional
6157 tasks for the system administrator when maintaining users and
6158 groups on either system. The winbind system provides a simple
6159 and elegant solution to all three components of the unifed logon
6160 problem.</P
6161 ></DIV
6162 ><DIV
6163 CLASS="SECT1"
6164 ><HR><H1
6165 CLASS="SECT1"
6167 NAME="AEN1346"
6168 >7.3. What Winbind Provides</A
6169 ></H1
6171 >Winbind unifies UNIX and Windows NT account management by
6172 allowing a UNIX box to become a full member of a NT domain. Once
6173 this is done the UNIX box will see NT users and groups as if
6174 they were native UNIX users and groups, allowing the NT domain
6175 to be used in much the same manner that NIS+ is used within
6176 UNIX-only environments.</P
6178 >The end result is that whenever any
6179 program on the UNIX machine asks the operating system to lookup
6180 a user or group name, the query will be resolved by asking the
6181 NT domain controller for the specied domain to do the lookup.
6182 Because Winbind hooks into the operating system at a low level
6183 (via the NSS name resolution modules in the C library) this
6184 redirection to the NT domain controller is completely
6185 transparent.</P
6187 >Users on the UNIX machine can then use NT user and group
6188 names as they would use "native" UNIX names. They can chown files
6189 so that they are owned by NT domain users or even login to the
6190 UNIX machine and run a UNIX X-Window session as a domain user.</P
6192 >The only obvious indication that Winbind is being used is
6193 that user and group names take the form DOMAIN\user and
6194 DOMAIN\group. This is necessary as it allows Winbind to determine
6195 that redirection to a domain controller is wanted for a particular
6196 lookup and which trusted domain is being referenced.</P
6198 >Additionally, Winbind provides a authentication service
6199 that hooks into the Pluggable Authentication Modules (PAM) system
6200 to provide authentication via a NT domain to any PAM enabled
6201 applications. This capability solves the problem of synchronizing
6202 passwords between systems as all passwords are stored in a single
6203 location (on the domain controller).</P
6204 ><DIV
6205 CLASS="SECT2"
6206 ><HR><H2
6207 CLASS="SECT2"
6209 NAME="AEN1353"
6210 >7.3.1. Target Uses</A
6211 ></H2
6213 >Winbind is targeted at organizations that have an
6214 existing NT based domain infrastructure into which they wish
6215 to put UNIX workstations or servers. Winbind will allow these
6216 organizations to deploy UNIX workstations without having to
6217 maintain a separate account infrastructure. This greatly simplies
6218 the administrative overhead of deploying UNIX workstations into
6219 a NT based organization.</P
6221 >Another interesting way in which we expect Winbind to
6222 be used is as a central part of UNIX based appliances. Appliances
6223 that provide file and print services to Microsoft based networks
6224 will be able to use Winbind to provide seamless integration of
6225 the appliance into the domain.</P
6226 ></DIV
6227 ></DIV
6228 ><DIV
6229 CLASS="SECT1"
6230 ><HR><H1
6231 CLASS="SECT1"
6233 NAME="AEN1357"
6234 >7.4. How Winbind Works</A
6235 ></H1
6237 >The winbind system is designed around a client/server
6238 architecture. A long running <B
6239 CLASS="COMMAND"
6240 >winbindd</B
6241 > daemon
6242 listens on a UNIX domain socket waiting for requests
6243 to arrive. These requests are generated by the NSS and PAM
6244 clients and processed sequentially.</P
6246 >The technologies used to implement winbind are described
6247 in detail below.</P
6248 ><DIV
6249 CLASS="SECT2"
6250 ><HR><H2
6251 CLASS="SECT2"
6253 NAME="AEN1362"
6254 >7.4.1. Microsoft Remote Procedure Calls</A
6255 ></H2
6257 >Over the last two years, efforts have been underway
6258 by various Samba Team members to decode various aspects of
6259 the Microsoft Remote Procedure Call (MSRPC) system. This
6260 system is used for most network related operations between
6261 Windows NT machines including remote management, user authentication
6262 and print spooling. Although initially this work was done
6263 to aid the implementation of Primary Domain Controller (PDC)
6264 functionality in Samba, it has also yielded a body of code which
6265 can be used for other purposes.</P
6267 >Winbind uses various MSRPC calls to enumerate domain users
6268 and groups and to obtain detailed information about individual
6269 users or groups. Other MSRPC calls can be used to authenticate
6270 NT domain users and to change user passwords. By directly querying
6271 a Windows PDC for user and group information, winbind maps the
6272 NT account information onto UNIX user and group names.</P
6273 ></DIV
6274 ><DIV
6275 CLASS="SECT2"
6276 ><HR><H2
6277 CLASS="SECT2"
6279 NAME="AEN1366"
6280 >7.4.2. Name Service Switch</A
6281 ></H2
6283 >The Name Service Switch, or NSS, is a feature that is
6284 present in many UNIX operating systems. It allows system
6285 information such as hostnames, mail aliases and user information
6286 to be resolved from dierent sources. For example, a standalone
6287 UNIX workstation may resolve system information from a series of
6288 flat files stored on the local lesystem. A networked workstation
6289 may first attempt to resolve system information from local files,
6290 then consult a NIS database for user information or a DNS server
6291 for hostname information.</P
6293 >The NSS application programming interface allows winbind
6294 to present itself as a source of system information when
6295 resolving UNIX usernames and groups. Winbind uses this interface,
6296 and information obtained from a Windows NT server using MSRPC
6297 calls to provide a new source of account enumeration. Using standard
6298 UNIX library calls, one can enumerate the users and groups on
6299 a UNIX machine running winbind and see all users and groups in
6300 a NT domain plus any trusted domain as though they were local
6301 users and groups.</P
6303 >The primary control le for NSS is <TT
6304 CLASS="FILENAME"
6305 >/etc/nsswitch.conf
6306 </TT
6307 >. When a UNIX application makes a request to do a lookup
6308 the C library looks in <TT
6309 CLASS="FILENAME"
6310 >/etc/nsswitch.conf</TT
6312 for a line which matches the service type being requested, for
6313 example the "passwd" service type is used when user or group names
6314 are looked up. This config line species which implementations
6315 of that service should be tried andin what order. If the passwd
6316 config line is:</P
6319 CLASS="COMMAND"
6320 >passwd: files example</B
6321 ></P
6323 >then the C library will first load a module called
6325 CLASS="FILENAME"
6326 >/lib/libnss_files.so</TT
6327 > followed by
6328 the module <TT
6329 CLASS="FILENAME"
6330 >/lib/libnss_example.so</TT
6331 >. The
6332 C library will dynamically load each of these modules in turn
6333 and call resolver functions within the modules to try to resolve
6334 the request. Once the request is resolved the C library returns the
6335 result to the application.</P
6337 >This NSS interface provides a very easy way for Winbind
6338 to hook into the operating system. All that needs to be done
6339 is to put <TT
6340 CLASS="FILENAME"
6341 >libnss_winbind.so</TT
6342 > in <TT
6343 CLASS="FILENAME"
6344 >/lib/</TT
6346 then add "winbind" into <TT
6347 CLASS="FILENAME"
6348 >/etc/nsswitch.conf</TT
6349 > at
6350 the appropriate place. The C library will then call Winbind to
6351 resolve user and group names.</P
6352 ></DIV
6353 ><DIV
6354 CLASS="SECT2"
6355 ><HR><H2
6356 CLASS="SECT2"
6358 NAME="AEN1382"
6359 >7.4.3. Pluggable Authentication Modules</A
6360 ></H2
6362 >Pluggable Authentication Modules, also known as PAM,
6363 is a system for abstracting authentication and authorization
6364 technologies. With a PAM module it is possible to specify different
6365 authentication methods for dierent system applications without
6366 having to recompile these applications. PAM is also useful
6367 for implementing a particular policy for authorization. For example,
6368 a system administrator may only allow console logins from users
6369 stored in the local password file but only allow users resolved from
6370 a NIS database to log in over the network.</P
6372 >Winbind uses the authentication management and password
6373 management PAM interface to integrate Windows NT users into a
6374 UNIX system. This allows Windows NT users to log in to a UNIX
6375 machine and be authenticated against a suitable Primary Domain
6376 Controller. These users can also change their passwords and have
6377 this change take eect directly on the Primary Domain Controller.
6380 >PAM is congured by providing control files in the directory
6382 CLASS="FILENAME"
6383 >/etc/pam.d/</TT
6384 > for each of the services that
6385 require authentication. When an authentication request is made
6386 by an application the PAM code in the C library looks up this
6387 control file to determine what modules to load to do the
6388 authentication check and in what order. This interface makes adding
6389 a new authentication service for Winbind very easy, all that needs
6390 to be done is that the <TT
6391 CLASS="FILENAME"
6392 >pam_winbind.so</TT
6393 > module
6394 is copied to <TT
6395 CLASS="FILENAME"
6396 >/lib/security/</TT
6397 > and the pam
6398 control files for relevant services are updated to allow
6399 authentication via winbind. See the PAM documentation
6400 for more details.</P
6401 ></DIV
6402 ><DIV
6403 CLASS="SECT2"
6404 ><HR><H2
6405 CLASS="SECT2"
6407 NAME="AEN1390"
6408 >7.4.4. User and Group ID Allocation</A
6409 ></H2
6411 >When a user or group is created under Windows NT
6412 is it allocated a numerical relative identier (RID). This is
6413 slightly dierent to UNIX which has a range of numbers which are
6414 used to identify users, and the same range in which to identify
6415 groups. It is winbind's job to convert RIDs to UNIX id numbers and
6416 vice versa. When winbind is congured it is given part of the UNIX
6417 user id space and a part of the UNIX group id space in which to
6418 store Windows NT users and groups. If a Windows NT user is
6419 resolved for the first time, it is allocated the next UNIX id from
6420 the range. The same process applies for Windows NT groups. Over
6421 time, winbind will have mapped all Windows NT users and groups
6422 to UNIX user ids and group ids.</P
6424 >The results of this mapping are stored persistently in
6425 a ID mapping database held in a tdb database). This ensures that
6426 RIDs are mapped to UNIX IDs in a consistent way.</P
6427 ></DIV
6428 ><DIV
6429 CLASS="SECT2"
6430 ><HR><H2
6431 CLASS="SECT2"
6433 NAME="AEN1394"
6434 >7.4.5. Result Caching</A
6435 ></H2
6437 >An active system can generate a lot of user and group
6438 name lookups. To reduce the network cost of these lookups winbind
6439 uses a caching scheme based on the SAM sequence number supplied
6440 by NT domain controllers. User or group information returned
6441 by a PDC is cached by winbind along with a sequence number also
6442 returned by the PDC. This sequence number is incremented by
6443 Windows NT whenever any user or group information is modied. If
6444 a cached entry has expired, the sequence number is requested from
6445 the PDC and compared against the sequence number of the cached entry.
6446 If the sequence numbers do not match, then the cached information
6447 is discarded and up to date information is requested directly
6448 from the PDC.</P
6449 ></DIV
6450 ></DIV
6451 ><DIV
6452 CLASS="SECT1"
6453 ><HR><H1
6454 CLASS="SECT1"
6456 NAME="AEN1397"
6457 >7.5. Installation and Configuration</A
6458 ></H1
6460 >The easiest way to install winbind is by using the packages
6461 provided in the <TT
6462 CLASS="FILENAME"
6463 >pub/samba/appliance/</TT
6465 directory on your nearest
6466 Samba mirror. These packages provide snapshots of the Samba source
6467 code and binaries already setup to provide the full functionality
6468 of winbind. This setup is a little more complex than a normal Samba
6469 build as winbind needs a small amount of functionality from a
6470 development code branch called SAMBA_TNG.</P
6472 >Once you have installed the packages you should read
6473 the <B
6474 CLASS="COMMAND"
6475 >winbindd(8)</B
6476 > man page which will provide you
6477 with conguration information and give you sample conguration files.
6478 You may also wish to update the main Samba daemons smbd and nmbd)
6479 with a more recent development release, such as the recently
6480 announced Samba 2.2 alpha release.</P
6481 ></DIV
6482 ><DIV
6483 CLASS="SECT1"
6484 ><HR><H1
6485 CLASS="SECT1"
6487 NAME="AEN1403"
6488 >7.6. Limitations</A
6489 ></H1
6491 >Winbind has a number of limitations in its current
6492 released version which we hope to overcome in future
6493 releases:</P
6495 ></P
6496 ><UL
6497 ><LI
6499 >Winbind is currently only available for
6500 the Linux operating system, although ports to other operating
6501 systems are certainly possible. For such ports to be feasible,
6502 we require the C library of the target operating system to
6503 support the Name Service Switch and Pluggable Authentication
6504 Modules systems. This is becoming more common as NSS and
6505 PAM gain support among UNIX vendors.</P
6506 ></LI
6507 ><LI
6509 >The mappings of Windows NT RIDs to UNIX ids
6510 is not made algorithmically and depends on the order in which
6511 unmapped users or groups are seen by winbind. It may be difficult
6512 to recover the mappings of rid to UNIX id mapping if the file
6513 containing this information is corrupted or destroyed.</P
6514 ></LI
6515 ><LI
6517 >Currently the winbind PAM module does not take
6518 into account possible workstation and logon time restrictions
6519 that may be been set for Windows NT users.</P
6520 ></LI
6521 ><LI
6523 >Building winbind from source is currently
6524 quite tedious as it requires combining source code from two Samba
6525 branches. Work is underway to solve this by providing all
6526 the necessary functionality in the main Samba code branch.</P
6527 ></LI
6528 ></UL
6529 ></DIV
6530 ><DIV
6531 CLASS="SECT1"
6532 ><HR><H1
6533 CLASS="SECT1"
6535 NAME="AEN1415"
6536 >7.7. Conclusion</A
6537 ></H1
6539 >The winbind system, through the use of the Name Service
6540 Switch, Pluggable Authentication Modules, and appropriate
6541 Microsoft RPC calls have allowed us to provide seamless
6542 integration of Microsoft Windows NT domain users on a
6543 UNIX system. The result is a great reduction in the administrative
6544 cost of running a mixed UNIX and NT network.</P
6545 ></DIV
6546 ></DIV
6547 ><DIV
6548 CLASS="CHAPTER"
6549 ><HR><H1
6551 NAME="AEN1418"
6552 >Chapter 8. UNIX Permission Bits and WIndows NT Access Control Lists</A
6553 ></H1
6554 ><DIV
6555 CLASS="SECT1"
6556 ><H1
6557 CLASS="SECT1"
6559 NAME="AEN1429"
6560 >8.1. Viewing and changing UNIX permissions using the NT
6561 security dialogs</A
6562 ></H1
6564 >New in the Samba 2.0.4 release is the ability for Windows
6565 NT clients to use their native security settings dialog box to
6566 view and modify the underlying UNIX permissions.</P
6568 >Note that this ability is careful not to compromise
6569 the security of the UNIX host Samba is running on, and
6570 still obeys all the file permission rules that a Samba
6571 administrator can set.</P
6573 >In Samba 2.0.4 and above the default value of the
6574 parameter <A
6575 HREF="smb.conf.5.html#NTACLSUPPORT"
6576 TARGET="_top"
6577 ><TT
6578 CLASS="PARAMETER"
6580 > nt acl support</I
6581 ></TT
6582 ></A
6583 > has been changed from
6585 CLASS="CONSTANT"
6586 >false</TT
6587 > to <TT
6588 CLASS="CONSTANT"
6589 >true</TT
6590 >, so
6591 manipulation of permissions is turned on by default.</P
6592 ></DIV
6593 ><DIV
6594 CLASS="SECT1"
6595 ><HR><H1
6596 CLASS="SECT1"
6598 NAME="AEN1438"
6599 >8.2. How to view file security on a Samba share</A
6600 ></H1
6602 >From an NT 4.0 client, single-click with the right
6603 mouse button on any file or directory in a Samba mounted
6604 drive letter or UNC path. When the menu pops-up, click
6605 on the <EM
6606 >Properties</EM
6607 > entry at the bottom of
6608 the menu. This brings up the normal file properties dialog
6609 box, but with Samba 2.0.4 this will have a new tab along the top
6610 marked <EM
6611 >Security</EM
6612 >. Click on this tab and you
6613 will see three buttons, <EM
6614 >Permissions</EM
6617 >Auditing</EM
6618 >, and <EM
6619 >Ownership</EM
6621 The <EM
6622 >Auditing</EM
6623 > button will cause either
6624 an error message <SPAN
6625 CLASS="ERRORNAME"
6626 >A requested privilege is not held
6627 by the client</SPAN
6628 > to appear if the user is not the
6629 NT Administrator, or a dialog which is intended to allow an
6630 Administrator to add auditing requirements to a file if the
6631 user is logged on as the NT Administrator. This dialog is
6632 non-functional with a Samba share at this time, as the only
6633 useful button, the <B
6634 CLASS="COMMAND"
6635 >Add</B
6636 > button will not currently
6637 allow a list of users to be seen.</P
6638 ></DIV
6639 ><DIV
6640 CLASS="SECT1"
6641 ><HR><H1
6642 CLASS="SECT1"
6644 NAME="AEN1449"
6645 >8.3. Viewing file ownership</A
6646 ></H1
6648 >Clicking on the <B
6649 CLASS="COMMAND"
6650 >"Ownership"</B
6651 > button
6652 brings up a dialog box telling you who owns the given file. The
6653 owner name will be of the form :</P
6656 CLASS="COMMAND"
6657 >"SERVER\user (Long name)"</B
6658 ></P
6660 >Where <TT
6661 CLASS="REPLACEABLE"
6663 >SERVER</I
6664 ></TT
6665 > is the NetBIOS name of
6666 the Samba server, <TT
6667 CLASS="REPLACEABLE"
6669 >user</I
6670 ></TT
6671 > is the user name of
6672 the UNIX user who owns the file, and <TT
6673 CLASS="REPLACEABLE"
6675 >(Long name)</I
6676 ></TT
6678 is the discriptive string identifying the user (normally found in the
6679 GECOS field of the UNIX password database). Click on the <B
6680 CLASS="COMMAND"
6681 >Close
6683 > button to remove this dialog.</P
6685 >If the parameter <TT
6686 CLASS="PARAMETER"
6688 >nt acl support</I
6689 ></TT
6691 is set to <TT
6692 CLASS="CONSTANT"
6693 >false</TT
6694 > then the file owner will
6695 be shown as the NT user <B
6696 CLASS="COMMAND"
6697 >"Everyone"</B
6698 >.</P
6700 >The <B
6701 CLASS="COMMAND"
6702 >Take Ownership</B
6703 > button will not allow
6704 you to change the ownership of this file to yourself (clicking on
6705 it will display a dialog box complaining that the user you are
6706 currently logged onto the NT client cannot be found). The reason
6707 for this is that changing the ownership of a file is a privilaged
6708 operation in UNIX, available only to the <EM
6709 >root</EM
6711 user. As clicking on this button causes NT to attempt to change
6712 the ownership of a file to the current user logged into the NT
6713 client this will not work with Samba at this time.</P
6715 >There is an NT chown command that will work with Samba
6716 and allow a user with Administrator privillage connected
6717 to a Samba 2.0.4 server as root to change the ownership of
6718 files on both a local NTFS filesystem or remote mounted NTFS
6719 or Samba drive. This is available as part of the <EM
6720 >Seclib
6721 </EM
6722 > NT security library written by Jeremy Allison of
6723 the Samba Team, available from the main Samba ftp site.</P
6724 ></DIV
6725 ><DIV
6726 CLASS="SECT1"
6727 ><HR><H1
6728 CLASS="SECT1"
6730 NAME="AEN1469"
6731 >8.4. Viewing file or directory permissions</A
6732 ></H1
6734 >The third button is the <B
6735 CLASS="COMMAND"
6736 >"Permissions"</B
6738 button. Clicking on this brings up a dialog box that shows both
6739 the permissions and the UNIX owner of the file or directory.
6740 The owner is displayed in the form :</P
6743 CLASS="COMMAND"
6744 >"SERVER\user (Long name)"</B
6745 ></P
6747 >Where <TT
6748 CLASS="REPLACEABLE"
6750 >SERVER</I
6751 ></TT
6752 > is the NetBIOS name of
6753 the Samba server, <TT
6754 CLASS="REPLACEABLE"
6756 >user</I
6757 ></TT
6758 > is the user name of
6759 the UNIX user who owns the file, and <TT
6760 CLASS="REPLACEABLE"
6762 >(Long name)</I
6763 ></TT
6765 is the discriptive string identifying the user (normally found in the
6766 GECOS field of the UNIX password database).</P
6768 >If the parameter <TT
6769 CLASS="PARAMETER"
6771 >nt acl support</I
6772 ></TT
6774 is set to <TT
6775 CLASS="CONSTANT"
6776 >false</TT
6777 > then the file owner will
6778 be shown as the NT user <B
6779 CLASS="COMMAND"
6780 >"Everyone"</B
6781 > and the
6782 permissions will be shown as NT "Full Control".</P
6784 >The permissions field is displayed differently for files
6785 and directories, so I'll describe the way file permissions
6786 are displayed first.</P
6787 ><DIV
6788 CLASS="SECT2"
6789 ><HR><H2
6790 CLASS="SECT2"
6792 NAME="AEN1484"
6793 >8.4.1. File Permissions</A
6794 ></H2
6796 >The standard UNIX user/group/world triple and
6797 the correspinding "read", "write", "execute" permissions
6798 triples are mapped by Samba into a three element NT ACL
6799 with the 'r', 'w', and 'x' bits mapped into the corresponding
6800 NT permissions. The UNIX world permissions are mapped into
6801 the global NT group <B
6802 CLASS="COMMAND"
6803 >Everyone</B
6804 >, followed
6805 by the list of permissions allowed for UNIX world. The UNIX
6806 owner and group permissions are displayed as an NT
6808 CLASS="COMMAND"
6809 >user</B
6810 > icon and an NT <B
6811 CLASS="COMMAND"
6812 >local
6813 group</B
6814 > icon respectively followed by the list
6815 of permissions allowed for the UNIX user and group.</P
6817 >As many UNIX permission sets don't map into common
6818 NT names such as <B
6819 CLASS="COMMAND"
6820 >"read"</B
6821 >, <B
6822 CLASS="COMMAND"
6823 > "change"</B
6824 > or <B
6825 CLASS="COMMAND"
6826 >"full control"</B
6827 > then
6828 usually the permissions will be prefixed by the words <B
6829 CLASS="COMMAND"
6830 > "Special Access"</B
6831 > in the NT display list.</P
6833 >But what happens if the file has no permissions allowed
6834 for a particular UNIX user group or world component ? In order
6835 to allow "no permissions" to be seen and modified then Samba
6836 overloads the NT <B
6837 CLASS="COMMAND"
6838 >"Take Ownership"</B
6839 > ACL attribute
6840 (which has no meaning in UNIX) and reports a component with
6841 no permissions as having the NT <B
6842 CLASS="COMMAND"
6843 >"O"</B
6844 > bit set.
6845 This was chosen of course to make it look like a zero, meaning
6846 zero permissions. More details on the decision behind this will
6847 be given below.</P
6848 ></DIV
6849 ><DIV
6850 CLASS="SECT2"
6851 ><HR><H2
6852 CLASS="SECT2"
6854 NAME="AEN1498"
6855 >8.4.2. Directory Permissions</A
6856 ></H2
6858 >Directories on an NT NTFS file system have two
6859 different sets of permissions. The first set of permissions
6860 is the ACL set on the directory itself, this is usually displayed
6861 in the first set of parentheses in the normal <B
6862 CLASS="COMMAND"
6863 >"RW"</B
6865 NT style. This first set of permissions is created by Samba in
6866 exactly the same way as normal file permissions are, described
6867 above, and is displayed in the same way.</P
6869 >The second set of directory permissions has no real meaning
6870 in the UNIX permissions world and represents the <B
6871 CLASS="COMMAND"
6872 > "inherited"</B
6873 > permissions that any file created within
6874 this directory would inherit.</P
6876 >Samba synthesises these inherited permissions for NT by
6877 returning as an NT ACL the UNIX permission mode that a new file
6878 created by Samba on this share would receive.</P
6879 ></DIV
6880 ></DIV
6881 ><DIV
6882 CLASS="SECT1"
6883 ><HR><H1
6884 CLASS="SECT1"
6886 NAME="AEN1505"
6887 >8.5. Modifying file or directory permissions</A
6888 ></H1
6890 >Modifying file and directory permissions is as simple
6891 as changing the displayed permissions in the dialog box, and
6892 clicking the <B
6893 CLASS="COMMAND"
6894 >OK</B
6895 > button. However, there are
6896 limitations that a user needs to be aware of, and also interactions
6897 with the standard Samba permission masks and mapping of DOS
6898 attributes that need to also be taken into account.</P
6900 >If the parameter <TT
6901 CLASS="PARAMETER"
6903 >nt acl support</I
6904 ></TT
6906 is set to <TT
6907 CLASS="CONSTANT"
6908 >false</TT
6909 > then any attempt to set
6910 security permissions will fail with an <B
6911 CLASS="COMMAND"
6912 >"Access Denied"
6914 > message.</P
6916 >The first thing to note is that the <B
6917 CLASS="COMMAND"
6918 >"Add"</B
6920 button will not return a list of users in Samba 2.0.4 (it will give
6921 an error message of <B
6922 CLASS="COMMAND"
6923 >"The remote proceedure call failed
6924 and did not execute"</B
6925 >). This means that you can only
6926 manipulate the current user/group/world permissions listed in
6927 the dialog box. This actually works quite well as these are the
6928 only permissions that UNIX actually has.</P
6930 >If a permission triple (either user, group, or world)
6931 is removed from the list of permissions in the NT dialog box,
6932 then when the <B
6933 CLASS="COMMAND"
6934 >"OK"</B
6935 > button is pressed it will
6936 be applied as "no permissions" on the UNIX side. If you then
6937 view the permissions again the "no permissions" entry will appear
6938 as the NT <B
6939 CLASS="COMMAND"
6940 >"O"</B
6941 > flag, as described above. This
6942 allows you to add permissions back to a file or directory once
6943 you have removed them from a triple component.</P
6945 >As UNIX supports only the "r", "w" and "x" bits of
6946 an NT ACL then if other NT security attributes such as "Delete
6947 access" are selected then they will be ignored when applied on
6948 the Samba server.</P
6950 >When setting permissions on a directory the second
6951 set of permissions (in the second set of parentheses) is
6952 by default applied to all files within that directory. If this
6953 is not what you want you must uncheck the <B
6954 CLASS="COMMAND"
6955 >"Replace
6956 permissions on existing files"</B
6957 > checkbox in the NT
6958 dialog before clicking <B
6959 CLASS="COMMAND"
6960 >"OK"</B
6961 >.</P
6963 >If you wish to remove all permissions from a
6964 user/group/world component then you may either highlight the
6965 component and click the <B
6966 CLASS="COMMAND"
6967 >"Remove"</B
6968 > button,
6969 or set the component to only have the special <B
6970 CLASS="COMMAND"
6971 >"Take
6972 Ownership"</B
6973 > permission (dsplayed as <B
6974 CLASS="COMMAND"
6975 >"O"
6977 >) highlighted.</P
6978 ></DIV
6979 ><DIV
6980 CLASS="SECT1"
6981 ><HR><H1
6982 CLASS="SECT1"
6984 NAME="AEN1527"
6985 >8.6. Interaction with the standard Samba create mask
6986 parameters</A
6987 ></H1
6989 >Note that with Samba 2.0.5 there are four new parameters
6990 to control this interaction. These are :</P
6992 ><TT
6993 CLASS="PARAMETER"
6995 >security mask</I
6996 ></TT
6997 ></P
6999 ><TT
7000 CLASS="PARAMETER"
7002 >force security mode</I
7003 ></TT
7004 ></P
7006 ><TT
7007 CLASS="PARAMETER"
7009 >directory security mask</I
7010 ></TT
7011 ></P
7013 ><TT
7014 CLASS="PARAMETER"
7016 >force directory security mode</I
7017 ></TT
7018 ></P
7020 >Once a user clicks <B
7021 CLASS="COMMAND"
7022 >"OK"</B
7023 > to apply the
7024 permissions Samba maps the given permissions into a user/group/world
7025 r/w/x triple set, and then will check the changed permissions for a
7026 file against the bits set in the <A
7027 HREF="smb.conf.5.html#SECURITYMASK"
7028 TARGET="_top"
7031 CLASS="PARAMETER"
7033 >security mask</I
7034 ></TT
7035 ></A
7036 > parameter. Any bits that
7037 were changed that are not set to '1' in this parameter are left alone
7038 in the file permissions.</P
7040 >Essentially, zero bits in the <TT
7041 CLASS="PARAMETER"
7043 >security mask</I
7044 ></TT
7046 mask may be treated as a set of bits the user is <EM
7047 >not</EM
7049 allowed to change, and one bits are those the user is allowed to change.
7052 >If not set explicitly this parameter is set to the same value as
7053 the <A
7054 HREF="smb.conf.5.html#CREATEMASK"
7055 TARGET="_top"
7056 ><TT
7057 CLASS="PARAMETER"
7059 >create mask
7061 ></TT
7062 ></A
7063 > parameter to provide compatibility with Samba 2.0.4
7064 where this permission change facility was introduced. To allow a user to
7065 modify all the user/group/world permissions on a file, set this parameter
7066 to 0777.</P
7068 >Next Samba checks the changed permissions for a file against
7069 the bits set in the <A
7070 HREF="smb.conf.5.html#FORCESECURITYMODE"
7071 TARGET="_top"
7072 > <TT
7073 CLASS="PARAMETER"
7075 >force security mode</I
7076 ></TT
7077 ></A
7078 > parameter. Any bits
7079 that were changed that correspond to bits set to '1' in this parameter
7080 are forced to be set.</P
7082 >Essentially, bits set in the <TT
7083 CLASS="PARAMETER"
7085 >force security mode
7087 ></TT
7088 > parameter may be treated as a set of bits that, when
7089 modifying security on a file, the user has always set to be 'on'.</P
7091 >If not set explicitly this parameter is set to the same value
7092 as the <A
7093 HREF="smb.conf.5.html#FORCECREATEMODE"
7094 TARGET="_top"
7095 ><TT
7096 CLASS="PARAMETER"
7098 >force
7099 create mode</I
7100 ></TT
7101 ></A
7102 > parameter to provide compatibility
7103 with Samba 2.0.4 where the permission change facility was introduced.
7104 To allow a user to modify all the user/group/world permissions on a file,
7105 with no restrictions set this parameter to 000.</P
7107 >The <TT
7108 CLASS="PARAMETER"
7110 >security mask</I
7111 ></TT
7112 > and <TT
7113 CLASS="PARAMETER"
7115 >force
7116 security mode</I
7117 ></TT
7118 > parameters are applied to the change
7119 request in that order.</P
7121 >For a directory Samba will perform the same operations as
7122 described above for a file except using the parameter <TT
7123 CLASS="PARAMETER"
7125 > directory security mask</I
7126 ></TT
7127 > instead of <TT
7128 CLASS="PARAMETER"
7130 >security
7131 mask</I
7132 ></TT
7133 >, and <TT
7134 CLASS="PARAMETER"
7136 >force directory security mode
7138 ></TT
7139 > parameter instead of <TT
7140 CLASS="PARAMETER"
7142 >force security mode
7144 ></TT
7145 >.</P
7147 >The <TT
7148 CLASS="PARAMETER"
7150 >directory security mask</I
7151 ></TT
7152 > parameter
7153 by default is set to the same value as the <TT
7154 CLASS="PARAMETER"
7156 >directory mask
7158 ></TT
7159 > parameter and the <TT
7160 CLASS="PARAMETER"
7162 >force directory security
7163 mode</I
7164 ></TT
7165 > parameter by default is set to the same value as
7166 the <TT
7167 CLASS="PARAMETER"
7169 >force directory mode</I
7170 ></TT
7171 > parameter to provide
7172 compatibility with Samba 2.0.4 where the permission change facility
7173 was introduced.</P
7175 >In this way Samba enforces the permission restrictions that
7176 an administrator can set on a Samba share, whilst still allowing users
7177 to modify the permission bits within that restriction.</P
7179 >If you want to set up a share that allows users full control
7180 in modifying the permission bits on their files and directories and
7181 doesn't force any particular bits to be set 'on', then set the following
7182 parameters in the <A
7183 HREF="smb.conf.5.html"
7184 TARGET="_top"
7185 ><TT
7186 CLASS="FILENAME"
7187 >smb.conf(5)
7188 </TT
7189 ></A
7190 > file in that share specific section :</P
7192 ><TT
7193 CLASS="PARAMETER"
7195 >security mask = 0777</I
7196 ></TT
7197 ></P
7199 ><TT
7200 CLASS="PARAMETER"
7202 >force security mode = 0</I
7203 ></TT
7204 ></P
7206 ><TT
7207 CLASS="PARAMETER"
7209 >directory security mask = 0777</I
7210 ></TT
7211 ></P
7213 ><TT
7214 CLASS="PARAMETER"
7216 >force directory security mode = 0</I
7217 ></TT
7218 ></P
7220 >As described, in Samba 2.0.4 the parameters :</P
7222 ><TT
7223 CLASS="PARAMETER"
7225 >create mask</I
7226 ></TT
7227 ></P
7229 ><TT
7230 CLASS="PARAMETER"
7232 >force create mode</I
7233 ></TT
7234 ></P
7236 ><TT
7237 CLASS="PARAMETER"
7239 >directory mask</I
7240 ></TT
7241 ></P
7243 ><TT
7244 CLASS="PARAMETER"
7246 >force directory mode</I
7247 ></TT
7248 ></P
7250 >were used instead of the parameters discussed here.</P
7251 ></DIV
7252 ><DIV
7253 CLASS="SECT1"
7254 ><HR><H1
7255 CLASS="SECT1"
7257 NAME="AEN1591"
7258 >8.7. Interaction with the standard Samba file attribute
7259 mapping</A
7260 ></H1
7262 >Samba maps some of the DOS attribute bits (such as "read
7263 only") into the UNIX permissions of a file. This means there can
7264 be a conflict between the permission bits set via the security
7265 dialog and the permission bits set by the file attribute mapping.
7268 >One way this can show up is if a file has no UNIX read access
7269 for the owner it will show up as "read only" in the standard
7270 file attributes tabbed dialog. Unfortunately this dialog is
7271 the same one that contains the security info in another tab.</P
7273 >What this can mean is that if the owner changes the permissions
7274 to allow themselves read access using the security dialog, clicks
7276 CLASS="COMMAND"
7277 >"OK"</B
7278 > to get back to the standard attributes tab
7279 dialog, and then clicks <B
7280 CLASS="COMMAND"
7281 >"OK"</B
7282 > on that dialog, then
7283 NT will set the file permissions back to read-only (as that is what
7284 the attributes still say in the dialog). This means that after setting
7285 permissions and clicking <B
7286 CLASS="COMMAND"
7287 >"OK"</B
7288 > to get back to the
7289 attributes dialog you should always hit <B
7290 CLASS="COMMAND"
7291 >"Cancel"</B
7293 rather than <B
7294 CLASS="COMMAND"
7295 >"OK"</B
7296 > to ensure that your changes
7297 are not overridden.</P
7298 ></DIV
7299 ></DIV
7300 ><DIV
7301 CLASS="CHAPTER"
7302 ><HR><H1
7304 NAME="AEN1601"
7305 >Chapter 9. OS2 Client HOWTO</A
7306 ></H1
7307 ><DIV
7308 CLASS="SECT1"
7309 ><H1
7310 CLASS="SECT1"
7312 NAME="AEN1612"
7313 >9.1. FAQs</A
7314 ></H1
7315 ><DIV
7316 CLASS="SECT2"
7317 ><H2
7318 CLASS="SECT2"
7320 NAME="AEN1614"
7321 >9.1.1. How can I configure OS/2 Warp Connect or
7322 OS/2 Warp 4 as a client for Samba?</A
7323 ></H2
7325 >A more complete answer to this question can be
7326 found on <A
7327 HREF="http://carol.wins.uva.nl/~leeuw/samba/warp.html"
7328 TARGET="_top"
7329 > http://carol.wins.uva.nl/~leeuw/samba/warp.html</A
7330 >.</P
7332 >Basically, you need three components:</P
7334 ></P
7335 ><UL
7336 ><LI
7338 >The File and Print Client ('IBM Peer')
7340 ></LI
7341 ><LI
7343 >TCP/IP ('Internet support')
7345 ></LI
7346 ><LI
7348 >The "NetBIOS over TCP/IP" driver ('TCPBEUI')
7350 ></LI
7351 ></UL
7353 >Installing the first two together with the base operating
7354 system on a blank system is explained in the Warp manual. If Warp
7355 has already been installed, but you now want to install the
7356 networking support, use the "Selective Install for Networking"
7357 object in the "System Setup" folder.</P
7359 >Adding the "NetBIOS over TCP/IP" driver is not described
7360 in the manual and just barely in the online documentation. Start
7361 MPTS.EXE, click on OK, click on "Configure LAPS" and click
7362 on "IBM OS/2 NETBIOS OVER TCP/IP" in 'Protocols'. This line
7363 is then moved to 'Current Configuration'. Select that line,
7364 click on "Change number" and increase it from 0 to 1. Save this
7365 configuration.</P
7367 >If the Samba server(s) is not on your local subnet, you
7368 can optionally add IP names and addresses of these servers
7369 to the "Names List", or specify a WINS server ('NetBIOS
7370 Nameserver' in IBM and RFC terminology). For Warp Connect you
7371 may need to download an update for 'IBM Peer' to bring it on
7372 the same level as Warp 4. See the webpage mentioned above.</P
7373 ></DIV
7374 ><DIV
7375 CLASS="SECT2"
7376 ><HR><H2
7377 CLASS="SECT2"
7379 NAME="AEN1629"
7380 >9.1.2. How can I configure OS/2 Warp 3 (not Connect),
7381 OS/2 1.2, 1.3 or 2.x for Samba?</A
7382 ></H2
7384 >You can use the free Microsoft LAN Manager 2.2c Client
7385 for OS/2 from
7387 HREF="ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/"
7388 TARGET="_top"
7389 > ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/</A
7391 See <A
7392 HREF="http://carol.wins.uva.nl/~leeuw/lanman.html"
7393 TARGET="_top"
7394 > http://carol.wins.uva.nl/~leeuw/lanman.html</A
7395 > for
7396 more information on how to install and use this client. In
7397 a nutshell, edit the file \OS2VER in the root directory of
7398 the OS/2 boot partition and add the lines:</P
7400 ><TABLE
7401 BORDER="0"
7402 BGCOLOR="#E0E0E0"
7403 WIDTH="100%"
7404 ><TR
7405 ><TD
7406 ><PRE
7407 CLASS="PROGRAMLISTING"
7408 > 20=setup.exe
7409 20=netwksta.sys
7410 20=netvdd.sys
7411 </PRE
7412 ></TD
7413 ></TR
7414 ></TABLE
7415 ></P
7417 >before you install the client. Also, don't use the
7418 included NE2000 driver because it is buggy. Try the NE2000
7419 or NS2000 driver from
7421 HREF="ftp://ftp.cdrom.com/pub/os2/network/ndis/"
7422 TARGET="_top"
7423 > ftp://ftp.cdrom.com/pub/os2/network/ndis/</A
7424 > instead.
7426 ></DIV
7427 ><DIV
7428 CLASS="SECT2"
7429 ><HR><H2
7430 CLASS="SECT2"
7432 NAME="AEN1638"
7433 >9.1.3. Are there any other issues when OS/2 (any version)
7434 is used as a client?</A
7435 ></H2
7437 >When you do a NET VIEW or use the "File and Print
7438 Client Resource Browser", no Samba servers show up. This can
7439 be fixed by a patch from <A
7440 HREF="http://carol.wins.uva.nl/~leeuw/samba/fix.html"
7441 TARGET="_top"
7442 > http://carol.wins.uva.nl/~leeuw/samba/fix.html</A
7444 The patch will be included in a later version of Samba. It also
7445 fixes a couple of other problems, such as preserving long
7446 filenames when objects are dragged from the Workplace Shell
7447 to the Samba server. </P
7448 ></DIV
7449 ><DIV
7450 CLASS="SECT2"
7451 ><HR><H2
7452 CLASS="SECT2"
7454 NAME="AEN1642"
7455 >9.1.4. How do I get printer driver download working
7456 for OS/2 clients?</A
7457 ></H2
7459 >First, create a share called [PRINTDRV] that is
7460 world-readable. Copy your OS/2 driver files there. Note
7461 that the .EA_ files must still be separate, so you will need
7462 to use the original install files, and not copy an installed
7463 driver from an OS/2 system.</P
7465 >Install the NT driver first for that printer. Then,
7466 add to your smb.conf a paramater, "os2 driver map =
7468 CLASS="REPLACEABLE"
7470 >filename</I
7471 ></TT
7472 >". Then, in the file
7473 specified by <TT
7474 CLASS="REPLACEABLE"
7476 >filename</I
7477 ></TT
7478 >, map the
7479 name of the NT driver name to the OS/2 driver name as
7480 follows:</P
7482 >&#60;nt driver name&#62; = &#60;os2 driver
7483 name&#62;.&#60;device name&#62;, e.g.:
7484 HP LaserJet 5L = LASERJET.HP LaserJet 5L</P
7486 >You can have multiple drivers mapped in this file.</P
7488 >If you only specify the OS/2 driver name, and not the
7489 device name, the first attempt to download the driver will
7490 actually download the files, but the OS/2 client will tell
7491 you the driver is not available. On the second attempt, it
7492 will work. This is fixed simply by adding the device name
7493 to the mapping, after which it will work on the first attempt.
7495 ></DIV
7496 ></DIV
7497 ></DIV
7498 ><DIV
7499 CLASS="CHAPTER"
7500 ><HR><H1
7502 NAME="AEN1651"
7503 >Chapter 10. HOWTO Access Samba source code via CVS</A
7504 ></H1
7505 ><DIV
7506 CLASS="SECT1"
7507 ><H1
7508 CLASS="SECT1"
7510 NAME="AEN1658"
7511 >10.1. Introduction</A
7512 ></H1
7514 >Samba is developed in an open environnment. Developers use CVS
7515 (Concurrent Versioning System) to "checkin" (also known as
7516 "commit") new source code. Samba's various CVS branches can
7517 be accessed via anonymouns CVS using the instructions
7518 detailed in this chapter.</P
7520 >This document is a modified version of the instructions found at
7522 HREF="http://samba.org/samba/cvs.html"
7523 TARGET="_top"
7524 >http://samba.org/samba/cvs.html</A
7525 ></P
7526 ></DIV
7527 ><DIV
7528 CLASS="SECT1"
7529 ><HR><H1
7530 CLASS="SECT1"
7532 NAME="AEN1663"
7533 >10.2. CVS Access to samba.org</A
7534 ></H1
7536 >The machine samba.org runs a publicly accessible CVS
7537 repository for access to the source code of several packages,
7538 including samba, rsync and jitterbug. There are two main ways of
7539 accessing the CVS server on this host.</P
7540 ><DIV
7541 CLASS="SECT2"
7542 ><HR><H2
7543 CLASS="SECT2"
7545 NAME="AEN1666"
7546 >10.2.1. Access via CVSweb</A
7547 ></H2
7549 >You can access the source code via your
7550 favourite WWW browser. This allows you to access the contents of
7551 individual files in the repository and also to look at the revision
7552 history and commit logs of individual files. You can also ask for a diff
7553 listing between any two versions on the repository.</P
7555 >Use the URL : <A
7556 HREF="http://samba.org/cgi-bin/cvsweb"
7557 TARGET="_top"
7558 >http://samba.org/cgi-bin/cvsweb</A
7559 ></P
7560 ></DIV
7561 ><DIV
7562 CLASS="SECT2"
7563 ><HR><H2
7564 CLASS="SECT2"
7566 NAME="AEN1671"
7567 >10.2.2. Access via cvs</A
7568 ></H2
7570 >You can also access the source code via a
7571 normal cvs client. This gives you much more control over you can
7572 do with the repository and allows you to checkout whole source trees
7573 and keep them uptodate via normal cvs commands. This is the
7574 preferred method of access if you are a developer and not
7575 just a casual browser.</P
7577 >To download the latest cvs source code, point your
7578 browser at the URL : <A
7579 HREF="http://www.cyclic.com/"
7580 TARGET="_top"
7581 >http://www.cyclic.com/</A
7583 and click on the 'How to get cvs' link. CVS is free software under
7584 the GNU GPL (as is Samba). Note that there are several graphical CVS clients
7585 which provide a graphical interface to the sometimes mundane CVS commands.
7586 Links to theses clients are also available from http://www.cyclic.com.</P
7588 >To gain access via anonymous cvs use the following steps.
7589 For this example it is assumed that you want a copy of the
7590 samba source code. For the other source code repositories
7591 on this system just substitute the correct package name</P
7593 ></P
7594 ><OL
7595 TYPE="1"
7596 ><LI
7598 > Install a recent copy of cvs. All you really need is a
7599 copy of the cvs client binary.
7601 ></LI
7602 ><LI
7604 > Run the command
7607 > <B
7608 CLASS="COMMAND"
7609 >cvs -d :pserver:cvs@samba.org:/cvsroot login</B
7613 > When it asks you for a password type <TT
7614 CLASS="USERINPUT"
7616 >cvs</B
7617 ></TT
7620 ></LI
7621 ><LI
7623 > Run the command
7626 > <B
7627 CLASS="COMMAND"
7628 >cvs -d :pserver:cvs@samba.org:/cvsroot co samba</B
7632 > This will create a directory called samba containing the
7633 latest samba source code (i.e. the HEAD tagged cvs branch). This
7634 currently corresponds to the 3.0 development tree.
7637 > CVS branches other HEAD can be obtained by using the <TT
7638 CLASS="PARAMETER"
7640 >-r</I
7641 ></TT
7643 and defining a tag name. A list of branch tag names can be found on the
7644 "Development" page of the samba web site. A common request is to obtain the
7645 latest 2.2 release code. This could be done by using the following command.
7648 > <B
7649 CLASS="COMMAND"
7650 >cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_2_2 samba</B
7653 ></LI
7654 ><LI
7656 > Whenever you want to merge in the latest code changes use
7657 the following command from within the samba directory:
7660 > <B
7661 CLASS="COMMAND"
7662 >cvs update -d -P</B
7665 ></LI
7666 ></OL
7667 ></DIV
7668 ></DIV
7669 ></DIV
7670 ></DIV
7671 ></BODY
7672 ></HTML