'make everything' in docs
[gd/samba-autobuild/.git] / docs / htmldocs / Samba-HOWTO-Collection.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >SAMBA Project Documentation</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.77"></HEAD
9 ><BODY
10 CLASS="BOOK"
11 BGCOLOR="#FFFFFF"
12 TEXT="#000000"
13 LINK="#0000FF"
14 VLINK="#840084"
15 ALINK="#0000FF"
16 ><DIV
17 CLASS="BOOK"
18 ><A
19 NAME="SAMBA-HOWTO-COLLECTION"
20 ></A
21 ><DIV
22 CLASS="TITLEPAGE"
23 ><H1
24 CLASS="TITLE"
25 ><A
26 NAME="SAMBA-HOWTO-COLLECTION"
27 ></A
28 >SAMBA Project Documentation</H1
29 ><H3
30 CLASS="AUTHOR"
31 ><A
32 NAME="AEN4"
33 ></A
34 >SAMBA Team</H3
35 ><HR></DIV
36 ><HR><H1
37 ><A
38 NAME="AEN8"
39 ></A
40 >Abstract</H1
41 ><P
42 ><SPAN
43 CLASS="emphasis"
44 ><I
45 CLASS="EMPHASIS"
46 >Last Update</I
47 ></SPAN
48 > : Thu Aug 15 12:48:45 CDT 2002</P
49 ><P
50 >This book is a collection of HOWTOs added to Samba documentation over the years.
51 I try to ensure that all are current, but sometimes the is a larger job
52 than one person can maintain.  The most recent version of this document
53 can be found at <A
54 HREF="http://www.samba.org/"
55 TARGET="_top"
56 >http://www.samba.org/</A
57 >
58 on the "Documentation" page.  Please send updates to <A
59 HREF="mailto:jerry@samba.org"
60 TARGET="_top"
61 >jerry@samba.org</A
62 >.</P
63 ><P
64 >This documentation is distributed under the GNU General Public License (GPL) 
65 version 2.  A copy of the license is included with the Samba source
66 distribution.  A copy can be found on-line at <A
67 HREF="http://www.fsf.org/licenses/gpl.txt"
68 TARGET="_top"
69 >http://www.fsf.org/licenses/gpl.txt</A
70 ></P
71 ><P
72 >Cheers, jerry</P
73 ><DIV
74 CLASS="TOC"
75 ><DL
76 ><DT
77 ><B
78 >Table of Contents</B
79 ></DT
80 ><DT
81 >I. <A
82 HREF="#AEN18"
83 >General installation</A
84 ></DT
85 ><DD
86 ><DL
87 ><DT
88 >1. <A
89 HREF="#INSTALL"
90 >How to Install and Test SAMBA</A
91 ></DT
92 ><DD
93 ><DL
94 ><DT
95 >1.1. <A
96 HREF="#AEN25"
97 >Read the man pages</A
98 ></DT
99 ><DT
100 >1.2. <A
101 HREF="#AEN35"
102 >Building the Binaries</A
103 ></DT
104 ><DT
105 >1.3. <A
106 HREF="#AEN63"
107 >The all important step</A
108 ></DT
109 ><DT
110 >1.4. <A
111 HREF="#AEN67"
112 >Create the smb configuration file.</A
113 ></DT
114 ><DT
115 >1.5. <A
116 HREF="#AEN81"
117 >Test your config file with 
118         <B
119 CLASS="COMMAND"
120 >testparm</B
121 ></A
122 ></DT
123 ><DT
124 >1.6. <A
125 HREF="#AEN89"
126 >Starting the smbd and nmbd</A
127 ></DT
128 ><DT
129 >1.7. <A
130 HREF="#AEN144"
131 >Try listing the shares available on your 
132         server</A
133 ></DT
134 ><DT
135 >1.8. <A
136 HREF="#AEN153"
137 >Try connecting with the unix client</A
138 ></DT
139 ><DT
140 >1.9. <A
141 HREF="#AEN169"
142 >Try connecting from a DOS, WfWg, Win9x, WinNT, 
143         Win2k, OS/2, etc... client</A
144 ></DT
145 ><DT
146 >1.10. <A
147 HREF="#AEN183"
148 >What If Things Don't Work?</A
149 ></DT
150 ></DL
151 ></DD
152 ><DT
153 >2. <A
154 HREF="#IMPROVED-BROWSING"
155 >Improved browsing in samba</A
156 ></DT
157 ><DD
158 ><DL
159 ><DT
160 >2.1. <A
161 HREF="#AEN228"
162 >Overview of browsing</A
163 ></DT
164 ><DT
165 >2.2. <A
166 HREF="#AEN232"
167 >Browsing support in samba</A
168 ></DT
169 ><DT
170 >2.3. <A
171 HREF="#AEN241"
172 >Problem resolution</A
173 ></DT
174 ><DT
175 >2.4. <A
176 HREF="#AEN248"
177 >Browsing across subnets</A
178 ></DT
179 ><DT
180 >2.5. <A
181 HREF="#AEN288"
182 >Setting up a WINS server</A
183 ></DT
184 ><DT
185 >2.6. <A
186 HREF="#AEN307"
187 >Setting up Browsing in a WORKGROUP</A
188 ></DT
189 ><DT
190 >2.7. <A
191 HREF="#AEN325"
192 >Setting up Browsing in a DOMAIN</A
193 ></DT
194 ><DT
195 >2.8. <A
196 HREF="#AEN335"
197 >Forcing samba to be the master</A
198 ></DT
199 ><DT
200 >2.9. <A
201 HREF="#AEN344"
202 >Making samba the domain master</A
203 ></DT
204 ><DT
205 >2.10. <A
206 HREF="#AEN362"
207 >Note about broadcast addresses</A
208 ></DT
209 ><DT
210 >2.11. <A
211 HREF="#AEN365"
212 >Multiple interfaces</A
213 ></DT
214 ></DL
215 ></DD
216 ><DT
217 >3. <A
218 HREF="#OPLOCKS"
219 >Oplocks</A
220 ></DT
221 ><DD
222 ><DL
223 ><DT
224 >3.1. <A
225 HREF="#AEN377"
226 >What are oplocks?</A
227 ></DT
228 ></DL
229 ></DD
230 ><DT
231 >4. <A
232 HREF="#BROWSING-QUICK"
233 >Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</A
234 ></DT
235 ><DD
236 ><DL
237 ><DT
238 >4.1. <A
239 HREF="#AEN392"
240 >Discussion</A
241 ></DT
242 ><DT
243 >4.2. <A
244 HREF="#AEN400"
245 >Use of the "Remote Announce" parameter</A
246 ></DT
247 ><DT
248 >4.3. <A
249 HREF="#AEN414"
250 >Use of the "Remote Browse Sync" parameter</A
251 ></DT
252 ><DT
253 >4.4. <A
254 HREF="#AEN419"
255 >Use of WINS</A
256 ></DT
257 ><DT
258 >4.5. <A
259 HREF="#AEN430"
260 >Do NOT use more than one (1) protocol on MS Windows machines</A
261 ></DT
262 ><DT
263 >4.6. <A
264 HREF="#AEN436"
265 >Name Resolution Order</A
266 ></DT
267 ></DL
268 ></DD
269 ><DT
270 >5. <A
271 HREF="#PWENCRYPT"
272 >LanMan and NT Password Encryption in Samba</A
273 ></DT
274 ><DD
275 ><DL
276 ><DT
277 >5.1. <A
278 HREF="#AEN472"
279 >Introduction</A
280 ></DT
281 ><DT
282 >5.2. <A
283 HREF="#AEN477"
284 >Important Notes About Security</A
285 ></DT
286 ><DT
287 >5.3. <A
288 HREF="#AEN512"
289 >The smbpasswd Command</A
290 ></DT
291 ></DL
292 ></DD
293 ></DL
294 ></DD
295 ><DT
296 >II. <A
297 HREF="#AEN544"
298 >Type of installation</A
299 ></DT
300 ><DD
301 ><DL
302 ><DT
303 >6. <A
304 HREF="#SAMBA-PDC"
305 >How to Configure Samba as a NT4 Primary Domain Controller</A
306 ></DT
307 ><DD
308 ><DL
309 ><DT
310 >6.1. <A
311 HREF="#AEN566"
312 >Prerequisite Reading</A
313 ></DT
314 ><DT
315 >6.2. <A
316 HREF="#AEN572"
317 >Background</A
318 ></DT
319 ><DT
320 >6.3. <A
321 HREF="#AEN611"
322 >Configuring the Samba Domain Controller</A
323 ></DT
324 ><DT
325 >6.4. <A
326 HREF="#AEN654"
327 >Creating Machine Trust Accounts and Joining Clients to the
328 Domain</A
329 ></DT
330 ><DT
331 >6.5. <A
332 HREF="#AEN738"
333 >Common Problems and Errors</A
334 ></DT
335 ><DT
336 >6.6. <A
337 HREF="#AEN786"
338 >System Policies and Profiles</A
339 ></DT
340 ><DT
341 >6.7. <A
342 HREF="#AEN830"
343 >What other help can I get?</A
344 ></DT
345 ><DT
346 >6.8. <A
347 HREF="#AEN944"
348 >Domain Control for Windows 9x/ME</A
349 ></DT
350 ><DT
351 >6.9. <A
352 HREF="#AEN1082"
353 >DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
354 ></DT
355 ></DL
356 ></DD
357 ><DT
358 >7. <A
359 HREF="#SAMBA-BDC"
360 >How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</A
361 ></DT
362 ><DD
363 ><DL
364 ><DT
365 >7.1. <A
366 HREF="#AEN1118"
367 >Prerequisite Reading</A
368 ></DT
369 ><DT
370 >7.2. <A
371 HREF="#AEN1122"
372 >Background</A
373 ></DT
374 ><DT
375 >7.3. <A
376 HREF="#AEN1130"
377 >What qualifies a Domain Controller on the network?</A
378 ></DT
379 ><DT
380 >7.4. <A
381 HREF="#AEN1139"
382 >Can Samba be a Backup Domain Controller?</A
383 ></DT
384 ><DT
385 >7.5. <A
386 HREF="#AEN1143"
387 >How do I set up a Samba BDC?</A
388 ></DT
389 ></DL
390 ></DD
391 ><DT
392 >8. <A
393 HREF="#ADS"
394 >Samba as a ADS domain member</A
395 ></DT
396 ><DD
397 ><DL
398 ><DT
399 >8.1. <A
400 HREF="#AEN1178"
401 >Installing the required packages for Debian</A
402 ></DT
403 ><DT
404 >8.2. <A
405 HREF="#AEN1184"
406 >Installing the required packages for RedHat</A
407 ></DT
408 ><DT
409 >8.3. <A
410 HREF="#AEN1193"
411 >Compile Samba</A
412 ></DT
413 ><DT
414 >8.4. <A
415 HREF="#AEN1205"
416 >Setup your /etc/krb5.conf</A
417 ></DT
418 ><DT
419 >8.5. <A
420 HREF="#AEN1215"
421 >Create the computer account</A
422 ></DT
423 ><DT
424 >8.6. <A
425 HREF="#AEN1231"
426 >Test your server setup</A
427 ></DT
428 ><DT
429 >8.7. <A
430 HREF="#AEN1236"
431 >Testing with smbclient</A
432 ></DT
433 ><DT
434 >8.8. <A
435 HREF="#AEN1239"
436 >Notes</A
437 ></DT
438 ></DL
439 ></DD
440 ><DT
441 >9. <A
442 HREF="#DOMAIN-SECURITY"
443 >Samba as a NT4 domain member</A
444 ></DT
445 ><DD
446 ><DL
447 ><DT
448 >9.1. <A
449 HREF="#AEN1261"
450 >Joining an NT Domain with Samba 2.2</A
451 ></DT
452 ><DT
453 >9.2. <A
454 HREF="#AEN1325"
455 >Samba and Windows 2000 Domains</A
456 ></DT
457 ><DT
458 >9.3. <A
459 HREF="#AEN1330"
460 >Why is this better than security = server?</A
461 ></DT
462 ></DL
463 ></DD
464 ></DL
465 ></DD
466 ><DT
467 >III. <A
468 HREF="#AEN1346"
469 >Optional configuration</A
470 ></DT
471 ><DD
472 ><DL
473 ><DT
474 >10. <A
475 HREF="#INTEGRATE-MS-NETWORKS"
476 >Integrating MS Windows networks with Samba</A
477 ></DT
478 ><DD
479 ><DL
480 ><DT
481 >10.1. <A
482 HREF="#AEN1362"
483 >Agenda</A
484 ></DT
485 ><DT
486 >10.2. <A
487 HREF="#AEN1384"
488 >Name Resolution in a pure Unix/Linux world</A
489 ></DT
490 ><DT
491 >10.3. <A
492 HREF="#AEN1447"
493 >Name resolution as used within MS Windows networking</A
494 ></DT
495 ><DT
496 >10.4. <A
497 HREF="#AEN1492"
498 >How browsing functions and how to deploy stable and 
499 dependable browsing using Samba</A
500 ></DT
501 ><DT
502 >10.5. <A
503 HREF="#AEN1502"
504 >MS Windows security options and how to configure 
505 Samba for seemless integration</A
506 ></DT
507 ><DT
508 >10.6. <A
509 HREF="#AEN1572"
510 >Conclusions</A
511 ></DT
512 ></DL
513 ></DD
514 ><DT
515 >11. <A
516 HREF="#UNIX-PERMISSIONS"
517 >UNIX Permission Bits and Windows NT Access Control Lists</A
518 ></DT
519 ><DD
520 ><DL
521 ><DT
522 >11.1. <A
523 HREF="#AEN1593"
524 >Viewing and changing UNIX permissions using the NT 
525         security dialogs</A
526 ></DT
527 ><DT
528 >11.2. <A
529 HREF="#AEN1602"
530 >How to view file security on a Samba share</A
531 ></DT
532 ><DT
533 >11.3. <A
534 HREF="#AEN1613"
535 >Viewing file ownership</A
536 ></DT
537 ><DT
538 >11.4. <A
539 HREF="#AEN1633"
540 >Viewing file or directory permissions</A
541 ></DT
542 ><DT
543 >11.5. <A
544 HREF="#AEN1669"
545 >Modifying file or directory permissions</A
546 ></DT
547 ><DT
548 >11.6. <A
549 HREF="#AEN1691"
550 >Interaction with the standard Samba create mask 
551         parameters</A
552 ></DT
553 ><DT
554 >11.7. <A
555 HREF="#AEN1755"
556 >Interaction with the standard Samba file attribute 
557         mapping</A
558 ></DT
559 ></DL
560 ></DD
561 ><DT
562 >12. <A
563 HREF="#PAM"
564 >Configuring PAM for distributed but centrally 
565 managed authentication</A
566 ></DT
567 ><DD
568 ><DL
569 ><DT
570 >12.1. <A
571 HREF="#AEN1776"
572 >Samba and PAM</A
573 ></DT
574 ><DT
575 >12.2. <A
576 HREF="#AEN1820"
577 >Distributed Authentication</A
578 ></DT
579 ><DT
580 >12.3. <A
581 HREF="#AEN1827"
582 >PAM Configuration in smb.conf</A
583 ></DT
584 ></DL
585 ></DD
586 ><DT
587 >13. <A
588 HREF="#MSDFS"
589 >Hosting a Microsoft Distributed File System tree on Samba</A
590 ></DT
591 ><DD
592 ><DL
593 ><DT
594 >13.1. <A
595 HREF="#AEN1847"
596 >Instructions</A
597 ></DT
598 ></DL
599 ></DD
600 ><DT
601 >14. <A
602 HREF="#PRINTING"
603 >Printing Support</A
604 ></DT
605 ><DD
606 ><DL
607 ><DT
608 >14.1. <A
609 HREF="#AEN1908"
610 >Introduction</A
611 ></DT
612 ><DT
613 >14.2. <A
614 HREF="#AEN1930"
615 >Configuration</A
616 ></DT
617 ><DT
618 >14.3. <A
619 HREF="#AEN2038"
620 >The Imprints Toolset</A
621 ></DT
622 ><DT
623 >14.4. <A
624 HREF="#AEN2081"
625 >Diagnosis</A
626 ></DT
627 ></DL
628 ></DD
629 ><DT
630 >15. <A
631 HREF="#SECURITYLEVELS"
632 >Security levels</A
633 ></DT
634 ><DD
635 ><DL
636 ><DT
637 >15.1. <A
638 HREF="#AEN2186"
639 >Introduction</A
640 ></DT
641 ><DT
642 >15.2. <A
643 HREF="#AEN2197"
644 >More complete description of security levels</A
645 ></DT
646 ></DL
647 ></DD
648 ><DT
649 >16. <A
650 HREF="#WINBIND"
651 >Unified Logons between Windows NT and UNIX using Winbind</A
652 ></DT
653 ><DD
654 ><DL
655 ><DT
656 >16.1. <A
657 HREF="#AEN2249"
658 >Abstract</A
659 ></DT
660 ><DT
661 >16.2. <A
662 HREF="#AEN2253"
663 >Introduction</A
664 ></DT
665 ><DT
666 >16.3. <A
667 HREF="#AEN2266"
668 >What Winbind Provides</A
669 ></DT
670 ><DT
671 >16.4. <A
672 HREF="#AEN2277"
673 >How Winbind Works</A
674 ></DT
675 ><DT
676 >16.5. <A
677 HREF="#AEN2317"
678 >Installation and Configuration</A
679 ></DT
680 ><DT
681 >16.6. <A
682 HREF="#AEN2566"
683 >Limitations</A
684 ></DT
685 ><DT
686 >16.7. <A
687 HREF="#AEN2576"
688 >Conclusion</A
689 ></DT
690 ></DL
691 ></DD
692 ><DT
693 >17. <A
694 HREF="#PDB-MYSQL"
695 >Passdb MySQL plugin</A
696 ></DT
697 ><DD
698 ><DL
699 ><DT
700 >17.1. <A
701 HREF="#AEN2590"
702 >Building</A
703 ></DT
704 ><DT
705 >17.2. <A
706 HREF="#AEN2596"
707 >Configuring</A
708 ></DT
709 ><DT
710 >17.3. <A
711 HREF="#AEN2611"
712 >Using plaintext passwords or encrypted password</A
713 ></DT
714 ><DT
715 >17.4. <A
716 HREF="#AEN2616"
717 >Getting non-column data from the table</A
718 ></DT
719 ></DL
720 ></DD
721 ><DT
722 >18. <A
723 HREF="#PDB-XML"
724 >Passdb XML plugin</A
725 ></DT
726 ><DD
727 ><DL
728 ><DT
729 >18.1. <A
730 HREF="#AEN2635"
731 >Building</A
732 ></DT
733 ><DT
734 >18.2. <A
735 HREF="#AEN2641"
736 >Usage</A
737 ></DT
738 ></DL
739 ></DD
740 ><DT
741 >19. <A
742 HREF="#SAMBA-LDAP-HOWTO"
743 >Storing Samba's User/Machine Account information in an LDAP Directory</A
744 ></DT
745 ><DD
746 ><DL
747 ><DT
748 >19.1. <A
749 HREF="#AEN2664"
750 >Purpose</A
751 ></DT
752 ><DT
753 >19.2. <A
754 HREF="#AEN2684"
755 >Introduction</A
756 ></DT
757 ><DT
758 >19.3. <A
759 HREF="#AEN2713"
760 >Supported LDAP Servers</A
761 ></DT
762 ><DT
763 >19.4. <A
764 HREF="#AEN2718"
765 >Schema and Relationship to the RFC 2307 posixAccount</A
766 ></DT
767 ><DT
768 >19.5. <A
769 HREF="#AEN2730"
770 >Configuring Samba with LDAP</A
771 ></DT
772 ><DT
773 >19.6. <A
774 HREF="#AEN2777"
775 >Accounts and Groups management</A
776 ></DT
777 ><DT
778 >19.7. <A
779 HREF="#AEN2782"
780 >Security and sambaAccount</A
781 ></DT
782 ><DT
783 >19.8. <A
784 HREF="#AEN2802"
785 >LDAP specials attributes for sambaAccounts</A
786 ></DT
787 ><DT
788 >19.9. <A
789 HREF="#AEN2872"
790 >Example LDIF Entries for a sambaAccount</A
791 ></DT
792 ><DT
793 >19.10. <A
794 HREF="#AEN2880"
795 >Comments</A
796 ></DT
797 ></DL
798 ></DD
799 ><DT
800 >20. <A
801 HREF="#CVS-ACCESS"
802 >HOWTO Access Samba source code via CVS</A
803 ></DT
804 ><DD
805 ><DL
806 ><DT
807 >20.1. <A
808 HREF="#AEN2891"
809 >Introduction</A
810 ></DT
811 ><DT
812 >20.2. <A
813 HREF="#AEN2896"
814 >CVS Access to samba.org</A
815 ></DT
816 ></DL
817 ></DD
818 ><DT
819 >21. <A
820 HREF="#GROUPMAPPING"
821 >Group mapping HOWTO</A
822 ></DT
823 ><DT
824 >22. <A
825 HREF="#SPEED"
826 >Samba performance issues</A
827 ></DT
828 ><DD
829 ><DL
830 ><DT
831 >22.1. <A
832 HREF="#AEN2982"
833 >Comparisons</A
834 ></DT
835 ><DT
836 >22.2. <A
837 HREF="#AEN2988"
838 >Oplocks</A
839 ></DT
840 ><DT
841 >22.3. <A
842 HREF="#AEN3008"
843 >Socket options</A
844 ></DT
845 ><DT
846 >22.4. <A
847 HREF="#AEN3015"
848 >Read size</A
849 ></DT
850 ><DT
851 >22.5. <A
852 HREF="#AEN3020"
853 >Max xmit</A
854 ></DT
855 ><DT
856 >22.6. <A
857 HREF="#AEN3025"
858 >Locking</A
859 ></DT
860 ><DT
861 >22.7. <A
862 HREF="#AEN3029"
863 >Share modes</A
864 ></DT
865 ><DT
866 >22.8. <A
867 HREF="#AEN3034"
868 >Log level</A
869 ></DT
870 ><DT
871 >22.9. <A
872 HREF="#AEN3037"
873 >Wide lines</A
874 ></DT
875 ><DT
876 >22.10. <A
877 HREF="#AEN3040"
878 >Read raw</A
879 ></DT
880 ><DT
881 >22.11. <A
882 HREF="#AEN3045"
883 >Write raw</A
884 ></DT
885 ><DT
886 >22.12. <A
887 HREF="#AEN3049"
888 >Read prediction</A
889 ></DT
890 ><DT
891 >22.13. <A
892 HREF="#AEN3056"
893 >Memory mapping</A
894 ></DT
895 ><DT
896 >22.14. <A
897 HREF="#AEN3061"
898 >Slow Clients</A
899 ></DT
900 ><DT
901 >22.15. <A
902 HREF="#AEN3065"
903 >Slow Logins</A
904 ></DT
905 ><DT
906 >22.16. <A
907 HREF="#AEN3068"
908 >Client tuning</A
909 ></DT
910 ><DT
911 >22.17. <A
912 HREF="#AEN3100"
913 >My Results</A
914 ></DT
915 ></DL
916 ></DD
917 ></DL
918 ></DD
919 ><DT
920 >IV. <A
921 HREF="#AEN3106"
922 >Appendixes</A
923 ></DT
924 ><DD
925 ><DL
926 ><DT
927 >23. <A
928 HREF="#PORTABILITY"
929 >Portability</A
930 ></DT
931 ><DD
932 ><DL
933 ><DT
934 >23.1. <A
935 HREF="#AEN3115"
936 >HPUX</A
937 ></DT
938 ><DT
939 >23.2. <A
940 HREF="#AEN3121"
941 >SCO Unix</A
942 ></DT
943 ><DT
944 >23.3. <A
945 HREF="#AEN3125"
946 >DNIX</A
947 ></DT
948 ><DT
949 >23.4. <A
950 HREF="#AEN3154"
951 >RedHat Linux Rembrandt-II</A
952 ></DT
953 ></DL
954 ></DD
955 ><DT
956 >24. <A
957 HREF="#OTHER-CLIENTS"
958 >Samba and other CIFS clients</A
959 ></DT
960 ><DD
961 ><DL
962 ><DT
963 >24.1. <A
964 HREF="#AEN3175"
965 >Macintosh clients?</A
966 ></DT
967 ><DT
968 >24.2. <A
969 HREF="#AEN3184"
970 >OS2 Client</A
971 ></DT
972 ><DT
973 >24.3. <A
974 HREF="#AEN3224"
975 >Windows for Workgroups</A
976 ></DT
977 ><DT
978 >24.4. <A
979 HREF="#AEN3245"
980 >Windows '95/'98</A
981 ></DT
982 ><DT
983 >24.5. <A
984 HREF="#AEN3261"
985 >Windows 2000 Service Pack 2</A
986 ></DT
987 ></DL
988 ></DD
989 ><DT
990 >25. <A
991 HREF="#BUGREPORT"
992 >Reporting Bugs</A
993 ></DT
994 ><DD
995 ><DL
996 ><DT
997 >25.1. <A
998 HREF="#AEN3285"
999 >Introduction</A
1000 ></DT
1001 ><DT
1002 >25.2. <A
1003 HREF="#AEN3295"
1004 >General info</A
1005 ></DT
1006 ><DT
1007 >25.3. <A
1008 HREF="#AEN3301"
1009 >Debug levels</A
1010 ></DT
1011 ><DT
1012 >25.4. <A
1013 HREF="#AEN3318"
1014 >Internal errors</A
1015 ></DT
1016 ><DT
1017 >25.5. <A
1018 HREF="#AEN3328"
1019 >Attaching to a running process</A
1020 ></DT
1021 ><DT
1022 >25.6. <A
1023 HREF="#AEN3331"
1024 >Patches</A
1025 ></DT
1026 ></DL
1027 ></DD
1028 ><DT
1029 >26. <A
1030 HREF="#DIAGNOSIS"
1031 >Diagnosing your samba server</A
1032 ></DT
1033 ><DD
1034 ><DL
1035 ><DT
1036 >26.1. <A
1037 HREF="#AEN3354"
1038 >Introduction</A
1039 ></DT
1040 ><DT
1041 >26.2. <A
1042 HREF="#AEN3359"
1043 >Assumptions</A
1044 ></DT
1045 ><DT
1046 >26.3. <A
1047 HREF="#AEN3369"
1048 >Tests</A
1049 ></DT
1050 ><DT
1051 >26.4. <A
1052 HREF="#AEN3479"
1053 >Still having troubles?</A
1054 ></DT
1055 ></DL
1056 ></DD
1057 ></DL
1058 ></DD
1059 ></DL
1060 ></DIV
1061 ><DIV
1062 CLASS="PART"
1063 ><A
1064 NAME="AEN18"
1065 ></A
1066 ><DIV
1067 CLASS="TITLEPAGE"
1068 ><H1
1069 CLASS="TITLE"
1070 >I. General installation</H1
1071 ><DIV
1072 CLASS="PARTINTRO"
1073 ><A
1074 NAME="AEN20"
1075 ></A
1076 ><H1
1077 >Introduction</H1
1078 ><P
1079 >This part contains general info on how to install samba 
1080 and how to configure the parts of samba you will most likely need.
1081 PLEASE read this.</P
1082 ></DIV
1083 ><DIV
1084 CLASS="TOC"
1085 ><DL
1086 ><DT
1087 ><B
1088 >Table of Contents</B
1089 ></DT
1090 ><DT
1091 >1. <A
1092 HREF="#INSTALL"
1093 >How to Install and Test SAMBA</A
1094 ></DT
1095 ><DD
1096 ><DL
1097 ><DT
1098 >1.1. <A
1099 HREF="#AEN25"
1100 >Read the man pages</A
1101 ></DT
1102 ><DT
1103 >1.2. <A
1104 HREF="#AEN35"
1105 >Building the Binaries</A
1106 ></DT
1107 ><DT
1108 >1.3. <A
1109 HREF="#AEN63"
1110 >The all important step</A
1111 ></DT
1112 ><DT
1113 >1.4. <A
1114 HREF="#AEN67"
1115 >Create the smb configuration file.</A
1116 ></DT
1117 ><DT
1118 >1.5. <A
1119 HREF="#AEN81"
1120 >Test your config file with 
1121         <B
1122 CLASS="COMMAND"
1123 >testparm</B
1124 ></A
1125 ></DT
1126 ><DT
1127 >1.6. <A
1128 HREF="#AEN89"
1129 >Starting the smbd and nmbd</A
1130 ></DT
1131 ><DD
1132 ><DL
1133 ><DT
1134 >1.6.1. <A
1135 HREF="#AEN99"
1136 >Starting from inetd.conf</A
1137 ></DT
1138 ><DT
1139 >1.6.2. <A
1140 HREF="#AEN128"
1141 >Alternative: starting it as a daemon</A
1142 ></DT
1143 ></DL
1144 ></DD
1145 ><DT
1146 >1.7. <A
1147 HREF="#AEN144"
1148 >Try listing the shares available on your 
1149         server</A
1150 ></DT
1151 ><DT
1152 >1.8. <A
1153 HREF="#AEN153"
1154 >Try connecting with the unix client</A
1155 ></DT
1156 ><DT
1157 >1.9. <A
1158 HREF="#AEN169"
1159 >Try connecting from a DOS, WfWg, Win9x, WinNT, 
1160         Win2k, OS/2, etc... client</A
1161 ></DT
1162 ><DT
1163 >1.10. <A
1164 HREF="#AEN183"
1165 >What If Things Don't Work?</A
1166 ></DT
1167 ><DD
1168 ><DL
1169 ><DT
1170 >1.10.1. <A
1171 HREF="#AEN188"
1172 >Diagnosing Problems</A
1173 ></DT
1174 ><DT
1175 >1.10.2. <A
1176 HREF="#AEN192"
1177 >Scope IDs</A
1178 ></DT
1179 ><DT
1180 >1.10.3. <A
1181 HREF="#AEN195"
1182 >Choosing the Protocol Level</A
1183 ></DT
1184 ><DT
1185 >1.10.4. <A
1186 HREF="#AEN204"
1187 >Printing from UNIX to a Client PC</A
1188 ></DT
1189 ><DT
1190 >1.10.5. <A
1191 HREF="#AEN209"
1192 >Locking</A
1193 ></DT
1194 ><DT
1195 >1.10.6. <A
1196 HREF="#AEN218"
1197 >Mapping Usernames</A
1198 ></DT
1199 ></DL
1200 ></DD
1201 ></DL
1202 ></DD
1203 ><DT
1204 >2. <A
1205 HREF="#IMPROVED-BROWSING"
1206 >Improved browsing in samba</A
1207 ></DT
1208 ><DD
1209 ><DL
1210 ><DT
1211 >2.1. <A
1212 HREF="#AEN228"
1213 >Overview of browsing</A
1214 ></DT
1215 ><DT
1216 >2.2. <A
1217 HREF="#AEN232"
1218 >Browsing support in samba</A
1219 ></DT
1220 ><DT
1221 >2.3. <A
1222 HREF="#AEN241"
1223 >Problem resolution</A
1224 ></DT
1225 ><DT
1226 >2.4. <A
1227 HREF="#AEN248"
1228 >Browsing across subnets</A
1229 ></DT
1230 ><DD
1231 ><DL
1232 ><DT
1233 >2.4.1. <A
1234 HREF="#AEN253"
1235 >How does cross subnet browsing work ?</A
1236 ></DT
1237 ></DL
1238 ></DD
1239 ><DT
1240 >2.5. <A
1241 HREF="#AEN288"
1242 >Setting up a WINS server</A
1243 ></DT
1244 ><DT
1245 >2.6. <A
1246 HREF="#AEN307"
1247 >Setting up Browsing in a WORKGROUP</A
1248 ></DT
1249 ><DT
1250 >2.7. <A
1251 HREF="#AEN325"
1252 >Setting up Browsing in a DOMAIN</A
1253 ></DT
1254 ><DT
1255 >2.8. <A
1256 HREF="#AEN335"
1257 >Forcing samba to be the master</A
1258 ></DT
1259 ><DT
1260 >2.9. <A
1261 HREF="#AEN344"
1262 >Making samba the domain master</A
1263 ></DT
1264 ><DT
1265 >2.10. <A
1266 HREF="#AEN362"
1267 >Note about broadcast addresses</A
1268 ></DT
1269 ><DT
1270 >2.11. <A
1271 HREF="#AEN365"
1272 >Multiple interfaces</A
1273 ></DT
1274 ></DL
1275 ></DD
1276 ><DT
1277 >3. <A
1278 HREF="#OPLOCKS"
1279 >Oplocks</A
1280 ></DT
1281 ><DD
1282 ><DL
1283 ><DT
1284 >3.1. <A
1285 HREF="#AEN377"
1286 >What are oplocks?</A
1287 ></DT
1288 ></DL
1289 ></DD
1290 ><DT
1291 >4. <A
1292 HREF="#BROWSING-QUICK"
1293 >Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</A
1294 ></DT
1295 ><DD
1296 ><DL
1297 ><DT
1298 >4.1. <A
1299 HREF="#AEN392"
1300 >Discussion</A
1301 ></DT
1302 ><DT
1303 >4.2. <A
1304 HREF="#AEN400"
1305 >Use of the "Remote Announce" parameter</A
1306 ></DT
1307 ><DT
1308 >4.3. <A
1309 HREF="#AEN414"
1310 >Use of the "Remote Browse Sync" parameter</A
1311 ></DT
1312 ><DT
1313 >4.4. <A
1314 HREF="#AEN419"
1315 >Use of WINS</A
1316 ></DT
1317 ><DT
1318 >4.5. <A
1319 HREF="#AEN430"
1320 >Do NOT use more than one (1) protocol on MS Windows machines</A
1321 ></DT
1322 ><DT
1323 >4.6. <A
1324 HREF="#AEN436"
1325 >Name Resolution Order</A
1326 ></DT
1327 ></DL
1328 ></DD
1329 ><DT
1330 >5. <A
1331 HREF="#PWENCRYPT"
1332 >LanMan and NT Password Encryption in Samba</A
1333 ></DT
1334 ><DD
1335 ><DL
1336 ><DT
1337 >5.1. <A
1338 HREF="#AEN472"
1339 >Introduction</A
1340 ></DT
1341 ><DT
1342 >5.2. <A
1343 HREF="#AEN477"
1344 >Important Notes About Security</A
1345 ></DT
1346 ><DD
1347 ><DL
1348 ><DT
1349 >5.2.1. <A
1350 HREF="#AEN496"
1351 >Advantages of SMB Encryption</A
1352 ></DT
1353 ><DT
1354 >5.2.2. <A
1355 HREF="#AEN503"
1356 >Advantages of non-encrypted passwords</A
1357 ></DT
1358 ></DL
1359 ></DD
1360 ><DT
1361 >5.3. <A
1362 HREF="#AEN512"
1363 >The smbpasswd Command</A
1364 ></DT
1365 ></DL
1366 ></DD
1367 ></DL
1368 ></DIV
1369 ></DIV
1370 ><DIV
1371 CLASS="CHAPTER"
1372 ><HR><H1
1373 ><A
1374 NAME="INSTALL"
1375 ></A
1376 >Chapter 1. How to Install and Test SAMBA</H1
1377 ><DIV
1378 CLASS="SECT1"
1379 ><H2
1380 CLASS="SECT1"
1381 ><A
1382 NAME="AEN25"
1383 ></A
1384 >1.1. Read the man pages</H2
1385 ><P
1386 >The man pages distributed with SAMBA contain 
1387         lots of useful info that will help to get you started. 
1388         If you don't know how to read man pages then try 
1389         something like:</P
1390 ><P
1391 ><TT
1392 CLASS="PROMPT"
1393 >$ </TT
1394 ><TT
1395 CLASS="USERINPUT"
1396 ><B
1397 >man smbd.8</B
1398 ></TT
1399 >
1400         or 
1401         <TT
1402 CLASS="PROMPT"
1403 >$ </TT
1404 ><TT
1405 CLASS="USERINPUT"
1406 ><B
1407 >nroff -man smbd.8 | more
1408         </B
1409 ></TT
1410 > on older unixes.</P
1411 ><P
1412 >Other sources of information are pointed to 
1413         by the Samba web site,<A
1414 HREF="http://www.samba.org/"
1415 TARGET="_top"
1416 >       http://www.samba.org</A
1417 ></P
1418 ></DIV
1419 ><DIV
1420 CLASS="SECT1"
1421 ><HR><H2
1422 CLASS="SECT1"
1423 ><A
1424 NAME="AEN35"
1425 ></A
1426 >1.2. Building the Binaries</H2
1427 ><P
1428 >To do this, first run the program <B
1429 CLASS="COMMAND"
1430 >./configure
1431         </B
1432 > in the source directory. This should automatically 
1433         configure Samba for your operating system. If you have unusual 
1434         needs then you may wish to run</P
1435 ><P
1436 ><TT
1437 CLASS="PROMPT"
1438 >root# </TT
1439 ><TT
1440 CLASS="USERINPUT"
1441 ><B
1442 >./configure --help
1443         </B
1444 ></TT
1445 ></P
1446 ><P
1447 >first to see what special options you can enable.
1448         Then executing</P
1449 ><P
1450 ><TT
1451 CLASS="PROMPT"
1452 >root# </TT
1453 ><TT
1454 CLASS="USERINPUT"
1455 ><B
1456 >make</B
1457 ></TT
1458 ></P
1459 ><P
1460 >will create the binaries. Once it's successfully 
1461         compiled you can use </P
1462 ><P
1463 ><TT
1464 CLASS="PROMPT"
1465 >root# </TT
1466 ><TT
1467 CLASS="USERINPUT"
1468 ><B
1469 >make install</B
1470 ></TT
1471 ></P
1472 ><P
1473 >to install the binaries and manual pages. You can 
1474         separately install the binaries and/or man pages using</P
1475 ><P
1476 ><TT
1477 CLASS="PROMPT"
1478 >root# </TT
1479 ><TT
1480 CLASS="USERINPUT"
1481 ><B
1482 >make installbin
1483         </B
1484 ></TT
1485 ></P
1486 ><P
1487 >and</P
1488 ><P
1489 ><TT
1490 CLASS="PROMPT"
1491 >root# </TT
1492 ><TT
1493 CLASS="USERINPUT"
1494 ><B
1495 >make installman
1496         </B
1497 ></TT
1498 ></P
1499 ><P
1500 >Note that if you are upgrading for a previous version 
1501         of Samba you might like to know that the old versions of 
1502         the binaries will be renamed with a ".old" extension. You 
1503         can go back to the previous version with</P
1504 ><P
1505 ><TT
1506 CLASS="PROMPT"
1507 >root# </TT
1508 ><TT
1509 CLASS="USERINPUT"
1510 ><B
1511 >make revert
1512         </B
1513 ></TT
1514 ></P
1515 ><P
1516 >if you find this version a disaster!</P
1517 ></DIV
1518 ><DIV
1519 CLASS="SECT1"
1520 ><HR><H2
1521 CLASS="SECT1"
1522 ><A
1523 NAME="AEN63"
1524 ></A
1525 >1.3. The all important step</H2
1526 ><P
1527 >At this stage you must fetch yourself a 
1528         coffee or other drink you find stimulating. Getting the rest 
1529         of the install right can sometimes be tricky, so you will 
1530         probably need it.</P
1531 ><P
1532 >If you have installed samba before then you can skip 
1533         this step.</P
1534 ></DIV
1535 ><DIV
1536 CLASS="SECT1"
1537 ><HR><H2
1538 CLASS="SECT1"
1539 ><A
1540 NAME="AEN67"
1541 ></A
1542 >1.4. Create the smb configuration file.</H2
1543 ><P
1544 >There are sample configuration files in the examples 
1545         subdirectory in the distribution. I suggest you read them 
1546         carefully so you can see how the options go together in 
1547         practice. See the man page for all the options.</P
1548 ><P
1549 >The simplest useful configuration file would be 
1550         something like this:</P
1551 ><P
1552 ><PRE
1553 CLASS="PROGRAMLISTING"
1554 >       [global]
1555            workgroup = MYGROUP
1556
1557            [homes]
1558               guest ok = no
1559               read only = no
1560         </PRE
1561 ></P
1562 ><P
1563 >which would allow connections by anyone with an 
1564         account on the server, using either their login name or 
1565         "homes" as the service name. (Note that I also set the 
1566         workgroup that Samba is part of. See BROWSING.txt for details)</P
1567 ><P
1568 >Note that <B
1569 CLASS="COMMAND"
1570 >make install</B
1571 > will not install 
1572         a <TT
1573 CLASS="FILENAME"
1574 >smb.conf</TT
1575 > file. You need to create it 
1576         yourself. </P
1577 ><P
1578 >Make sure you put the smb.conf file in the same place 
1579         you specified in the<TT
1580 CLASS="FILENAME"
1581 >Makefile</TT
1582 > (the default is to 
1583         look for it in <TT
1584 CLASS="FILENAME"
1585 >/usr/local/samba/lib/</TT
1586 >).</P
1587 ><P
1588 >For more information about security settings for the 
1589         [homes] share please refer to the document UNIX_SECURITY.txt.</P
1590 ></DIV
1591 ><DIV
1592 CLASS="SECT1"
1593 ><HR><H2
1594 CLASS="SECT1"
1595 ><A
1596 NAME="AEN81"
1597 ></A
1598 >1.5. Test your config file with 
1599         <B
1600 CLASS="COMMAND"
1601 >testparm</B
1602 ></H2
1603 ><P
1604 >It's important that you test the validity of your
1605         <TT
1606 CLASS="FILENAME"
1607 >smb.conf</TT
1608 > file using the testparm program. 
1609         If testparm runs OK then it will list the loaded services. If 
1610         not it will give an error message.</P
1611 ><P
1612 >Make sure it runs OK and that the services look 
1613         reasonable before proceeding. </P
1614 ><P
1615 >Always run testparm again when you change 
1616         <TT
1617 CLASS="FILENAME"
1618 >smb.conf</TT
1619 >!</P
1620 ></DIV
1621 ><DIV
1622 CLASS="SECT1"
1623 ><HR><H2
1624 CLASS="SECT1"
1625 ><A
1626 NAME="AEN89"
1627 ></A
1628 >1.6. Starting the smbd and nmbd</H2
1629 ><P
1630 >You must choose to start smbd and nmbd either
1631         as daemons or from <B
1632 CLASS="COMMAND"
1633 >inetd</B
1634 >. Don't try
1635         to do both!  Either you can put them in <TT
1636 CLASS="FILENAME"
1637 >       inetd.conf</TT
1638 > and have them started on demand
1639         by <B
1640 CLASS="COMMAND"
1641 >inetd</B
1642 >, or you can start them as
1643         daemons either from the command line or in <TT
1644 CLASS="FILENAME"
1645 >       /etc/rc.local</TT
1646 >. See the man pages for details
1647         on the command line options. Take particular care to read
1648         the bit about what user you need to be in order to start
1649         Samba.  In many cases you must be root.</P
1650 ><P
1651 >The main advantage of starting <B
1652 CLASS="COMMAND"
1653 >smbd</B
1654 >
1655         and <B
1656 CLASS="COMMAND"
1657 >nmbd</B
1658 > using the recommended daemon method
1659         is that they will respond slightly more quickly to an initial connection
1660         request.</P
1661 ><DIV
1662 CLASS="SECT2"
1663 ><HR><H3
1664 CLASS="SECT2"
1665 ><A
1666 NAME="AEN99"
1667 ></A
1668 >1.6.1. Starting from inetd.conf</H3
1669 ><P
1670 >NOTE; The following will be different if 
1671                 you use NIS or NIS+ to distributed services maps.</P
1672 ><P
1673 >Look at your <TT
1674 CLASS="FILENAME"
1675 >/etc/services</TT
1676 >. 
1677                 What is defined at port 139/tcp. If nothing is defined 
1678                 then add a line like this:</P
1679 ><P
1680 ><TT
1681 CLASS="USERINPUT"
1682 ><B
1683 >netbios-ssn     139/tcp</B
1684 ></TT
1685 ></P
1686 ><P
1687 >similarly for 137/udp you should have an entry like:</P
1688 ><P
1689 ><TT
1690 CLASS="USERINPUT"
1691 ><B
1692 >netbios-ns     137/udp</B
1693 ></TT
1694 ></P
1695 ><P
1696 >Next edit your <TT
1697 CLASS="FILENAME"
1698 >/etc/inetd.conf</TT
1699
1700                 and add two lines something like this:</P
1701 ><P
1702 ><PRE
1703 CLASS="PROGRAMLISTING"
1704 >               netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd 
1705                 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd 
1706                 </PRE
1707 ></P
1708 ><P
1709 >The exact syntax of <TT
1710 CLASS="FILENAME"
1711 >/etc/inetd.conf</TT
1712
1713                 varies between unixes. Look at the other entries in inetd.conf 
1714                 for a guide.</P
1715 ><P
1716 >NOTE: Some unixes already have entries like netbios_ns 
1717                 (note the underscore) in <TT
1718 CLASS="FILENAME"
1719 >/etc/services</TT
1720 >. 
1721                 You must either edit <TT
1722 CLASS="FILENAME"
1723 >/etc/services</TT
1724 > or
1725                 <TT
1726 CLASS="FILENAME"
1727 >/etc/inetd.conf</TT
1728 > to make them consistent.</P
1729 ><P
1730 >NOTE: On many systems you may need to use the 
1731                 "interfaces" option in smb.conf to specify the IP address 
1732                 and netmask of your interfaces. Run <B
1733 CLASS="COMMAND"
1734 >ifconfig</B
1735
1736                 as root if you don't know what the broadcast is for your
1737                 net. <B
1738 CLASS="COMMAND"
1739 >nmbd</B
1740 > tries to determine it at run 
1741                 time, but fails on some unixes. See the section on "testing nmbd" 
1742                 for a method of finding if you need to do this.</P
1743 ><P
1744 >!!!WARNING!!! Many unixes only accept around 5 
1745                 parameters on the command line in <TT
1746 CLASS="FILENAME"
1747 >inetd.conf</TT
1748 >. 
1749                 This means you shouldn't use spaces between the options and 
1750                 arguments, or you should use a script, and start the script 
1751                 from <B
1752 CLASS="COMMAND"
1753 >inetd</B
1754 >.</P
1755 ><P
1756 >Restart <B
1757 CLASS="COMMAND"
1758 >inetd</B
1759 >, perhaps just send 
1760                 it a HUP. If you have installed an earlier version of <B
1761 CLASS="COMMAND"
1762 >               nmbd</B
1763 > then you may need to kill nmbd as well.</P
1764 ></DIV
1765 ><DIV
1766 CLASS="SECT2"
1767 ><HR><H3
1768 CLASS="SECT2"
1769 ><A
1770 NAME="AEN128"
1771 ></A
1772 >1.6.2. Alternative: starting it as a daemon</H3
1773 ><P
1774 >To start the server as a daemon you should create 
1775                 a script something like this one, perhaps calling 
1776                 it <TT
1777 CLASS="FILENAME"
1778 >startsmb</TT
1779 >.</P
1780 ><P
1781 ><PRE
1782 CLASS="PROGRAMLISTING"
1783 >               #!/bin/sh
1784                 /usr/local/samba/bin/smbd -D 
1785                 /usr/local/samba/bin/nmbd -D 
1786                 </PRE
1787 ></P
1788 ><P
1789 >then make it executable with <B
1790 CLASS="COMMAND"
1791 >chmod 
1792                 +x startsmb</B
1793 ></P
1794 ><P
1795 >You can then run <B
1796 CLASS="COMMAND"
1797 >startsmb</B
1798 > by 
1799                 hand or execute it from <TT
1800 CLASS="FILENAME"
1801 >/etc/rc.local</TT
1802 >
1803                 </P
1804 ><P
1805 >To kill it send a kill signal to the processes 
1806                 <B
1807 CLASS="COMMAND"
1808 >nmbd</B
1809 > and <B
1810 CLASS="COMMAND"
1811 >smbd</B
1812 >.</P
1813 ><P
1814 >NOTE: If you use the SVR4 style init system then 
1815                 you may like to look at the <TT
1816 CLASS="FILENAME"
1817 >examples/svr4-startup</TT
1818 >
1819                 script to make Samba fit into that system.</P
1820 ></DIV
1821 ></DIV
1822 ><DIV
1823 CLASS="SECT1"
1824 ><HR><H2
1825 CLASS="SECT1"
1826 ><A
1827 NAME="AEN144"
1828 ></A
1829 >1.7. Try listing the shares available on your 
1830         server</H2
1831 ><P
1832 ><TT
1833 CLASS="PROMPT"
1834 >$ </TT
1835 ><TT
1836 CLASS="USERINPUT"
1837 ><B
1838 >smbclient -L 
1839         <TT
1840 CLASS="REPLACEABLE"
1841 ><I
1842 >yourhostname</I
1843 ></TT
1844 ></B
1845 ></TT
1846 ></P
1847 ><P
1848 >You should get back a list of shares available on 
1849         your server. If you don't then something is incorrectly setup. 
1850         Note that this method can also be used to see what shares 
1851         are available on other LanManager clients (such as WfWg).</P
1852 ><P
1853 >If you choose user level security then you may find 
1854         that Samba requests a password before it will list the shares. 
1855         See the <B
1856 CLASS="COMMAND"
1857 >smbclient</B
1858 > man page for details. (you 
1859         can force it to list the shares without a password by
1860         adding the option -U% to the command line. This will not work 
1861         with non-Samba servers)</P
1862 ></DIV
1863 ><DIV
1864 CLASS="SECT1"
1865 ><HR><H2
1866 CLASS="SECT1"
1867 ><A
1868 NAME="AEN153"
1869 ></A
1870 >1.8. Try connecting with the unix client</H2
1871 ><P
1872 ><TT
1873 CLASS="PROMPT"
1874 >$ </TT
1875 ><TT
1876 CLASS="USERINPUT"
1877 ><B
1878 >smbclient <TT
1879 CLASS="REPLACEABLE"
1880 ><I
1881 >       //yourhostname/aservice</I
1882 ></TT
1883 ></B
1884 ></TT
1885 ></P
1886 ><P
1887 >Typically the <TT
1888 CLASS="REPLACEABLE"
1889 ><I
1890 >yourhostname</I
1891 ></TT
1892
1893         would be the name of the host where you installed <B
1894 CLASS="COMMAND"
1895 >       smbd</B
1896 >. The <TT
1897 CLASS="REPLACEABLE"
1898 ><I
1899 >aservice</I
1900 ></TT
1901 > is 
1902         any service you have defined in the <TT
1903 CLASS="FILENAME"
1904 >smb.conf</TT
1905
1906         file. Try your user name if you just have a [homes] section
1907         in <TT
1908 CLASS="FILENAME"
1909 >smb.conf</TT
1910 >.</P
1911 ><P
1912 >For example if your unix host is bambi and your login 
1913         name is fred you would type:</P
1914 ><P
1915 ><TT
1916 CLASS="PROMPT"
1917 >$ </TT
1918 ><TT
1919 CLASS="USERINPUT"
1920 ><B
1921 >smbclient //bambi/fred
1922         </B
1923 ></TT
1924 ></P
1925 ></DIV
1926 ><DIV
1927 CLASS="SECT1"
1928 ><HR><H2
1929 CLASS="SECT1"
1930 ><A
1931 NAME="AEN169"
1932 ></A
1933 >1.9. Try connecting from a DOS, WfWg, Win9x, WinNT, 
1934         Win2k, OS/2, etc... client</H2
1935 ><P
1936 >Try mounting disks. eg:</P
1937 ><P
1938 ><TT
1939 CLASS="PROMPT"
1940 >C:\WINDOWS\&#62; </TT
1941 ><TT
1942 CLASS="USERINPUT"
1943 ><B
1944 >net use d: \\servername\service
1945         </B
1946 ></TT
1947 ></P
1948 ><P
1949 >Try printing. eg:</P
1950 ><P
1951 ><TT
1952 CLASS="PROMPT"
1953 >C:\WINDOWS\&#62; </TT
1954 ><TT
1955 CLASS="USERINPUT"
1956 ><B
1957 >net use lpt1:
1958         \\servername\spoolservice</B
1959 ></TT
1960 ></P
1961 ><P
1962 ><TT
1963 CLASS="PROMPT"
1964 >C:\WINDOWS\&#62; </TT
1965 ><TT
1966 CLASS="USERINPUT"
1967 ><B
1968 >print filename
1969         </B
1970 ></TT
1971 ></P
1972 ><P
1973 >Celebrate, or send me a bug report!</P
1974 ></DIV
1975 ><DIV
1976 CLASS="SECT1"
1977 ><HR><H2
1978 CLASS="SECT1"
1979 ><A
1980 NAME="AEN183"
1981 ></A
1982 >1.10. What If Things Don't Work?</H2
1983 ><P
1984 >If nothing works and you start to think "who wrote 
1985         this pile of trash" then I suggest you do step 2 again (and 
1986         again) till you calm down.</P
1987 ><P
1988 >Then you might read the file DIAGNOSIS.txt and the 
1989         FAQ. If you are still stuck then try the mailing list or 
1990         newsgroup (look in the README for details). Samba has been 
1991         successfully installed at thousands of sites worldwide, so maybe 
1992         someone else has hit your problem and has overcome it. You could 
1993         also use the WWW site to scan back issues of the samba-digest.</P
1994 ><P
1995 >When you fix the problem PLEASE send me some updates to the
1996         documentation (or source code) so that the next person will find it
1997         easier. </P
1998 ><DIV
1999 CLASS="SECT2"
2000 ><HR><H3
2001 CLASS="SECT2"
2002 ><A
2003 NAME="AEN188"
2004 ></A
2005 >1.10.1. Diagnosing Problems</H3
2006 ><P
2007 >If you have installation problems then go to the
2008                 <A
2009 HREF="Diagnosis.html"
2010 TARGET="_top"
2011 >Diagnosis</A
2012 > chapter to try to find the 
2013                 problem.</P
2014 ></DIV
2015 ><DIV
2016 CLASS="SECT2"
2017 ><HR><H3
2018 CLASS="SECT2"
2019 ><A
2020 NAME="AEN192"
2021 ></A
2022 >1.10.2. Scope IDs</H3
2023 ><P
2024 >By default Samba uses a blank scope ID. This means 
2025                 all your windows boxes must also have a blank scope ID. 
2026                 If you really want to use a non-blank scope ID then you will 
2027                 need to use the 'netbios scope' smb.conf option.
2028                 All your PCs will need to have the same setting for 
2029                 this to work. I do not recommend scope IDs.</P
2030 ></DIV
2031 ><DIV
2032 CLASS="SECT2"
2033 ><HR><H3
2034 CLASS="SECT2"
2035 ><A
2036 NAME="AEN195"
2037 ></A
2038 >1.10.3. Choosing the Protocol Level</H3
2039 ><P
2040 >The SMB protocol has many dialects. Currently 
2041                 Samba supports 5, called CORE, COREPLUS, LANMAN1, 
2042                 LANMAN2 and NT1.</P
2043 ><P
2044 >You can choose what maximum protocol to support 
2045                 in the <TT
2046 CLASS="FILENAME"
2047 >smb.conf</TT
2048 > file. The default is 
2049                 NT1 and that is the best for the vast majority of sites.</P
2050 ><P
2051 >In older versions of Samba you may have found it 
2052                 necessary to use COREPLUS. The limitations that led to 
2053                 this have mostly been fixed. It is now less likely that you 
2054                 will want to use less than LANMAN1. The only remaining advantage 
2055                 of COREPLUS is that for some obscure reason WfWg preserves 
2056                 the case of passwords in this protocol, whereas under LANMAN1, 
2057                 LANMAN2 or NT1 it uppercases all passwords before sending them,
2058                 forcing you to use the "password level=" option in some cases.</P
2059 ><P
2060 >The main advantage of LANMAN2 and NT1 is support for 
2061                 long filenames with some clients (eg: smbclient, Windows NT 
2062                 or Win95). </P
2063 ><P
2064 >See the smb.conf(5) manual page for more details.</P
2065 ><P
2066 >Note: To support print queue reporting you may find 
2067                 that you have to use TCP/IP as the default protocol under 
2068                 WfWg. For some reason if you leave Netbeui as the default 
2069                 it may break the print queue reporting on some systems. 
2070                 It is presumably a WfWg bug.</P
2071 ></DIV
2072 ><DIV
2073 CLASS="SECT2"
2074 ><HR><H3
2075 CLASS="SECT2"
2076 ><A
2077 NAME="AEN204"
2078 ></A
2079 >1.10.4. Printing from UNIX to a Client PC</H3
2080 ><P
2081 >To use a printer that is available via a smb-based 
2082                 server from a unix host with LPR you will need to compile the 
2083                 smbclient program. You then need to install the script 
2084                 "smbprint". Read the instruction in smbprint for more details.
2085                 </P
2086 ><P
2087 >There is also a SYSV style script that does much 
2088                 the same thing called smbprint.sysv. It contains instructions.</P
2089 ><P
2090 >See the CUPS manual for information about setting up 
2091                 printing from a unix host with CUPS to a smb-based server. </P
2092 ></DIV
2093 ><DIV
2094 CLASS="SECT2"
2095 ><HR><H3
2096 CLASS="SECT2"
2097 ><A
2098 NAME="AEN209"
2099 ></A
2100 >1.10.5. Locking</H3
2101 ><P
2102 >One area which sometimes causes trouble is locking.</P
2103 ><P
2104 >There are two types of locking which need to be 
2105                 performed by a SMB server. The first is "record locking" 
2106                 which allows a client to lock a range of bytes in a open file. 
2107                 The second is the "deny modes" that are specified when a file 
2108                 is open.</P
2109 ><P
2110 >Record locking semantics under Unix is very
2111                 different from record locking under Windows. Versions
2112                 of Samba before 2.2 have tried to use the native
2113                 fcntl() unix system call to implement proper record
2114                 locking between different Samba clients. This can not
2115                 be fully correct due to several reasons. The simplest
2116                 is the fact that a Windows client is allowed to lock a
2117                 byte range up to 2^32 or 2^64, depending on the client
2118                 OS. The unix locking only supports byte ranges up to
2119                 2^31. So it is not possible to correctly satisfy a
2120                 lock request above 2^31. There are many more
2121                 differences, too many to be listed here.</P
2122 ><P
2123 >Samba 2.2 and above implements record locking
2124                 completely independent of the underlying unix
2125                 system. If a byte range lock that the client requests
2126                 happens to fall into the range 0-2^31, Samba hands
2127                 this request down to the Unix system. All other locks
2128                 can not be seen by unix anyway.</P
2129 ><P
2130 >Strictly a SMB server should check for locks before 
2131                 every read and write call on a file. Unfortunately with the 
2132                 way fcntl() works this can be slow and may overstress the 
2133                 rpc.lockd. It is also almost always unnecessary as clients 
2134                 are supposed to independently make locking calls before reads 
2135                 and writes anyway if locking is important to them. By default 
2136                 Samba only makes locking calls when explicitly asked
2137                 to by a client, but if you set "strict locking = yes" then it will
2138                 make lock checking calls on every read and write. </P
2139 ><P
2140 >You can also disable by range locking completely 
2141                 using "locking = no". This is useful for those shares that 
2142                 don't support locking or don't need it (such as cdroms). In 
2143                 this case Samba fakes the return codes of locking calls to 
2144                 tell clients that everything is OK.</P
2145 ><P
2146 >The second class of locking is the "deny modes". These 
2147                 are set by an application when it opens a file to determine 
2148                 what types of access should be allowed simultaneously with 
2149                 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE 
2150                 or DENY_ALL. There are also special compatibility modes called 
2151                 DENY_FCB and  DENY_DOS.</P
2152 ></DIV
2153 ><DIV
2154 CLASS="SECT2"
2155 ><HR><H3
2156 CLASS="SECT2"
2157 ><A
2158 NAME="AEN218"
2159 ></A
2160 >1.10.6. Mapping Usernames</H3
2161 ><P
2162 >If you have different usernames on the PCs and 
2163                 the unix server then take a look at the "username map" option. 
2164                 See the smb.conf man page for details.</P
2165 ></DIV
2166 ></DIV
2167 ></DIV
2168 ><DIV
2169 CLASS="CHAPTER"
2170 ><HR><H1
2171 ><A
2172 NAME="IMPROVED-BROWSING"
2173 ></A
2174 >Chapter 2. Improved browsing in samba</H1
2175 ><DIV
2176 CLASS="SECT1"
2177 ><H2
2178 CLASS="SECT1"
2179 ><A
2180 NAME="AEN228"
2181 ></A
2182 >2.1. Overview of browsing</H2
2183 ><P
2184 >SMB networking provides a mechanism by which clients can access a list
2185 of machines in a network, a so-called "browse list".  This list
2186 contains machines that are ready to offer file and/or print services
2187 to other machines within the network. Thus it does not include
2188 machines which aren't currently able to do server tasks.  The browse
2189 list is heavily used by all SMB clients.  Configuration of SMB
2190 browsing has been problematic for some Samba users, hence this
2191 document.</P
2192 ><P
2193 >Browsing will NOT work if name resolution from NetBIOS names to IP
2194 addresses does not function correctly. Use of a WINS server is highly
2195 recommended to aid the resolution of NetBIOS (SMB) names to IP addresses.
2196 WINS allows remote segment clients to obtain NetBIOS name_type information
2197 that can NOT be provided by any other means of name resolution.</P
2198 ></DIV
2199 ><DIV
2200 CLASS="SECT1"
2201 ><HR><H2
2202 CLASS="SECT1"
2203 ><A
2204 NAME="AEN232"
2205 ></A
2206 >2.2. Browsing support in samba</H2
2207 ><P
2208 >Samba now fully supports browsing.  The browsing is supported by nmbd
2209 and is also controlled by options in the smb.conf file (see smb.conf(5)).</P
2210 ><P
2211 >Samba can act as a local browse master for a workgroup and the ability
2212 for samba to support domain logons and scripts is now available.  See
2213 DOMAIN.txt for more information on domain logons.</P
2214 ><P
2215 >Samba can also act as a domain master browser for a workgroup.  This
2216 means that it will collate lists from local browse masters into a
2217 wide area network server list.  In order for browse clients to
2218 resolve the names they may find in this list, it is recommended that
2219 both samba and your clients use a WINS server.</P
2220 ><P
2221 >Note that you should NOT set Samba to be the domain master for a
2222 workgroup that has the same name as an NT Domain: on each wide area
2223 network, you must only ever have one domain master browser per workgroup,
2224 regardless of whether it is NT, Samba or any other type of domain master
2225 that is providing this service.</P
2226 ><P
2227 >[Note that nmbd can be configured as a WINS server, but it is not
2228 necessary to specifically use samba as your WINS server.  NTAS can
2229 be configured as your WINS server.  In a mixed NT server and
2230 samba environment on a Wide Area Network, it is recommended that
2231 you use the NT server's WINS server capabilities.  In a samba-only
2232 environment, it is recommended that you use one and only one nmbd
2233 as your WINS server].</P
2234 ><P
2235 >To get browsing to work you need to run nmbd as usual, but will need
2236 to use the "workgroup" option in smb.conf to control what workgroup
2237 Samba becomes a part of.</P
2238 ><P
2239 >Samba also has a useful option for a Samba server to offer itself for
2240 browsing on another subnet.  It is recommended that this option is only
2241 used for 'unusual' purposes: announcements over the internet, for
2242 example.  See "remote announce" in the smb.conf man page.  </P
2243 ></DIV
2244 ><DIV
2245 CLASS="SECT1"
2246 ><HR><H2
2247 CLASS="SECT1"
2248 ><A
2249 NAME="AEN241"
2250 ></A
2251 >2.3. Problem resolution</H2
2252 ><P
2253 >If something doesn't work then hopefully the log.nmb file will help
2254 you track down the problem.  Try a debug level of 2 or 3 for finding
2255 problems. Also note that the current browse list usually gets stored
2256 in text form in a file called browse.dat.</P
2257 ><P
2258 >Note that if it doesn't work for you, then you should still be able to
2259 type the server name as \\SERVER in filemanager then hit enter and
2260 filemanager should display the list of available shares.</P
2261 ><P
2262 >Some people find browsing fails because they don't have the global
2263 "guest account" set to a valid account.  Remember that the IPC$
2264 connection that lists the shares is done as guest, and thus you must
2265 have a valid guest account.</P
2266 ><P
2267 >Also, a lot of people are getting bitten by the problem of too many
2268 parameters on the command line of nmbd in inetd.conf.  This trick is to
2269 not use spaces between the option and the parameter (eg: -d2 instead
2270 of -d 2), and to not use the -B and -N options.  New versions of nmbd
2271 are now far more likely to correctly find your broadcast and network
2272 address, so in most cases these aren't needed.</P
2273 ><P
2274 >The other big problem people have is that their broadcast address,
2275 netmask or IP address is wrong (specified with the "interfaces" option
2276 in smb.conf)</P
2277 ></DIV
2278 ><DIV
2279 CLASS="SECT1"
2280 ><HR><H2
2281 CLASS="SECT1"
2282 ><A
2283 NAME="AEN248"
2284 ></A
2285 >2.4. Browsing across subnets</H2
2286 ><P
2287 >With the release of Samba 1.9.17(alpha1 and above) Samba has been
2288 updated to enable it to support the replication of browse lists
2289 across subnet boundaries.  New code and options have been added to
2290 achieve this.  This section describes how to set this feature up
2291 in different settings.</P
2292 ><P
2293 >To see browse lists that span TCP/IP subnets (ie.  networks separated
2294 by routers that don't pass broadcast traffic) you must set up at least
2295 one WINS server.  The WINS server acts as a DNS for NetBIOS names, allowing
2296 NetBIOS name to IP address translation to be done by doing a direct
2297 query of the WINS server.  This is done via a directed UDP packet on
2298 port 137 to the WINS server machine.  The reason for a WINS server is
2299 that by default, all NetBIOS name to IP address translation is done
2300 by broadcasts from the querying machine.  This means that machines
2301 on one subnet will not be able to resolve the names of machines on
2302 another subnet without using a WINS server.</P
2303 ><P
2304 >Remember, for browsing across subnets to work correctly, all machines,
2305 be they Windows 95, Windows NT, or Samba servers must have the IP address
2306 of a WINS server given to them by a DHCP server, or by manual configuration 
2307 (for Win95 and WinNT, this is in the TCP/IP Properties, under Network 
2308 settings) for Samba this is in the smb.conf file.</P
2309 ><DIV
2310 CLASS="SECT2"
2311 ><HR><H3
2312 CLASS="SECT2"
2313 ><A
2314 NAME="AEN253"
2315 ></A
2316 >2.4.1. How does cross subnet browsing work ?</H3
2317 ><P
2318 >Cross subnet browsing is a complicated dance, containing multiple
2319 moving parts.  It has taken Microsoft several years to get the code
2320 that achieves this correct, and Samba lags behind in some areas.
2321 However, with the 1.9.17 release, Samba is capable of cross subnet
2322 browsing when configured correctly.</P
2323 ><P
2324 >Consider a network set up as follows :</P
2325 ><P
2326 ><PRE
2327 CLASS="PROGRAMLISTING"
2328 >                                   (DMB)
2329              N1_A      N1_B        N1_C       N1_D        N1_E
2330               |          |           |          |           |
2331           -------------------------------------------------------
2332             |          subnet 1                       |
2333           +---+                                      +---+
2334           |R1 | Router 1                  Router 2   |R2 |
2335           +---+                                      +---+
2336             |                                          |
2337             |  subnet 2              subnet 3          |
2338   --------------------------       ------------------------------------
2339   |     |     |      |               |        |         |           |
2340  N2_A  N2_B  N2_C   N2_D           N3_A     N3_B      N3_C        N3_D 
2341                     (WINS)</PRE
2342 ></P
2343 ><P
2344 >Consisting of 3 subnets (1, 2, 3) connected by two routers
2345 (R1, R2) - these do not pass broadcasts.  Subnet 1 has 5 machines
2346 on it, subnet 2 has 4 machines, subnet 3 has 4 machines.  Assume
2347 for the moment that all these machines are configured to be in the
2348 same workgroup (for simplicities sake).  Machine N1_C on subnet 1
2349 is configured as Domain Master Browser (ie.  it will collate the
2350 browse lists for the workgroup).  Machine N2_D is configured as
2351 WINS server and all the other machines are configured to register
2352 their NetBIOS names with it.</P
2353 ><P
2354 >As all these machines are booted up, elections for master browsers
2355 will take place on each of the three subnets.  Assume that machine
2356 N1_C wins on subnet 1, N2_B wins on subnet 2, and N3_D wins on
2357 subnet 3 - these machines are known as local master browsers for
2358 their particular subnet.  N1_C has an advantage in winning as the
2359 local master browser on subnet 1 as it is set up as Domain Master
2360 Browser.</P
2361 ><P
2362 >On each of the three networks, machines that are configured to 
2363 offer sharing services will broadcast that they are offering
2364 these services.  The local master browser on each subnet will
2365 receive these broadcasts and keep a record of the fact that
2366 the machine is offering a service.  This list of records is
2367 the basis of the browse list.  For this case, assume that
2368 all the machines are configured to offer services so all machines
2369 will be on the browse list.</P
2370 ><P
2371 >For each network, the local master browser on that network is
2372 considered 'authoritative' for all the names it receives via
2373 local broadcast.  This is because a machine seen by the local
2374 master browser via a local broadcast must be on the same 
2375 network as the local master browser and thus is a 'trusted'
2376 and 'verifiable' resource.  Machines on other networks that
2377 the local master browsers learn about when collating their
2378 browse lists have not been directly seen - these records are
2379 called 'non-authoritative'.</P
2380 ><P
2381 >At this point the browse lists look as follows (these are 
2382 the machines you would see in your network neighborhood if
2383 you looked in it on a particular network right now).</P
2384 ><P
2385 ><PRE
2386 CLASS="PROGRAMLISTING"
2387 >Subnet           Browse Master   List
2388 ------           -------------   ----
2389 Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E
2390
2391 Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
2392
2393 Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D</PRE
2394 ></P
2395 ><P
2396 >Note that at this point all the subnets are separate, no
2397 machine is seen across any of the subnets.</P
2398 ><P
2399 >Now examine subnet 2.  As soon as N2_B has become the local
2400 master browser it looks for a Domain master browser to synchronize
2401 its browse list with.  It does this by querying the WINS server
2402 (N2_D) for the IP address associated with the NetBIOS name 
2403 WORKGROUP&gt;1B&lt;.  This name was registerd by the Domain master
2404 browser (N1_C) with the WINS server as soon as it was booted.</P
2405 ><P
2406 >Once N2_B knows the address of the Domain master browser it
2407 tells it that is the local master browser for subnet 2 by
2408 sending a MasterAnnouncement packet as a UDP port 138 packet.
2409 It then synchronizes with it by doing a NetServerEnum2 call.  This
2410 tells the Domain Master Browser to send it all the server
2411 names it knows about.  Once the domain master browser receives
2412 the MasterAnnouncement packet it schedules a synchronization
2413 request to the sender of that packet.  After both synchronizations
2414 are done the browse lists look like :</P
2415 ><P
2416 ><PRE
2417 CLASS="PROGRAMLISTING"
2418 >Subnet           Browse Master   List
2419 ------           -------------   ----
2420 Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
2421                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*)
2422
2423 Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
2424                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
2425
2426 Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
2427
2428 Servers with a (*) after them are non-authoritative names.</PRE
2429 ></P
2430 ><P
2431 >At this point users looking in their network neighborhood on
2432 subnets 1 or 2 will see all the servers on both, users on
2433 subnet 3 will still only see the servers on their own subnet.</P
2434 ><P
2435 >The same sequence of events that occured for N2_B now occurs
2436 for the local master browser on subnet 3 (N3_D).  When it
2437 synchronizes browse lists with the domain master browser (N1_A)
2438 it gets both the server entries on subnet 1, and those on
2439 subnet 2.  After N3_D has synchronized with N1_C and vica-versa
2440 the browse lists look like.</P
2441 ><P
2442 ><PRE
2443 CLASS="PROGRAMLISTING"
2444 >Subnet           Browse Master   List
2445 ------           -------------   ----
2446 Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
2447                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*),
2448                                  N3_A(*), N3_B(*), N3_C(*), N3_D(*)
2449
2450 Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
2451                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
2452
2453 Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
2454                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*),
2455                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*)
2456
2457 Servers with a (*) after them are non-authoritative names.</PRE
2458 ></P
2459 ><P
2460 >At this point users looking in their network neighborhood on
2461 subnets 1 or 3 will see all the servers on all sunbets, users on
2462 subnet 2 will still only see the servers on subnets 1 and 2, but not 3.</P
2463 ><P
2464 >Finally, the local master browser for subnet 2 (N2_B) will sync again
2465 with the domain master browser (N1_C) and will recieve the missing
2466 server entries.  Finally - and as a steady state (if no machines
2467 are removed or shut off) the browse lists will look like :</P
2468 ><P
2469 ><PRE
2470 CLASS="PROGRAMLISTING"
2471 >Subnet           Browse Master   List
2472 ------           -------------   ----
2473 Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
2474                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*),
2475                                  N3_A(*), N3_B(*), N3_C(*), N3_D(*)
2476
2477 Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
2478                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
2479                                  N3_A(*), N3_B(*), N3_C(*), N3_D(*)
2480
2481 Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
2482                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*),
2483                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*)
2484         
2485 Servers with a (*) after them are non-authoritative names.</PRE
2486 ></P
2487 ><P
2488 >Synchronizations between the domain master browser and local
2489 master browsers will continue to occur, but this should be a
2490 steady state situation.</P
2491 ><P
2492 >If either router R1 or R2 fails the following will occur:</P
2493 ><P
2494 ></P
2495 ><OL
2496 TYPE="1"
2497 ><LI
2498 ><P
2499 >       Names of computers on each side of the inaccessible network fragments
2500         will be maintained for as long as 36 minutes, in the network neighbourhood
2501         lists.
2502         </P
2503 ></LI
2504 ><LI
2505 ><P
2506 >       Attempts to connect to these inaccessible computers will fail, but the
2507         names will not be removed from the network neighbourhood lists.
2508         </P
2509 ></LI
2510 ><LI
2511 ><P
2512 >       If one of the fragments is cut off from the WINS server, it will only
2513         be able to access servers on its local subnet, by using subnet-isolated
2514         broadcast NetBIOS name resolution.  The effects are similar to that of
2515         losing access to a DNS server.
2516         </P
2517 ></LI
2518 ></OL
2519 ></DIV
2520 ></DIV
2521 ><DIV
2522 CLASS="SECT1"
2523 ><HR><H2
2524 CLASS="SECT1"
2525 ><A
2526 NAME="AEN288"
2527 ></A
2528 >2.5. Setting up a WINS server</H2
2529 ><P
2530 >Either a Samba machine or a Windows NT Server machine may be set up
2531 as a WINS server.  To set a Samba machine to be a WINS server you must
2532 add the following option to the smb.conf file on the selected machine :
2533 in the [globals] section add the line </P
2534 ><P
2535 ><B
2536 CLASS="COMMAND"
2537 >               wins support = yes</B
2538 ></P
2539 ><P
2540 >Versions of Samba previous to 1.9.17 had this parameter default to
2541 yes.  If you have any older versions of Samba on your network it is
2542 strongly suggested you upgrade to 1.9.17 or above, or at the very
2543 least set the parameter to 'no' on all these machines.</P
2544 ><P
2545 >Machines with "<B
2546 CLASS="COMMAND"
2547 >wins support = yes</B
2548 >" will keep a list of 
2549 all NetBIOS names registered with them, acting as a DNS for NetBIOS names.</P
2550 ><P
2551 >You should set up only ONE wins server.  Do NOT set the
2552 "<B
2553 CLASS="COMMAND"
2554 >wins support = yes</B
2555 >" option on more than one Samba 
2556 server.</P
2557 ><P
2558 >To set up a Windows NT Server as a WINS server you need to set up
2559 the WINS service - see your NT documentation for details.  Note that
2560 Windows NT WINS Servers can replicate to each other, allowing more
2561 than one to be set up in a complex subnet environment.  As Microsoft
2562 refuse to document these replication protocols Samba cannot currently
2563 participate in these replications.  It is possible in the future that
2564 a Samba-&#62;Samba WINS replication protocol may be defined, in which
2565 case more than one Samba machine could be set up as a WINS server
2566 but currently only one Samba server should have the "wins support = yes"
2567 parameter set.</P
2568 ><P
2569 >After the WINS server has been configured you must ensure that all
2570 machines participating on the network are configured with the address
2571 of this WINS server.  If your WINS server is a Samba machine, fill in
2572 the Samba machine IP address in the "Primary WINS Server" field of
2573 the "Control Panel-&#62;Network-&#62;Protocols-&#62;TCP-&#62;WINS Server" dialogs
2574 in Windows 95 or Windows NT.  To tell a Samba server the IP address
2575 of the WINS server add the following line to the [global] section of
2576 all smb.conf files :</P
2577 ><P
2578 ><B
2579 CLASS="COMMAND"
2580 >wins server = &gt;name or IP address&lt;</B
2581 ></P
2582 ><P
2583 >where &gt;name or IP address&lt; is either the DNS name of the WINS server
2584 machine or its IP address.</P
2585 ><P
2586 >Note that this line MUST NOT BE SET in the smb.conf file of the Samba
2587 server acting as the WINS server itself.  If you set both the
2588 "<B
2589 CLASS="COMMAND"
2590 >wins support = yes</B
2591 >" option and the 
2592 "<B
2593 CLASS="COMMAND"
2594 >wins server = &gt;name&lt;</B
2595 >" option then
2596 nmbd will fail to start.</P
2597 ><P
2598 >There are two possible scenarios for setting up cross subnet browsing.
2599 The first details setting up cross subnet browsing on a network containing
2600 Windows 95, Samba and Windows NT machines that are not configured as
2601 part of a Windows NT Domain.  The second details setting up cross subnet
2602 browsing on networks that contain NT Domains.</P
2603 ></DIV
2604 ><DIV
2605 CLASS="SECT1"
2606 ><HR><H2
2607 CLASS="SECT1"
2608 ><A
2609 NAME="AEN307"
2610 ></A
2611 >2.6. Setting up Browsing in a WORKGROUP</H2
2612 ><P
2613 >To set up cross subnet browsing on a network containing machines
2614 in up to be in a WORKGROUP, not an NT Domain you need to set up one
2615 Samba server to be the Domain Master Browser (note that this is *NOT*
2616 the same as a Primary Domain Controller, although in an NT Domain the
2617 same machine plays both roles).  The role of a Domain master browser is
2618 to collate the browse lists from local master browsers on all the
2619 subnets that have a machine participating in the workgroup.  Without
2620 one machine configured as a domain master browser each subnet would
2621 be an isolated workgroup, unable to see any machines on any other
2622 subnet.  It is the presense of a domain master browser that makes
2623 cross subnet browsing possible for a workgroup.</P
2624 ><P
2625 >In an WORKGROUP environment the domain master browser must be a
2626 Samba server, and there must only be one domain master browser per
2627 workgroup name.  To set up a Samba server as a domain master browser,
2628 set the following option in the [global] section of the smb.conf file :</P
2629 ><P
2630 ><B
2631 CLASS="COMMAND"
2632 >domain master = yes</B
2633 ></P
2634 ><P
2635 >The domain master browser should also preferrably be the local master
2636 browser for its own subnet.  In order to achieve this set the following
2637 options in the [global] section of the smb.conf file :</P
2638 ><P
2639 ><PRE
2640 CLASS="PROGRAMLISTING"
2641 >        domain master = yes
2642         local master = yes
2643         preferred master = yes
2644         os level = 65</PRE
2645 ></P
2646 ><P
2647 >The domain master browser may be the same machine as the WINS
2648 server, if you require.</P
2649 ><P
2650 >Next, you should ensure that each of the subnets contains a
2651 machine that can act as a local master browser for the
2652 workgroup.  Any NT machine should be able to do this, as will
2653 Windows 95 machines (although these tend to get rebooted more
2654 often, so it's not such a good idea to use these).  To make a 
2655 Samba server a local master browser set the following
2656 options in the [global] section of the smb.conf file :</P
2657 ><P
2658 ><PRE
2659 CLASS="PROGRAMLISTING"
2660 >        domain master = no
2661         local master = yes
2662         preferred master = yes
2663         os level = 65</PRE
2664 ></P
2665 ><P
2666 >Do not do this for more than one Samba server on each subnet,
2667 or they will war with each other over which is to be the local
2668 master browser.</P
2669 ><P
2670 >The "local master" parameter allows Samba to act as a local master
2671 browser.  The "preferred master" causes nmbd to force a browser
2672 election on startup and the "os level" parameter sets Samba high
2673 enough so that it should win any browser elections.</P
2674 ><P
2675 >If you have an NT machine on the subnet that you wish to
2676 be the local master browser then you can disable Samba from
2677 becoming a local master browser by setting the following
2678 options in the [global] section of the smb.conf file :</P
2679 ><P
2680 ><PRE
2681 CLASS="PROGRAMLISTING"
2682 >        domain master = no
2683         local master = no
2684         preferred master = no
2685         os level = 0</PRE
2686 ></P
2687 ></DIV
2688 ><DIV
2689 CLASS="SECT1"
2690 ><HR><H2
2691 CLASS="SECT1"
2692 ><A
2693 NAME="AEN325"
2694 ></A
2695 >2.7. Setting up Browsing in a DOMAIN</H2
2696 ><P
2697 >If you are adding Samba servers to a Windows NT Domain then
2698 you must not set up a Samba server as a domain master browser.
2699 By default, a Windows NT Primary Domain Controller for a Domain
2700 name is also the Domain master browser for that name, and many
2701 things will break if a Samba server registers the Domain master
2702 browser NetBIOS name (DOMAIN&gt;1B&lt;) with WINS instead of the PDC.</P
2703 ><P
2704 >For subnets other than the one containing the Windows NT PDC
2705 you may set up Samba servers as local master browsers as
2706 described.  To make a Samba server a local master browser set 
2707 the following options in the [global] section of the smb.conf 
2708 file :</P
2709 ><P
2710 ><PRE
2711 CLASS="PROGRAMLISTING"
2712 >        domain master = no
2713         local master = yes
2714         preferred master = yes
2715         os level = 65</PRE
2716 ></P
2717 ><P
2718 >If you wish to have a Samba server fight the election with machines
2719 on the same subnet you may set the "os level" parameter to lower
2720 levels.  By doing this you can tune the order of machines that
2721 will become local master browsers if they are running.  For
2722 more details on this see the section "FORCING SAMBA TO BE THE MASTER"
2723 below.</P
2724 ><P
2725 >If you have Windows NT machines that are members of the domain
2726 on all subnets, and you are sure they will always be running then
2727 you can disable Samba from taking part in browser elections and
2728 ever becoming a local master browser by setting following options 
2729 in the [global] section of the smb.conf file :</P
2730 ><P
2731 ><B
2732 CLASS="COMMAND"
2733 >        domain master = no
2734         local master = no
2735         preferred master = no
2736         os level = 0</B
2737 ></P
2738 ></DIV
2739 ><DIV
2740 CLASS="SECT1"
2741 ><HR><H2
2742 CLASS="SECT1"
2743 ><A
2744 NAME="AEN335"
2745 ></A
2746 >2.8. Forcing samba to be the master</H2
2747 ><P
2748 >Who becomes the "master browser" is determined by an election process
2749 using broadcasts.  Each election packet contains a number of parameters
2750 which determine what precedence (bias) a host should have in the
2751 election.  By default Samba uses a very low precedence and thus loses
2752 elections to just about anyone else.</P
2753 ><P
2754 >If you want Samba to win elections then just set the "os level" global
2755 option in smb.conf to a higher number.  It defaults to 0.  Using 34
2756 would make it win all elections over every other system (except other
2757 samba systems!)</P
2758 ><P
2759 >A "os level" of 2 would make it beat WfWg and Win95, but not NTAS.  A
2760 NTAS domain controller uses level 32.</P
2761 ><P
2762 >The maximum os level is 255</P
2763 ><P
2764 >If you want samba to force an election on startup, then set the
2765 "preferred master" global option in smb.conf to "yes".  Samba will
2766 then have a slight advantage over other potential master browsers
2767 that are not preferred master browsers.  Use this parameter with
2768 care, as if you have two hosts (whether they are windows 95 or NT or
2769 samba) on the same local subnet both set with "preferred master" to
2770 "yes", then periodically and continually they will force an election
2771 in order to become the local master browser.</P
2772 ><P
2773 >If you want samba to be a "domain master browser", then it is
2774 recommended that you also set "preferred master" to "yes", because
2775 samba will not become a domain master browser for the whole of your
2776 LAN or WAN if it is not also a local master browser on its own
2777 broadcast isolated subnet.</P
2778 ><P
2779 >It is possible to configure two samba servers to attempt to become
2780 the domain master browser for a domain.  The first server that comes
2781 up will be the domain master browser.  All other samba servers will
2782 attempt to become the domain master browser every 5 minutes.  They
2783 will find that another samba server is already the domain master
2784 browser and will fail.  This provides automatic redundancy, should
2785 the current domain master browser fail.</P
2786 ></DIV
2787 ><DIV
2788 CLASS="SECT1"
2789 ><HR><H2
2790 CLASS="SECT1"
2791 ><A
2792 NAME="AEN344"
2793 ></A
2794 >2.9. Making samba the domain master</H2
2795 ><P
2796 >The domain master is responsible for collating the browse lists of
2797 multiple subnets so that browsing can occur between subnets.  You can
2798 make samba act as the domain master by setting "domain master = yes"
2799 in smb.conf.  By default it will not be a domain master.</P
2800 ><P
2801 >Note that you should NOT set Samba to be the domain master for a
2802 workgroup that has the same name as an NT Domain.</P
2803 ><P
2804 >When samba is the domain master and the master browser it will listen
2805 for master announcements (made roughly every twelve minutes) from local
2806 master browsers on other subnets and then contact them to synchronise
2807 browse lists.</P
2808 ><P
2809 >If you want samba to be the domain master then I suggest you also set
2810 the "os level" high enough to make sure it wins elections, and set
2811 "preferred master" to "yes", to get samba to force an election on
2812 startup.</P
2813 ><P
2814 >Note that all your servers (including samba) and clients should be
2815 using a WINS server to resolve NetBIOS names.  If your clients are only
2816 using broadcasting to resolve NetBIOS names, then two things will occur:</P
2817 ><P
2818 ></P
2819 ><OL
2820 TYPE="1"
2821 ><LI
2822 ><P
2823 >       your local master browsers will be unable to find a domain master
2824         browser, as it will only be looking on the local subnet.
2825         </P
2826 ></LI
2827 ><LI
2828 ><P
2829 >       if a client happens to get hold of a domain-wide browse list, and
2830         a user attempts to access a host in that list, it will be unable to
2831         resolve the NetBIOS name of that host.
2832         </P
2833 ></LI
2834 ></OL
2835 ><P
2836 >If, however, both samba and your clients are using a WINS server, then:</P
2837 ><P
2838 ></P
2839 ><OL
2840 TYPE="1"
2841 ><LI
2842 ><P
2843 >       your local master browsers will contact the WINS server and, as long as
2844         samba has registered that it is a domain master browser with the WINS
2845         server, your local master browser will receive samba's ip address
2846         as its domain master browser.
2847         </P
2848 ></LI
2849 ><LI
2850 ><P
2851 >       when a client receives a domain-wide browse list, and a user attempts
2852         to access a host in that list, it will contact the WINS server to
2853         resolve the NetBIOS name of that host.  as long as that host has
2854         registered its NetBIOS name with the same WINS server, the user will
2855         be able to see that host.  
2856         </P
2857 ></LI
2858 ></OL
2859 ></DIV
2860 ><DIV
2861 CLASS="SECT1"
2862 ><HR><H2
2863 CLASS="SECT1"
2864 ><A
2865 NAME="AEN362"
2866 ></A
2867 >2.10. Note about broadcast addresses</H2
2868 ><P
2869 >If your network uses a "0" based broadcast address (for example if it
2870 ends in a 0) then you will strike problems.  Windows for Workgroups
2871 does not seem to support a 0's broadcast and you will probably find
2872 that browsing and name lookups won't work.</P
2873 ></DIV
2874 ><DIV
2875 CLASS="SECT1"
2876 ><HR><H2
2877 CLASS="SECT1"
2878 ><A
2879 NAME="AEN365"
2880 ></A
2881 >2.11. Multiple interfaces</H2
2882 ><P
2883 >Samba now supports machines with multiple network interfaces.  If you
2884 have multiple interfaces then you will need to use the "interfaces"
2885 option in smb.conf to configure them.  See smb.conf(5) for details.</P
2886 ></DIV
2887 ></DIV
2888 ><DIV
2889 CLASS="CHAPTER"
2890 ><HR><H1
2891 ><A
2892 NAME="OPLOCKS"
2893 ></A
2894 >Chapter 3. Oplocks</H1
2895 ><DIV
2896 CLASS="SECT1"
2897 ><H2
2898 CLASS="SECT1"
2899 ><A
2900 NAME="AEN377"
2901 ></A
2902 >3.1. What are oplocks?</H2
2903 ><P
2904 >When a client opens a file it can request an "oplock" or file
2905 lease. This is (to simplify a bit) a guarentee that no one else
2906 has the file open simultaneously. It allows the client to not
2907 send any updates on the file to the server, thus reducing a
2908 network file access to local access (once the file is in
2909 client cache). An "oplock break" is when the server sends
2910 a request to the client to flush all its changes back to
2911 the server, so the file is in a consistent state for other
2912 opens to succeed. If a client fails to respond to this
2913 asynchronous request then the file can be corrupted. Hence
2914 the "turn off oplocks" answer if people are having multi-user
2915 file access problems.</P
2916 ><P
2917 >Unless the kernel is "oplock aware" (SGI IRIX and Linux are
2918 the only two UNIXes that are at the moment) then if a local
2919 UNIX process accesses the file simultaneously then Samba
2920 has no way of telling this is occuring, so the guarentee
2921 to the client is broken. This can corrupt the file. Short
2922 answer - it you have UNIX clients accessing the same file
2923 as smbd locally or via NFS and you're not running Linux or
2924 IRIX then turn off oplocks for that file or share.</P
2925 ><P
2926 >"Share modes". These are modes of opening a file, that
2927 guarentee an invarient - such as DENY_WRITE - which means
2928 that if any other opens are requested with write access after
2929 this current open has succeeded then they should be denied
2930 with a "sharing violation" error message. Samba handles these
2931 internally inside smbd. UNIX clients accessing the same file
2932 ignore these invarients. Just proving that if you need simultaneous
2933 file access from a Windows and UNIX client you *must* have an
2934 application that is written to lock records correctly on both
2935 sides. Few applications are written like this, and even fewer
2936 are cross platform (UNIX and Windows) so in practice this isn't
2937 much of a problem.</P
2938 ><P
2939 >"Locking". This really means "byte range locking" - such as
2940 lock 10 bytes at file offset 24 for write access. This is the
2941 area in which well written UNIX and Windows apps will cooperate.
2942 Windows locks (at least from NT or above) are 64-bit unsigned
2943 offsets. UNIX locks are either 31 bit or 63 bit and are signed
2944 (the top bit is used for the sign). Samba handles these by
2945 first ensuring that all the Windows locks don't conflict (ie.
2946 if other Windows clients have competing locks then just reject
2947 immediately) - this allows us to support 64-bit Windows locks
2948 on 32-bit filesystems. Secondly any locks that are valid are
2949 then mapped onto UNIX fcntl byte range locks. These are the
2950 locks that will be seen by UNIX processes. If there is a conflict
2951 here the lock is rejected.</P
2952 ><P
2953 >Note that if a client has an oplock then it "knows" that no
2954 other client can have the file open so usually doesn't bother
2955 to send to lock request to the server - this means once again
2956 if you need to share files between UNIX and Windows processes
2957 either use IRIX or Linux, or turn off oplocks for these
2958 files/shares.</P
2959 ></DIV
2960 ></DIV
2961 ><DIV
2962 CLASS="CHAPTER"
2963 ><HR><H1
2964 ><A
2965 NAME="BROWSING-QUICK"
2966 ></A
2967 >Chapter 4. Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</H1
2968 ><P
2969 >This document should be read in conjunction with Browsing and may
2970 be taken as the fast track guide to implementing browsing across subnets
2971 and / or across workgroups (or domains). WINS is the best tool for resolution
2972 of NetBIOS names to IP addesses. WINS is NOT involved in browse list handling
2973 except by way of name to address mapping.</P
2974 ><DIV
2975 CLASS="SECT1"
2976 ><HR><H2
2977 CLASS="SECT1"
2978 ><A
2979 NAME="AEN392"
2980 ></A
2981 >4.1. Discussion</H2
2982 ><P
2983 >Firstly, all MS Windows networking is based on SMB (Server Message
2984 Block) based messaging. SMB messaging is implemented using NetBIOS. Samba
2985 implements NetBIOS by encapsulating it over TCP/IP. MS Windows products can
2986 do likewise. NetBIOS based networking uses broadcast messaging to affect
2987 browse list management. When running NetBIOS over TCP/IP this uses UDP
2988 based messaging. UDP messages can be broadcast or unicast.</P
2989 ><P
2990 >Normally, only unicast UDP messaging can be forwarded by routers. The
2991 "remote announce" parameter to smb.conf helps to project browse announcements
2992 to remote network segments via unicast UDP. Similarly, the "remote browse sync"
2993 parameter of smb.conf implements browse list collation using unicast UDP.</P
2994 ><P
2995 >Secondly, in those networks where Samba is the only SMB server technology
2996 wherever possible nmbd should be configured on one (1) machine as the WINS
2997 server. This makes it easy to manage the browsing environment. If each network
2998 segment is configured with it's own Samba WINS server, then the only way to
2999 get cross segment browsing to work is by using the "remote announce" and
3000 the "remote browse sync" parameters to your smb.conf file.</P
3001 ><P
3002 >If only one WINS server is used then the use of the "remote announce" and the
3003 "remote browse sync" parameters should NOT be necessary.</P
3004 ><P
3005 >Samba WINS does not support MS-WINS replication. This means that when setting up
3006 Samba as a WINS server there must only be one nmbd configured as a WINS server
3007 on the network. Some sites have used multiple Samba WINS servers for redundancy
3008 (one server per subnet) and then used "remote browse sync" and "remote announce"
3009 to affect browse list collation across all segments. Note that this means
3010 clients will only resolve local names, and must be configured to use DNS to
3011 resolve names on other subnets in order to resolve the IP addresses of the
3012 servers they can see on other subnets. This setup is not recommended, but is
3013 mentioned as a practical consideration (ie: an 'if all else fails' scenario).</P
3014 ><P
3015 >Lastly, take note that browse lists are a collection of unreliable broadcast
3016 messages that are repeated at intervals of not more than 15 minutes. This means
3017 that it will take time to establish a browse list and it can take up to 45
3018 minutes to stabilise, particularly across network segments.</P
3019 ></DIV
3020 ><DIV
3021 CLASS="SECT1"
3022 ><HR><H2
3023 CLASS="SECT1"
3024 ><A
3025 NAME="AEN400"
3026 ></A
3027 >4.2. Use of the "Remote Announce" parameter</H2
3028 ><P
3029 >The "remote announce" parameter of smb.conf can be used to forcibly ensure
3030 that all the NetBIOS names on a network get announced to a remote network.
3031 The syntax of the "remote announce" parameter is:
3032 <PRE
3033 CLASS="PROGRAMLISTING"
3034 >       remote announce = a.b.c.d [e.f.g.h] ...</PRE
3035 >
3036 _or_
3037 <PRE
3038 CLASS="PROGRAMLISTING"
3039 >       remote announce = a.b.c.d/WORKGROUP [e.f.g.h/WORKGROUP] ...</PRE
3040 >
3041
3042 where:
3043 <P
3044 ></P
3045 ><DIV
3046 CLASS="VARIABLELIST"
3047 ><DL
3048 ><DT
3049 >a.b.c.d and e.f.g.h</DT
3050 ><DD
3051 ><P
3052 >is either the LMB (Local Master Browser) IP address
3053 or the broadcst address of the remote network.
3054 ie: the LMB is at 192.168.1.10, or the address
3055 could be given as 192.168.1.255 where the netmask
3056 is assumed to be 24 bits (255.255.255.0).
3057 When the remote announcement is made to the broadcast
3058 address of the remote network every host will receive
3059 our announcements. This is noisy and therefore
3060 undesirable but may be necessary if we do NOT know
3061 the IP address of the remote LMB.</P
3062 ></DD
3063 ><DT
3064 >WORKGROUP</DT
3065 ><DD
3066 ><P
3067 >is optional and can be either our own workgroup
3068 or that of the remote network. If you use the
3069 workgroup name of the remote network then our
3070 NetBIOS machine names will end up looking like
3071 they belong to that workgroup, this may cause
3072 name resolution problems and should be avoided.</P
3073 ></DD
3074 ></DL
3075 ></DIV
3076 >&#13;</P
3077 ></DIV
3078 ><DIV
3079 CLASS="SECT1"
3080 ><HR><H2
3081 CLASS="SECT1"
3082 ><A
3083 NAME="AEN414"
3084 ></A
3085 >4.3. Use of the "Remote Browse Sync" parameter</H2
3086 ><P
3087 >The "remote browse sync" parameter of smb.conf is used to announce to
3088 another LMB that it must synchronise it's NetBIOS name list with our
3089 Samba LMB. It works ONLY if the Samba server that has this option is
3090 simultaneously the LMB on it's network segment.</P
3091 ><P
3092 >The syntax of the "remote browse  sync" parameter is:
3093 <PRE
3094 CLASS="PROGRAMLISTING"
3095 >       remote browse sync = a.b.c.d</PRE
3096 >
3097
3098 where a.b.c.d is either the IP address of the remote LMB or else is the network broadcast address of the remote segment.</P
3099 ></DIV
3100 ><DIV
3101 CLASS="SECT1"
3102 ><HR><H2
3103 CLASS="SECT1"
3104 ><A
3105 NAME="AEN419"
3106 ></A
3107 >4.4. Use of WINS</H2
3108 ><P
3109 >Use of WINS (either Samba WINS _or_ MS Windows NT Server WINS) is highly
3110 recommended. Every NetBIOS machine registers it's name together with a
3111 name_type value for each of of several types of service it has available.
3112 eg: It registers it's name directly as a unique (the type 0x03) name.
3113 It also registers it's name if it is running the lanmanager compatible
3114 server service (used to make shares and printers available to other users)
3115 by registering the server (the type 0x20) name.</P
3116 ><P
3117 >All NetBIOS names are up to 15 characters in length. The name_type variable
3118 is added to the end of the name - thus creating a 16 character name. Any
3119 name that is shorter than 15 characters is padded with spaces to the 15th
3120 character. ie: All NetBIOS names are 16 characters long (including the
3121 name_type information).</P
3122 ><P
3123 >WINS can store these 16 character names as they get registered. A client
3124 that wants to log onto the network can ask the WINS server for a list
3125 of all names that have registered the NetLogon service name_type. This saves
3126 broadcast traffic and greatly expedites logon processing. Since broadcast
3127 name resolution can not be used across network segments this type of
3128 information can only be provided via WINS _or_ via statically configured
3129 "lmhosts" files that must reside on all clients in the absence of WINS.</P
3130 ><P
3131 >WINS also serves the purpose of forcing browse list synchronisation by all
3132 LMB's. LMB's must synchronise their browse list with the DMB (domain master
3133 browser) and WINS helps the LMB to identify it's DMB. By definition this
3134 will work only within a single workgroup. Note that the domain master browser
3135 has NOTHING to do with what is referred to as an MS Windows NT Domain. The
3136 later is a reference to a security environment while the DMB refers to the
3137 master controller for browse list information only.</P
3138 ><P
3139 >Use of WINS will work correctly only if EVERY client TCP/IP protocol stack
3140 has been configured to use the WINS server/s. Any client that has not been
3141 configured to use the WINS server will continue to use only broadcast based
3142 name registration so that WINS may NEVER get to know about it. In any case,
3143 machines that have not registered with a WINS server will fail name to address
3144 lookup attempts by other clients and will therefore cause workstation access
3145 errors.</P
3146 ><P
3147 >To configure Samba as a WINS server just add "wins support = yes" to the
3148 smb.conf file [globals] section.</P
3149 ><P
3150 >To configure Samba to register with a WINS server just add
3151 "wins server = a.b.c.d" to your smb.conf file [globals] section.</P
3152 ><P
3153 ><SPAN
3154 CLASS="emphasis"
3155 ><I
3156 CLASS="EMPHASIS"
3157 >DO NOT EVER</I
3158 ></SPAN
3159 > use both "wins support = yes" together with "wins server = a.b.c.d"
3160 particularly not using it's own IP address.</P
3161 ></DIV
3162 ><DIV
3163 CLASS="SECT1"
3164 ><HR><H2
3165 CLASS="SECT1"
3166 ><A
3167 NAME="AEN430"
3168 ></A
3169 >4.5. Do NOT use more than one (1) protocol on MS Windows machines</H2
3170 ><P
3171 >A very common cause of browsing problems results from installing more than
3172 one protocol on an MS Windows machine.</P
3173 ><P
3174 >Every NetBIOS machine take part in a process of electing the LMB (and DMB)
3175 every 15 minutes. A set of election criteria is used to determine the order
3176 of precidence for winning this election process. A machine running Samba or
3177 Windows NT will be biased so that the most suitable machine will predictably
3178 win and thus retain it's role.</P
3179 ><P
3180 >The election process is "fought out" so to speak over every NetBIOS network
3181 interface. In the case of a Windows 9x machine that has both TCP/IP and IPX
3182 installed and has NetBIOS enabled over both protocols the election will be
3183 decided over both protocols. As often happens, if the Windows 9x machine is
3184 the only one with both protocols then the LMB may be won on the NetBIOS
3185 interface over the IPX protocol. Samba will then lose the LMB role as Windows
3186 9x will insist it knows who the LMB is. Samba will then cease to function
3187 as an LMB and thus browse list operation on all TCP/IP only machines will
3188 fail.</P
3189 ><P
3190 >The safest rule of all to follow it this - USE ONLY ONE PROTOCOL!</P
3191 ></DIV
3192 ><DIV
3193 CLASS="SECT1"
3194 ><HR><H2
3195 CLASS="SECT1"
3196 ><A
3197 NAME="AEN436"
3198 ></A
3199 >4.6. Name Resolution Order</H2
3200 ><P
3201 >Resolution of NetBIOS names to IP addresses can take place using a number
3202 of methods. The only ones that can provide NetBIOS name_type information
3203 are:
3204 <P
3205 ></P
3206 ><TABLE
3207 BORDER="0"
3208 ><TBODY
3209 ><TR
3210 ><TD
3211 >WINS: the best tool!</TD
3212 ></TR
3213 ><TR
3214 ><TD
3215 >LMHOSTS: is static and hard to maintain.</TD
3216 ></TR
3217 ><TR
3218 ><TD
3219 >Broadcast: uses UDP and can not resolve names across remote segments.</TD
3220 ></TR
3221 ></TBODY
3222 ></TABLE
3223 ><P
3224 ></P
3225 ></P
3226 ><P
3227 >Alternative means of name resolution includes:
3228 <P
3229 ></P
3230 ><TABLE
3231 BORDER="0"
3232 ><TBODY
3233 ><TR
3234 ><TD
3235 >/etc/hosts: is static, hard to maintain, and lacks name_type info</TD
3236 ></TR
3237 ><TR
3238 ><TD
3239 >DNS: is a good choice but lacks essential name_type info.</TD
3240 ></TR
3241 ></TBODY
3242 ></TABLE
3243 ><P
3244 ></P
3245 ></P
3246 ><P
3247 >Many sites want to restrict DNS lookups and want to avoid broadcast name
3248 resolution traffic. The "name resolve order" parameter is of great help here.
3249 The syntax of the "name resolve order" parameter is:
3250 <PRE
3251 CLASS="PROGRAMLISTING"
3252 >       name resolve order = wins lmhosts bcast host</PRE
3253 >
3254 _or_
3255 <PRE
3256 CLASS="PROGRAMLISTING"
3257 >       name resolve order = wins lmhosts       (eliminates bcast and host)</PRE
3258 >
3259 The default is:
3260 <PRE
3261 CLASS="PROGRAMLISTING"
3262 >       name  resolve order = host lmhost wins bcast</PRE
3263 >.
3264 where "host" refers the the native methods used by the Unix system
3265 to implement the gethostbyname() function call. This is normally
3266 controlled by <TT
3267 CLASS="FILENAME"
3268 >/etc/host.conf</TT
3269 >, <TT
3270 CLASS="FILENAME"
3271 >/etc/nsswitch.conf</TT
3272 > and <TT
3273 CLASS="FILENAME"
3274 >/etc/resolv.conf</TT
3275 >.</P
3276 ></DIV
3277 ></DIV
3278 ><DIV
3279 CLASS="CHAPTER"
3280 ><HR><H1
3281 ><A
3282 NAME="PWENCRYPT"
3283 ></A
3284 >Chapter 5. LanMan and NT Password Encryption in Samba</H1
3285 ><DIV
3286 CLASS="SECT1"
3287 ><H2
3288 CLASS="SECT1"
3289 ><A
3290 NAME="AEN472"
3291 ></A
3292 >5.1. Introduction</H2
3293 ><P
3294 >Newer windows clients send encrypted passwords over 
3295         the wire, instead of plain text passwords. The newest clients 
3296         will only send encrypted passwords and refuse to send plain text 
3297         passwords, unless their registry is tweaked.</P
3298 ><P
3299 >These passwords can't be converted to unix style encrypted 
3300         passwords. Because of that you can't use the standard unix 
3301         user database, and you have to store the Lanman and NT hashes 
3302         somewhere else. For more information, see the documentation 
3303         about the <B
3304 CLASS="COMMAND"
3305 >passdb backend = </B
3306 > parameter.
3307         </P
3308 ></DIV
3309 ><DIV
3310 CLASS="SECT1"
3311 ><HR><H2
3312 CLASS="SECT1"
3313 ><A
3314 NAME="AEN477"
3315 ></A
3316 >5.2. Important Notes About Security</H2
3317 ><P
3318 >The unix and SMB password encryption techniques seem similar 
3319         on the surface. This similarity is, however, only skin deep. The unix 
3320         scheme typically sends clear text passwords over the network when 
3321         logging in. This is bad. The SMB encryption scheme never sends the 
3322         cleartext password over the network but it does store the 16 byte 
3323         hashed values on disk. This is also bad. Why? Because the 16 byte hashed 
3324         values are a "password equivalent". You cannot derive the user's 
3325         password from them, but they could potentially be used in a modified 
3326         client to gain access to a server. This would require considerable 
3327         technical knowledge on behalf of the attacker but is perfectly possible. 
3328         You should thus treat the smbpasswd file as though it contained the 
3329         cleartext passwords of all your users. Its contents must be kept 
3330         secret, and the file should be protected accordingly.</P
3331 ><P
3332 >Ideally we would like a password scheme which neither requires 
3333         plain text passwords on the net or on disk. Unfortunately this 
3334         is not available as Samba is stuck with being compatible with 
3335         other SMB systems (WinNT, WfWg, Win95 etc). </P
3336 ><DIV
3337 CLASS="WARNING"
3338 ><P
3339 ></P
3340 ><TABLE
3341 CLASS="WARNING"
3342 WIDTH="100%"
3343 BORDER="0"
3344 ><TR
3345 ><TD
3346 WIDTH="25"
3347 ALIGN="CENTER"
3348 VALIGN="TOP"
3349 ><IMG
3350 SRC="/docbook-dsssl/warning.gif"
3351 HSPACE="5"
3352 ALT="Warning"></TD
3353 ><TD
3354 ALIGN="LEFT"
3355 VALIGN="TOP"
3356 ><P
3357 >Note that Windows NT 4.0 Service pack 3 changed the 
3358                 default for permissible authentication so that plaintext 
3359                 passwords are <SPAN
3360 CLASS="emphasis"
3361 ><I
3362 CLASS="EMPHASIS"
3363 >never</I
3364 ></SPAN
3365 > sent over the wire. 
3366                 The solution to this is either to switch to encrypted passwords 
3367                 with Samba or edit the Windows NT registry to re-enable plaintext 
3368                 passwords. See the document WinNT.txt for details on how to do 
3369                 this.</P
3370 ><P
3371 >Other Microsoft operating systems which also exhibit 
3372                 this behavior includes</P
3373 ><P
3374 ></P
3375 ><UL
3376 ><LI
3377 ><P
3378 >MS DOS Network client 3.0 with 
3379                         the basic network redirector installed</P
3380 ></LI
3381 ><LI
3382 ><P
3383 >Windows 95 with the network redirector 
3384                         update installed</P
3385 ></LI
3386 ><LI
3387 ><P
3388 >Windows 98 [se]</P
3389 ></LI
3390 ><LI
3391 ><P
3392 >Windows 2000</P
3393 ></LI
3394 ></UL
3395 ><P
3396 ><SPAN
3397 CLASS="emphasis"
3398 ><I
3399 CLASS="EMPHASIS"
3400 >Note :</I
3401 ></SPAN
3402 >All current release of 
3403                 Microsoft SMB/CIFS clients support authentication via the
3404                 SMB Challenge/Response mechanism described here.  Enabling
3405                 clear text authentication does not disable the ability
3406                 of the client to participate in encrypted authentication.</P
3407 ></TD
3408 ></TR
3409 ></TABLE
3410 ></DIV
3411 ><DIV
3412 CLASS="SECT2"
3413 ><HR><H3
3414 CLASS="SECT2"
3415 ><A
3416 NAME="AEN496"
3417 ></A
3418 >5.2.1. Advantages of SMB Encryption</H3
3419 ><P
3420 ></P
3421 ><UL
3422 ><LI
3423 ><P
3424 >plain text passwords are not passed across 
3425                         the network. Someone using a network sniffer cannot just 
3426                         record passwords going to the SMB server.</P
3427 ></LI
3428 ><LI
3429 ><P
3430 >WinNT doesn't like talking to a server 
3431                         that isn't using SMB encrypted passwords. It will refuse 
3432                         to browse the server if the server is also in user level 
3433                         security mode. It will insist on prompting the user for the 
3434                         password on each connection, which is very annoying. The
3435                         only things you can do to stop this is to use SMB encryption.
3436                         </P
3437 ></LI
3438 ></UL
3439 ></DIV
3440 ><DIV
3441 CLASS="SECT2"
3442 ><HR><H3
3443 CLASS="SECT2"
3444 ><A
3445 NAME="AEN503"
3446 ></A
3447 >5.2.2. Advantages of non-encrypted passwords</H3
3448 ><P
3449 ></P
3450 ><UL
3451 ><LI
3452 ><P
3453 >plain text passwords are not kept 
3454                         on disk. </P
3455 ></LI
3456 ><LI
3457 ><P
3458 >uses same password file as other unix 
3459                         services such as login and ftp</P
3460 ></LI
3461 ><LI
3462 ><P
3463 >you are probably already using other 
3464                         services (such as telnet and ftp) which send plain text 
3465                         passwords over the net, so sending them for SMB isn't 
3466                         such a big deal.</P
3467 ></LI
3468 ></UL
3469 ></DIV
3470 ></DIV
3471 ><DIV
3472 CLASS="SECT1"
3473 ><HR><H2
3474 CLASS="SECT1"
3475 ><A
3476 NAME="AEN512"
3477 ></A
3478 >5.3. The smbpasswd Command</H2
3479 ><P
3480 >The smbpasswd command maintains the two 32 byte password fields 
3481         in the smbpasswd file. If you wish to make it similar to the unix 
3482         <B
3483 CLASS="COMMAND"
3484 >passwd</B
3485 > or <B
3486 CLASS="COMMAND"
3487 >yppasswd</B
3488 > programs, 
3489         install it in <TT
3490 CLASS="FILENAME"
3491 >/usr/local/samba/bin/</TT
3492 > (or your 
3493         main Samba binary directory).</P
3494 ><P
3495 ><B
3496 CLASS="COMMAND"
3497 >smbpasswd</B
3498 > now works in a client-server mode 
3499         where it contacts the local smbd to change the user's password on its 
3500         behalf. This has enormous benefits - as follows.</P
3501 ><P
3502 ><B
3503 CLASS="COMMAND"
3504 >smbpasswd</B
3505 > now has the capability 
3506         to change passwords on Windows NT servers (this only works when 
3507         the request is sent to the NT Primary Domain Controller if you 
3508         are changing an NT Domain user's password).</P
3509 ><P
3510 >To run smbpasswd as a normal user just type :</P
3511 ><P
3512 ><TT
3513 CLASS="PROMPT"
3514 >$ </TT
3515 ><TT
3516 CLASS="USERINPUT"
3517 ><B
3518 >smbpasswd</B
3519 ></TT
3520 ></P
3521 ><P
3522 ><TT
3523 CLASS="PROMPT"
3524 >Old SMB password: </TT
3525 ><TT
3526 CLASS="USERINPUT"
3527 ><B
3528 >&lt;type old value here - 
3529         or hit return if there was no old password&gt;</B
3530 ></TT
3531 ></P
3532 ><P
3533 ><TT
3534 CLASS="PROMPT"
3535 >New SMB Password: </TT
3536 ><TT
3537 CLASS="USERINPUT"
3538 ><B
3539 >&lt;type new value&gt;
3540         </B
3541 ></TT
3542 ></P
3543 ><P
3544 ><TT
3545 CLASS="PROMPT"
3546 >Repeat New SMB Password: </TT
3547 ><TT
3548 CLASS="USERINPUT"
3549 ><B
3550 >&lt;re-type new value
3551         </B
3552 ></TT
3553 ></P
3554 ><P
3555 >If the old value does not match the current value stored for 
3556         that user, or the two new values do not match each other, then the 
3557         password will not be changed.</P
3558 ><P
3559 >If invoked by an ordinary user it will only allow the user 
3560         to change his or her own Samba password.</P
3561 ><P
3562 >If run by the root user smbpasswd may take an optional 
3563         argument, specifying the user name whose SMB password you wish to 
3564         change.  Note that when run as root smbpasswd does not prompt for 
3565         or check the old password value, thus allowing root to set passwords 
3566         for users who have forgotten their passwords.</P
3567 ><P
3568 ><B
3569 CLASS="COMMAND"
3570 >smbpasswd</B
3571 > is designed to work in the same way 
3572         and be familiar to UNIX users who use the <B
3573 CLASS="COMMAND"
3574 >passwd</B
3575 > or 
3576         <B
3577 CLASS="COMMAND"
3578 >yppasswd</B
3579 > commands.</P
3580 ><P
3581 >For more details on using <B
3582 CLASS="COMMAND"
3583 >smbpasswd</B
3584 > refer 
3585         to the man page which will always be the definitive reference.</P
3586 ></DIV
3587 ></DIV
3588 ></DIV
3589 ><DIV
3590 CLASS="PART"
3591 ><A
3592 NAME="AEN544"
3593 ></A
3594 ><DIV
3595 CLASS="TITLEPAGE"
3596 ><H1
3597 CLASS="TITLE"
3598 >II. Type of installation</H1
3599 ><DIV
3600 CLASS="PARTINTRO"
3601 ><A
3602 NAME="AEN546"
3603 ></A
3604 ><H1
3605 >Introduction</H1
3606 ><P
3607 >This part contains information on using samba in a (NT 4 or ADS) domain. 
3608 If you wish to run samba as a domain member or DC, read the appropriate chapter in 
3609 this part.</P
3610 ></DIV
3611 ><DIV
3612 CLASS="TOC"
3613 ><DL
3614 ><DT
3615 ><B
3616 >Table of Contents</B
3617 ></DT
3618 ><DT
3619 >6. <A
3620 HREF="#SAMBA-PDC"
3621 >How to Configure Samba as a NT4 Primary Domain Controller</A
3622 ></DT
3623 ><DD
3624 ><DL
3625 ><DT
3626 >6.1. <A
3627 HREF="#AEN566"
3628 >Prerequisite Reading</A
3629 ></DT
3630 ><DT
3631 >6.2. <A
3632 HREF="#AEN572"
3633 >Background</A
3634 ></DT
3635 ><DT
3636 >6.3. <A
3637 HREF="#AEN611"
3638 >Configuring the Samba Domain Controller</A
3639 ></DT
3640 ><DT
3641 >6.4. <A
3642 HREF="#AEN654"
3643 >Creating Machine Trust Accounts and Joining Clients to the
3644 Domain</A
3645 ></DT
3646 ><DD
3647 ><DL
3648 ><DT
3649 >6.4.1. <A
3650 HREF="#AEN673"
3651 >Manual Creation of Machine Trust Accounts</A
3652 ></DT
3653 ><DT
3654 >6.4.2. <A
3655 HREF="#AEN714"
3656 >"On-the-Fly" Creation of Machine Trust Accounts</A
3657 ></DT
3658 ><DT
3659 >6.4.3. <A
3660 HREF="#AEN723"
3661 >Joining the Client to the Domain</A
3662 ></DT
3663 ></DL
3664 ></DD
3665 ><DT
3666 >6.5. <A
3667 HREF="#AEN738"
3668 >Common Problems and Errors</A
3669 ></DT
3670 ><DT
3671 >6.6. <A
3672 HREF="#AEN786"
3673 >System Policies and Profiles</A
3674 ></DT
3675 ><DT
3676 >6.7. <A
3677 HREF="#AEN830"
3678 >What other help can I get?</A
3679 ></DT
3680 ><DT
3681 >6.8. <A
3682 HREF="#AEN944"
3683 >Domain Control for Windows 9x/ME</A
3684 ></DT
3685 ><DD
3686 ><DL
3687 ><DT
3688 >6.8.1. <A
3689 HREF="#AEN970"
3690 >Configuration Instructions:    Network Logons</A
3691 ></DT
3692 ><DT
3693 >6.8.2. <A
3694 HREF="#AEN989"
3695 >Configuration Instructions:    Setting up Roaming User Profiles</A
3696 ></DT
3697 ></DL
3698 ></DD
3699 ><DT
3700 >6.9. <A
3701 HREF="#AEN1082"
3702 >DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
3703 ></DT
3704 ></DL
3705 ></DD
3706 ><DT
3707 >7. <A
3708 HREF="#SAMBA-BDC"
3709 >How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</A
3710 ></DT
3711 ><DD
3712 ><DL
3713 ><DT
3714 >7.1. <A
3715 HREF="#AEN1118"
3716 >Prerequisite Reading</A
3717 ></DT
3718 ><DT
3719 >7.2. <A
3720 HREF="#AEN1122"
3721 >Background</A
3722 ></DT
3723 ><DT
3724 >7.3. <A
3725 HREF="#AEN1130"
3726 >What qualifies a Domain Controller on the network?</A
3727 ></DT
3728 ><DD
3729 ><DL
3730 ><DT
3731 >7.3.1. <A
3732 HREF="#AEN1133"
3733 >How does a Workstation find its domain controller?</A
3734 ></DT
3735 ><DT
3736 >7.3.2. <A
3737 HREF="#AEN1136"
3738 >When is the PDC needed?</A
3739 ></DT
3740 ></DL
3741 ></DD
3742 ><DT
3743 >7.4. <A
3744 HREF="#AEN1139"
3745 >Can Samba be a Backup Domain Controller?</A
3746 ></DT
3747 ><DT
3748 >7.5. <A
3749 HREF="#AEN1143"
3750 >How do I set up a Samba BDC?</A
3751 ></DT
3752 ><DD
3753 ><DL
3754 ><DT
3755 >7.5.1. <A
3756 HREF="#AEN1160"
3757 >How do I replicate the smbpasswd file?</A
3758 ></DT
3759 ></DL
3760 ></DD
3761 ></DL
3762 ></DD
3763 ><DT
3764 >8. <A
3765 HREF="#ADS"
3766 >Samba as a ADS domain member</A
3767 ></DT
3768 ><DD
3769 ><DL
3770 ><DT
3771 >8.1. <A
3772 HREF="#AEN1178"
3773 >Installing the required packages for Debian</A
3774 ></DT
3775 ><DT
3776 >8.2. <A
3777 HREF="#AEN1184"
3778 >Installing the required packages for RedHat</A
3779 ></DT
3780 ><DT
3781 >8.3. <A
3782 HREF="#AEN1193"
3783 >Compile Samba</A
3784 ></DT
3785 ><DT
3786 >8.4. <A
3787 HREF="#AEN1205"
3788 >Setup your /etc/krb5.conf</A
3789 ></DT
3790 ><DT
3791 >8.5. <A
3792 HREF="#AEN1215"
3793 >Create the computer account</A
3794 ></DT
3795 ><DD
3796 ><DL
3797 ><DT
3798 >8.5.1. <A
3799 HREF="#AEN1219"
3800 >Possible errors</A
3801 ></DT
3802 ></DL
3803 ></DD
3804 ><DT
3805 >8.6. <A
3806 HREF="#AEN1231"
3807 >Test your server setup</A
3808 ></DT
3809 ><DT
3810 >8.7. <A
3811 HREF="#AEN1236"
3812 >Testing with smbclient</A
3813 ></DT
3814 ><DT
3815 >8.8. <A
3816 HREF="#AEN1239"
3817 >Notes</A
3818 ></DT
3819 ></DL
3820 ></DD
3821 ><DT
3822 >9. <A
3823 HREF="#DOMAIN-SECURITY"
3824 >Samba as a NT4 domain member</A
3825 ></DT
3826 ><DD
3827 ><DL
3828 ><DT
3829 >9.1. <A
3830 HREF="#AEN1261"
3831 >Joining an NT Domain with Samba 2.2</A
3832 ></DT
3833 ><DT
3834 >9.2. <A
3835 HREF="#AEN1325"
3836 >Samba and Windows 2000 Domains</A
3837 ></DT
3838 ><DT
3839 >9.3. <A
3840 HREF="#AEN1330"
3841 >Why is this better than security = server?</A
3842 ></DT
3843 ></DL
3844 ></DD
3845 ></DL
3846 ></DIV
3847 ></DIV
3848 ><DIV
3849 CLASS="CHAPTER"
3850 ><HR><H1
3851 ><A
3852 NAME="SAMBA-PDC"
3853 ></A
3854 >Chapter 6. How to Configure Samba as a NT4 Primary Domain Controller</H1
3855 ><DIV
3856 CLASS="SECT1"
3857 ><H2
3858 CLASS="SECT1"
3859 ><A
3860 NAME="AEN566"
3861 ></A
3862 >6.1. Prerequisite Reading</H2
3863 ><P
3864 >Before you continue reading in this chapter, please make sure 
3865 that you are comfortable with configuring basic files services
3866 in smb.conf and how to enable and administer password 
3867 encryption in Samba.  Theses two topics are covered in the
3868 <A
3869 HREF="smb.conf.5.html"
3870 TARGET="_top"
3871 ><TT
3872 CLASS="FILENAME"
3873 >smb.conf(5)</TT
3874 ></A
3875
3876 manpage and the <A
3877 HREF="ENCRYPTION.html"
3878 TARGET="_top"
3879 >Encryption chapter</A
3880
3881 of this HOWTO Collection.</P
3882 ></DIV
3883 ><DIV
3884 CLASS="SECT1"
3885 ><HR><H2
3886 CLASS="SECT1"
3887 ><A
3888 NAME="AEN572"
3889 ></A
3890 >6.2. Background</H2
3891 ><DIV
3892 CLASS="NOTE"
3893 ><P
3894 ></P
3895 ><TABLE
3896 CLASS="NOTE"
3897 WIDTH="100%"
3898 BORDER="0"
3899 ><TR
3900 ><TD
3901 WIDTH="25"
3902 ALIGN="CENTER"
3903 VALIGN="TOP"
3904 ><IMG
3905 SRC="/docbook-dsssl/note.gif"
3906 HSPACE="5"
3907 ALT="Note"></TD
3908 ><TD
3909 ALIGN="LEFT"
3910 VALIGN="TOP"
3911 ><P
3912 ><SPAN
3913 CLASS="emphasis"
3914 ><I
3915 CLASS="EMPHASIS"
3916 >Author's Note:</I
3917 ></SPAN
3918 > This document is a combination 
3919 of David Bannon's "Samba 2.2 PDC HOWTO" and "Samba NT Domain FAQ". 
3920 Both documents are superseded by this one.</P
3921 ></TD
3922 ></TR
3923 ></TABLE
3924 ></DIV
3925 ><P
3926 >Versions of Samba prior to release 2.2 had marginal capabilities to act
3927 as a Windows NT 4.0 Primary Domain Controller
3928
3929 (PDC).  With Samba 2.2.0, we are proud to announce official support for
3930 Windows NT 4.0-style domain logons from Windows NT 4.0 and Windows 
3931 2000 clients.  This article outlines the steps
3932 necessary for configuring Samba as a PDC.  It is necessary to have a
3933 working Samba server prior to implementing the PDC functionality.  If
3934 you have not followed the steps outlined in <A
3935 HREF="UNIX_INSTALL.html"
3936 TARGET="_top"
3937 > UNIX_INSTALL.html</A
3938 >, please make sure
3939 that your server is configured correctly before proceeding.  Another
3940 good resource in the <A
3941 HREF="smb.conf.5.html"
3942 TARGET="_top"
3943 >smb.conf(5) man
3944 page</A
3945 >. The following functionality should work in 2.2:</P
3946 ><P
3947 ></P
3948 ><UL
3949 ><LI
3950 ><P
3951 >       domain logons for Windows NT 4.0/2000 clients.
3952         </P
3953 ></LI
3954 ><LI
3955 ><P
3956 >       placing a Windows 9x client in user level security
3957         </P
3958 ></LI
3959 ><LI
3960 ><P
3961 >       retrieving a list of users and groups from a Samba PDC to
3962         Windows 9x/NT/2000 clients
3963         </P
3964 ></LI
3965 ><LI
3966 ><P
3967 >       roving (roaming) user profiles
3968         </P
3969 ></LI
3970 ><LI
3971 ><P
3972 >       Windows NT 4.0-style system policies
3973         </P
3974 ></LI
3975 ></UL
3976 ><P
3977 >The following pieces of functionality are not included in the 2.2 release:</P
3978 ><P
3979 ></P
3980 ><UL
3981 ><LI
3982 ><P
3983 >       Windows NT 4 domain trusts
3984         </P
3985 ></LI
3986 ><LI
3987 ><P
3988 >       SAM replication with Windows NT 4.0 Domain Controllers
3989         (i.e. a Samba PDC and a Windows NT BDC or vice versa) 
3990         </P
3991 ></LI
3992 ><LI
3993 ><P
3994 >       Adding users via the User Manager for Domains
3995         </P
3996 ></LI
3997 ><LI
3998 ><P
3999 >       Acting as a Windows 2000 Domain Controller (i.e. Kerberos and 
4000         Active Directory)
4001         </P
4002 ></LI
4003 ></UL
4004 ><P
4005 >Please note that Windows 9x clients are not true members of a domain
4006 for reasons outlined in this article.  Therefore the protocol for
4007 support Windows 9x-style domain logons is completely different
4008 from NT4 domain logons and has been officially supported for some 
4009 time.</P
4010 ><P
4011 >Implementing a Samba PDC can basically be divided into 2 broad
4012 steps.</P
4013 ><P
4014 ></P
4015 ><OL
4016 TYPE="1"
4017 ><LI
4018 ><P
4019 >       Configuring the Samba PDC
4020         </P
4021 ></LI
4022 ><LI
4023 ><P
4024 >       Creating machine trust accounts and joining clients 
4025         to the domain
4026         </P
4027 ></LI
4028 ></OL
4029 ><P
4030 >There are other minor details such as user profiles, system
4031 policies, etc...  However, these are not necessarily specific
4032 to a Samba PDC as much as they are related to Windows NT networking
4033 concepts.  They will be mentioned only briefly here.</P
4034 ></DIV
4035 ><DIV
4036 CLASS="SECT1"
4037 ><HR><H2
4038 CLASS="SECT1"
4039 ><A
4040 NAME="AEN611"
4041 ></A
4042 >6.3. Configuring the Samba Domain Controller</H2
4043 ><P
4044 >The first step in creating a working Samba PDC is to 
4045 understand the parameters necessary in smb.conf.  I will not
4046 attempt to re-explain the parameters here as they are more that
4047 adequately covered in <A
4048 HREF="smb.conf.5.html"
4049 TARGET="_top"
4050 > the smb.conf
4051 man page</A
4052 >.  For convenience, the parameters have been
4053 linked with the actual smb.conf description.</P
4054 ><P
4055 >Here is an example <TT
4056 CLASS="FILENAME"
4057 >smb.conf</TT
4058 > for acting as a PDC:</P
4059 ><P
4060 ><PRE
4061 CLASS="PROGRAMLISTING"
4062 >[global]
4063     ; Basic server settings
4064     <A
4065 HREF="smb.conf.5.html#NETBIOSNAME"
4066 TARGET="_top"
4067 >netbios name</A
4068 > = <TT
4069 CLASS="REPLACEABLE"
4070 ><I
4071 >POGO</I
4072 ></TT
4073 >
4074     <A
4075 HREF="smb.conf.5.html#WORKGROUP"
4076 TARGET="_top"
4077 >workgroup</A
4078 > = <TT
4079 CLASS="REPLACEABLE"
4080 ><I
4081 >NARNIA</I
4082 ></TT
4083 >
4084
4085     ; we should act as the domain and local master browser
4086     <A
4087 HREF="smb.conf.5.html#OSLEVEL"
4088 TARGET="_top"
4089 >os level</A
4090 > = 64
4091     <A
4092 HREF="smb.conf.5.html#PERFERREDMASTER"
4093 TARGET="_top"
4094 >preferred master</A
4095 > = yes
4096     <A
4097 HREF="smb.conf.5.html#DOMAINMASTER"
4098 TARGET="_top"
4099 >domain master</A
4100 > = yes
4101     <A
4102 HREF="smb.conf.5.html#LOCALMASTER"
4103 TARGET="_top"
4104 >local master</A
4105 > = yes
4106     
4107     ; security settings (must user security = user)
4108     <A
4109 HREF="smb.conf.5.html#SECURITYEQUALSUSER"
4110 TARGET="_top"
4111 >security</A
4112 > = user
4113     
4114     ; encrypted passwords are a requirement for a PDC
4115     <A
4116 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
4117 TARGET="_top"
4118 >encrypt passwords</A
4119 > = yes
4120     
4121     ; support domain logons
4122     <A
4123 HREF="smb.conf.5.html#DOMAINLOGONS"
4124 TARGET="_top"
4125 >domain logons</A
4126 > = yes
4127     
4128     ; where to store user profiles?
4129     <A
4130 HREF="smb.conf.5.html#LOGONPATH"
4131 TARGET="_top"
4132 >logon path</A
4133 > = \\%N\profiles\%u
4134     
4135     ; where is a user's home directory and where should it
4136     ; be mounted at?
4137     <A
4138 HREF="smb.conf.5.html#LOGONDRIVE"
4139 TARGET="_top"
4140 >logon drive</A
4141 > = H:
4142     <A
4143 HREF="smb.conf.5.html#LOGONHOME"
4144 TARGET="_top"
4145 >logon home</A
4146 > = \\homeserver\%u
4147     
4148     ; specify a generic logon script for all users
4149     ; this is a relative **DOS** path to the [netlogon] share
4150     <A
4151 HREF="smb.conf.5.html#LOGONSCRIPT"
4152 TARGET="_top"
4153 >logon script</A
4154 > = logon.cmd
4155
4156 ; necessary share for domain controller
4157 [netlogon]
4158     <A
4159 HREF="smb.conf.5.html#PATH"
4160 TARGET="_top"
4161 >path</A
4162 > = /usr/local/samba/lib/netlogon
4163     <A
4164 HREF="smb.conf.5.html#READONLY"
4165 TARGET="_top"
4166 >read only</A
4167 > = yes
4168     <A
4169 HREF="smb.conf.5.html#WRITELIST"
4170 TARGET="_top"
4171 >write list</A
4172 > = <TT
4173 CLASS="REPLACEABLE"
4174 ><I
4175 >ntadmin</I
4176 ></TT
4177 >
4178     
4179 ; share for storing user profiles
4180 [profiles]
4181     <A
4182 HREF="smb.conf.5.html#PATH"
4183 TARGET="_top"
4184 >path</A
4185 > = /export/smb/ntprofile
4186     <A
4187 HREF="smb.conf.5.html#READONLY"
4188 TARGET="_top"
4189 >read only</A
4190 > = no
4191     <A
4192 HREF="smb.conf.5.html#CREATEMASK"
4193 TARGET="_top"
4194 >create mask</A
4195 > = 0600
4196     <A
4197 HREF="smb.conf.5.html#DIRECTORYMASK"
4198 TARGET="_top"
4199 >directory mask</A
4200 > = 0700</PRE
4201 ></P
4202 ><P
4203 >There are a couple of points to emphasize in the above configuration.</P
4204 ><P
4205 ></P
4206 ><UL
4207 ><LI
4208 ><P
4209 >       Encrypted passwords must be enabled.  For more details on how 
4210         to do this, refer to <A
4211 HREF="ENCRYPTION.html"
4212 TARGET="_top"
4213 >ENCRYPTION.html</A
4214 >.
4215         </P
4216 ></LI
4217 ><LI
4218 ><P
4219 >       The server must support domain logons and a
4220         <TT
4221 CLASS="FILENAME"
4222 >[netlogon]</TT
4223 > share
4224         </P
4225 ></LI
4226 ><LI
4227 ><P
4228 >       The server must be the domain master browser in order for Windows 
4229         client to locate the server as a DC.  Please refer to the various 
4230         Network Browsing documentation included with this distribution for 
4231         details.
4232         </P
4233 ></LI
4234 ></UL
4235 ><P
4236 >As Samba 2.2 does not offer a complete implementation of group mapping
4237 between Windows NT groups and Unix groups (this is really quite
4238 complicated to explain in a short space), you should refer to the
4239 <A
4240 HREF="smb.conf.5.html#DOMAINADMINGROUP"
4241 TARGET="_top"
4242 >domain admin
4243 group</A
4244 > smb.conf parameter for information of creating "Domain
4245 Admins" style accounts.</P
4246 ></DIV
4247 ><DIV
4248 CLASS="SECT1"
4249 ><HR><H2
4250 CLASS="SECT1"
4251 ><A
4252 NAME="AEN654"
4253 ></A
4254 >6.4. Creating Machine Trust Accounts and Joining Clients to the
4255 Domain</H2
4256 ><P
4257 >A machine trust account is a Samba account that is used to
4258 authenticate a client machine (rather than a user) to the Samba
4259 server.  In Windows terminology, this is known as a "Computer
4260 Account."</P
4261 ><P
4262 >The password of a machine trust account acts as the shared secret for
4263 secure communication with the Domain Controller.  This is a security
4264 feature to prevent an unauthorized machine with the same NetBIOS name
4265 from joining the domain and gaining access to domain user/group
4266 accounts.  Windows NT and 2000 clients use machine trust accounts, but
4267 Windows 9x clients do not.  Hence, a Windows 9x client is never a true
4268 member of a domain because it does not possess a machine trust
4269 account, and thus has no shared secret with the domain controller.</P
4270 ><P
4271 >A Windows PDC stores each machine trust account in the Windows
4272 Registry.  A Samba PDC, however, stores each machine trust account 
4273 in two parts, as follows:
4274
4275 <P
4276 ></P
4277 ><UL
4278 ><LI
4279 ><P
4280 >A Samba account, stored in the same location as user
4281     LanMan and NT password hashes (currently
4282     <TT
4283 CLASS="FILENAME"
4284 >smbpasswd</TT
4285 >). The Samba account 
4286     possesses and uses only the NT password hash.</P
4287 ></LI
4288 ><LI
4289 ><P
4290 >A corresponding Unix account, typically stored in
4291     <TT
4292 CLASS="FILENAME"
4293 >/etc/passwd</TT
4294 >. (Future releases will alleviate the need to
4295     create <TT
4296 CLASS="FILENAME"
4297 >/etc/passwd</TT
4298 > entries.) </P
4299 ></LI
4300 ></UL
4301 ></P
4302 ><P
4303 >There are two ways to create machine trust accounts:</P
4304 ><P
4305 ></P
4306 ><UL
4307 ><LI
4308 ><P
4309 > Manual creation. Both the Samba and corresponding
4310         Unix account are created by hand.</P
4311 ></LI
4312 ><LI
4313 ><P
4314 > "On-the-fly" creation. The Samba machine trust
4315         account is automatically created by Samba at the time the client
4316         is joined to the domain. (For security, this is the
4317         recommended method.) The corresponding Unix account may be
4318         created automatically or manually. </P
4319 ></LI
4320 ></UL
4321 ><DIV
4322 CLASS="SECT2"
4323 ><HR><H3
4324 CLASS="SECT2"
4325 ><A
4326 NAME="AEN673"
4327 ></A
4328 >6.4.1. Manual Creation of Machine Trust Accounts</H3
4329 ><P
4330 >The first step in manually creating a machine trust account is to
4331 manually create the corresponding Unix account in
4332 <TT
4333 CLASS="FILENAME"
4334 >/etc/passwd</TT
4335 >.  This can be done using
4336 <B
4337 CLASS="COMMAND"
4338 >vipw</B
4339 > or other 'add user' command that is normally
4340 used to create new Unix accounts.  The following is an example for a
4341 Linux based Samba server:</P
4342 ><P
4343 >  <TT
4344 CLASS="PROMPT"
4345 >root# </TT
4346 ><B
4347 CLASS="COMMAND"
4348 >/usr/sbin/useradd -g 100 -d /dev/null -c <TT
4349 CLASS="REPLACEABLE"
4350 ><I
4351 >"machine 
4352 nickname"</I
4353 ></TT
4354 > -s /bin/false <TT
4355 CLASS="REPLACEABLE"
4356 ><I
4357 >machine_name</I
4358 ></TT
4359 >$ </B
4360 ></P
4361 ><P
4362 ><TT
4363 CLASS="PROMPT"
4364 >root# </TT
4365 ><B
4366 CLASS="COMMAND"
4367 >passwd -l <TT
4368 CLASS="REPLACEABLE"
4369 ><I
4370 >machine_name</I
4371 ></TT
4372 >$</B
4373 ></P
4374 ><P
4375 >On *BSD systems, this can be done using the 'chpass' utility:</P
4376 ><P
4377 ><TT
4378 CLASS="PROMPT"
4379 >root# </TT
4380 ><B
4381 CLASS="COMMAND"
4382 >chpass -a "<TT
4383 CLASS="REPLACEABLE"
4384 ><I
4385 >machine_name</I
4386 ></TT
4387 >$:*:101:100::0:0:Workstation <TT
4388 CLASS="REPLACEABLE"
4389 ><I
4390 >machine_name</I
4391 ></TT
4392 >:/dev/null:/sbin/nologin"</B
4393 ></P
4394 ><P
4395 >The <TT
4396 CLASS="FILENAME"
4397 >/etc/passwd</TT
4398 > entry will list the machine name 
4399 with a "$" appended, won't have a password, will have a null shell and no 
4400 home directory. For example a machine named 'doppy' would have an 
4401 <TT
4402 CLASS="FILENAME"
4403 >/etc/passwd</TT
4404 > entry like this:</P
4405 ><P
4406 ><PRE
4407 CLASS="PROGRAMLISTING"
4408 >doppy$:x:505:501:<TT
4409 CLASS="REPLACEABLE"
4410 ><I
4411 >machine_nickname</I
4412 ></TT
4413 >:/dev/null:/bin/false</PRE
4414 ></P
4415 ><P
4416 >Above, <TT
4417 CLASS="REPLACEABLE"
4418 ><I
4419 >machine_nickname</I
4420 ></TT
4421 > can be any
4422 descriptive name for the client, i.e., BasementComputer.
4423 <TT
4424 CLASS="REPLACEABLE"
4425 ><I
4426 >machine_name</I
4427 ></TT
4428 > absolutely must be the NetBIOS
4429 name of the client to be joined to the domain.  The "$" must be
4430 appended to the NetBIOS name of the client or Samba will not recognize
4431 this as a machine trust account.</P
4432 ><P
4433 >Now that the corresponding Unix account has been created, the next step is to create 
4434 the Samba account for the client containing the well-known initial 
4435 machine trust account password.  This can be done using the <A
4436 HREF="smbpasswd.8.html"
4437 TARGET="_top"
4438 ><B
4439 CLASS="COMMAND"
4440 >smbpasswd(8)</B
4441 ></A
4442 > command 
4443 as shown here:</P
4444 ><P
4445 ><TT
4446 CLASS="PROMPT"
4447 >root# </TT
4448 ><B
4449 CLASS="COMMAND"
4450 >smbpasswd -a -m <TT
4451 CLASS="REPLACEABLE"
4452 ><I
4453 >machine_name</I
4454 ></TT
4455 ></B
4456 ></P
4457 ><P
4458 >where <TT
4459 CLASS="REPLACEABLE"
4460 ><I
4461 >machine_name</I
4462 ></TT
4463 > is the machine's NetBIOS
4464 name.  The RID of the new machine account is generated from the UID of 
4465 the corresponding Unix account.</P
4466 ><DIV
4467 CLASS="WARNING"
4468 ><P
4469 ></P
4470 ><TABLE
4471 CLASS="WARNING"
4472 WIDTH="100%"
4473 BORDER="0"
4474 ><TR
4475 ><TD
4476 WIDTH="25"
4477 ALIGN="CENTER"
4478 VALIGN="TOP"
4479 ><IMG
4480 SRC="/docbook-dsssl/warning.gif"
4481 HSPACE="5"
4482 ALT="Warning"></TD
4483 ><TH
4484 ALIGN="LEFT"
4485 VALIGN="CENTER"
4486 ><B
4487 >Join the client to the domain immediately</B
4488 ></TH
4489 ></TR
4490 ><TR
4491 ><TD
4492 >&nbsp;</TD
4493 ><TD
4494 ALIGN="LEFT"
4495 VALIGN="TOP"
4496 ><P
4497 >       Manually creating a machine trust account using this method is the 
4498         equivalent of creating a machine trust account on a Windows NT PDC using 
4499         the "Server Manager".  From the time at which the account is created
4500         to the time which the client joins the domain and changes the password,
4501         your domain is vulnerable to an intruder joining your domain using a
4502         a machine with the same NetBIOS name.  A PDC inherently trusts
4503         members of the domain and will serve out a large degree of user 
4504         information to such clients.  You have been warned!
4505         </P
4506 ></TD
4507 ></TR
4508 ></TABLE
4509 ></DIV
4510 ></DIV
4511 ><DIV
4512 CLASS="SECT2"
4513 ><HR><H3
4514 CLASS="SECT2"
4515 ><A
4516 NAME="AEN714"
4517 ></A
4518 >6.4.2. "On-the-Fly" Creation of Machine Trust Accounts</H3
4519 ><P
4520 >The second (and recommended) way of creating machine trust accounts is
4521 simply to allow the Samba server to create them as needed when the client
4522 is joined to the domain. </P
4523 ><P
4524 >Since each Samba machine trust account requires a corresponding
4525 Unix account, a method for automatically creating the
4526 Unix account is usually supplied; this requires configuration of the
4527 <A
4528 HREF="smb.conf.5.html#ADDUSERSCRIPT"
4529 TARGET="_top"
4530 >add user script</A
4531
4532 option in <TT
4533 CLASS="FILENAME"
4534 >smb.conf</TT
4535 >.  This
4536 method is not required, however; corresponding Unix accounts may also
4537 be created manually.</P
4538 ><P
4539 >Below is an example for a RedHat 6.2 Linux system.</P
4540 ><P
4541 ><PRE
4542 CLASS="PROGRAMLISTING"
4543 >[global]
4544    # &#60;...remainder of parameters...&#62;
4545    add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u </PRE
4546 ></P
4547 ></DIV
4548 ><DIV
4549 CLASS="SECT2"
4550 ><HR><H3
4551 CLASS="SECT2"
4552 ><A
4553 NAME="AEN723"
4554 ></A
4555 >6.4.3. Joining the Client to the Domain</H3
4556 ><P
4557 >The procedure for joining a client to the domain varies with the
4558 version of Windows.</P
4559 ><P
4560 ></P
4561 ><UL
4562 ><LI
4563 ><P
4564 ><SPAN
4565 CLASS="emphasis"
4566 ><I
4567 CLASS="EMPHASIS"
4568 >Windows 2000</I
4569 ></SPAN
4570 ></P
4571 ><P
4572 > When the user elects to join the client to a domain, Windows prompts for
4573         an account and password that is privileged to join the domain.  A
4574         Samba administrative account (i.e., a Samba account that has root
4575         privileges on the Samba server) must be entered here; the
4576         operation will fail if an ordinary user account is given. 
4577         The password for this account should be
4578         set to a different password than the associated
4579         <TT
4580 CLASS="FILENAME"
4581 >/etc/passwd</TT
4582 > entry, for security
4583         reasons. </P
4584 ><P
4585 >The session key of the Samba administrative account acts as an
4586         encryption key for setting the password of the machine trust
4587         account. The machine trust account will be created on-the-fly, or
4588         updated if it already exists.</P
4589 ></LI
4590 ><LI
4591 ><P
4592 ><SPAN
4593 CLASS="emphasis"
4594 ><I
4595 CLASS="EMPHASIS"
4596 >Windows NT</I
4597 ></SPAN
4598 ></P
4599 ><P
4600 > If the machine trust account was created manually, on the
4601         Identification Changes menu enter the domain name, but do not
4602         check the box "Create a Computer Account in the Domain."  In this case,
4603         the existing machine trust account is used to join the machine to
4604         the domain.</P
4605 ><P
4606 > If the machine trust account is to be created
4607         on-the-fly, on the Identification Changes menu enter the domain
4608         name, and check the box "Create a Computer Account in the Domain."  In
4609         this case, joining the domain proceeds as above for Windows 2000
4610         (i.e., you must supply a Samba administrative account when
4611         prompted).</P
4612 ></LI
4613 ></UL
4614 ></DIV
4615 ></DIV
4616 ><DIV
4617 CLASS="SECT1"
4618 ><HR><H2
4619 CLASS="SECT1"
4620 ><A
4621 NAME="AEN738"
4622 ></A
4623 >6.5. Common Problems and Errors</H2
4624 ><P
4625 ></P
4626 ><P
4627 ></P
4628 ><UL
4629 ><LI
4630 ><P
4631 >       <SPAN
4632 CLASS="emphasis"
4633 ><I
4634 CLASS="EMPHASIS"
4635 >I cannot include a '$' in a machine name.</I
4636 ></SPAN
4637 >
4638         </P
4639 ><P
4640 >       A 'machine name' in (typically) <TT
4641 CLASS="FILENAME"
4642 >/etc/passwd</TT
4643 >       
4644         of the machine name with a '$' appended. FreeBSD (and other BSD 
4645         systems?) won't create a user with a '$' in their name.
4646         </P
4647 ><P
4648 >       The problem is only in the program used to make the entry, once 
4649         made, it works perfectly. So create a user without the '$' and 
4650         use <B
4651 CLASS="COMMAND"
4652 >vipw</B
4653 > to edit the entry, adding the '$'. Or create 
4654         the whole entry with vipw if you like, make sure you use a 
4655         unique User ID !
4656         </P
4657 ></LI
4658 ><LI
4659 ><P
4660 >       <SPAN
4661 CLASS="emphasis"
4662 ><I
4663 CLASS="EMPHASIS"
4664 >I get told "You already have a connection to the Domain...." 
4665         or "Cannot join domain, the credentials supplied conflict with an 
4666         existing set.." when creating a machine trust account.</I
4667 ></SPAN
4668 >
4669         </P
4670 ><P
4671 >       This happens if you try to create a machine trust account from the 
4672         machine itself and already have a connection (e.g. mapped drive) 
4673         to a share (or IPC$) on the Samba PDC.  The following command
4674         will remove all network drive connections:
4675         </P
4676 ><P
4677 >       <TT
4678 CLASS="PROMPT"
4679 >C:\WINNT\&#62;</TT
4680 > <B
4681 CLASS="COMMAND"
4682 >net use * /d</B
4683 >
4684         </P
4685 ><P
4686 >       Further, if the machine is a already a 'member of a workgroup' that 
4687         is the same name as the domain you are joining (bad idea) you will 
4688         get this message.  Change the workgroup name to something else, it 
4689         does not matter what, reboot, and try again.
4690         </P
4691 ></LI
4692 ><LI
4693 ><P
4694 >       <SPAN
4695 CLASS="emphasis"
4696 ><I
4697 CLASS="EMPHASIS"
4698 >The system can not log you on (C000019B)....</I
4699 ></SPAN
4700 >
4701         </P
4702 ><P
4703 >I joined the domain successfully but after upgrading 
4704         to a newer version of the Samba code I get the message, "The system 
4705         can not log you on (C000019B), Please try a gain or consult your 
4706         system administrator" when attempting to logon.
4707         </P
4708 ><P
4709 >       This occurs when the domain SID stored in 
4710         <TT
4711 CLASS="FILENAME"
4712 >private/WORKGROUP.SID</TT
4713 > is 
4714         changed.  For example, you remove the file and <B
4715 CLASS="COMMAND"
4716 >smbd</B
4717 > automatically 
4718         creates a new one.  Or you are swapping back and forth between 
4719         versions 2.0.7, TNG and the HEAD branch code (not recommended).  The 
4720         only way to correct the problem is to restore the original domain 
4721         SID or remove the domain client from the domain and rejoin.
4722         </P
4723 ></LI
4724 ><LI
4725 ><P
4726 >       <SPAN
4727 CLASS="emphasis"
4728 ><I
4729 CLASS="EMPHASIS"
4730 >The machine trust account for this computer either does not 
4731         exist or is not accessible.</I
4732 ></SPAN
4733 >
4734         </P
4735 ><P
4736 >       When I try to join the domain I get the message "The machine account 
4737         for this computer either does not exist or is not accessible". What's 
4738         wrong?
4739         </P
4740 ><P
4741 >       This problem is caused by the PDC not having a suitable machine trust account. 
4742         If you are using the <TT
4743 CLASS="PARAMETER"
4744 ><I
4745 >add user script</I
4746 ></TT
4747 > method to create 
4748         accounts then this would indicate that it has not worked. Ensure the domain 
4749         admin user system is working.
4750         </P
4751 ><P
4752 >       Alternatively if you are creating account entries manually then they 
4753         have not been created correctly. Make sure that you have the entry 
4754         correct for the machine trust account in smbpasswd file on the Samba PDC. 
4755         If you added the account using an editor rather than using the smbpasswd 
4756         utility, make sure that the account name is the machine NetBIOS name 
4757         with a '$' appended to it ( i.e. computer_name$ ). There must be an entry 
4758         in both /etc/passwd and the smbpasswd file. Some people have reported 
4759         that inconsistent subnet masks between the Samba server and the NT 
4760         client have caused this problem.   Make sure that these are consistent 
4761         for both client and server.
4762         </P
4763 ></LI
4764 ><LI
4765 ><P
4766 >       <SPAN
4767 CLASS="emphasis"
4768 ><I
4769 CLASS="EMPHASIS"
4770 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
4771         I get a message about my account being disabled.</I
4772 ></SPAN
4773 >
4774         </P
4775 ><P
4776 >       This problem is caused by a PAM related bug in Samba 2.2.0.  This bug is 
4777         fixed in 2.2.1.  Other symptoms could be unaccessible shares on 
4778         NT/W2K member servers in the domain or the following error in your smbd.log:
4779         passdb/pampass.c:pam_account(268) PAM: UNKNOWN ERROR for User: %user%
4780         </P
4781 ><P
4782 >       At first be ensure to enable the useraccounts with <B
4783 CLASS="COMMAND"
4784 >smbpasswd -e 
4785         %user%</B
4786 >, this is normally done, when you create an account.
4787         </P
4788 ><P
4789 >       In order to work around this problem in 2.2.0, configure the 
4790         <TT
4791 CLASS="PARAMETER"
4792 ><I
4793 >account</I
4794 ></TT
4795 > control flag in 
4796         <TT
4797 CLASS="FILENAME"
4798 >/etc/pam.d/samba</TT
4799 > file as follows:
4800         </P
4801 ><P
4802 ><PRE
4803 CLASS="PROGRAMLISTING"
4804 >       account required        pam_permit.so
4805         </PRE
4806 ></P
4807 ><P
4808 >       If you want to remain backward compatibility to samba 2.0.x use
4809         <TT
4810 CLASS="FILENAME"
4811 >pam_permit.so</TT
4812 >, it's also possible to use 
4813         <TT
4814 CLASS="FILENAME"
4815 >pam_pwdb.so</TT
4816 >. There are some bugs if you try to 
4817         use <TT
4818 CLASS="FILENAME"
4819 >pam_unix.so</TT
4820 >, if you need this, be ensure to use
4821         the most recent version of this file.
4822         </P
4823 ></LI
4824 ></UL
4825 ></DIV
4826 ><DIV
4827 CLASS="SECT1"
4828 ><HR><H2
4829 CLASS="SECT1"
4830 ><A
4831 NAME="AEN786"
4832 ></A
4833 >6.6. System Policies and Profiles</H2
4834 ><P
4835 >Much of the information necessary to implement System Policies and
4836 Roving User Profiles in a Samba domain is the same as that for 
4837 implementing these same items in a Windows NT 4.0 domain. 
4838 You should read the white paper <A
4839 HREF="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp"
4840 TARGET="_top"
4841 >Implementing
4842 Profiles and Policies in Windows NT 4.0</A
4843 > available from Microsoft.</P
4844 ><P
4845 >Here are some additional details:</P
4846 ><P
4847 ></P
4848 ><UL
4849 ><LI
4850 ><P
4851 >       <SPAN
4852 CLASS="emphasis"
4853 ><I
4854 CLASS="EMPHASIS"
4855 >What about Windows NT Policy Editor?</I
4856 ></SPAN
4857 >
4858         </P
4859 ><P
4860 >       To create or edit <TT
4861 CLASS="FILENAME"
4862 >ntconfig.pol</TT
4863 > you must use 
4864         the NT Server Policy Editor, <B
4865 CLASS="COMMAND"
4866 >poledit.exe</B
4867 >       which 
4868         is included with NT Server but <SPAN
4869 CLASS="emphasis"
4870 ><I
4871 CLASS="EMPHASIS"
4872 >not NT Workstation</I
4873 ></SPAN
4874 >. 
4875         There is a Policy Editor on a NTws 
4876         but it is not suitable for creating <SPAN
4877 CLASS="emphasis"
4878 ><I
4879 CLASS="EMPHASIS"
4880 >Domain Policies</I
4881 ></SPAN
4882 >. 
4883         Further, although the Windows 95 
4884         Policy Editor can be installed on an NT Workstation/Server, it will not
4885         work with NT policies because the registry key that are set by the policy templates. 
4886         However, the files from the NT Server will run happily enough on an NTws.       
4887         You need <TT
4888 CLASS="FILENAME"
4889 >poledit.exe, common.adm</TT
4890 > and <TT
4891 CLASS="FILENAME"
4892 >winnt.adm</TT
4893 >. It is convenient
4894         to put the two *.adm files in <TT
4895 CLASS="FILENAME"
4896 >c:\winnt\inf</TT
4897 > which is where
4898         the binary will look for them unless told otherwise. Note also that that 
4899         directory is 'hidden'.
4900         </P
4901 ><P
4902 >       The Windows NT policy editor is also included with the Service Pack 3 (and 
4903         later) for Windows NT 4.0. Extract the files using <B
4904 CLASS="COMMAND"
4905 >servicepackname /x</B
4906 >, 
4907         i.e. that's <B
4908 CLASS="COMMAND"
4909 >Nt4sp6ai.exe /x</B
4910 > for service pack 6a.  The policy editor, 
4911         <B
4912 CLASS="COMMAND"
4913 >poledit.exe</B
4914 > and the associated template files (*.adm) should
4915         be extracted as well.  It is also possible to downloaded the policy template 
4916         files for Office97 and get a copy of the policy editor.  Another possible 
4917         location is with the Zero Administration Kit available for download from Microsoft.
4918         </P
4919 ></LI
4920 ><LI
4921 ><P
4922 >       <SPAN
4923 CLASS="emphasis"
4924 ><I
4925 CLASS="EMPHASIS"
4926 >Can Win95 do Policies?</I
4927 ></SPAN
4928 >
4929         </P
4930 ><P
4931 >       Install the group policy handler for Win9x to pick up group 
4932         policies.   Look on the Win98 CD in <TT
4933 CLASS="FILENAME"
4934 >\tools\reskit\netadmin\poledit</TT
4935 >. 
4936         Install group policies on a Win9x client by double-clicking 
4937         <TT
4938 CLASS="FILENAME"
4939 >grouppol.inf</TT
4940 >. Log off and on again a couple of 
4941         times and see if Win98 picks up group policies.  Unfortunately this needs 
4942         to be done on every Win9x machine that uses group policies....
4943         </P
4944 ><P
4945 >       If group policies don't work one reports suggests getting the updated 
4946         (read: working) grouppol.dll for Windows 9x. The group list is grabbed 
4947         from /etc/group.
4948         </P
4949 ></LI
4950 ><LI
4951 ><P
4952 >       <SPAN
4953 CLASS="emphasis"
4954 ><I
4955 CLASS="EMPHASIS"
4956 >How do I get 'User Manager' and 'Server Manager'</I
4957 ></SPAN
4958 >
4959         </P
4960 ><P
4961 >       Since I don't need to buy an NT Server CD now, how do I get 
4962         the 'User Manager for Domains', the 'Server Manager'?
4963         </P
4964 ><P
4965 >       Microsoft distributes a version of these tools called nexus for 
4966         installation on Windows 95 systems.  The tools set includes
4967         </P
4968 ><P
4969 ></P
4970 ><UL
4971 ><LI
4972 ><P
4973 >Server Manager</P
4974 ></LI
4975 ><LI
4976 ><P
4977 >User Manager for Domains</P
4978 ></LI
4979 ><LI
4980 ><P
4981 >Event Viewer</P
4982 ></LI
4983 ></UL
4984 ><P
4985 >       Click here to download the archived file <A
4986 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE"
4987 TARGET="_top"
4988 >ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</A
4989 >
4990         </P
4991 ><P
4992 >       The Windows NT 4.0 version of the 'User Manager for 
4993         Domains' and 'Server Manager' are available from Microsoft via ftp 
4994         from <A
4995 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE"
4996 TARGET="_top"
4997 >ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</A
4998 >
4999         </P
5000 ></LI
5001 ></UL
5002 ></DIV
5003 ><DIV
5004 CLASS="SECT1"
5005 ><HR><H2
5006 CLASS="SECT1"
5007 ><A
5008 NAME="AEN830"
5009 ></A
5010 >6.7. What other help can I get?</H2
5011 ><P
5012 >There are many sources of information available in the form 
5013 of mailing lists, RFC's and documentation.  The docs that come 
5014 with the samba distribution contain very good explanations of 
5015 general SMB topics such as browsing.</P
5016 ><P
5017 ></P
5018 ><UL
5019 ><LI
5020 ><P
5021 >       <SPAN
5022 CLASS="emphasis"
5023 ><I
5024 CLASS="EMPHASIS"
5025 >What are some diagnostics tools I can use to debug the domain logon 
5026         process and where can I find them?</I
5027 ></SPAN
5028 >
5029         </P
5030 ><P
5031 >       One of the best diagnostic tools for debugging problems is Samba itself.  
5032         You can use the -d option for both smbd and nmbd to specify what 
5033         'debug level' at which to run.  See the man pages on smbd, nmbd  and 
5034         smb.conf for more information on debugging options.  The debug 
5035         level can range from 1 (the default) to 10 (100 for debugging passwords).
5036         </P
5037 ><P
5038 >       Another helpful method of debugging is to compile samba using the 
5039         <B
5040 CLASS="COMMAND"
5041 >gcc -g </B
5042 > flag.   This will include debug 
5043         information in the binaries and allow you to attach gdb to the 
5044         running smbd / nmbd process.  In order to attach gdb to an smbd 
5045         process for an NT workstation, first get the workstation to make the 
5046         connection. Pressing ctrl-alt-delete and going down to the domain box 
5047         is sufficient (at least, on the first time you join the domain) to 
5048         generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation 
5049         maintains an open connection, and therefore there will be an smbd 
5050         process running (assuming that you haven't set a really short smbd 
5051         idle timeout)  So, in between pressing ctrl alt delete, and actually 
5052         typing in your password, you can gdb attach and continue.
5053         </P
5054 ><P
5055 >       Some useful samba commands worth investigating:
5056         </P
5057 ><P
5058 ></P
5059 ><UL
5060 ><LI
5061 ><P
5062 >testparam | more</P
5063 ></LI
5064 ><LI
5065 ><P
5066 >smbclient -L //{netbios name of server}</P
5067 ></LI
5068 ></UL
5069 ><P
5070 >       An SMB enabled version of tcpdump is available from 
5071         <A
5072 HREF="http://www.tcpdump.org/"
5073 TARGET="_top"
5074 >http://www.tcpdup.org/</A
5075 >.
5076         Ethereal, another good packet sniffer for Unix and Win32
5077         hosts, can be downloaded from <A
5078 HREF="http://www.ethereal.com/"
5079 TARGET="_top"
5080 >http://www.ethereal.com</A
5081 >.
5082         </P
5083 ><P
5084 >       For tracing things on the Microsoft Windows NT, Network Monitor 
5085         (aka. netmon) is available on the Microsoft Developer Network CD's, 
5086         the Windows NT Server install CD and the SMS CD's.  The version of 
5087         netmon that ships with SMS allows for dumping packets between any two 
5088         computers (i.e. placing the network interface in promiscuous mode).  
5089         The version on the NT Server install CD will only allow monitoring 
5090         of network traffic directed to the local NT box and broadcasts on the 
5091         local subnet.  Be aware that Ethereal can read and write netmon 
5092         formatted files.
5093         </P
5094 ></LI
5095 ><LI
5096 ><P
5097 >       <SPAN
5098 CLASS="emphasis"
5099 ><I
5100 CLASS="EMPHASIS"
5101 >How do I install 'Network Monitor' on an NT Workstation 
5102         or a Windows 9x box?</I
5103 ></SPAN
5104 >
5105         </P
5106 ><P
5107 >       Installing netmon on an NT workstation requires a couple 
5108         of steps.  The following are for installing Netmon V4.00.349, which comes 
5109         with Microsoft Windows NT Server 4.0, on Microsoft Windows NT 
5110         Workstation 4.0.  The process should be similar for other version of 
5111         Windows NT / Netmon.  You will need both the Microsoft Windows 
5112         NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
5113         </P
5114 ><P
5115 >       Initially you will need to install 'Network Monitor Tools and Agent' 
5116         on the NT Server.  To do this 
5117         </P
5118 ><P
5119 ></P
5120 ><UL
5121 ><LI
5122 ><P
5123 >Goto Start - Settings - Control Panel - 
5124                 Network - Services - Add </P
5125 ></LI
5126 ><LI
5127 ><P
5128 >Select the 'Network Monitor Tools and Agent' and 
5129                 click on 'OK'.</P
5130 ></LI
5131 ><LI
5132 ><P
5133 >Click 'OK' on the Network Control Panel.
5134                 </P
5135 ></LI
5136 ><LI
5137 ><P
5138 >Insert the Windows NT Server 4.0 install CD 
5139                 when prompted.</P
5140 ></LI
5141 ></UL
5142 ><P
5143 >       At this point the Netmon files should exist in 
5144         <TT
5145 CLASS="FILENAME"
5146 >%SYSTEMROOT%\System32\netmon\*.*</TT
5147 >.    
5148         Two subdirectories exist as well, <TT
5149 CLASS="FILENAME"
5150 >parsers\</TT
5151
5152         which contains the necessary DLL's for parsing the netmon packet 
5153         dump, and <TT
5154 CLASS="FILENAME"
5155 >captures\</TT
5156 >.
5157         </P
5158 ><P
5159 >       In order to install the Netmon tools on an NT Workstation, you will 
5160         first need to install the 'Network  Monitor Agent' from the Workstation 
5161         install CD.
5162         </P
5163 ><P
5164 ></P
5165 ><UL
5166 ><LI
5167 ><P
5168 >Goto Start - Settings - Control Panel - 
5169                 Network - Services - Add</P
5170 ></LI
5171 ><LI
5172 ><P
5173 >Select the 'Network Monitor Agent' and click 
5174                 on 'OK'.</P
5175 ></LI
5176 ><LI
5177 ><P
5178 >Click 'OK' on the Network Control Panel.
5179                 </P
5180 ></LI
5181 ><LI
5182 ><P
5183 >Insert the Windows NT Workstation 4.0 install 
5184                 CD when prompted.</P
5185 ></LI
5186 ></UL
5187 ><P
5188 >       Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.* 
5189         to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set 
5190         permissions as  you deem appropriate for your site. You will need 
5191         administrative rights on the NT box to run netmon.
5192         </P
5193 ><P
5194 >       To install Netmon on a Windows 9x box install the network monitor agent 
5195         from the Windows 9x CD (\admin\nettools\netmon).  There is a readme 
5196         file located with the netmon driver files on the CD if you need 
5197         information on how to do this.  Copy the files from a working 
5198         Netmon installation.
5199         </P
5200 ></LI
5201 ><LI
5202 ><P
5203 >       The following is a list if helpful URLs and other links:
5204         </P
5205 ><P
5206 ></P
5207 ><UL
5208 ><LI
5209 ><P
5210 >Home of Samba site <A
5211 HREF="http://samba.org"
5212 TARGET="_top"
5213 >        http://samba.org</A
5214 >. We have a mirror near you !</P
5215 ></LI
5216 ><LI
5217 ><P
5218 > The <SPAN
5219 CLASS="emphasis"
5220 ><I
5221 CLASS="EMPHASIS"
5222 >Development</I
5223 ></SPAN
5224 > document 
5225         on the Samba mirrors might mention your problem. If so,
5226         it might mean that the developers are working on it.</P
5227 ></LI
5228 ><LI
5229 ><P
5230 >See how Scott Merrill simulates a BDC behavior at 
5231         <A
5232 HREF="http://www.skippy.net/linux/smb-howto.html"
5233 TARGET="_top"
5234 >        http://www.skippy.net/linux/smb-howto.html</A
5235 >. </P
5236 ></LI
5237 ><LI
5238 ><P
5239 >Although 2.0.7 has almost had its day as a PDC, David Bannon will
5240         keep the 2.0.7 PDC pages at <A
5241 HREF="http://bioserve.latrobe.edu.au/samba"
5242 TARGET="_top"
5243 >        http://bioserve.latrobe.edu.au/samba</A
5244 > going for a while yet.</P
5245 ></LI
5246 ><LI
5247 ><P
5248 >Misc links to CIFS information 
5249         <A
5250 HREF="http://samba.org/cifs/"
5251 TARGET="_top"
5252 >http://samba.org/cifs/</A
5253 ></P
5254 ></LI
5255 ><LI
5256 ><P
5257 >NT Domains for Unix <A
5258 HREF="http://mailhost.cb1.com/~lkcl/ntdom/"
5259 TARGET="_top"
5260 >        http://mailhost.cb1.com/~lkcl/ntdom/</A
5261 ></P
5262 ></LI
5263 ><LI
5264 ><P
5265 >FTP site for older SMB specs: 
5266         <A
5267 HREF="ftp://ftp.microsoft.com/developr/drg/CIFS/"
5268 TARGET="_top"
5269 >        ftp://ftp.microsoft.com/developr/drg/CIFS/</A
5270 ></P
5271 ></LI
5272 ></UL
5273 ></LI
5274 ></UL
5275 ><P
5276 ></P
5277 ><UL
5278 ><LI
5279 ><P
5280 >       <SPAN
5281 CLASS="emphasis"
5282 ><I
5283 CLASS="EMPHASIS"
5284 >How do I get help from the mailing lists?</I
5285 ></SPAN
5286 >
5287         </P
5288 ><P
5289 >       There are a number of Samba related mailing lists. Go to <A
5290 HREF="http://samba.org"
5291 TARGET="_top"
5292 >http://samba.org</A
5293 >, click on your nearest mirror
5294         and then click on <B
5295 CLASS="COMMAND"
5296 >Support</B
5297 > and then click on <B
5298 CLASS="COMMAND"
5299 >       Samba related mailing lists</B
5300 >.
5301         </P
5302 ><P
5303 >       For questions relating to Samba TNG go to
5304         <A
5305 HREF="http://www.samba-tng.org/"
5306 TARGET="_top"
5307 >http://www.samba-tng.org/</A
5308
5309         It has been requested that you don't post questions about Samba-TNG to the
5310         main stream Samba lists.</P
5311 ><P
5312 >       If you post a message to one of the lists please observe the following guide lines :
5313         </P
5314 ><P
5315 ></P
5316 ><UL
5317 ><LI
5318 ><P
5319 > Always remember that the developers are volunteers, they are 
5320                 not paid and they never guarantee to produce a particular feature at 
5321                 a particular time. Any time lines are 'best guess' and nothing more.
5322                 </P
5323 ></LI
5324 ><LI
5325 ><P
5326 > Always mention what version of samba you are using and what 
5327                 operating system its running under. You should probably list the
5328         relevant sections of your smb.conf file, at least the options 
5329         in [global] that affect PDC support.</P
5330 ></LI
5331 ><LI
5332 ><P
5333 >In addition to the version, if you obtained Samba via
5334         CVS mention the date when you last checked it out.</P
5335 ></LI
5336 ><LI
5337 ><P
5338 > Try and make your question clear and brief, lots of long, 
5339                 convoluted questions get deleted before they are completely read ! 
5340                 Don't post html encoded messages (if you can select colour or font 
5341                 size its html).</P
5342 ></LI
5343 ><LI
5344 ><P
5345 > If you run one of those nifty 'I'm on holidays' things when 
5346                 you are away, make sure its configured  to not answer mailing lists.
5347                 </P
5348 ></LI
5349 ><LI
5350 ><P
5351 > Don't cross post. Work out which is the best list to post to 
5352                 and see what happens, i.e. don't post to both samba-ntdom and samba-technical.
5353         Many people active on the lists subscribe to more 
5354                 than one list and get annoyed to see the same message two or more times. 
5355                 Often someone will see a message and thinking it would be better dealt 
5356                 with on another, will forward it on for you.</P
5357 ></LI
5358 ><LI
5359 ><P
5360 >You might include <SPAN
5361 CLASS="emphasis"
5362 ><I
5363 CLASS="EMPHASIS"
5364 >partial</I
5365 ></SPAN
5366 >
5367         log files written at a debug level set to as much as 20.  
5368         Please don't send the entire log but enough to give the context of the 
5369         error messages.</P
5370 ></LI
5371 ><LI
5372 ><P
5373 >(Possibly) If you have a complete netmon trace ( from the opening of 
5374         the pipe to the error ) you can send the *.CAP file as well.</P
5375 ></LI
5376 ><LI
5377 ><P
5378 >Please think carefully before attaching a document to an email.
5379         Consider pasting the relevant parts into the body of the message. The samba
5380         mailing lists go to a huge number of people, do they all need a copy of your 
5381         smb.conf in their attach directory?</P
5382 ></LI
5383 ></UL
5384 ></LI
5385 ><LI
5386 ><P
5387 >       <SPAN
5388 CLASS="emphasis"
5389 ><I
5390 CLASS="EMPHASIS"
5391 >How do I get off the mailing lists?</I
5392 ></SPAN
5393 >
5394         </P
5395 ><P
5396 >To have your name removed from a samba mailing list, go to the
5397         same place you went to to get on it. Go to <A
5398 HREF="http://lists.samba.org/"
5399 TARGET="_top"
5400 >http://lists.samba.org</A
5401 >, 
5402         click on your nearest mirror and then click on <B
5403 CLASS="COMMAND"
5404 >Support</B
5405 > and 
5406         then click on <B
5407 CLASS="COMMAND"
5408 > Samba related mailing lists</B
5409 >. Or perhaps see 
5410         <A
5411 HREF="http://lists.samba.org/mailman/roster/samba-ntdom"
5412 TARGET="_top"
5413 >here</A
5414 >
5415         </P
5416 ><P
5417 >       Please don't post messages to the list asking to be removed, you will just
5418         be referred to the above address (unless that process failed in some way...)
5419         </P
5420 ></LI
5421 ></UL
5422 ></DIV
5423 ><DIV
5424 CLASS="SECT1"
5425 ><HR><H2
5426 CLASS="SECT1"
5427 ><A
5428 NAME="AEN944"
5429 ></A
5430 >6.8. Domain Control for Windows 9x/ME</H2
5431 ><DIV
5432 CLASS="NOTE"
5433 ><P
5434 ></P
5435 ><TABLE
5436 CLASS="NOTE"
5437 WIDTH="100%"
5438 BORDER="0"
5439 ><TR
5440 ><TD
5441 WIDTH="25"
5442 ALIGN="CENTER"
5443 VALIGN="TOP"
5444 ><IMG
5445 SRC="/docbook-dsssl/note.gif"
5446 HSPACE="5"
5447 ALT="Note"></TD
5448 ><TD
5449 ALIGN="LEFT"
5450 VALIGN="TOP"
5451 ><P
5452 >The following section contains much of the original 
5453 DOMAIN.txt file previously included with Samba.  Much of 
5454 the material is based on what went into the book <SPAN
5455 CLASS="emphasis"
5456 ><I
5457 CLASS="EMPHASIS"
5458 >Special 
5459 Edition, Using Samba</I
5460 ></SPAN
5461 >, by Richard Sharpe.</P
5462 ></TD
5463 ></TR
5464 ></TABLE
5465 ></DIV
5466 ><P
5467 >A domain and a workgroup are exactly the same thing in terms of network
5468 browsing.  The difference is that a distributable authentication
5469 database is associated with a domain, for secure login access to a
5470 network.  Also, different access rights can be granted to users if they
5471 successfully authenticate against a domain logon server (NT server and 
5472 other systems based on NT server support this, as does at least Samba TNG now).</P
5473 ><P
5474 >The SMB client logging on to a domain has an expectation that every other
5475 server in the domain should accept the same authentication information.
5476 Network browsing functionality of domains and workgroups is
5477 identical and is explained in BROWSING.txt. It should be noted, that browsing
5478 is totally orthogonal to logon support.</P
5479 ><P
5480 >Issues related to the single-logon network model are discussed in this
5481 section.  Samba supports domain logons, network logon scripts, and user
5482 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
5483 which will be the focus of this section.</P
5484 ><P
5485 >When an SMB client in a domain wishes to logon it broadcast requests for a
5486 logon server.  The first one to reply gets the job, and validates its
5487 password using whatever mechanism the Samba administrator has installed.
5488 It is possible (but very stupid) to create a domain where the user
5489 database is not shared between servers, i.e. they are effectively workgroup
5490 servers advertising themselves as participating in a domain.  This
5491 demonstrates how authentication is quite different from but closely
5492 involved with domains.</P
5493 ><P
5494 >Using these features you can make your clients verify their logon via
5495 the Samba server; make clients run a batch file when they logon to
5496 the network and download their preferences, desktop and start menu.</P
5497 ><P
5498 >Before launching into the configuration instructions, it is 
5499 worthwhile lookingat how a Windows 9x/ME client performs a logon:</P
5500 ><P
5501 ></P
5502 ><OL
5503 TYPE="1"
5504 ><LI
5505 ><P
5506 >       The client broadcasts (to the IP broadcast address of the subnet it is in)
5507         a NetLogon request. This is sent to the NetBIOS name DOMAIN&#60;1c&#62; at the
5508         NetBIOS layer.  The client chooses the first response it receives, which
5509         contains the NetBIOS name of the logon server to use in the format of 
5510         \\SERVER.
5511         </P
5512 ></LI
5513 ><LI
5514 ><P
5515 >       The client then connects to that server, logs on (does an SMBsessetupX) and
5516         then connects to the IPC$ share (using an SMBtconX).
5517         </P
5518 ></LI
5519 ><LI
5520 ><P
5521 >       The client then does a NetWkstaUserLogon request, which retrieves the name
5522         of the user's logon script. 
5523         </P
5524 ></LI
5525 ><LI
5526 ><P
5527 >       The client then connects to the NetLogon share and searches for this    
5528         and if it is found and can be read, is retrieved and executed by the client.
5529         After this, the client disconnects from the NetLogon share.
5530         </P
5531 ></LI
5532 ><LI
5533 ><P
5534 >       The client then sends a NetUserGetInfo request to the server, to retrieve
5535         the user's home share, which is used to search for profiles. Since the
5536         response to the NetUserGetInfo request does not contain much more       
5537         the user's home share, profiles for Win9X clients MUST reside in the user
5538         home directory.
5539         </P
5540 ></LI
5541 ><LI
5542 ><P
5543 >       The client then connects to the user's home share and searches for the 
5544         user's profile. As it turns out, you can specify the user's home share as
5545         a sharename and path. For example, \\server\fred\.profile.
5546         If the profiles are found, they are implemented.
5547         </P
5548 ></LI
5549 ><LI
5550 ><P
5551 >       The client then disconnects from the user's home share, and reconnects to
5552         the NetLogon share and looks for CONFIG.POL, the policies file. If this is
5553         found, it is read and implemented.
5554         </P
5555 ></LI
5556 ></OL
5557 ><DIV
5558 CLASS="SECT2"
5559 ><HR><H3
5560 CLASS="SECT2"
5561 ><A
5562 NAME="AEN970"
5563 ></A
5564 >6.8.1. Configuration Instructions:     Network Logons</H3
5565 ><P
5566 >The main difference between a PDC and a Windows 9x logon 
5567 server configuration is that</P
5568 ><P
5569 ></P
5570 ><UL
5571 ><LI
5572 ><P
5573 >Password encryption is not required for a Windows 9x logon server.</P
5574 ></LI
5575 ><LI
5576 ><P
5577 >Windows 9x/ME clients do not possess machine trust accounts.</P
5578 ></LI
5579 ></UL
5580 ><P
5581 >Therefore, a Samba PDC will also act as a Windows 9x logon 
5582 server.</P
5583 ><DIV
5584 CLASS="WARNING"
5585 ><P
5586 ></P
5587 ><TABLE
5588 CLASS="WARNING"
5589 WIDTH="100%"
5590 BORDER="0"
5591 ><TR
5592 ><TD
5593 WIDTH="25"
5594 ALIGN="CENTER"
5595 VALIGN="TOP"
5596 ><IMG
5597 SRC="/docbook-dsssl/warning.gif"
5598 HSPACE="5"
5599 ALT="Warning"></TD
5600 ><TH
5601 ALIGN="LEFT"
5602 VALIGN="CENTER"
5603 ><B
5604 >security mode and master browsers</B
5605 ></TH
5606 ></TR
5607 ><TR
5608 ><TD
5609 >&nbsp;</TD
5610 ><TD
5611 ALIGN="LEFT"
5612 VALIGN="TOP"
5613 ><P
5614 >There are a few comments to make in order to tie up some 
5615 loose ends.  There has been much debate over the issue of whether
5616 or not it is ok to configure Samba as a Domain Controller in security
5617 modes other than <TT
5618 CLASS="CONSTANT"
5619 >USER</TT
5620 >.  The only security mode 
5621 which  will not work due to technical reasons is <TT
5622 CLASS="CONSTANT"
5623 >SHARE</TT
5624 >
5625 mode security.  <TT
5626 CLASS="CONSTANT"
5627 >DOMAIN</TT
5628 > and <TT
5629 CLASS="CONSTANT"
5630 >SERVER</TT
5631 >
5632 mode security is really just a variation on SMB user level security.</P
5633 ><P
5634 >Actually, this issue is also closely tied to the debate on whether 
5635 or not Samba must be the domain master browser for its workgroup
5636 when operating as a DC.  While it may technically be possible
5637 to configure a server as such (after all, browsing and domain logons
5638 are two distinctly different functions), it is not a good idea to
5639 so.  You should remember that the DC must register the DOMAIN#1b NetBIOS 
5640 name.  This is the name used by Windows clients to locate the DC.
5641 Windows clients do not distinguish between the DC and the DMB.
5642 For this reason, it is very wise to configure the Samba DC as the DMB.</P
5643 ><P
5644 >Now back to the issue of configuring a Samba DC to use a mode other
5645 than "security = user".  If a Samba host is configured to use 
5646 another SMB server or DC in order to validate user connection 
5647 requests, then it is a fact that some other machine on the network 
5648 (the "password server") knows more about user than the Samba host.
5649 99% of the time, this other host is a domain controller.  Now 
5650 in order to operate in domain mode security, the "workgroup" parameter
5651 must be set to the name of the Windows NT domain (which already 
5652 has a domain controller, right?)</P
5653 ><P
5654 >Therefore configuring a Samba box as a DC for a domain that 
5655 already by definition has a PDC is asking for trouble.
5656 Therefore, you should always configure the Samba DC to be the DMB
5657 for its domain.</P
5658 ></TD
5659 ></TR
5660 ></TABLE
5661 ></DIV
5662 ></DIV
5663 ><DIV
5664 CLASS="SECT2"
5665 ><HR><H3
5666 CLASS="SECT2"
5667 ><A
5668 NAME="AEN989"
5669 ></A
5670 >6.8.2. Configuration Instructions:     Setting up Roaming User Profiles</H3
5671 ><DIV
5672 CLASS="WARNING"
5673 ><P
5674 ></P
5675 ><TABLE
5676 CLASS="WARNING"
5677 WIDTH="100%"
5678 BORDER="0"
5679 ><TR
5680 ><TD
5681 WIDTH="25"
5682 ALIGN="CENTER"
5683 VALIGN="TOP"
5684 ><IMG
5685 SRC="/docbook-dsssl/warning.gif"
5686 HSPACE="5"
5687 ALT="Warning"></TD
5688 ><TD
5689 ALIGN="LEFT"
5690 VALIGN="TOP"
5691 ><P
5692 ><SPAN
5693 CLASS="emphasis"
5694 ><I
5695 CLASS="EMPHASIS"
5696 >NOTE!</I
5697 ></SPAN
5698 > Roaming profiles support is different 
5699 for Win9X and WinNT.</P
5700 ></TD
5701 ></TR
5702 ></TABLE
5703 ></DIV
5704 ><P
5705 >Before discussing how to configure roaming profiles, it is useful to see how
5706 Win9X and WinNT clients implement these features.</P
5707 ><P
5708 >Win9X clients send a NetUserGetInfo request to the server to get the user's
5709 profiles location. However, the response does not have room for a separate 
5710 profiles location field, only the user's home share. This means that Win9X 
5711 profiles are restricted to being in the user's home directory.</P
5712 ><P
5713 >WinNT clients send a NetSAMLogon RPC request, which contains many fields, 
5714 including a separate field for the location of the user's profiles. 
5715 This means that support for profiles is different for Win9X and WinNT.</P
5716 ><DIV
5717 CLASS="SECT3"
5718 ><HR><H4
5719 CLASS="SECT3"
5720 ><A
5721 NAME="AEN997"
5722 ></A
5723 >6.8.2.1. Windows NT Configuration</H4
5724 ><P
5725 >To support WinNT clients, in the [global] section of smb.conf set the
5726 following (for example):</P
5727 ><P
5728 ><PRE
5729 CLASS="PROGRAMLISTING"
5730 >logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath</PRE
5731 ></P
5732 ><P
5733 >The default for this option is \\%N\%U\profile, namely
5734 \\sambaserver\username\profile.  The \\N%\%U service is created
5735 automatically by the [homes] service.
5736 If you are using a samba server for the profiles, you _must_ make the
5737 share specified in the logon path browseable. </P
5738 ><DIV
5739 CLASS="NOTE"
5740 ><P
5741 ></P
5742 ><TABLE
5743 CLASS="NOTE"
5744 WIDTH="100%"
5745 BORDER="0"
5746 ><TR
5747 ><TD
5748 WIDTH="25"
5749 ALIGN="CENTER"
5750 VALIGN="TOP"
5751 ><IMG
5752 SRC="/docbook-dsssl/note.gif"
5753 HSPACE="5"
5754 ALT="Note"></TD
5755 ><TD
5756 ALIGN="LEFT"
5757 VALIGN="TOP"
5758 ><P
5759 >[lkcl 26aug96 - we have discovered a problem where Windows clients can
5760 maintain a connection to the [homes] share in between logins.  The
5761 [homes] share must NOT therefore be used in a profile path.]</P
5762 ></TD
5763 ></TR
5764 ></TABLE
5765 ></DIV
5766 ></DIV
5767 ><DIV
5768 CLASS="SECT3"
5769 ><HR><H4
5770 CLASS="SECT3"
5771 ><A
5772 NAME="AEN1005"
5773 ></A
5774 >6.8.2.2. Windows 9X Configuration</H4
5775 ><P
5776 >To support Win9X clients, you must use the "logon home" parameter. Samba has
5777 now been fixed so that "net use/home" now works as well, and it, too, relies
5778 on the "logon home" parameter.</P
5779 ><P
5780 >By using the logon home parameter, you are restricted to putting Win9X 
5781 profiles in the user's home directory.   But wait! There is a trick you 
5782 can use. If you set the following in the [global] section of your 
5783 smb.conf file:</P
5784 ><P
5785 ><PRE
5786 CLASS="PROGRAMLISTING"
5787 >logon home = \\%L\%U\.profiles</PRE
5788 ></P
5789 ><P
5790 >then your Win9X clients will dutifully put their clients in a subdirectory
5791 of your home directory called .profiles (thus making them hidden).</P
5792 ><P
5793 >Not only that, but 'net use/home' will also work, because of a feature in 
5794 Win9X. It removes any directory stuff off the end of the home directory area
5795 and only uses the server and share portion. That is, it looks like you
5796 specified \\%L\%U for "logon home".</P
5797 ></DIV
5798 ><DIV
5799 CLASS="SECT3"
5800 ><HR><H4
5801 CLASS="SECT3"
5802 ><A
5803 NAME="AEN1013"
5804 ></A
5805 >6.8.2.3. Win9X and WinNT Configuration</H4
5806 ><P
5807 >You can support profiles for both Win9X and WinNT clients by setting both the
5808 "logon home" and "logon path" parameters. For example:</P
5809 ><P
5810 ><PRE
5811 CLASS="PROGRAMLISTING"
5812 >logon home = \\%L\%U\.profiles
5813 logon path = \\%L\profiles\%U</PRE
5814 ></P
5815 ><DIV
5816 CLASS="NOTE"
5817 ><P
5818 ></P
5819 ><TABLE
5820 CLASS="NOTE"
5821 WIDTH="100%"
5822 BORDER="0"
5823 ><TR
5824 ><TD
5825 WIDTH="25"
5826 ALIGN="CENTER"
5827 VALIGN="TOP"
5828 ><IMG
5829 SRC="/docbook-dsssl/note.gif"
5830 HSPACE="5"
5831 ALT="Note"></TD
5832 ><TD
5833 ALIGN="LEFT"
5834 VALIGN="TOP"
5835 ><P
5836 >I have not checked what 'net use /home' does on NT when "logon home" is
5837 set as above.</P
5838 ></TD
5839 ></TR
5840 ></TABLE
5841 ></DIV
5842 ></DIV
5843 ><DIV
5844 CLASS="SECT3"
5845 ><HR><H4
5846 CLASS="SECT3"
5847 ><A
5848 NAME="AEN1020"
5849 ></A
5850 >6.8.2.4. Windows 9X Profile Setup</H4
5851 ><P
5852 >When a user first logs in on Windows 9X, the file user.DAT is created,
5853 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".  
5854 These directories and their contents will be merged with the local
5855 versions stored in c:\windows\profiles\username on subsequent logins,
5856 taking the most recent from each.  You will need to use the [global]
5857 options "preserve case = yes", "short preserve case = yes" and
5858 "case sensitive = no" in order to maintain capital letters in shortcuts
5859 in any of the profile folders.</P
5860 ><P
5861 >The user.DAT file contains all the user's preferences.  If you wish to
5862 enforce a set of preferences, rename their user.DAT file to user.MAN,
5863 and deny them write access to this file.</P
5864 ><P
5865 ></P
5866 ><OL
5867 TYPE="1"
5868 ><LI
5869 ><P
5870 >       On the Windows 95 machine, go to Control Panel | Passwords and
5871         select the User Profiles tab.  Select the required level of
5872         roaming preferences.  Press OK, but do _not_ allow the computer
5873         to reboot.
5874         </P
5875 ></LI
5876 ><LI
5877 ><P
5878 >       On the Windows 95 machine, go to Control Panel | Network |
5879         Client for Microsoft Networks | Preferences.  Select 'Log on to
5880         NT Domain'.  Then, ensure that the Primary Logon is 'Client for
5881         Microsoft Networks'.  Press OK, and this time allow the computer
5882         to reboot.
5883         </P
5884 ></LI
5885 ></OL
5886 ><P
5887 >Under Windows 95, Profiles are downloaded from the Primary Logon.
5888 If you have the Primary Logon as 'Client for Novell Networks', then
5889 the profiles and logon script will be downloaded from your Novell
5890 Server.  If you have the Primary Logon as 'Windows Logon', then the
5891 profiles will be loaded from the local machine - a bit against the
5892 concept of roaming profiles, if you ask me.</P
5893 ><P
5894 >You will now find that the Microsoft Networks Login box contains
5895 [user, password, domain] instead of just [user, password].  Type in
5896 the samba server's domain name (or any other domain known to exist,
5897 but bear in mind that the user will be authenticated against this
5898 domain and profiles downloaded from it, if that domain logon server
5899 supports it), user name and user's password.</P
5900 ><P
5901 >Once the user has been successfully validated, the Windows 95 machine
5902 will inform you that 'The user has not logged on before' and asks you
5903 if you wish to save the user's preferences?  Select 'yes'.</P
5904 ><P
5905 >Once the Windows 95 client comes up with the desktop, you should be able
5906 to examine the contents of the directory specified in the "logon path"
5907 on the samba server and verify that the "Desktop", "Start Menu",
5908 "Programs" and "Nethood" folders have been created.</P
5909 ><P
5910 >These folders will be cached locally on the client, and updated when
5911 the user logs off (if you haven't made them read-only by then :-).
5912 You will find that if the user creates further folders or short-cuts,
5913 that the client will merge the profile contents downloaded with the
5914 contents of the profile directory already on the local client, taking
5915 the newest folders and short-cuts from each set.</P
5916 ><P
5917 >If you have made the folders / files read-only on the samba server,
5918 then you will get errors from the w95 machine on logon and logout, as
5919 it attempts to merge the local and the remote profile.  Basically, if
5920 you have any errors reported by the w95 machine, check the Unix file
5921 permissions and ownership rights on the profile directory contents,
5922 on the samba server.</P
5923 ><P
5924 >If you have problems creating user profiles, you can reset the user's
5925 local desktop cache, as shown below.  When this user then next logs in,
5926 they will be told that they are logging in "for the first time".</P
5927 ><P
5928 ></P
5929 ><OL
5930 TYPE="1"
5931 ><LI
5932 ><P
5933 >       instead of logging in under the [user, password, domain] dialog,
5934         press escape.
5935         </P
5936 ></LI
5937 ><LI
5938 ><P
5939 >       run the regedit.exe program, and look in:
5940         </P
5941 ><P
5942 >       HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
5943         </P
5944 ><P
5945 >       you will find an entry, for each user, of ProfilePath.  Note the
5946         contents of this key (likely to be c:\windows\profiles\username),
5947         then delete the key ProfilePath for the required user.
5948         </P
5949 ><P
5950 >       [Exit the registry editor].
5951         </P
5952 ></LI
5953 ><LI
5954 ><P
5955 >       <SPAN
5956 CLASS="emphasis"
5957 ><I
5958 CLASS="EMPHASIS"
5959 >WARNING</I
5960 ></SPAN
5961 > - before deleting the contents of the 
5962         directory listed in
5963    the ProfilePath (this is likely to be c:\windows\profiles\username),
5964    ask them if they have any important files stored on their desktop
5965    or in their start menu.  delete the contents of the directory
5966    ProfilePath (making a backup if any of the files are needed).
5967         </P
5968 ><P
5969 >   This will have the effect of removing the local (read-only hidden
5970    system file) user.DAT in their profile directory, as well as the
5971    local "desktop", "nethood", "start menu" and "programs" folders.
5972         </P
5973 ></LI
5974 ><LI
5975 ><P
5976 >       search for the user's .PWL password-caching file in the c:\windows
5977         directory, and delete it.
5978         </P
5979 ></LI
5980 ><LI
5981 ><P
5982 >       log off the windows 95 client.
5983         </P
5984 ></LI
5985 ><LI
5986 ><P
5987 >       check the contents of the profile path (see "logon path" described
5988         above), and delete the user.DAT or user.MAN file for the user,
5989         making a backup if required.  
5990         </P
5991 ></LI
5992 ></OL
5993 ><P
5994 >If all else fails, increase samba's debug log levels to between 3 and 10,
5995 and / or run a packet trace program such as tcpdump or netmon.exe, and
5996 look for any error reports.</P
5997 ><P
5998 >If you have access to an NT server, then first set up roaming profiles
5999 and / or netlogons on the NT server.  Make a packet trace, or examine
6000 the example packet traces provided with NT server, and see what the
6001 differences are with the equivalent samba trace.</P
6002 ></DIV
6003 ><DIV
6004 CLASS="SECT3"
6005 ><HR><H4
6006 CLASS="SECT3"
6007 ><A
6008 NAME="AEN1056"
6009 ></A
6010 >6.8.2.5. Windows NT Workstation 4.0</H4
6011 ><P
6012 >When a user first logs in to a Windows NT Workstation, the profile
6013 NTuser.DAT is created.  The profile location can be now specified
6014 through the "logon path" parameter.  </P
6015 ><DIV
6016 CLASS="NOTE"
6017 ><P
6018 ></P
6019 ><TABLE
6020 CLASS="NOTE"
6021 WIDTH="100%"
6022 BORDER="0"
6023 ><TR
6024 ><TD
6025 WIDTH="25"
6026 ALIGN="CENTER"
6027 VALIGN="TOP"
6028 ><IMG
6029 SRC="/docbook-dsssl/note.gif"
6030 HSPACE="5"
6031 ALT="Note"></TD
6032 ><TD
6033 ALIGN="LEFT"
6034 VALIGN="TOP"
6035 ><P
6036 >[lkcl 10aug97 - i tried setting the path to
6037 \\samba-server\homes\profile, and discovered that this fails because
6038 a background process maintains the connection to the [homes] share
6039 which does _not_ close down in between user logins.  you have to
6040 have \\samba-server\%L\profile, where user is the username created
6041 from the [homes] share].</P
6042 ></TD
6043 ></TR
6044 ></TABLE
6045 ></DIV
6046 ><P
6047 >There is a parameter that is now available for use with NT Profiles:
6048 "logon drive".  This should be set to "h:" or any other drive, and
6049 should be used in conjunction with the new "logon home" parameter.</P
6050 ><P
6051 >The entry for the NT 4.0 profile is a _directory_ not a file.  The NT
6052 help on profiles mentions that a directory is also created with a .PDS
6053 extension.  The user, while logging in, must have write permission to
6054 create the full profile path (and the folder with the .PDS extension)
6055 [lkcl 10aug97 - i found that the creation of the .PDS directory failed,
6056 and had to create these manually for each user, with a shell script.
6057 also, i presume, but have not tested, that the full profile path must
6058 be browseable just as it is for w95, due to the manner in which they
6059 attempt to create the full profile path: test existence of each path
6060 component; create path component].</P
6061 ><P
6062 >In the profile directory, NT creates more folders than 95.  It creates
6063 "Application Data" and others, as well as "Desktop", "Nethood",
6064 "Start Menu" and "Programs".  The profile itself is stored in a file
6065 NTuser.DAT.  Nothing appears to be stored in the .PDS directory, and
6066 its purpose is currently unknown.</P
6067 ><P
6068 >You can use the System Control Panel to copy a local profile onto
6069 a samba server (see NT Help on profiles: it is also capable of firing
6070 up the correct location in the System Control Panel for you).  The
6071 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
6072 turns a profile into a mandatory one.</P
6073 ><DIV
6074 CLASS="NOTE"
6075 ><P
6076 ></P
6077 ><TABLE
6078 CLASS="NOTE"
6079 WIDTH="100%"
6080 BORDER="0"
6081 ><TR
6082 ><TD
6083 WIDTH="25"
6084 ALIGN="CENTER"
6085 VALIGN="TOP"
6086 ><IMG
6087 SRC="/docbook-dsssl/note.gif"
6088 HSPACE="5"
6089 ALT="Note"></TD
6090 ><TD
6091 ALIGN="LEFT"
6092 VALIGN="TOP"
6093 ><P
6094 >[lkcl 10aug97 - i notice that NT Workstation tells me that it is
6095 downloading a profile from a slow link.  whether this is actually the
6096 case, or whether there is some configuration issue, as yet unknown,
6097 that makes NT Workstation _think_ that the link is a slow one is a
6098 matter to be resolved].</P
6099 ><P
6100 >[lkcl 20aug97 - after samba digest correspondence, one user found, and
6101 another confirmed, that profiles cannot be loaded from a samba server
6102 unless "security = user" and "encrypt passwords = yes" (see the file
6103 ENCRYPTION.txt) or "security = server" and "password server = ip.address.
6104 of.yourNTserver" are used.  Either of these options will allow the NT
6105 workstation to access the samba server using LAN manager encrypted
6106 passwords, without the user intervention normally required by NT
6107 workstation for clear-text passwords].</P
6108 ><P
6109 >[lkcl 25aug97 - more comments received about NT profiles: the case of
6110 the profile _matters_.  the file _must_ be called NTuser.DAT or, for
6111 a mandatory profile, NTuser.MAN].</P
6112 ></TD
6113 ></TR
6114 ></TABLE
6115 ></DIV
6116 ></DIV
6117 ><DIV
6118 CLASS="SECT3"
6119 ><HR><H4
6120 CLASS="SECT3"
6121 ><A
6122 NAME="AEN1069"
6123 ></A
6124 >6.8.2.6. Windows NT Server</H4
6125 ><P
6126 >There is nothing to stop you specifying any path that you like for the
6127 location of users' profiles.  Therefore, you could specify that the
6128 profile be stored on a samba server, or any other SMB server, as long as
6129 that SMB server supports encrypted passwords.</P
6130 ></DIV
6131 ><DIV
6132 CLASS="SECT3"
6133 ><HR><H4
6134 CLASS="SECT3"
6135 ><A
6136 NAME="AEN1072"
6137 ></A
6138 >6.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0</H4
6139 ><DIV
6140 CLASS="WARNING"
6141 ><P
6142 ></P
6143 ><TABLE
6144 CLASS="WARNING"
6145 WIDTH="100%"
6146 BORDER="0"
6147 ><TR
6148 ><TD
6149 WIDTH="25"
6150 ALIGN="CENTER"
6151 VALIGN="TOP"
6152 ><IMG
6153 SRC="/docbook-dsssl/warning.gif"
6154 HSPACE="5"
6155 ALT="Warning"></TD
6156 ><TH
6157 ALIGN="LEFT"
6158 VALIGN="CENTER"
6159 ><B
6160 >Potentially outdated or incorrect material follows</B
6161 ></TH
6162 ></TR
6163 ><TR
6164 ><TD
6165 >&nbsp;</TD
6166 ><TD
6167 ALIGN="LEFT"
6168 VALIGN="TOP"
6169 ><P
6170 >I think this is all bogus, but have not deleted it. (Richard Sharpe)</P
6171 ></TD
6172 ></TR
6173 ></TABLE
6174 ></DIV
6175 ><P
6176 >The default logon path is \\%N\%U.  NT Workstation will attempt to create
6177 a directory "\\samba-server\username.PDS" if you specify the logon path
6178 as "\\samba-server\username" with the NT User Manager.  Therefore, you
6179 will need to specify (for example) "\\samba-server\username\profile".
6180 NT 4.0 will attempt to create "\\samba-server\username\profile.PDS", which
6181 is more likely to succeed.</P
6182 ><P
6183 >If you then want to share the same Start Menu / Desktop with W95, you will
6184 need to specify "logon path = \\samba-server\username\profile" [lkcl 10aug97
6185 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
6186 to run from the c:\winnt\system32 directory.  this directory is obviously
6187 unlikely to exist on a Win95-only host].</P
6188 ><P
6189 >&#13;If you have this set up correctly, you will find separate user.DAT and
6190 NTuser.DAT files in the same profile directory.</P
6191 ><DIV
6192 CLASS="NOTE"
6193 ><P
6194 ></P
6195 ><TABLE
6196 CLASS="NOTE"
6197 WIDTH="100%"
6198 BORDER="0"
6199 ><TR
6200 ><TD
6201 WIDTH="25"
6202 ALIGN="CENTER"
6203 VALIGN="TOP"
6204 ><IMG
6205 SRC="/docbook-dsssl/note.gif"
6206 HSPACE="5"
6207 ALT="Note"></TD
6208 ><TD
6209 ALIGN="LEFT"
6210 VALIGN="TOP"
6211 ><P
6212 >[lkcl 25aug97 - there are some issues to resolve with downloading of
6213 NT profiles, probably to do with time/date stamps.  i have found that
6214 NTuser.DAT is never updated on the workstation after the first time that
6215 it is copied to the local workstation profile directory.  this is in
6216 contrast to w95, where it _does_ transfer / update profiles correctly].</P
6217 ></TD
6218 ></TR
6219 ></TABLE
6220 ></DIV
6221 ></DIV
6222 ></DIV
6223 ></DIV
6224 ><DIV
6225 CLASS="SECT1"
6226 ><HR><H2
6227 CLASS="SECT1"
6228 ><A
6229 NAME="AEN1082"
6230 ></A
6231 >6.9. DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</H2
6232 ><DIV
6233 CLASS="WARNING"
6234 ><P
6235 ></P
6236 ><TABLE
6237 CLASS="WARNING"
6238 WIDTH="100%"
6239 BORDER="0"
6240 ><TR
6241 ><TD
6242 WIDTH="25"
6243 ALIGN="CENTER"
6244 VALIGN="TOP"
6245 ><IMG
6246 SRC="/docbook-dsssl/warning.gif"
6247 HSPACE="5"
6248 ALT="Warning"></TD
6249 ><TH
6250 ALIGN="LEFT"
6251 VALIGN="CENTER"
6252 ><B
6253 >Possibly Outdated Material</B
6254 ></TH
6255 ></TR
6256 ><TR
6257 ><TD
6258 >&nbsp;</TD
6259 ><TD
6260 ALIGN="LEFT"
6261 VALIGN="TOP"
6262 ><P
6263 >       This appendix was originally authored by John H Terpstra of 
6264         the Samba Team and is included here for posterity.
6265         </P
6266 ></TD
6267 ></TR
6268 ></TABLE
6269 ></DIV
6270 ><P
6271 ><SPAN
6272 CLASS="emphasis"
6273 ><I
6274 CLASS="EMPHASIS"
6275 >NOTE :</I
6276 ></SPAN
6277
6278 The term "Domain Controller" and those related to it refer to one specific
6279 method of authentication that can underly an SMB domain. Domain Controllers
6280 prior to Windows NT Server 3.1 were sold by various companies and based on 
6281 private extensions to the LAN Manager 2.1 protocol. Windows NT introduced
6282 Microsoft-specific ways of distributing the user authentication database.
6283 See DOMAIN.txt for examples of how Samba can participate in or create
6284 SMB domains based on shared authentication database schemes other than the 
6285 Windows NT SAM.</P
6286 ><P
6287 >Windows NT Server can be installed as either a plain file and print server
6288 (WORKGROUP workstation or server) or as a server that participates in Domain
6289 Control (DOMAIN member, Primary Domain controller or Backup Domain controller).
6290 The same is true for OS/2 Warp Server, Digital Pathworks and other similar
6291 products, all of which can participate in Domain Control along with Windows NT.</P
6292 ><P
6293 >To many people these terms can be confusing, so let's try to clear the air.</P
6294 ><P
6295 >Every Windows NT system (workstation or server) has a registry database.
6296 The registry contains entries that describe the initialization information
6297 for all services (the equivalent of Unix Daemons) that run within the Windows
6298 NT environment. The registry also contains entries that tell application
6299 software where to find dynamically loadable libraries that they depend upon.
6300 In fact, the registry contains entries that describes everything that anything
6301 may need to know to interact with the rest of the system.</P
6302 ><P
6303 >The registry files can be located on any Windows NT machine by opening a
6304 command prompt and typing:</P
6305 ><P
6306 ><TT
6307 CLASS="PROMPT"
6308 >C:\WINNT\&#62;</TT
6309 > dir %SystemRoot%\System32\config</P
6310 ><P
6311 >The environment variable %SystemRoot% value can be obtained by typing:</P
6312 ><P
6313 ><TT
6314 CLASS="PROMPT"
6315 >C:\WINNT&#62;</TT
6316 >echo %SystemRoot%</P
6317 ><P
6318 >The active parts of the registry that you may want to be familiar with are
6319 the files called: default, system, software, sam and security.</P
6320 ><P
6321 >In a domain environment, Microsoft Windows NT domain controllers participate
6322 in replication of the SAM and SECURITY files so that all controllers within
6323 the domain have an exactly identical copy of each.</P
6324 ><P
6325 >The Microsoft Windows NT system is structured within a security model that
6326 says that all applications and services must authenticate themselves before
6327 they can obtain permission from the security manager to do what they set out
6328 to do.</P
6329 ><P
6330 >The Windows NT User database also resides within the registry. This part of
6331 the registry contains the user's security identifier, home directory, group
6332 memberships, desktop profile, and so on.</P
6333 ><P
6334 >Every Windows NT system (workstation as well as server) will have its own
6335 registry. Windows NT Servers that participate in Domain Security control
6336 have a database that they share in common - thus they do NOT own an
6337 independent full registry database of their own, as do Workstations and
6338 plain Servers.</P
6339 ><P
6340 >The User database is called the SAM (Security Access Manager) database and
6341 is used for all user authentication as well as for authentication of inter-
6342 process authentication (i.e. to ensure that the service action a user has
6343 requested is permitted within the limits of that user's privileges).</P
6344 ><P
6345 >The Samba team have produced a utility that can dump the Windows NT SAM into 
6346 smbpasswd format: see ENCRYPTION.txt for information on smbpasswd and
6347 /pub/samba/pwdump on your nearest Samba mirror for the utility. This 
6348 facility is useful but cannot be easily used to implement SAM replication
6349 to Samba systems.</P
6350 ><P
6351 >Windows for Workgroups, Windows 95, and Windows NT Workstations and Servers
6352 can participate in a Domain security system that is controlled by Windows NT
6353 servers that have been correctly configured. Almost every domain will have
6354 ONE Primary Domain Controller (PDC). It is desirable that each domain will
6355 have at least one Backup Domain Controller (BDC).</P
6356 ><P
6357 >The PDC and BDCs then participate in replication of the SAM database so that
6358 each Domain Controlling participant will have an up to date SAM component
6359 within its registry.</P
6360 ></DIV
6361 ></DIV
6362 ><DIV
6363 CLASS="CHAPTER"
6364 ><HR><H1
6365 ><A
6366 NAME="SAMBA-BDC"
6367 ></A
6368 >Chapter 7. How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</H1
6369 ><DIV
6370 CLASS="SECT1"
6371 ><H2
6372 CLASS="SECT1"
6373 ><A
6374 NAME="AEN1118"
6375 ></A
6376 >7.1. Prerequisite Reading</H2
6377 ><P
6378 >Before you continue reading in this chapter, please make sure
6379 that you are comfortable with configuring a Samba PDC
6380 as described in the <A
6381 HREF="Samba-PDC-HOWTO.html"
6382 TARGET="_top"
6383 >Samba-PDC-HOWTO</A
6384 >.</P
6385 ></DIV
6386 ><DIV
6387 CLASS="SECT1"
6388 ><HR><H2
6389 CLASS="SECT1"
6390 ><A
6391 NAME="AEN1122"
6392 ></A
6393 >7.2. Background</H2
6394 ><P
6395 >What is a Domain Controller? It is a machine that is able to answer
6396 logon requests from workstations in a Windows NT Domain. Whenever a
6397 user logs into a Windows NT Workstation, the workstation connects to a
6398 Domain Controller and asks him whether the username and password the
6399 user typed in is correct.  The Domain Controller replies with a lot of
6400 information about the user, for example the place where the users
6401 profile is stored, the users full name of the user. All this
6402 information is stored in the NT user database, the so-called SAM.</P
6403 ><P
6404 >There are two kinds of Domain Controller in a NT 4 compatible Domain:
6405 A Primary Domain Controller (PDC) and one or more Backup Domain
6406 Controllers (BDC). The PDC contains the master copy of the
6407 SAM. Whenever the SAM has to change, for example when a user changes
6408 his password, this change has to be done on the PDC. A Backup Domain
6409 Controller is a machine that maintains a read-only copy of the
6410 SAM. This way it is able to reply to logon requests and authenticate
6411 users in case the PDC is not available. During this time no changes to
6412 the SAM are possible. Whenever changes to the SAM are done on the PDC,
6413 all BDC receive the changes from the PDC.</P
6414 ><P
6415 >Since version 2.2 Samba officially supports domain logons for all
6416 current Windows Clients, including Windows 2000 and XP. This text
6417 assumes the domain to be named SAMBA. To be able to act as a PDC, some
6418 parameters in the [global]-section of the smb.conf have to be set:</P
6419 ><P
6420 ><PRE
6421 CLASS="PROGRAMLISTING"
6422 >workgroup = SAMBA
6423 domain master = yes
6424 domain logons = yes</PRE
6425 ></P
6426 ><P
6427 >Several other things like a [homes] and a [netlogon] share also may be
6428 set along with settings for the profile path, the users home drive and
6429 others. This will not be covered in this document.</P
6430 ></DIV
6431 ><DIV
6432 CLASS="SECT1"
6433 ><HR><H2
6434 CLASS="SECT1"
6435 ><A
6436 NAME="AEN1130"
6437 ></A
6438 >7.3. What qualifies a Domain Controller on the network?</H2
6439 ><P
6440 >Every machine that is a Domain Controller for the domain SAMBA has to
6441 register the NetBIOS group name SAMBA#1c with the WINS server and/or
6442 by broadcast on the local network. The PDC also registers the unique
6443 NetBIOS name SAMBA#1b with the WINS server. The name type #1b is
6444 normally reserved for the domain master browser, a role that has
6445 nothing to do with anything related to authentication, but the
6446 Microsoft Domain implementation requires the domain master browser to
6447 be on the same machine as the PDC.</P
6448 ><DIV
6449 CLASS="SECT2"
6450 ><HR><H3
6451 CLASS="SECT2"
6452 ><A
6453 NAME="AEN1133"
6454 ></A
6455 >7.3.1. How does a Workstation find its domain controller?</H3
6456 ><P
6457 >A NT workstation in the domain SAMBA that wants a local user to be
6458 authenticated has to find the domain controller for SAMBA. It does
6459 this by doing a NetBIOS name query for the group name SAMBA#1c. It
6460 assumes that each of the machines it gets back from the queries is a
6461 domain controller and can answer logon requests. To not open security
6462 holes both the workstation and the selected (TODO: How is the DC
6463 chosen) domain controller authenticate each other. After that the
6464 workstation sends the user's credentials (his name and password) to
6465 the domain controller, asking for approval.</P
6466 ></DIV
6467 ><DIV
6468 CLASS="SECT2"
6469 ><HR><H3
6470 CLASS="SECT2"
6471 ><A
6472 NAME="AEN1136"
6473 ></A
6474 >7.3.2. When is the PDC needed?</H3
6475 ><P
6476 >Whenever a user wants to change his password, this has to be done on
6477 the PDC. To find the PDC, the workstation does a NetBIOS name query
6478 for SAMBA#1b, assuming this machine maintains the master copy of the
6479 SAM. The workstation contacts the PDC, both mutually authenticate and
6480 the password change is done.</P
6481 ></DIV
6482 ></DIV
6483 ><DIV
6484 CLASS="SECT1"
6485 ><HR><H2
6486 CLASS="SECT1"
6487 ><A
6488 NAME="AEN1139"
6489 ></A
6490 >7.4. Can Samba be a Backup Domain Controller?</H2
6491 ><P
6492 >With version 2.2, no. The native NT SAM replication protocols have
6493 not yet been fully implemented. The Samba Team is working on
6494 understanding and implementing the protocols, but this work has not
6495 been finished for version 2.2.</P
6496 ><P
6497 >Can I get the benefits of a BDC with Samba?  Yes. The main reason for
6498 implementing a BDC is availability. If the PDC is a Samba machine,
6499 a second Samba machine can be set up to
6500 service logon requests whenever the PDC is down.</P
6501 ></DIV
6502 ><DIV
6503 CLASS="SECT1"
6504 ><HR><H2
6505 CLASS="SECT1"
6506 ><A
6507 NAME="AEN1143"
6508 ></A
6509 >7.5. How do I set up a Samba BDC?</H2
6510 ><P
6511 >Several things have to be done:</P
6512 ><P
6513 ></P
6514 ><UL
6515 ><LI
6516 ><P
6517 >The domain SID has to be the same on the PDC and the BDC. This used to
6518 be stored in the file private/MACHINE.SID. This file is not created
6519 anymore since Samba 2.2.5 or even earlier. Nowadays the domain SID is
6520 stored in the file private/secrets.tdb. Simply copying the secrets.tdb
6521 from the PDC to the BDC does not work, as the BDC would
6522 generate a new SID for itself and override the domain SID with this
6523 new BDC SID.</P
6524 ><P
6525 >To retrieve the domain SID from the PDC or an existing BDC and store it in the
6526 secrets.tdb, execute 'net rpc getsid' on the BDC.</P
6527 ></LI
6528 ><LI
6529 ><P
6530 >The Unix user database has to be synchronized from the PDC to the
6531 BDC. This means that both the /etc/passwd and /etc/group have to be
6532 replicated from the PDC to the BDC. This can be done manually
6533 whenever changes are made, or the PDC is set up as a NIS master
6534 server and the BDC as a NIS slave server. To set up the BDC as a
6535 mere NIS client would not be enough, as the BDC would not be able to
6536 access its user database in case of a PDC failure.</P
6537 ></LI
6538 ><LI
6539 ><P
6540 >The Samba password database in the file private/smbpasswd has to be
6541 replicated from the PDC to the BDC. This is a bit tricky, see the
6542 next section.</P
6543 ></LI
6544 ><LI
6545 ><P
6546 >Any netlogon share has to be replicated from the PDC to the
6547 BDC. This can be done manually whenever login scripts are changed,
6548 or it can be done automatically together with the smbpasswd
6549 synchronization.</P
6550 ></LI
6551 ></UL
6552 ><P
6553 >Finally, the BDC has to be found by the workstations. This can be done
6554 by setting</P
6555 ><P
6556 ><PRE
6557 CLASS="PROGRAMLISTING"
6558 >workgroup = samba
6559 domain master = no
6560 domain logons = yes</PRE
6561 ></P
6562 ><P
6563 >in the [global]-section of the smb.conf of the BDC. This makes the BDC
6564 only register the name SAMBA#1c with the WINS server. This is no
6565 problem as the name SAMBA#1c is a NetBIOS group name that is meant to
6566 be registered by more than one machine. The parameter 'domain master =
6567 no' forces the BDC not to register SAMBA#1b which as a unique NetBIOS
6568 name is reserved for the Primary Domain Controller.</P
6569 ><DIV
6570 CLASS="SECT2"
6571 ><HR><H3
6572 CLASS="SECT2"
6573 ><A
6574 NAME="AEN1160"
6575 ></A
6576 >7.5.1. How do I replicate the smbpasswd file?</H3
6577 ><P
6578 >Replication of the smbpasswd file is sensitive. It has to be done
6579 whenever changes to the SAM are made. Every user's password change is
6580 done in the smbpasswd file and has to be replicated to the BDC. So
6581 replicating the smbpasswd file very often is necessary.</P
6582 ><P
6583 >As the smbpasswd file contains plain text password equivalents, it
6584 must not be sent unencrypted over the wire. The best way to set up
6585 smbpasswd replication from the PDC to the BDC is to use the utility
6586 rsync. rsync can use ssh as a transport. ssh itself can be set up to
6587 accept *only* rsync transfer without requiring the user to type a
6588 password.</P
6589 ></DIV
6590 ></DIV
6591 ></DIV
6592 ><DIV
6593 CLASS="CHAPTER"
6594 ><HR><H1
6595 ><A
6596 NAME="ADS"
6597 ></A
6598 >Chapter 8. Samba as a ADS domain member</H1
6599 ><P
6600 >This is a VERY ROUGH guide to setting up the current (November 2001)
6601 pre-alpha version of Samba 3.0 with kerberos authentication against a
6602 Windows2000 KDC. The procedures listed here are likely to change as
6603 the code develops.</P
6604 ><P
6605 >Pieces you need before you begin:
6606 <P
6607 ></P
6608 ><TABLE
6609 BORDER="0"
6610 ><TBODY
6611 ><TR
6612 ><TD
6613 >a Windows 2000 server.</TD
6614 ></TR
6615 ><TR
6616 ><TD
6617 >samba 3.0 or higher.</TD
6618 ></TR
6619 ><TR
6620 ><TD
6621 >the MIT kerberos development libraries (either install from the above sources or use a package). The heimdal libraries will not work.</TD
6622 ></TR
6623 ><TR
6624 ><TD
6625 >the OpenLDAP development libraries.</TD
6626 ></TR
6627 ></TBODY
6628 ></TABLE
6629 ><P
6630 ></P
6631 ></P
6632 ><DIV
6633 CLASS="SECT1"
6634 ><HR><H2
6635 CLASS="SECT1"
6636 ><A
6637 NAME="AEN1178"
6638 ></A
6639 >8.1. Installing the required packages for Debian</H2
6640 ><P
6641 >On Debian you need to install the following packages:
6642 <P
6643 ></P
6644 ><TABLE
6645 BORDER="0"
6646 ><TBODY
6647 ><TR
6648 ><TD
6649 >libkrb5-dev</TD
6650 ></TR
6651 ><TR
6652 ><TD
6653 >krb5-user</TD
6654 ></TR
6655 ></TBODY
6656 ></TABLE
6657 ><P
6658 ></P
6659 ></P
6660 ></DIV
6661 ><DIV
6662 CLASS="SECT1"
6663 ><HR><H2
6664 CLASS="SECT1"
6665 ><A
6666 NAME="AEN1184"
6667 ></A
6668 >8.2. Installing the required packages for RedHat</H2
6669 ><P
6670 >On RedHat this means you should have at least: 
6671 <P
6672 ></P
6673 ><TABLE
6674 BORDER="0"
6675 ><TBODY
6676 ><TR
6677 ><TD
6678 >krb5-workstation (for kinit)</TD
6679 ></TR
6680 ><TR
6681 ><TD
6682 >krb5-libs (for linking with)</TD
6683 ></TR
6684 ><TR
6685 ><TD
6686 >krb5-devel (because you are compiling from source)</TD
6687 ></TR
6688 ></TBODY
6689 ></TABLE
6690 ><P
6691 ></P
6692 ></P
6693 ><P
6694 >in addition to the standard development environment.</P
6695 ><P
6696 >Note that these are not standard on a RedHat install, and you may need 
6697 to get them off CD2.</P
6698 ></DIV
6699 ><DIV
6700 CLASS="SECT1"
6701 ><HR><H2
6702 CLASS="SECT1"
6703 ><A
6704 NAME="AEN1193"
6705 ></A
6706 >8.3. Compile Samba</H2
6707 ><P
6708 >If your kerberos libraries are in a non-standard location then
6709   remember to add the configure option --with-krb5=DIR.</P
6710 ><P
6711 >After you run configure make sure that include/config.h contains 
6712   lines like this:</P
6713 ><P
6714 ><PRE
6715 CLASS="PROGRAMLISTING"
6716 >#define HAVE_KRB5 1
6717 #define HAVE_LDAP 1</PRE
6718 ></P
6719 ><P
6720 >If it doesn't then configure did not find your krb5 libraries or
6721   your ldap libraries. Look in config.log to figure out why and fix
6722   it.</P
6723 ><P
6724 >Then compile and install Samba as usual. You must use at least the
6725   following 3 options in smb.conf:</P
6726 ><P
6727 ><PRE
6728 CLASS="PROGRAMLISTING"
6729 >  realm = YOUR.KERBEROS.REALM
6730   ads server = your.kerberos.server
6731   security = ADS
6732   encrypt passwords = yes</PRE
6733 ></P
6734 ><P
6735 >Strictly speaking, you can omit the realm name and you can use an IP
6736   address for the ads server. In that case Samba will auto-detect these.</P
6737 ><P
6738 >You do *not* need a smbpasswd file, although it won't do any harm
6739   and if you have one then Samba will be able to fall back to normal
6740   password security for older clients. I expect that the above
6741   required options will change soon when we get better active
6742   directory integration.</P
6743 ></DIV
6744 ><DIV
6745 CLASS="SECT1"
6746 ><HR><H2
6747 CLASS="SECT1"
6748 ><A
6749 NAME="AEN1205"
6750 ></A
6751 >8.4. Setup your /etc/krb5.conf</H2
6752 ><P
6753 >The minimal configuration for krb5.conf is:</P
6754 ><P
6755 ><PRE
6756 CLASS="PROGRAMLISTING"
6757 >       [realms]
6758     YOUR.KERBEROS.REALM = {
6759         kdc = your.kerberos.server
6760     }</PRE
6761 ></P
6762 ><P
6763 >Test your config by doing a "kinit USERNAME@REALM" and making sure that
6764   your password is accepted by the Win2000 KDC. </P
6765 ><P
6766 >NOTE: The realm must be uppercase. </P
6767 ><P
6768 >You also must ensure that you can do a reverse DNS lookup on the IP
6769 address of your KDC. Also, the name that this reverse lookup maps to
6770 must either be the netbios name of the KDC (ie. the hostname with no
6771 domain attached) or it can alternatively be the netbios name
6772 followed by the realm. </P
6773 ><P
6774 >The easiest way to ensure you get this right is to add a /etc/hosts
6775 entry mapping the IP address of your KDC to its netbios name. If you
6776 don't get this right then you will get a "local error" when you try
6777 to join the realm.</P
6778 ><P
6779 >If all you want is kerberos support in smbclient then you can skip
6780 straight to step 5 now. Step 3 is only needed if you want kerberos
6781 support in smbd.</P
6782 ></DIV
6783 ><DIV
6784 CLASS="SECT1"
6785 ><HR><H2
6786 CLASS="SECT1"
6787 ><A
6788 NAME="AEN1215"
6789 ></A
6790 >8.5. Create the computer account</H2
6791 ><P
6792 >Do a "kinit" as a user that has authority to change arbitrary
6793 passwords on the KDC ("Administrator" is a good choice). Then as a
6794 user that has write permission on the Samba private directory
6795 (usually root) run:
6796 <B
6797 CLASS="COMMAND"
6798 >net ads join</B
6799 ></P
6800 ><DIV
6801 CLASS="SECT2"
6802 ><HR><H3
6803 CLASS="SECT2"
6804 ><A
6805 NAME="AEN1219"
6806 ></A
6807 >8.5.1. Possible errors</H3
6808 ><P
6809 ><P
6810 ></P
6811 ><DIV
6812 CLASS="VARIABLELIST"
6813 ><DL
6814 ><DT
6815 >"bash: kinit: command not found"</DT
6816 ><DD
6817 ><P
6818 >kinit is in the krb5-workstation RPM on RedHat systems, and is in /usr/kerberos/bin, so it won't be in the path until you log in again (or open a new terminal)</P
6819 ></DD
6820 ><DT
6821 >"ADS support not compiled in"</DT
6822 ><DD
6823 ><P
6824 >Samba must be reconfigured (remove config.cache) and recompiled (make clean all install) after the kerberos libs and headers are installed.</P
6825 ></DD
6826 ></DL
6827 ></DIV
6828 ></P
6829 ></DIV
6830 ></DIV
6831 ><DIV
6832 CLASS="SECT1"
6833 ><HR><H2
6834 CLASS="SECT1"
6835 ><A
6836 NAME="AEN1231"
6837 ></A
6838 >8.6. Test your server setup</H2
6839 ><P
6840 >On a Windows 2000 client try <B
6841 CLASS="COMMAND"
6842 >net use * \\server\share</B
6843 >. You should
6844 be logged in with kerberos without needing to know a password. If
6845 this fails then run <B
6846 CLASS="COMMAND"
6847 >klist tickets</B
6848 >. Did you get a ticket for the
6849 server? Does it have an encoding type of DES-CBC-MD5 ? </P
6850 ></DIV
6851 ><DIV
6852 CLASS="SECT1"
6853 ><HR><H2
6854 CLASS="SECT1"
6855 ><A
6856 NAME="AEN1236"
6857 ></A
6858 >8.7. Testing with smbclient</H2
6859 ><P
6860 >On your Samba server try to login to a Win2000 server or your Samba
6861 server using smbclient and kerberos. Use smbclient as usual, but
6862 specify the -k option to choose kerberos authentication.</P
6863 ></DIV
6864 ><DIV
6865 CLASS="SECT1"
6866 ><HR><H2
6867 CLASS="SECT1"
6868 ><A
6869 NAME="AEN1239"
6870 ></A
6871 >8.8. Notes</H2
6872 ><P
6873 >You must change administrator password at least once after DC install,
6874  to create the right encoding types</P
6875 ><P
6876 >w2k doesn't seem to create the _kerberos._udp and _ldap._tcp in
6877    their defaults DNS setup. Maybe fixed in service packs?</P
6878 ></DIV
6879 ></DIV
6880 ><DIV
6881 CLASS="CHAPTER"
6882 ><HR><H1
6883 ><A
6884 NAME="DOMAIN-SECURITY"
6885 ></A
6886 >Chapter 9. Samba as a NT4 domain member</H1
6887 ><DIV
6888 CLASS="SECT1"
6889 ><H2
6890 CLASS="SECT1"
6891 ><A
6892 NAME="AEN1261"
6893 ></A
6894 >9.1. Joining an NT Domain with Samba 2.2</H2
6895 ><P
6896 >Assume you have a Samba 2.x server with a NetBIOS name of 
6897         <TT
6898 CLASS="CONSTANT"
6899 >SERV1</TT
6900 > and are joining an NT domain called
6901         <TT
6902 CLASS="CONSTANT"
6903 >DOM</TT
6904 >, which has a PDC with a NetBIOS name
6905         of <TT
6906 CLASS="CONSTANT"
6907 >DOMPDC</TT
6908 > and two backup domain controllers 
6909         with NetBIOS names <TT
6910 CLASS="CONSTANT"
6911 >DOMBDC1</TT
6912 > and <TT
6913 CLASS="CONSTANT"
6914 >DOMBDC2
6915         </TT
6916 >.</P
6917 ><P
6918 >In order to join the domain, first stop all Samba daemons 
6919         and run the command:</P
6920 ><P
6921 ><TT
6922 CLASS="PROMPT"
6923 >root# </TT
6924 ><TT
6925 CLASS="USERINPUT"
6926 ><B
6927 >smbpasswd -j DOM -r DOMPDC
6928         -U<TT
6929 CLASS="REPLACEABLE"
6930 ><I
6931 >Administrator%password</I
6932 ></TT
6933 ></B
6934 ></TT
6935 ></P
6936 ><P
6937 >as we are joining the domain DOM and the PDC for that domain 
6938         (the only machine that has write access to the domain SAM database) 
6939         is DOMPDC. The <TT
6940 CLASS="REPLACEABLE"
6941 ><I
6942 >Administrator%password</I
6943 ></TT
6944 > is 
6945         the login name and password for an account which has the necessary 
6946         privilege to add machines to the domain.  If this is successful 
6947         you will see the message:</P
6948 ><P
6949 ><TT
6950 CLASS="COMPUTEROUTPUT"
6951 >smbpasswd: Joined domain DOM.</TT
6952 >
6953         </P
6954 ><P
6955 >in your terminal window. See the <A
6956 HREF="smbpasswd.8.html"
6957 TARGET="_top"
6958 >       smbpasswd(8)</A
6959 > man page for more details.</P
6960 ><P
6961 >There is existing development code to join a domain
6962         without having to create the machine trust account on the PDC
6963         beforehand.  This code will hopefully be available soon
6964         in release branches as well.</P
6965 ><P
6966 >This command goes through the machine account password 
6967         change protocol, then writes the new (random) machine account 
6968         password for this Samba server into a file in the same directory 
6969         in which an smbpasswd file would be stored - normally :</P
6970 ><P
6971 ><TT
6972 CLASS="FILENAME"
6973 >/usr/local/samba/private</TT
6974 ></P
6975 ><P
6976 >In Samba 2.0.x, the filename looks like this:</P
6977 ><P
6978 ><TT
6979 CLASS="FILENAME"
6980 ><TT
6981 CLASS="REPLACEABLE"
6982 ><I
6983 >&lt;NT DOMAIN NAME&gt;</I
6984 ></TT
6985 >.<TT
6986 CLASS="REPLACEABLE"
6987 ><I
6988 >&lt;Samba 
6989         Server Name&gt;</I
6990 ></TT
6991 >.mac</TT
6992 ></P
6993 ><P
6994 >The <TT
6995 CLASS="FILENAME"
6996 >.mac</TT
6997 > suffix stands for machine account 
6998         password file. So in our example above, the file would be called:</P
6999 ><P
7000 ><TT
7001 CLASS="FILENAME"
7002 >DOM.SERV1.mac</TT
7003 ></P
7004 ><P
7005 >In Samba 2.2, this file has been replaced with a TDB 
7006         (Trivial Database) file named <TT
7007 CLASS="FILENAME"
7008 >secrets.tdb</TT
7009 >.
7010         </P
7011 ><P
7012 >This file is created and owned by root and is not 
7013         readable by any other user. It is the key to the domain-level 
7014         security for your system, and should be treated as carefully 
7015         as a shadow password file.</P
7016 ><P
7017 >Now, before restarting the Samba daemons you must 
7018         edit your <A
7019 HREF="smb.conf.5.html"
7020 TARGET="_top"
7021 ><TT
7022 CLASS="FILENAME"
7023 >smb.conf(5)</TT
7024 >
7025         </A
7026 > file to tell Samba it should now use domain security.</P
7027 ><P
7028 >Change (or add) your <A
7029 HREF="smb.conf.5.html#SECURITY"
7030 TARGET="_top"
7031 >       <TT
7032 CLASS="PARAMETER"
7033 ><I
7034 >security =</I
7035 ></TT
7036 ></A
7037 > line in the [global] section 
7038         of your smb.conf to read:</P
7039 ><P
7040 ><B
7041 CLASS="COMMAND"
7042 >security = domain</B
7043 ></P
7044 ><P
7045 >Next change the <A
7046 HREF="smb.conf.5.html#WORKGROUP"
7047 TARGET="_top"
7048 ><TT
7049 CLASS="PARAMETER"
7050 ><I
7051 >       workgroup =</I
7052 ></TT
7053 ></A
7054 > line in the [global] section to read: </P
7055 ><P
7056 ><B
7057 CLASS="COMMAND"
7058 >workgroup = DOM</B
7059 ></P
7060 ><P
7061 >as this is the name of the domain we are joining. </P
7062 ><P
7063 >You must also have the parameter <A
7064 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
7065 TARGET="_top"
7066 >       <TT
7067 CLASS="PARAMETER"
7068 ><I
7069 >encrypt passwords</I
7070 ></TT
7071 ></A
7072 > set to <TT
7073 CLASS="CONSTANT"
7074 >yes
7075         </TT
7076 > in order for your users to authenticate to the NT PDC.</P
7077 ><P
7078 >Finally, add (or modify) a <A
7079 HREF="smb.conf.5.html#PASSWORDSERVER"
7080 TARGET="_top"
7081 >       <TT
7082 CLASS="PARAMETER"
7083 ><I
7084 >password server =</I
7085 ></TT
7086 ></A
7087 > line in the [global]
7088         section to read: </P
7089 ><P
7090 ><B
7091 CLASS="COMMAND"
7092 >password server = DOMPDC DOMBDC1 DOMBDC2</B
7093 ></P
7094 ><P
7095 >These are the primary and backup domain controllers Samba 
7096         will attempt to contact in order to authenticate users. Samba will 
7097         try to contact each of these servers in order, so you may want to 
7098         rearrange this list in order to spread out the authentication load 
7099         among domain controllers.</P
7100 ><P
7101 >Alternatively, if you want smbd to automatically determine 
7102         the list of Domain controllers to use for authentication, you may 
7103         set this line to be :</P
7104 ><P
7105 ><B
7106 CLASS="COMMAND"
7107 >password server = *</B
7108 ></P
7109 ><P
7110 >This method, which was introduced in Samba 2.0.6, 
7111         allows Samba to use exactly the same mechanism that NT does. This 
7112         method either broadcasts or uses a WINS database in order to
7113         find domain controllers to authenticate against.</P
7114 ><P
7115 >Finally, restart your Samba daemons and get ready for 
7116         clients to begin using domain security!</P
7117 ></DIV
7118 ><DIV
7119 CLASS="SECT1"
7120 ><HR><H2
7121 CLASS="SECT1"
7122 ><A
7123 NAME="AEN1325"
7124 ></A
7125 >9.2. Samba and Windows 2000 Domains</H2
7126 ><P
7127 >Many people have asked regarding the state of Samba's ability to participate in
7128 a Windows 2000 Domain.  Samba 3.0 is able to act as a member server of a Windows
7129 2000 domain operating in mixed or native mode.</P
7130 ><P
7131 >There is much confusion between the circumstances that require a "mixed" mode
7132 Win2k DC and a when this host can be switched to "native" mode.  A "mixed" mode
7133 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
7134 domain.  By default, a Win2k DC in "native" mode will still support
7135 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and 
7136 NT 4.0.  Samba has the same requirements as a Windows NT 4.0 member server.</P
7137 ><P
7138 >The steps for adding a Samba 2.2 host to a Win2k domain are the same as those
7139 for adding a Samba server to a Windows NT 4.0 domain. The only exception is that 
7140 the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and 
7141 Computers" MMC (Microsoft Management Console) plugin.</P
7142 ></DIV
7143 ><DIV
7144 CLASS="SECT1"
7145 ><HR><H2
7146 CLASS="SECT1"
7147 ><A
7148 NAME="AEN1330"
7149 ></A
7150 >9.3. Why is this better than security = server?</H2
7151 ><P
7152 >Currently, domain security in Samba doesn't free you from 
7153         having to create local Unix users to represent the users attaching 
7154         to your server. This means that if domain user <TT
7155 CLASS="CONSTANT"
7156 >DOM\fred
7157         </TT
7158 > attaches to your domain security Samba server, there needs 
7159         to be a local Unix user fred to represent that user in the Unix 
7160         filesystem. This is very similar to the older Samba security mode 
7161         <A
7162 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
7163 TARGET="_top"
7164 >security = server</A
7165 >, 
7166         where Samba would pass through the authentication request to a Windows 
7167         NT server in the same way as a Windows 95 or Windows 98 server would.
7168         </P
7169 ><P
7170 >Please refer to the <A
7171 HREF="winbind.html"
7172 TARGET="_top"
7173 >Winbind 
7174         paper</A
7175 > for information on a system to automatically
7176         assign UNIX uids and gids to Windows NT Domain users and groups.
7177         This code is available in development branches only at the moment,
7178         but will be moved to release branches soon.</P
7179 ><P
7180 >The advantage to domain-level security is that the 
7181         authentication in domain-level security is passed down the authenticated 
7182         RPC channel in exactly the same way that an NT server would do it. This 
7183         means Samba servers now participate in domain trust relationships in 
7184         exactly the same way NT servers do (i.e., you can add Samba servers into 
7185         a resource domain and have the authentication passed on from a resource
7186         domain PDC to an account domain PDC.</P
7187 ><P
7188 >In addition, with <B
7189 CLASS="COMMAND"
7190 >security = server</B
7191 > every Samba 
7192         daemon on a server has to keep a connection open to the 
7193         authenticating server for as long as that daemon lasts. This can drain 
7194         the connection resources on a Microsoft NT server and cause it to run 
7195         out of available connections. With <B
7196 CLASS="COMMAND"
7197 >security = domain</B
7198 >, 
7199         however, the Samba daemons connect to the PDC/BDC only for as long 
7200         as is necessary to authenticate the user, and then drop the connection, 
7201         thus conserving PDC connection resources.</P
7202 ><P
7203 >And finally, acting in the same manner as an NT server 
7204         authenticating to a PDC means that as part of the authentication 
7205         reply, the Samba server gets the user identification information such 
7206         as the user SID, the list of NT groups the user belongs to, etc. All 
7207         this information will allow Samba to be extended in the future into 
7208         a mode the developers currently call appliance mode. In this mode, 
7209         no local Unix users will be necessary, and Samba will generate Unix 
7210         uids and gids from the information passed back from the PDC when a 
7211         user is authenticated, making a Samba server truly plug and play 
7212         in an NT domain environment. Watch for this code soon.</P
7213 ><P
7214 ><SPAN
7215 CLASS="emphasis"
7216 ><I
7217 CLASS="EMPHASIS"
7218 >NOTE:</I
7219 ></SPAN
7220 > Much of the text of this document 
7221         was first published in the Web magazine <A
7222 HREF="http://www.linuxworld.com"
7223 TARGET="_top"
7224 >       
7225         LinuxWorld</A
7226 > as the article <A
7227 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
7228 TARGET="_top"
7229 >Doing 
7230         the NIS/NT Samba</A
7231 >.</P
7232 ></DIV
7233 ></DIV
7234 ></DIV
7235 ><DIV
7236 CLASS="PART"
7237 ><A
7238 NAME="AEN1346"
7239 ></A
7240 ><DIV
7241 CLASS="TITLEPAGE"
7242 ><H1
7243 CLASS="TITLE"
7244 >III. Optional configuration</H1
7245 ><DIV
7246 CLASS="PARTINTRO"
7247 ><A
7248 NAME="AEN1348"
7249 ></A
7250 ><H1
7251 >Introduction</H1
7252 ><P
7253 >Samba has several features that you might want or might not want to use. The chapters in this 
7254 part each cover one specific feature.</P
7255 ></DIV
7256 ><DIV
7257 CLASS="TOC"
7258 ><DL
7259 ><DT
7260 ><B
7261 >Table of Contents</B
7262 ></DT
7263 ><DT
7264 >10. <A
7265 HREF="#INTEGRATE-MS-NETWORKS"
7266 >Integrating MS Windows networks with Samba</A
7267 ></DT
7268 ><DD
7269 ><DL
7270 ><DT
7271 >10.1. <A
7272 HREF="#AEN1362"
7273 >Agenda</A
7274 ></DT
7275 ><DT
7276 >10.2. <A
7277 HREF="#AEN1384"
7278 >Name Resolution in a pure Unix/Linux world</A
7279 ></DT
7280 ><DD
7281 ><DL
7282 ><DT
7283 >10.2.1. <A
7284 HREF="#AEN1400"
7285 ><TT
7286 CLASS="FILENAME"
7287 >/etc/hosts</TT
7288 ></A
7289 ></DT
7290 ><DT
7291 >10.2.2. <A
7292 HREF="#AEN1416"
7293 ><TT
7294 CLASS="FILENAME"
7295 >/etc/resolv.conf</TT
7296 ></A
7297 ></DT
7298 ><DT
7299 >10.2.3. <A
7300 HREF="#AEN1427"
7301 ><TT
7302 CLASS="FILENAME"
7303 >/etc/host.conf</TT
7304 ></A
7305 ></DT
7306 ><DT
7307 >10.2.4. <A
7308 HREF="#AEN1435"
7309 ><TT
7310 CLASS="FILENAME"
7311 >/etc/nsswitch.conf</TT
7312 ></A
7313 ></DT
7314 ></DL
7315 ></DD
7316 ><DT
7317 >10.3. <A
7318 HREF="#AEN1447"
7319 >Name resolution as used within MS Windows networking</A
7320 ></DT
7321 ><DD
7322 ><DL
7323 ><DT
7324 >10.3.1. <A
7325 HREF="#AEN1459"
7326 >The NetBIOS Name Cache</A
7327 ></DT
7328 ><DT
7329 >10.3.2. <A
7330 HREF="#AEN1464"
7331 >The LMHOSTS file</A
7332 ></DT
7333 ><DT
7334 >10.3.3. <A
7335 HREF="#AEN1472"
7336 >HOSTS file</A
7337 ></DT
7338 ><DT
7339 >10.3.4. <A
7340 HREF="#AEN1477"
7341 >DNS Lookup</A
7342 ></DT
7343 ><DT
7344 >10.3.5. <A
7345 HREF="#AEN1480"
7346 >WINS Lookup</A
7347 ></DT
7348 ></DL
7349 ></DD
7350 ><DT
7351 >10.4. <A
7352 HREF="#AEN1492"
7353 >How browsing functions and how to deploy stable and 
7354 dependable browsing using Samba</A
7355 ></DT
7356 ><DT
7357 >10.5. <A
7358 HREF="#AEN1502"
7359 >MS Windows security options and how to configure 
7360 Samba for seemless integration</A
7361 ></DT
7362 ><DD
7363 ><DL
7364 ><DT
7365 >10.5.1. <A
7366 HREF="#AEN1530"
7367 >Use MS Windows NT as an authentication server</A
7368 ></DT
7369 ><DT
7370 >10.5.2. <A
7371 HREF="#AEN1538"
7372 >Make Samba a member of an MS Windows NT security domain</A
7373 ></DT
7374 ><DT
7375 >10.5.3. <A
7376 HREF="#AEN1555"
7377 >Configure Samba as an authentication server</A
7378 ></DT
7379 ></DL
7380 ></DD
7381 ><DT
7382 >10.6. <A
7383 HREF="#AEN1572"
7384 >Conclusions</A
7385 ></DT
7386 ></DL
7387 ></DD
7388 ><DT
7389 >11. <A
7390 HREF="#UNIX-PERMISSIONS"
7391 >UNIX Permission Bits and Windows NT Access Control Lists</A
7392 ></DT
7393 ><DD
7394 ><DL
7395 ><DT
7396 >11.1. <A
7397 HREF="#AEN1593"
7398 >Viewing and changing UNIX permissions using the NT 
7399         security dialogs</A
7400 ></DT
7401 ><DT
7402 >11.2. <A
7403 HREF="#AEN1602"
7404 >How to view file security on a Samba share</A
7405 ></DT
7406 ><DT
7407 >11.3. <A
7408 HREF="#AEN1613"
7409 >Viewing file ownership</A
7410 ></DT
7411 ><DT
7412 >11.4. <A
7413 HREF="#AEN1633"
7414 >Viewing file or directory permissions</A
7415 ></DT
7416 ><DD
7417 ><DL
7418 ><DT
7419 >11.4.1. <A
7420 HREF="#AEN1648"
7421 >File Permissions</A
7422 ></DT
7423 ><DT
7424 >11.4.2. <A
7425 HREF="#AEN1662"
7426 >Directory Permissions</A
7427 ></DT
7428 ></DL
7429 ></DD
7430 ><DT
7431 >11.5. <A
7432 HREF="#AEN1669"
7433 >Modifying file or directory permissions</A
7434 ></DT
7435 ><DT
7436 >11.6. <A
7437 HREF="#AEN1691"
7438 >Interaction with the standard Samba create mask 
7439         parameters</A
7440 ></DT
7441 ><DT
7442 >11.7. <A
7443 HREF="#AEN1755"
7444 >Interaction with the standard Samba file attribute 
7445         mapping</A
7446 ></DT
7447 ></DL
7448 ></DD
7449 ><DT
7450 >12. <A
7451 HREF="#PAM"
7452 >Configuring PAM for distributed but centrally 
7453 managed authentication</A
7454 ></DT
7455 ><DD
7456 ><DL
7457 ><DT
7458 >12.1. <A
7459 HREF="#AEN1776"
7460 >Samba and PAM</A
7461 ></DT
7462 ><DT
7463 >12.2. <A
7464 HREF="#AEN1820"
7465 >Distributed Authentication</A
7466 ></DT
7467 ><DT
7468 >12.3. <A
7469 HREF="#AEN1827"
7470 >PAM Configuration in smb.conf</A
7471 ></DT
7472 ></DL
7473 ></DD
7474 ><DT
7475 >13. <A
7476 HREF="#MSDFS"
7477 >Hosting a Microsoft Distributed File System tree on Samba</A
7478 ></DT
7479 ><DD
7480 ><DL
7481 ><DT
7482 >13.1. <A
7483 HREF="#AEN1847"
7484 >Instructions</A
7485 ></DT
7486 ><DD
7487 ><DL
7488 ><DT
7489 >13.1.1. <A
7490 HREF="#AEN1882"
7491 >Notes</A
7492 ></DT
7493 ></DL
7494 ></DD
7495 ></DL
7496 ></DD
7497 ><DT
7498 >14. <A
7499 HREF="#PRINTING"
7500 >Printing Support</A
7501 ></DT
7502 ><DD
7503 ><DL
7504 ><DT
7505 >14.1. <A
7506 HREF="#AEN1908"
7507 >Introduction</A
7508 ></DT
7509 ><DT
7510 >14.2. <A
7511 HREF="#AEN1930"
7512 >Configuration</A
7513 ></DT
7514 ><DD
7515 ><DL
7516 ><DT
7517 >14.2.1. <A
7518 HREF="#AEN1938"
7519 >Creating [print$]</A
7520 ></DT
7521 ><DT
7522 >14.2.2. <A
7523 HREF="#AEN1973"
7524 >Setting Drivers for Existing Printers</A
7525 ></DT
7526 ><DT
7527 >14.2.3. <A
7528 HREF="#AEN1989"
7529 >Support a large number of printers</A
7530 ></DT
7531 ><DT
7532 >14.2.4. <A
7533 HREF="#AEN2000"
7534 >Adding New Printers via the Windows NT APW</A
7535 ></DT
7536 ><DT
7537 >14.2.5. <A
7538 HREF="#AEN2030"
7539 >Samba and Printer Ports</A
7540 ></DT
7541 ></DL
7542 ></DD
7543 ><DT
7544 >14.3. <A
7545 HREF="#AEN2038"
7546 >The Imprints Toolset</A
7547 ></DT
7548 ><DD
7549 ><DL
7550 ><DT
7551 >14.3.1. <A
7552 HREF="#AEN2042"
7553 >What is Imprints?</A
7554 ></DT
7555 ><DT
7556 >14.3.2. <A
7557 HREF="#AEN2052"
7558 >Creating Printer Driver Packages</A
7559 ></DT
7560 ><DT
7561 >14.3.3. <A
7562 HREF="#AEN2055"
7563 >The Imprints server</A
7564 ></DT
7565 ><DT
7566 >14.3.4. <A
7567 HREF="#AEN2059"
7568 >The Installation Client</A
7569 ></DT
7570 ></DL
7571 ></DD
7572 ><DT
7573 >14.4. <A
7574 HREF="#AEN2081"
7575 >Diagnosis</A
7576 ></DT
7577 ><DD
7578 ><DL
7579 ><DT
7580 >14.4.1. <A
7581 HREF="#AEN2083"
7582 >Introduction</A
7583 ></DT
7584 ><DT
7585 >14.4.2. <A
7586 HREF="#AEN2099"
7587 >Debugging printer problems</A
7588 ></DT
7589 ><DT
7590 >14.4.3. <A
7591 HREF="#AEN2108"
7592 >What printers do I have?</A
7593 ></DT
7594 ><DT
7595 >14.4.4. <A
7596 HREF="#AEN2116"
7597 >Setting up printcap and print servers</A
7598 ></DT
7599 ><DT
7600 >14.4.5. <A
7601 HREF="#AEN2144"
7602 >Job sent, no output</A
7603 ></DT
7604 ><DT
7605 >14.4.6. <A
7606 HREF="#AEN2155"
7607 >Job sent, strange output</A
7608 ></DT
7609 ><DT
7610 >14.4.7. <A
7611 HREF="#AEN2167"
7612 >Raw PostScript printed</A
7613 ></DT
7614 ><DT
7615 >14.4.8. <A
7616 HREF="#AEN2170"
7617 >Advanced Printing</A
7618 ></DT
7619 ><DT
7620 >14.4.9. <A
7621 HREF="#AEN2173"
7622 >Real debugging</A
7623 ></DT
7624 ></DL
7625 ></DD
7626 ></DL
7627 ></DD
7628 ><DT
7629 >15. <A
7630 HREF="#SECURITYLEVELS"
7631 >Security levels</A
7632 ></DT
7633 ><DD
7634 ><DL
7635 ><DT
7636 >15.1. <A
7637 HREF="#AEN2186"
7638 >Introduction</A
7639 ></DT
7640 ><DT
7641 >15.2. <A
7642 HREF="#AEN2197"
7643 >More complete description of security levels</A
7644 ></DT
7645 ></DL
7646 ></DD
7647 ><DT
7648 >16. <A
7649 HREF="#WINBIND"
7650 >Unified Logons between Windows NT and UNIX using Winbind</A
7651 ></DT
7652 ><DD
7653 ><DL
7654 ><DT
7655 >16.1. <A
7656 HREF="#AEN2249"
7657 >Abstract</A
7658 ></DT
7659 ><DT
7660 >16.2. <A
7661 HREF="#AEN2253"
7662 >Introduction</A
7663 ></DT
7664 ><DT
7665 >16.3. <A
7666 HREF="#AEN2266"
7667 >What Winbind Provides</A
7668 ></DT
7669 ><DD
7670 ><DL
7671 ><DT
7672 >16.3.1. <A
7673 HREF="#AEN2273"
7674 >Target Uses</A
7675 ></DT
7676 ></DL
7677 ></DD
7678 ><DT
7679 >16.4. <A
7680 HREF="#AEN2277"
7681 >How Winbind Works</A
7682 ></DT
7683 ><DD
7684 ><DL
7685 ><DT
7686 >16.4.1. <A
7687 HREF="#AEN2282"
7688 >Microsoft Remote Procedure Calls</A
7689 ></DT
7690 ><DT
7691 >16.4.2. <A
7692 HREF="#AEN2286"
7693 >Name Service Switch</A
7694 ></DT
7695 ><DT
7696 >16.4.3. <A
7697 HREF="#AEN2302"
7698 >Pluggable Authentication Modules</A
7699 ></DT
7700 ><DT
7701 >16.4.4. <A
7702 HREF="#AEN2310"
7703 >User and Group ID Allocation</A
7704 ></DT
7705 ><DT
7706 >16.4.5. <A
7707 HREF="#AEN2314"
7708 >Result Caching</A
7709 ></DT
7710 ></DL
7711 ></DD
7712 ><DT
7713 >16.5. <A
7714 HREF="#AEN2317"
7715 >Installation and Configuration</A
7716 ></DT
7717 ><DD
7718 ><DL
7719 ><DT
7720 >16.5.1. <A
7721 HREF="#AEN2324"
7722 >Introduction</A
7723 ></DT
7724 ><DT
7725 >16.5.2. <A
7726 HREF="#AEN2337"
7727 >Requirements</A
7728 ></DT
7729 ><DT
7730 >16.5.3. <A
7731 HREF="#AEN2351"
7732 >Testing Things Out</A
7733 ></DT
7734 ></DL
7735 ></DD
7736 ><DT
7737 >16.6. <A
7738 HREF="#AEN2566"
7739 >Limitations</A
7740 ></DT
7741 ><DT
7742 >16.7. <A
7743 HREF="#AEN2576"
7744 >Conclusion</A
7745 ></DT
7746 ></DL
7747 ></DD
7748 ><DT
7749 >17. <A
7750 HREF="#PDB-MYSQL"
7751 >Passdb MySQL plugin</A
7752 ></DT
7753 ><DD
7754 ><DL
7755 ><DT
7756 >17.1. <A
7757 HREF="#AEN2590"
7758 >Building</A
7759 ></DT
7760 ><DT
7761 >17.2. <A
7762 HREF="#AEN2596"
7763 >Configuring</A
7764 ></DT
7765 ><DT
7766 >17.3. <A
7767 HREF="#AEN2611"
7768 >Using plaintext passwords or encrypted password</A
7769 ></DT
7770 ><DT
7771 >17.4. <A
7772 HREF="#AEN2616"
7773 >Getting non-column data from the table</A
7774 ></DT
7775 ></DL
7776 ></DD
7777 ><DT
7778 >18. <A
7779 HREF="#PDB-XML"
7780 >Passdb XML plugin</A
7781 ></DT
7782 ><DD
7783 ><DL
7784 ><DT
7785 >18.1. <A
7786 HREF="#AEN2635"
7787 >Building</A
7788 ></DT
7789 ><DT
7790 >18.2. <A
7791 HREF="#AEN2641"
7792 >Usage</A
7793 ></DT
7794 ></DL
7795 ></DD
7796 ><DT
7797 >19. <A
7798 HREF="#SAMBA-LDAP-HOWTO"
7799 >Storing Samba's User/Machine Account information in an LDAP Directory</A
7800 ></DT
7801 ><DD
7802 ><DL
7803 ><DT
7804 >19.1. <A
7805 HREF="#AEN2664"
7806 >Purpose</A
7807 ></DT
7808 ><DT
7809 >19.2. <A
7810 HREF="#AEN2684"
7811 >Introduction</A
7812 ></DT
7813 ><DT
7814 >19.3. <A
7815 HREF="#AEN2713"
7816 >Supported LDAP Servers</A
7817 ></DT
7818 ><DT
7819 >19.4. <A
7820 HREF="#AEN2718"
7821 >Schema and Relationship to the RFC 2307 posixAccount</A
7822 ></DT
7823 ><DT
7824 >19.5. <A
7825 HREF="#AEN2730"
7826 >Configuring Samba with LDAP</A
7827 ></DT
7828 ><DD
7829 ><DL
7830 ><DT
7831 >19.5.1. <A
7832 HREF="#AEN2732"
7833 >OpenLDAP configuration</A
7834 ></DT
7835 ><DT
7836 >19.5.2. <A
7837 HREF="#AEN2749"
7838 >Configuring Samba</A
7839 ></DT
7840 ></DL
7841 ></DD
7842 ><DT
7843 >19.6. <A
7844 HREF="#AEN2777"
7845 >Accounts and Groups management</A
7846 ></DT
7847 ><DT
7848 >19.7. <A
7849 HREF="#AEN2782"
7850 >Security and sambaAccount</A
7851 ></DT
7852 ><DT
7853 >19.8. <A
7854 HREF="#AEN2802"
7855 >LDAP specials attributes for sambaAccounts</A
7856 ></DT
7857 ><DT
7858 >19.9. <A
7859 HREF="#AEN2872"
7860 >Example LDIF Entries for a sambaAccount</A
7861 ></DT
7862 ><DT
7863 >19.10. <A
7864 HREF="#AEN2880"
7865 >Comments</A
7866 ></DT
7867 ></DL
7868 ></DD
7869 ><DT
7870 >20. <A
7871 HREF="#CVS-ACCESS"
7872 >HOWTO Access Samba source code via CVS</A
7873 ></DT
7874 ><DD
7875 ><DL
7876 ><DT
7877 >20.1. <A
7878 HREF="#AEN2891"
7879 >Introduction</A
7880 ></DT
7881 ><DT
7882 >20.2. <A
7883 HREF="#AEN2896"
7884 >CVS Access to samba.org</A
7885 ></DT
7886 ><DD
7887 ><DL
7888 ><DT
7889 >20.2.1. <A
7890 HREF="#AEN2899"
7891 >Access via CVSweb</A
7892 ></DT
7893 ><DT
7894 >20.2.2. <A
7895 HREF="#AEN2904"
7896 >Access via cvs</A
7897 ></DT
7898 ></DL
7899 ></DD
7900 ></DL
7901 ></DD
7902 ><DT
7903 >21. <A
7904 HREF="#GROUPMAPPING"
7905 >Group mapping HOWTO</A
7906 ></DT
7907 ><DT
7908 >22. <A
7909 HREF="#SPEED"
7910 >Samba performance issues</A
7911 ></DT
7912 ><DD
7913 ><DL
7914 ><DT
7915 >22.1. <A
7916 HREF="#AEN2982"
7917 >Comparisons</A
7918 ></DT
7919 ><DT
7920 >22.2. <A
7921 HREF="#AEN2988"
7922 >Oplocks</A
7923 ></DT
7924 ><DD
7925 ><DL
7926 ><DT
7927 >22.2.1. <A
7928 HREF="#AEN2990"
7929 >Overview</A
7930 ></DT
7931 ><DT
7932 >22.2.2. <A
7933 HREF="#AEN2998"
7934 >Level2 Oplocks</A
7935 ></DT
7936 ><DT
7937 >22.2.3. <A
7938 HREF="#AEN3004"
7939 >Old 'fake oplocks' option - deprecated</A
7940 ></DT
7941 ></DL
7942 ></DD
7943 ><DT
7944 >22.3. <A
7945 HREF="#AEN3008"
7946 >Socket options</A
7947 ></DT
7948 ><DT
7949 >22.4. <A
7950 HREF="#AEN3015"
7951 >Read size</A
7952 ></DT
7953 ><DT
7954 >22.5. <A
7955 HREF="#AEN3020"
7956 >Max xmit</A
7957 ></DT
7958 ><DT
7959 >22.6. <A
7960 HREF="#AEN3025"
7961 >Locking</A
7962 ></DT
7963 ><DT
7964 >22.7. <A
7965 HREF="#AEN3029"
7966 >Share modes</A
7967 ></DT
7968 ><DT
7969 >22.8. <A
7970 HREF="#AEN3034"
7971 >Log level</A
7972 ></DT
7973 ><DT
7974 >22.9. <A
7975 HREF="#AEN3037"
7976 >Wide lines</A
7977 ></DT
7978 ><DT
7979 >22.10. <A
7980 HREF="#AEN3040"
7981 >Read raw</A
7982 ></DT
7983 ><DT
7984 >22.11. <A
7985 HREF="#AEN3045"
7986 >Write raw</A
7987 ></DT
7988 ><DT
7989 >22.12. <A
7990 HREF="#AEN3049"
7991 >Read prediction</A
7992 ></DT
7993 ><DT
7994 >22.13. <A
7995 HREF="#AEN3056"
7996 >Memory mapping</A
7997 ></DT
7998 ><DT
7999 >22.14. <A
8000 HREF="#AEN3061"
8001 >Slow Clients</A
8002 ></DT
8003 ><DT
8004 >22.15. <A
8005 HREF="#AEN3065"
8006 >Slow Logins</A
8007 ></DT
8008 ><DT
8009 >22.16. <A
8010 HREF="#AEN3068"
8011 >Client tuning</A
8012 ></DT
8013 ><DT
8014 >22.17. <A
8015 HREF="#AEN3100"
8016 >My Results</A
8017 ></DT
8018 ></DL
8019 ></DD
8020 ></DL
8021 ></DIV
8022 ></DIV
8023 ><DIV
8024 CLASS="CHAPTER"
8025 ><HR><H1
8026 ><A
8027 NAME="INTEGRATE-MS-NETWORKS"
8028 ></A
8029 >Chapter 10. Integrating MS Windows networks with Samba</H1
8030 ><DIV
8031 CLASS="SECT1"
8032 ><H2
8033 CLASS="SECT1"
8034 ><A
8035 NAME="AEN1362"
8036 ></A
8037 >10.1. Agenda</H2
8038 ><P
8039 >To identify the key functional mechanisms of MS Windows networking 
8040 to enable the deployment of Samba as a means of extending and/or 
8041 replacing MS Windows NT/2000 technology.</P
8042 ><P
8043 >We will examine:</P
8044 ><P
8045 ></P
8046 ><OL
8047 TYPE="1"
8048 ><LI
8049 ><P
8050 >Name resolution in a pure Unix/Linux TCP/IP 
8051         environment
8052         </P
8053 ></LI
8054 ><LI
8055 ><P
8056 >Name resolution as used within MS Windows 
8057         networking
8058         </P
8059 ></LI
8060 ><LI
8061 ><P
8062 >How browsing functions and how to deploy stable 
8063         and dependable browsing using Samba
8064         </P
8065 ></LI
8066 ><LI
8067 ><P
8068 >MS Windows security options and how to 
8069         configure Samba for seemless integration
8070         </P
8071 ></LI
8072 ><LI
8073 ><P
8074 >Configuration of Samba as:</P
8075 ><P
8076 ></P
8077 ><OL
8078 TYPE="a"
8079 ><LI
8080 ><P
8081 >A stand-alone server</P
8082 ></LI
8083 ><LI
8084 ><P
8085 >An MS Windows NT 3.x/4.0 security domain member
8086                 </P
8087 ></LI
8088 ><LI
8089 ><P
8090 >An alternative to an MS Windows NT 3.x/4.0 Domain Controller
8091                 </P
8092 ></LI
8093 ></OL
8094 ></LI
8095 ></OL
8096 ></DIV
8097 ><DIV
8098 CLASS="SECT1"
8099 ><HR><H2
8100 CLASS="SECT1"
8101 ><A
8102 NAME="AEN1384"
8103 ></A
8104 >10.2. Name Resolution in a pure Unix/Linux world</H2
8105 ><P
8106 >The key configuration files covered in this section are:</P
8107 ><P
8108 ></P
8109 ><UL
8110 ><LI
8111 ><P
8112 ><TT
8113 CLASS="FILENAME"
8114 >/etc/hosts</TT
8115 ></P
8116 ></LI
8117 ><LI
8118 ><P
8119 ><TT
8120 CLASS="FILENAME"
8121 >/etc/resolv.conf</TT
8122 ></P
8123 ></LI
8124 ><LI
8125 ><P
8126 ><TT
8127 CLASS="FILENAME"
8128 >/etc/host.conf</TT
8129 ></P
8130 ></LI
8131 ><LI
8132 ><P
8133 ><TT
8134 CLASS="FILENAME"
8135 >/etc/nsswitch.conf</TT
8136 ></P
8137 ></LI
8138 ></UL
8139 ><DIV
8140 CLASS="SECT2"
8141 ><HR><H3
8142 CLASS="SECT2"
8143 ><A
8144 NAME="AEN1400"
8145 ></A
8146 >10.2.1. <TT
8147 CLASS="FILENAME"
8148 >/etc/hosts</TT
8149 ></H3
8150 ><P
8151 >Contains a static list of IP Addresses and names.
8152 eg:</P
8153 ><P
8154 ><PRE
8155 CLASS="PROGRAMLISTING"
8156 >       127.0.0.1       localhost localhost.localdomain
8157         192.168.1.1     bigbox.caldera.com      bigbox  alias4box</PRE
8158 ></P
8159 ><P
8160 >The purpose of <TT
8161 CLASS="FILENAME"
8162 >/etc/hosts</TT
8163 > is to provide a 
8164 name resolution mechanism so that uses do not need to remember 
8165 IP addresses.</P
8166 ><P
8167 >Network packets that are sent over the physical network transport 
8168 layer communicate not via IP addresses but rather using the Media 
8169 Access Control address, or MAC address. IP Addresses are currently 
8170 32 bits in length and are typically presented as four (4) decimal 
8171 numbers that are separated by a dot (or period). eg: 168.192.1.1</P
8172 ><P
8173 >MAC Addresses use 48 bits (or 6 bytes) and are typically represented 
8174 as two digit hexadecimal numbers separated by colons. eg: 
8175 40:8e:0a:12:34:56</P
8176 ><P
8177 >Every network interfrace must have an MAC address. Associated with 
8178 a MAC address there may be one or more IP addresses. There is NO 
8179 relationship between an IP address and a MAC address, all such assignments 
8180 are arbitary or discretionary in nature. At the most basic level all 
8181 network communications takes place using MAC addressing. Since MAC 
8182 addresses must be globally unique, and generally remains fixed for 
8183 any particular interface, the assignment of an IP address makes sense 
8184 from a network management perspective. More than one IP address can 
8185 be assigned per MAC address. One address must be the primary IP address, 
8186 this is the address that will be returned in the ARP reply.</P
8187 ><P
8188 >When a user or a process wants to communicate with another machine 
8189 the protocol implementation ensures that the "machine name" or "host 
8190 name" is resolved to an IP address in a manner that is controlled 
8191 by the TCP/IP configuration control files. The file 
8192 <TT
8193 CLASS="FILENAME"
8194 >/etc/hosts</TT
8195 > is one such file.</P
8196 ><P
8197 >When the IP address of the destination interface has been 
8198 determined a protocol called ARP/RARP is used to identify 
8199 the MAC address of the target interface. ARP stands for Address 
8200 Resolution Protocol, and is a broadcast oriented method that 
8201 uses UDP (User Datagram Protocol) to send a request to all 
8202 interfaces on the local network segment using the all 1's MAC 
8203 address. Network interfaces are programmed to respond to two 
8204 MAC addresses only; their own unique address and the address 
8205 ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will 
8206 contain the MAC address and the primary IP address for each 
8207 interface.</P
8208 ><P
8209 >The <TT
8210 CLASS="FILENAME"
8211 >/etc/hosts</TT
8212 > file is foundational to all 
8213 Unix/Linux TCP/IP installations and as a minumum will contain 
8214 the localhost and local network interface IP addresses and the 
8215 primary names by which they are known within the local machine. 
8216 This file helps to prime the pump so that a basic level of name 
8217 resolution can exist before any other method of name resolution 
8218 becomes available.</P
8219 ></DIV
8220 ><DIV
8221 CLASS="SECT2"
8222 ><HR><H3
8223 CLASS="SECT2"
8224 ><A
8225 NAME="AEN1416"
8226 ></A
8227 >10.2.2. <TT
8228 CLASS="FILENAME"
8229 >/etc/resolv.conf</TT
8230 ></H3
8231 ><P
8232 >This file tells the name resolution libraries:</P
8233 ><P
8234 ></P
8235 ><UL
8236 ><LI
8237 ><P
8238 >The name of the domain to which the machine 
8239         belongs
8240         </P
8241 ></LI
8242 ><LI
8243 ><P
8244 >The name(s) of any domains that should be 
8245         automatically searched when trying to resolve unqualified 
8246         host names to their IP address
8247         </P
8248 ></LI
8249 ><LI
8250 ><P
8251 >The name or IP address of available Domain 
8252         Name Servers that may be asked to perform name to address 
8253         translation lookups
8254         </P
8255 ></LI
8256 ></UL
8257 ></DIV
8258 ><DIV
8259 CLASS="SECT2"
8260 ><HR><H3
8261 CLASS="SECT2"
8262 ><A
8263 NAME="AEN1427"
8264 ></A
8265 >10.2.3. <TT
8266 CLASS="FILENAME"
8267 >/etc/host.conf</TT
8268 ></H3
8269 ><P
8270 ><TT
8271 CLASS="FILENAME"
8272 >/etc/host.conf</TT
8273 > is the primary means by 
8274 which the setting in /etc/resolv.conf may be affected. It is a 
8275 critical configuration file.  This file controls the order by 
8276 which name resolution may procede. The typical structure is:</P
8277 ><P
8278 ><PRE
8279 CLASS="PROGRAMLISTING"
8280 >       order hosts,bind
8281         multi on</PRE
8282 ></P
8283 ><P
8284 >then both addresses should be returned. Please refer to the 
8285 man page for host.conf for further details.</P
8286 ></DIV
8287 ><DIV
8288 CLASS="SECT2"
8289 ><HR><H3
8290 CLASS="SECT2"
8291 ><A
8292 NAME="AEN1435"
8293 ></A
8294 >10.2.4. <TT
8295 CLASS="FILENAME"
8296 >/etc/nsswitch.conf</TT
8297 ></H3
8298 ><P
8299 >This file controls the actual name resolution targets. The 
8300 file typically has resolver object specifications as follows:</P
8301 ><P
8302 ><PRE
8303 CLASS="PROGRAMLISTING"
8304 >       # /etc/nsswitch.conf
8305         #
8306         # Name Service Switch configuration file.
8307         #
8308
8309         passwd:         compat
8310         # Alternative entries for password authentication are:
8311         # passwd:       compat files nis ldap winbind
8312         shadow:         compat
8313         group:          compat
8314
8315         hosts:          files nis dns
8316         # Alternative entries for host name resolution are:
8317         # hosts:        files dns nis nis+ hesoid db compat ldap wins
8318         networks:       nis files dns
8319
8320         ethers:         nis files
8321         protocols:      nis files
8322         rpc:            nis files
8323         services:       nis files</PRE
8324 ></P
8325 ><P
8326 >Of course, each of these mechanisms requires that the appropriate 
8327 facilities and/or services are correctly configured.</P
8328 ><P
8329 >It should be noted that unless a network request/message must be 
8330 sent, TCP/IP networks are silent. All TCP/IP communications assumes a 
8331 principal of speaking only when necessary.</P
8332 ><P
8333 >Starting with version 2.2.0 samba has Linux support for extensions to 
8334 the name service switch infrastructure so that linux clients will 
8335 be able to obtain resolution of MS Windows NetBIOS names to IP 
8336 Addresses. To gain this functionality Samba needs to be compiled 
8337 with appropriate arguments to the make command (ie: <B
8338 CLASS="COMMAND"
8339 >make 
8340 nsswitch/libnss_wins.so</B
8341 >). The resulting library should 
8342 then be installed in the <TT
8343 CLASS="FILENAME"
8344 >/lib</TT
8345 > directory and 
8346 the "wins" parameter needs to be added to the "hosts:" line in 
8347 the <TT
8348 CLASS="FILENAME"
8349 >/etc/nsswitch.conf</TT
8350 > file. At this point it 
8351 will be possible to ping any MS Windows machine by it's NetBIOS 
8352 machine name, so long as that machine is within the workgroup to 
8353 which both the samba machine and the MS Windows machine belong.</P
8354 ></DIV
8355 ></DIV
8356 ><DIV
8357 CLASS="SECT1"
8358 ><HR><H2
8359 CLASS="SECT1"
8360 ><A
8361 NAME="AEN1447"
8362 ></A
8363 >10.3. Name resolution as used within MS Windows networking</H2
8364 ><P
8365 >MS Windows networking is predicated about the name each machine 
8366 is given. This name is known variously (and inconsistently) as 
8367 the "computer name", "machine name", "networking name", "netbios name", 
8368 "SMB name". All terms mean the same thing with the exception of 
8369 "netbios name" which can apply also to the name of the workgroup or the 
8370 domain name. The terms "workgroup" and "domain" are really just a 
8371 simply name with which the machine is associated. All NetBIOS names 
8372 are exactly 16 characters in length. The 16th character is reserved. 
8373 It is used to store a one byte value that indicates service level 
8374 information for the NetBIOS name that is registered. A NetBIOS machine 
8375 name is therefore registered for each service type that is provided by 
8376 the client/server.</P
8377 ><P
8378 >The following are typical NetBIOS name/service type registrations:</P
8379 ><P
8380 ><PRE
8381 CLASS="PROGRAMLISTING"
8382 >       Unique NetBIOS Names:
8383                 MACHINENAME&#60;00&#62; = Server Service is running on MACHINENAME
8384                 MACHINENAME&#60;03&#62; = Generic Machine Name (NetBIOS name)
8385                 MACHINENAME&#60;20&#62; = LanMan Server service is running on MACHINENAME
8386                 WORKGROUP&#60;1b&#62; = Domain Master Browser
8387
8388         Group Names:
8389                 WORKGROUP&#60;03&#62; = Generic Name registered by all members of WORKGROUP
8390                 WORKGROUP&#60;1c&#62; = Domain Controllers / Netlogon Servers
8391                 WORKGROUP&#60;1d&#62; = Local Master Browsers
8392                 WORKGROUP&#60;1e&#62; = Internet Name Resolvers</PRE
8393 ></P
8394 ><P
8395 >It should be noted that all NetBIOS machines register their own 
8396 names as per the above. This is in vast contrast to TCP/IP 
8397 installations where traditionally the system administrator will 
8398 determine in the /etc/hosts or in the DNS database what names 
8399 are associated with each IP address.</P
8400 ><P
8401 >One further point of clarification should be noted, the <TT
8402 CLASS="FILENAME"
8403 >/etc/hosts</TT
8404
8405 file and the DNS records do not provide the NetBIOS name type information 
8406 that MS Windows clients depend on to locate the type of service that may 
8407 be needed. An example of this is what happens when an MS Windows client 
8408 wants to locate a domain logon server. It find this service and the IP 
8409 address of a server that provides it by performing a lookup (via a 
8410 NetBIOS broadcast) for enumeration of all machines that have 
8411 registered the name type *&#60;1c&#62;. A logon request is then sent to each 
8412 IP address that is returned in the enumerated list of IP addresses. Which 
8413 ever machine first replies then ends up providing the logon services.</P
8414 ><P
8415 >The name "workgroup" or "domain" really can be confusing since these 
8416 have the added significance of indicating what is the security 
8417 architecture of the MS Windows network. The term "workgroup" indicates 
8418 that the primary nature of the network environment is that of a 
8419 peer-to-peer design. In a WORKGROUP all machines are responsible for 
8420 their own security, and generally such security is limited to use of 
8421 just a password (known as SHARE MODE security). In most situations 
8422 with peer-to-peer networking the users who control their own machines 
8423 will simply opt to have no security at all. It is possible to have 
8424 USER MODE security in a WORKGROUP environment, thus requiring use 
8425 of a user name and a matching password.</P
8426 ><P
8427 >MS Windows networking is thus predetermined to use machine names 
8428 for all local and remote machine message passing. The protocol used is 
8429 called Server Message Block (SMB) and this is implemented using 
8430 the NetBIOS protocol (Network Basic Input Output System). NetBIOS can 
8431 be encapsulated using LLC (Logical Link Control) protocol - in which case 
8432 the resulting protocol is called NetBEUI (Network Basic Extended User 
8433 Interface). NetBIOS can also be run over IPX (Internetworking Packet 
8434 Exchange) protocol as used by Novell NetWare, and it can be run 
8435 over TCP/IP protocols - in which case the resulting protocol is called 
8436 NBT or NetBT, the NetBIOS over TCP/IP.</P
8437 ><P
8438 >MS Windows machines use a complex array of name resolution mechanisms. 
8439 Since we are primarily concerned with TCP/IP this demonstration is 
8440 limited to this area.</P
8441 ><DIV
8442 CLASS="SECT2"
8443 ><HR><H3
8444 CLASS="SECT2"
8445 ><A
8446 NAME="AEN1459"
8447 ></A
8448 >10.3.1. The NetBIOS Name Cache</H3
8449 ><P
8450 >All MS Windows machines employ an in memory buffer in which is 
8451 stored the NetBIOS names and IP addresses for all external 
8452 machines that that machine has communicated with over the 
8453 past 10-15 minutes. It is more efficient to obtain an IP address 
8454 for a machine from the local cache than it is to go through all the 
8455 configured name resolution mechanisms.</P
8456 ><P
8457 >If a machine whose name is in the local name cache has been shut 
8458 down before the name had been expired and flushed from the cache, then 
8459 an attempt to exchange a message with that machine will be subject 
8460 to time-out delays. i.e.: Its name is in the cache, so a name resolution 
8461 lookup will succeed, but the machine can not respond. This can be 
8462 frustrating for users - but it is a characteristic of the protocol.</P
8463 ><P
8464 >The MS Windows utility that allows examination of the NetBIOS 
8465 name cache is called "nbtstat". The Samba equivalent of this 
8466 is called "nmblookup".</P
8467 ></DIV
8468 ><DIV
8469 CLASS="SECT2"
8470 ><HR><H3
8471 CLASS="SECT2"
8472 ><A
8473 NAME="AEN1464"
8474 ></A
8475 >10.3.2. The LMHOSTS file</H3
8476 ><P
8477 >This file is usually located in MS Windows NT 4.0 or 
8478 2000 in <TT
8479 CLASS="FILENAME"
8480 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
8481 > and contains 
8482 the IP Address and the machine name in matched pairs. The 
8483 <TT
8484 CLASS="FILENAME"
8485 >LMHOSTS</TT
8486 > file performs NetBIOS name 
8487 to IP address mapping oriented.</P
8488 ><P
8489 >It typically looks like:</P
8490 ><P
8491 ><PRE
8492 CLASS="PROGRAMLISTING"
8493 >       # Copyright (c) 1998 Microsoft Corp.
8494         #
8495         # This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
8496         # over TCP/IP) stack for Windows98
8497         #
8498         # This file contains the mappings of IP addresses to NT computernames
8499         # (NetBIOS) names.  Each entry should be kept on an individual line.
8500         # The IP address should be placed in the first column followed by the
8501         # corresponding computername. The address and the comptername
8502         # should be separated by at least one space or tab. The "#" character
8503         # is generally used to denote the start of a comment (see the exceptions
8504         # below).
8505         #
8506         # This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
8507         # files and offers the following extensions:
8508         #
8509         #      #PRE
8510         #      #DOM:&lt;domain&gt;
8511         #      #INCLUDE &lt;filename&gt;
8512         #      #BEGIN_ALTERNATE
8513         #      #END_ALTERNATE
8514         #      \0xnn (non-printing character support)
8515         #
8516         # Following any entry in the file with the characters "#PRE" will cause
8517         # the entry to be preloaded into the name cache. By default, entries are
8518         # not preloaded, but are parsed only after dynamic name resolution fails.
8519         #
8520         # Following an entry with the "#DOM:&lt;domain&gt;" tag will associate the
8521         # entry with the domain specified by &lt;domain&gt;. This affects how the
8522         # browser and logon services behave in TCP/IP environments. To preload
8523         # the host name associated with #DOM entry, it is necessary to also add a
8524         # #PRE to the line. The &lt;domain&gt; is always preloaded although it will not
8525         # be shown when the name cache is viewed.
8526         #
8527         # Specifying "#INCLUDE &lt;filename&gt;" will force the RFC NetBIOS (NBT)
8528         # software to seek the specified &lt;filename&gt; and parse it as if it were
8529         # local. &lt;filename&gt; is generally a UNC-based name, allowing a
8530         # centralized lmhosts file to be maintained on a server.
8531         # It is ALWAYS necessary to provide a mapping for the IP address of the
8532         # server prior to the #INCLUDE. This mapping must use the #PRE directive.
8533         # In addtion the share "public" in the example below must be in the
8534         # LanManServer list of "NullSessionShares" in order for client machines to
8535         # be able to read the lmhosts file successfully. This key is under
8536         # \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
8537         # in the registry. Simply add "public" to the list found there.
8538         #
8539         # The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
8540         # statements to be grouped together. Any single successful include
8541         # will cause the group to succeed.
8542         #
8543         # Finally, non-printing characters can be embedded in mappings by
8544         # first surrounding the NetBIOS name in quotations, then using the
8545         # \0xnn notation to specify a hex value for a non-printing character.
8546         #
8547         # The following example illustrates all of these extensions:
8548         #
8549         # 102.54.94.97     rhino         #PRE #DOM:networking  #net group's DC
8550         # 102.54.94.102    "appname  \0x14"                    #special app server
8551         # 102.54.94.123    popular            #PRE             #source server
8552         # 102.54.94.117    localsrv           #PRE             #needed for the include
8553         #
8554         # #BEGIN_ALTERNATE
8555         # #INCLUDE \\localsrv\public\lmhosts
8556         # #INCLUDE \\rhino\public\lmhosts
8557         # #END_ALTERNATE
8558         #
8559         # In the above example, the "appname" server contains a special
8560         # character in its name, the "popular" and "localsrv" server names are
8561         # preloaded, and the "rhino" server name is specified so it can be used
8562         # to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
8563         # system is unavailable.
8564         #
8565         # Note that the whole file is parsed including comments on each lookup,
8566         # so keeping the number of comments to a minimum will improve performance.
8567         # Therefore it is not advisable to simply add lmhosts file entries onto the
8568         # end of this file.</PRE
8569 ></P
8570 ></DIV
8571 ><DIV
8572 CLASS="SECT2"
8573 ><HR><H3
8574 CLASS="SECT2"
8575 ><A
8576 NAME="AEN1472"
8577 ></A
8578 >10.3.3. HOSTS file</H3
8579 ><P
8580 >This file is usually located in MS Windows NT 4.0 or 2000 in 
8581 <TT
8582 CLASS="FILENAME"
8583 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
8584 > and contains 
8585 the IP Address and the IP hostname in matched pairs. It can be 
8586 used by the name resolution infrastructure in MS Windows, depending 
8587 on how the TCP/IP environment is configured. This file is in 
8588 every way the equivalent of the Unix/Linux <TT
8589 CLASS="FILENAME"
8590 >/etc/hosts</TT
8591 > file.</P
8592 ></DIV
8593 ><DIV
8594 CLASS="SECT2"
8595 ><HR><H3
8596 CLASS="SECT2"
8597 ><A
8598 NAME="AEN1477"
8599 ></A
8600 >10.3.4. DNS Lookup</H3
8601 ><P
8602 >This capability is configured in the TCP/IP setup area in the network 
8603 configuration facility. If enabled an elaborate name resolution sequence 
8604 is followed the precise nature of which isdependant on what the NetBIOS 
8605 Node Type parameter is configured to. A Node Type of 0 means use 
8606 NetBIOS broadcast (over UDP broadcast) is first used if the name 
8607 that is the subject of a name lookup is not found in the NetBIOS name 
8608 cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to 
8609 Node Type 8, then a NetBIOS Unicast (over UDP Unicast) is sent to the 
8610 WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast 
8611 lookup is used.</P
8612 ></DIV
8613 ><DIV
8614 CLASS="SECT2"
8615 ><HR><H3
8616 CLASS="SECT2"
8617 ><A
8618 NAME="AEN1480"
8619 ></A
8620 >10.3.5. WINS Lookup</H3
8621 ><P
8622 >A WINS (Windows Internet Name Server) service is the equivaent of the 
8623 rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores 
8624 the names and IP addresses that are registered by a Windows client 
8625 if the TCP/IP setup has been given at least one WINS Server IP Address.</P
8626 ><P
8627 >To configure Samba to be a WINS server the following parameter needs 
8628 to be added to the <TT
8629 CLASS="FILENAME"
8630 >smb.conf</TT
8631 > file:</P
8632 ><P
8633 ><PRE
8634 CLASS="PROGRAMLISTING"
8635 >       wins support = Yes</PRE
8636 ></P
8637 ><P
8638 >To configure Samba to use a WINS server the following parameters are 
8639 needed in the smb.conf file:</P
8640 ><P
8641 ><PRE
8642 CLASS="PROGRAMLISTING"
8643 >       wins support = No
8644         wins server = xxx.xxx.xxx.xxx</PRE
8645 ></P
8646 ><P
8647 >where <TT
8648 CLASS="REPLACEABLE"
8649 ><I
8650 >xxx.xxx.xxx.xxx</I
8651 ></TT
8652 > is the IP address 
8653 of the WINS server.</P
8654 ></DIV
8655 ></DIV
8656 ><DIV
8657 CLASS="SECT1"
8658 ><HR><H2
8659 CLASS="SECT1"
8660 ><A
8661 NAME="AEN1492"
8662 ></A
8663 >10.4. How browsing functions and how to deploy stable and 
8664 dependable browsing using Samba</H2
8665 ><P
8666 >As stated above, MS Windows machines register their NetBIOS names 
8667 (i.e.: the machine name for each service type in operation) on start 
8668 up. Also, as stated above, the exact method by which this name registration 
8669 takes place is determined by whether or not the MS Windows client/server 
8670 has been given a WINS server address, whether or not LMHOSTS lookup 
8671 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.</P
8672 ><P
8673 >In the case where there is no WINS server all name registrations as 
8674 well as name lookups are done by UDP broadcast. This isolates name 
8675 resolution to the local subnet, unless LMHOSTS is used to list all 
8676 names and IP addresses. In such situations Samba provides a means by 
8677 which the samba server name may be forcibly injected into the browse 
8678 list of a remote MS Windows network (using the "remote announce" parameter).</P
8679 ><P
8680 >Where a WINS server is used, the MS Windows client will use UDP 
8681 unicast to register with the WINS server. Such packets can be routed 
8682 and thus WINS allows name resolution to function across routed networks.</P
8683 ><P
8684 >During the startup process an election will take place to create a 
8685 local master browser if one does not already exist. On each NetBIOS network 
8686 one machine will be elected to function as the domain master browser. This 
8687 domain browsing has nothing to do with MS security domain control. 
8688 Instead, the domain master browser serves the role of contacting each local 
8689 master browser (found by asking WINS or from LMHOSTS) and exchanging browse 
8690 list contents. This way every master browser will eventually obtain a complete 
8691 list of all machines that are on the network. Every 11-15 minutes an election 
8692 is held to determine which machine will be the master browser. By the nature of 
8693 the election criteria used, the machine with the highest uptime, or the 
8694 most senior protocol version, or other criteria, will win the election 
8695 as domain master browser.</P
8696 ><P
8697 >Clients wishing to browse the network make use of this list, but also depend 
8698 on the availability of correct name resolution to the respective IP 
8699 address/addresses. </P
8700 ><P
8701 >Any configuration that breaks name resolution and/or browsing intrinsics 
8702 will annoy users because they will have to put up with protracted 
8703 inability to use the network services.</P
8704 ><P
8705 >Samba supports a feature that allows forced synchonisation 
8706 of browse lists across routed networks using the "remote 
8707 browse sync" parameter in the smb.conf file. This causes Samba 
8708 to contact the local master browser on a remote network and 
8709 to request browse list synchronisation. This effectively bridges 
8710 two networks that are separated by routers. The two remote 
8711 networks may use either broadcast based name resolution or WINS 
8712 based name resolution, but it should be noted that the "remote 
8713 browse sync" parameter provides browse list synchronisation - and 
8714 that is distinct from name to address resolution, in other 
8715 words, for cross subnet browsing to function correctly it is 
8716 essential that a name to address resolution mechanism be provided. 
8717 This mechanism could be via DNS, <TT
8718 CLASS="FILENAME"
8719 >/etc/hosts</TT
8720 >, 
8721 and so on.</P
8722 ></DIV
8723 ><DIV
8724 CLASS="SECT1"
8725 ><HR><H2
8726 CLASS="SECT1"
8727 ><A
8728 NAME="AEN1502"
8729 ></A
8730 >10.5. MS Windows security options and how to configure 
8731 Samba for seemless integration</H2
8732 ><P
8733 >MS Windows clients may use encrypted passwords as part of a 
8734 challenege/response authentication model (a.k.a. NTLMv1) or 
8735 alone, or clear text strings for simple password based 
8736 authentication. It should be realized that with the SMB 
8737 protocol the password is passed over the network either 
8738 in plain text or encrypted, but not both in the same 
8739 authentication requets.</P
8740 ><P
8741 >When encrypted passwords are used a password that has been 
8742 entered by the user is encrypted in two ways:</P
8743 ><P
8744 ></P
8745 ><UL
8746 ><LI
8747 ><P
8748 >An MD4 hash of the UNICODE of the password
8749         string.  This is known as the NT hash.
8750         </P
8751 ></LI
8752 ><LI
8753 ><P
8754 >The password is converted to upper case,
8755         and then padded or trucated to 14 bytes.  This string is 
8756         then appended with 5 bytes of NULL characters and split to
8757         form two 56 bit DES keys to encrypt a "magic" 8 byte value.
8758         The resulting 16 bytes for the LanMan hash.
8759         </P
8760 ></LI
8761 ></UL
8762 ><P
8763 >You should refer to the <A
8764 HREF="ENCRYPTION.html"
8765 TARGET="_top"
8766 >Password Encryption</A
8767 > chapter in this HOWTO collection
8768 for more details on the inner workings</P
8769 ><P
8770 >MS Windows 95 pre-service pack 1, MS Windows NT versions 3.x 
8771 and version 4.0 pre-service pack 3 will use either mode of 
8772 password authentication. All versions of MS Windows that follow 
8773 these versions no longer support plain text passwords by default.</P
8774 ><P
8775 >MS Windows clients have a habit of dropping network mappings that 
8776 have been idle for 10 minutes or longer. When the user attempts to 
8777 use the mapped drive connection that has been dropped, the client
8778 re-establishes the connection using 
8779 a cached copy of the password.</P
8780 ><P
8781 >When Microsoft changed the default password mode, they dropped support for 
8782 caching of the plain text password. This means that when the registry 
8783 parameter is changed to re-enable use of plain text passwords it appears to 
8784 work, but when a dropped mapping attempts to revalidate it will fail if 
8785 the remote authentication server does not support encrypted passwords. 
8786 This means that it is definitely not a good idea to re-enable plain text 
8787 password support in such clients.</P
8788 ><P
8789 >The following parameters can be used to work around the 
8790 issue of Windows 9x client upper casing usernames and
8791 password before transmitting them to the SMB server
8792 when using clear text authentication.</P
8793 ><P
8794 ><PRE
8795 CLASS="PROGRAMLISTING"
8796 >       <A
8797 HREF="smb.conf.5.html#PASSWORDLEVEL"
8798 TARGET="_top"
8799 >passsword level</A
8800 > = <TT
8801 CLASS="REPLACEABLE"
8802 ><I
8803 >integer</I
8804 ></TT
8805 >
8806         <A
8807 HREF="smb.conf.5.html#USERNAMELEVEL"
8808 TARGET="_top"
8809 >username level</A
8810 > = <TT
8811 CLASS="REPLACEABLE"
8812 ><I
8813 >integer</I
8814 ></TT
8815 ></PRE
8816 ></P
8817 ><P
8818 >By default Samba will lower case the username before attempting
8819 to lookup the user in the database of local system accounts.
8820 Because UNIX usernames conventionally only contain lower case
8821 character, the <TT
8822 CLASS="PARAMETER"
8823 ><I
8824 >username level</I
8825 ></TT
8826 > parameter
8827 is rarely even needed.</P
8828 ><P
8829 >However, password on UNIX systems often make use of mixed case
8830 characters.  This means that in order for a user on a Windows 9x
8831 client to connect to a Samba server using clear text authentication,
8832 the <TT
8833 CLASS="PARAMETER"
8834 ><I
8835 >password level</I
8836 ></TT
8837 > must be set to the maximum
8838 number of upper case letter which <SPAN
8839 CLASS="emphasis"
8840 ><I
8841 CLASS="EMPHASIS"
8842 >could</I
8843 ></SPAN
8844 > appear
8845 is a password.  Note that is the server OS uses the traditional
8846 DES version of crypt(), then a <TT
8847 CLASS="PARAMETER"
8848 ><I
8849 >password level</I
8850 ></TT
8851 >
8852 of 8 will result in case insensitive passwords as seen from Windows
8853 users.  This will also result in longer login times as Samba
8854 hash to compute the permutations of the password string and 
8855 try them one by one until a match is located (or all combinations fail).</P
8856 ><P
8857 >The best option to adopt is to enable support for encrypted passwords 
8858 where ever Samba is used. There are three configuration possibilities 
8859 for support of encrypted passwords:</P
8860 ><DIV
8861 CLASS="SECT2"
8862 ><HR><H3
8863 CLASS="SECT2"
8864 ><A
8865 NAME="AEN1530"
8866 ></A
8867 >10.5.1. Use MS Windows NT as an authentication server</H3
8868 ><P
8869 >This method involves the additions of the following parameters 
8870 in the smb.conf file:</P
8871 ><P
8872 ><PRE
8873 CLASS="PROGRAMLISTING"
8874 >       encrypt passwords = Yes
8875         security = server
8876         password server = "NetBIOS_name_of_PDC"</PRE
8877 ></P
8878 ><P
8879 >There are two ways of identifying whether or not a username and 
8880 password pair was valid or not. One uses the reply information provided 
8881 as part of the authentication messaging process, the other uses 
8882 just and error code.</P
8883 ><P
8884 >The down-side of this mode of configuration is the fact that 
8885 for security reasons Samba will send the password server a bogus 
8886 username and a bogus password and if the remote server fails to 
8887 reject the username and password pair then an alternative mode 
8888 of identification of validation is used. Where a site uses password 
8889 lock out after a certain number of failed authentication attempts 
8890 this will result in user lockouts.</P
8891 ><P
8892 >Use of this mode of authentication does require there to be 
8893 a standard Unix account for the user, this account can be blocked 
8894 to prevent logons by other than MS Windows clients.</P
8895 ></DIV
8896 ><DIV
8897 CLASS="SECT2"
8898 ><HR><H3
8899 CLASS="SECT2"
8900 ><A
8901 NAME="AEN1538"
8902 ></A
8903 >10.5.2. Make Samba a member of an MS Windows NT security domain</H3
8904 ><P
8905 >This method involves additon of the following paramters in the smb.conf file:</P
8906 ><P
8907 ><PRE
8908 CLASS="PROGRAMLISTING"
8909 >       encrypt passwords = Yes
8910         security = domain
8911         workgroup = "name of NT domain"
8912         password server = *</PRE
8913 ></P
8914 ><P
8915 >The use of the "*" argument to "password server" will cause samba 
8916 to locate the domain controller in a way analogous to the way 
8917 this is done within MS Windows NT.</P
8918 ><P
8919 >In order for this method to work the Samba server needs to join the 
8920 MS Windows NT security domain. This is done as follows:</P
8921 ><P
8922 ></P
8923 ><UL
8924 ><LI
8925 ><P
8926 >On the MS Windows NT domain controller using 
8927         the Server Manager add a machine account for the Samba server.
8928         </P
8929 ></LI
8930 ><LI
8931 ><P
8932 >Next, on the Linux system execute: 
8933         <B
8934 CLASS="COMMAND"
8935 >smbpasswd -r PDC_NAME -j DOMAIN_NAME</B
8936 >
8937         </P
8938 ></LI
8939 ></UL
8940 ><P
8941 >Use of this mode of authentication does require there to be 
8942 a standard Unix account for the user in order to assign
8943 a uid once the account has been authenticated by the remote
8944 Windows DC.  This account can be blocked to prevent logons by 
8945 other than MS Windows clients by things such as setting an invalid
8946 shell in the <TT
8947 CLASS="FILENAME"
8948 >/etc/passwd</TT
8949 > entry.</P
8950 ><P
8951 >An alternative to assigning UIDs to Windows users on a 
8952 Samba member server is presented in the <A
8953 HREF="winbind.html"
8954 TARGET="_top"
8955 >Winbind Overview</A
8956 > chapter in
8957 this HOWTO collection.</P
8958 ></DIV
8959 ><DIV
8960 CLASS="SECT2"
8961 ><HR><H3
8962 CLASS="SECT2"
8963 ><A
8964 NAME="AEN1555"
8965 ></A
8966 >10.5.3. Configure Samba as an authentication server</H3
8967 ><P
8968 >This mode of authentication demands that there be on the 
8969 Unix/Linux system both a Unix style account as well as an 
8970 smbpasswd entry for the user. The Unix system account can be 
8971 locked if required as only the encrypted password will be 
8972 used for SMB client authentication.</P
8973 ><P
8974 >This method involves addition of the following parameters to 
8975 the smb.conf file:</P
8976 ><P
8977 ><PRE
8978 CLASS="PROGRAMLISTING"
8979 >## please refer to the Samba PDC HOWTO chapter later in 
8980 ## this collection for more details
8981 [global]
8982         encrypt passwords = Yes
8983         security = user
8984         domain logons = Yes
8985         ; an OS level of 33 or more is recommended
8986         os level = 33
8987
8988 [NETLOGON]
8989         path = /somewhare/in/file/system
8990         read only = yes</PRE
8991 ></P
8992 ><P
8993 >in order for this method to work a Unix system account needs 
8994 to be created for each user, as well as for each MS Windows NT/2000 
8995 machine. The following structure is required.</P
8996 ><DIV
8997 CLASS="SECT3"
8998 ><HR><H4
8999 CLASS="SECT3"
9000 ><A
9001 NAME="AEN1562"
9002 ></A
9003 >10.5.3.1. Users</H4
9004 ><P
9005 >A user account that may provide a home directory should be 
9006 created. The following Linux system commands are typical of 
9007 the procedure for creating an account.</P
9008 ><P
9009 ><PRE
9010 CLASS="PROGRAMLISTING"
9011 >       # useradd -s /bin/bash -d /home/"userid" -m "userid"
9012         # passwd "userid"
9013           Enter Password: &lt;pw&gt;
9014           
9015         # smbpasswd -a "userid"
9016           Enter Password: &lt;pw&gt;</PRE
9017 ></P
9018 ></DIV
9019 ><DIV
9020 CLASS="SECT3"
9021 ><HR><H4
9022 CLASS="SECT3"
9023 ><A
9024 NAME="AEN1567"
9025 ></A
9026 >10.5.3.2. MS Windows NT Machine Accounts</H4
9027 ><P
9028 >These are required only when Samba is used as a domain 
9029 controller.  Refer to the Samba-PDC-HOWTO for more details.</P
9030 ><P
9031 ><PRE
9032 CLASS="PROGRAMLISTING"
9033 >       # useradd -s /bin/false -d /dev/null "machine_name"\$
9034         # passwd -l "machine_name"\$
9035         # smbpasswd -a -m "machine_name"</PRE
9036 ></P
9037 ></DIV
9038 ></DIV
9039 ></DIV
9040 ><DIV
9041 CLASS="SECT1"
9042 ><HR><H2
9043 CLASS="SECT1"
9044 ><A
9045 NAME="AEN1572"
9046 ></A
9047 >10.6. Conclusions</H2
9048 ><P
9049 >Samba provides a flexible means to operate as...</P
9050 ><P
9051 ></P
9052 ><UL
9053 ><LI
9054 ><P
9055 >A Stand-alone server - No special action is needed 
9056         other than to create user accounts. Stand-alone servers do NOT 
9057         provide network logon services, meaning that machines that use this 
9058         server do NOT perform a domain logon but instead make use only of 
9059         the MS Windows logon which is local to the MS Windows 
9060         workstation/server.
9061         </P
9062 ></LI
9063 ><LI
9064 ><P
9065 >An MS Windows NT 3.x/4.0 security domain member.
9066         </P
9067 ></LI
9068 ><LI
9069 ><P
9070 >An alternative to an MS Windows NT 3.x/4.0 
9071         Domain Controller.
9072         </P
9073 ></LI
9074 ></UL
9075 ></DIV
9076 ></DIV
9077 ><DIV
9078 CLASS="CHAPTER"
9079 ><HR><H1
9080 ><A
9081 NAME="UNIX-PERMISSIONS"
9082 ></A
9083 >Chapter 11. UNIX Permission Bits and Windows NT Access Control Lists</H1
9084 ><DIV
9085 CLASS="SECT1"
9086 ><H2
9087 CLASS="SECT1"
9088 ><A
9089 NAME="AEN1593"
9090 ></A
9091 >11.1. Viewing and changing UNIX permissions using the NT 
9092         security dialogs</H2
9093 ><P
9094 >New in the Samba 2.0.4 release is the ability for Windows 
9095         NT clients to use their native security settings dialog box to 
9096         view and modify the underlying UNIX permissions.</P
9097 ><P
9098 >Note that this ability is careful not to compromise 
9099         the security of the UNIX host Samba is running on, and 
9100         still obeys all the file permission rules that a Samba 
9101         administrator can set.</P
9102 ><P
9103 >In Samba 2.0.4 and above the default value of the 
9104         parameter <A
9105 HREF="smb.conf.5.html#NTACLSUPPORT"
9106 TARGET="_top"
9107 ><TT
9108 CLASS="PARAMETER"
9109 ><I
9110 >       nt acl support</I
9111 ></TT
9112 ></A
9113 > has been changed from 
9114         <TT
9115 CLASS="CONSTANT"
9116 >false</TT
9117 > to <TT
9118 CLASS="CONSTANT"
9119 >true</TT
9120 >, so 
9121         manipulation of permissions is turned on by default.</P
9122 ></DIV
9123 ><DIV
9124 CLASS="SECT1"
9125 ><HR><H2
9126 CLASS="SECT1"
9127 ><A
9128 NAME="AEN1602"
9129 ></A
9130 >11.2. How to view file security on a Samba share</H2
9131 ><P
9132 >From an NT 4.0 client, single-click with the right 
9133         mouse button on any file or directory in a Samba mounted 
9134         drive letter or UNC path. When the menu pops-up, click 
9135         on the <SPAN
9136 CLASS="emphasis"
9137 ><I
9138 CLASS="EMPHASIS"
9139 >Properties</I
9140 ></SPAN
9141 > entry at the bottom of 
9142         the menu. This brings up the normal file properties dialog
9143         box, but with Samba 2.0.4 this will have a new tab along the top
9144         marked <SPAN
9145 CLASS="emphasis"
9146 ><I
9147 CLASS="EMPHASIS"
9148 >Security</I
9149 ></SPAN
9150 >. Click on this tab and you 
9151         will see three buttons, <SPAN
9152 CLASS="emphasis"
9153 ><I
9154 CLASS="EMPHASIS"
9155 >Permissions</I
9156 ></SPAN
9157 >,      
9158         <SPAN
9159 CLASS="emphasis"
9160 ><I
9161 CLASS="EMPHASIS"
9162 >Auditing</I
9163 ></SPAN
9164 >, and <SPAN
9165 CLASS="emphasis"
9166 ><I
9167 CLASS="EMPHASIS"
9168 >Ownership</I
9169 ></SPAN
9170 >. 
9171         The <SPAN
9172 CLASS="emphasis"
9173 ><I
9174 CLASS="EMPHASIS"
9175 >Auditing</I
9176 ></SPAN
9177 > button will cause either 
9178         an error message <SPAN
9179 CLASS="ERRORNAME"
9180 >A requested privilege is not held 
9181         by the client</SPAN
9182 > to appear if the user is not the 
9183         NT Administrator, or a dialog which is intended to allow an 
9184         Administrator to add auditing requirements to a file if the 
9185         user is logged on as the NT Administrator. This dialog is 
9186         non-functional with a Samba share at this time, as the only 
9187         useful button, the <B
9188 CLASS="COMMAND"
9189 >Add</B
9190 > button will not currently 
9191         allow a list of users to be seen.</P
9192 ></DIV
9193 ><DIV
9194 CLASS="SECT1"
9195 ><HR><H2
9196 CLASS="SECT1"
9197 ><A
9198 NAME="AEN1613"
9199 ></A
9200 >11.3. Viewing file ownership</H2
9201 ><P
9202 >Clicking on the <B
9203 CLASS="COMMAND"
9204 >"Ownership"</B
9205 > button 
9206         brings up a dialog box telling you who owns the given file. The 
9207         owner name will be of the form :</P
9208 ><P
9209 ><B
9210 CLASS="COMMAND"
9211 >"SERVER\user (Long name)"</B
9212 ></P
9213 ><P
9214 >Where <TT
9215 CLASS="REPLACEABLE"
9216 ><I
9217 >SERVER</I
9218 ></TT
9219 > is the NetBIOS name of 
9220         the Samba server, <TT
9221 CLASS="REPLACEABLE"
9222 ><I
9223 >user</I
9224 ></TT
9225 > is the user name of 
9226         the UNIX user who owns the file, and <TT
9227 CLASS="REPLACEABLE"
9228 ><I
9229 >(Long name)</I
9230 ></TT
9231 >
9232         is the descriptive string identifying the user (normally found in the
9233         GECOS field of the UNIX password database). Click on the <B
9234 CLASS="COMMAND"
9235 >Close
9236         </B
9237 > button to remove this dialog.</P
9238 ><P
9239 >If the parameter <TT
9240 CLASS="PARAMETER"
9241 ><I
9242 >nt acl support</I
9243 ></TT
9244 >
9245         is set to <TT
9246 CLASS="CONSTANT"
9247 >false</TT
9248 > then the file owner will 
9249         be shown as the NT user <B
9250 CLASS="COMMAND"
9251 >"Everyone"</B
9252 >.</P
9253 ><P
9254 >The <B
9255 CLASS="COMMAND"
9256 >Take Ownership</B
9257 > button will not allow 
9258         you to change the ownership of this file to yourself (clicking on 
9259         it will display a dialog box complaining that the user you are 
9260         currently logged onto the NT client cannot be found). The reason 
9261         for this is that changing the ownership of a file is a privileged 
9262         operation in UNIX, available only to the <SPAN
9263 CLASS="emphasis"
9264 ><I
9265 CLASS="EMPHASIS"
9266 >root</I
9267 ></SPAN
9268
9269         user. As clicking on this button causes NT to attempt to change 
9270         the ownership of a file to the current user logged into the NT 
9271         client this will not work with Samba at this time.</P
9272 ><P
9273 >There is an NT chown command that will work with Samba 
9274         and allow a user with Administrator privilege connected 
9275         to a Samba 2.0.4 server as root to change the ownership of 
9276         files on both a local NTFS filesystem or remote mounted NTFS 
9277         or Samba drive. This is available as part of the <SPAN
9278 CLASS="emphasis"
9279 ><I
9280 CLASS="EMPHASIS"
9281 >Seclib
9282         </I
9283 ></SPAN
9284 > NT security library written by Jeremy Allison of 
9285         the Samba Team, available from the main Samba ftp site.</P
9286 ></DIV
9287 ><DIV
9288 CLASS="SECT1"
9289 ><HR><H2
9290 CLASS="SECT1"
9291 ><A
9292 NAME="AEN1633"
9293 ></A
9294 >11.4. Viewing file or directory permissions</H2
9295 ><P
9296 >The third button is the <B
9297 CLASS="COMMAND"
9298 >"Permissions"</B
9299
9300         button. Clicking on this brings up a dialog box that shows both 
9301         the permissions and the UNIX owner of the file or directory. 
9302         The owner is displayed in the form :</P
9303 ><P
9304 ><B
9305 CLASS="COMMAND"
9306 >"SERVER\user (Long name)"</B
9307 ></P
9308 ><P
9309 >Where <TT
9310 CLASS="REPLACEABLE"
9311 ><I
9312 >SERVER</I
9313 ></TT
9314 > is the NetBIOS name of 
9315         the Samba server, <TT
9316 CLASS="REPLACEABLE"
9317 ><I
9318 >user</I
9319 ></TT
9320 > is the user name of 
9321         the UNIX user who owns the file, and <TT
9322 CLASS="REPLACEABLE"
9323 ><I
9324 >(Long name)</I
9325 ></TT
9326 >
9327         is the descriptive string identifying the user (normally found in the
9328         GECOS field of the UNIX password database).</P
9329 ><P
9330 >If the parameter <TT
9331 CLASS="PARAMETER"
9332 ><I
9333 >nt acl support</I
9334 ></TT
9335 >
9336         is set to <TT
9337 CLASS="CONSTANT"
9338 >false</TT
9339 > then the file owner will 
9340         be shown as the NT user <B
9341 CLASS="COMMAND"
9342 >"Everyone"</B
9343 > and the 
9344         permissions will be shown as NT "Full Control".</P
9345 ><P
9346 >The permissions field is displayed differently for files 
9347         and directories, so I'll describe the way file permissions 
9348         are displayed first.</P
9349 ><DIV
9350 CLASS="SECT2"
9351 ><HR><H3
9352 CLASS="SECT2"
9353 ><A
9354 NAME="AEN1648"
9355 ></A
9356 >11.4.1. File Permissions</H3
9357 ><P
9358 >The standard UNIX user/group/world triple and 
9359                 the corresponding "read", "write", "execute" permissions 
9360                 triples are mapped by Samba into a three element NT ACL 
9361                 with the 'r', 'w', and 'x' bits mapped into the corresponding 
9362                 NT permissions. The UNIX world permissions are mapped into 
9363                 the global NT group <B
9364 CLASS="COMMAND"
9365 >Everyone</B
9366 >, followed 
9367                 by the list of permissions allowed for UNIX world. The UNIX 
9368                 owner and group permissions are displayed as an NT 
9369                 <B
9370 CLASS="COMMAND"
9371 >user</B
9372 > icon and an NT <B
9373 CLASS="COMMAND"
9374 >local 
9375                 group</B
9376 > icon respectively followed by the list 
9377                 of permissions allowed for the UNIX user and group.</P
9378 ><P
9379 >As many UNIX permission sets don't map into common 
9380                 NT names such as <B
9381 CLASS="COMMAND"
9382 >"read"</B
9383 >, <B
9384 CLASS="COMMAND"
9385 >               "change"</B
9386 > or <B
9387 CLASS="COMMAND"
9388 >"full control"</B
9389 > then 
9390                 usually the permissions will be prefixed by the words <B
9391 CLASS="COMMAND"
9392 >               "Special Access"</B
9393 > in the NT display list.</P
9394 ><P
9395 >But what happens if the file has no permissions allowed 
9396                 for a particular UNIX user group or world component ? In order 
9397                 to  allow "no permissions" to be seen and modified then Samba 
9398                 overloads the NT <B
9399 CLASS="COMMAND"
9400 >"Take Ownership"</B
9401 > ACL attribute 
9402                 (which has no meaning in UNIX) and reports a component with 
9403                 no permissions as having the NT <B
9404 CLASS="COMMAND"
9405 >"O"</B
9406 > bit set. 
9407                 This was chosen of course to make it look like a zero, meaning 
9408                 zero permissions. More details on the decision behind this will 
9409                 be given below.</P
9410 ></DIV
9411 ><DIV
9412 CLASS="SECT2"
9413 ><HR><H3
9414 CLASS="SECT2"
9415 ><A
9416 NAME="AEN1662"
9417 ></A
9418 >11.4.2. Directory Permissions</H3
9419 ><P
9420 >Directories on an NT NTFS file system have two 
9421                 different sets of permissions. The first set of permissions 
9422                 is the ACL set on the directory itself, this is usually displayed 
9423                 in the first set of parentheses in the normal <B
9424 CLASS="COMMAND"
9425 >"RW"</B
9426
9427                 NT style. This first set of permissions is created by Samba in 
9428                 exactly the same way as normal file permissions are, described 
9429                 above, and is displayed in the same way.</P
9430 ><P
9431 >The second set of directory permissions has no real meaning 
9432                 in the UNIX permissions world and represents the <B
9433 CLASS="COMMAND"
9434 >               "inherited"</B
9435 > permissions that any file created within 
9436                 this directory would inherit.</P
9437 ><P
9438 >Samba synthesises these inherited permissions for NT by 
9439                 returning as an NT ACL the UNIX permission mode that a new file 
9440                 created by Samba on this share would receive.</P
9441 ></DIV
9442 ></DIV
9443 ><DIV
9444 CLASS="SECT1"
9445 ><HR><H2
9446 CLASS="SECT1"
9447 ><A
9448 NAME="AEN1669"
9449 ></A
9450 >11.5. Modifying file or directory permissions</H2
9451 ><P
9452 >Modifying file and directory permissions is as simple 
9453         as changing the displayed permissions in the dialog box, and 
9454         clicking the <B
9455 CLASS="COMMAND"
9456 >OK</B
9457 > button. However, there are 
9458         limitations that a user needs to be aware of, and also interactions 
9459         with the standard Samba permission masks and mapping of DOS 
9460         attributes that need to also be taken into account.</P
9461 ><P
9462 >If the parameter <TT
9463 CLASS="PARAMETER"
9464 ><I
9465 >nt acl support</I
9466 ></TT
9467 >
9468         is set to <TT
9469 CLASS="CONSTANT"
9470 >false</TT
9471 > then any attempt to set 
9472         security permissions will fail with an <B
9473 CLASS="COMMAND"
9474 >"Access Denied"
9475         </B
9476 > message.</P
9477 ><P
9478 >The first thing to note is that the <B
9479 CLASS="COMMAND"
9480 >"Add"</B
9481
9482         button will not return a list of users in Samba 2.0.4 (it will give 
9483         an error message of <B
9484 CLASS="COMMAND"
9485 >"The remote procedure call failed 
9486         and did not execute"</B
9487 >). This means that you can only 
9488         manipulate the current user/group/world permissions listed in 
9489         the dialog box. This actually works quite well as these are the 
9490         only permissions that UNIX actually has.</P
9491 ><P
9492 >If a permission triple (either user, group, or world) 
9493         is removed from the list of permissions in the NT dialog box, 
9494         then when the <B
9495 CLASS="COMMAND"
9496 >"OK"</B
9497 > button is pressed it will 
9498         be applied as "no permissions" on the UNIX side. If you then 
9499         view the permissions again the "no permissions" entry will appear 
9500         as the NT <B
9501 CLASS="COMMAND"
9502 >"O"</B
9503 > flag, as described above. This 
9504         allows you to add permissions back to a file or directory once 
9505         you have removed them from a triple component.</P
9506 ><P
9507 >As UNIX supports only the "r", "w" and "x" bits of 
9508         an NT ACL then if other NT security attributes such as "Delete 
9509         access" are selected then they will be ignored when applied on 
9510         the Samba server.</P
9511 ><P
9512 >When setting permissions on a directory the second 
9513         set of permissions (in the second set of parentheses) is 
9514         by default applied to all files within that directory. If this 
9515         is not what you want you must uncheck the <B
9516 CLASS="COMMAND"
9517 >"Replace 
9518         permissions on existing files"</B
9519 > checkbox in the NT 
9520         dialog before clicking <B
9521 CLASS="COMMAND"
9522 >"OK"</B
9523 >.</P
9524 ><P
9525 >If you wish to remove all permissions from a 
9526         user/group/world  component then you may either highlight the 
9527         component and click the <B
9528 CLASS="COMMAND"
9529 >"Remove"</B
9530 > button, 
9531         or set the component to only have the special <B
9532 CLASS="COMMAND"
9533 >"Take
9534         Ownership"</B
9535 > permission (displayed as <B
9536 CLASS="COMMAND"
9537 >"O"
9538         </B
9539 >) highlighted.</P
9540 ></DIV
9541 ><DIV
9542 CLASS="SECT1"
9543 ><HR><H2
9544 CLASS="SECT1"
9545 ><A
9546 NAME="AEN1691"
9547 ></A
9548 >11.6. Interaction with the standard Samba create mask 
9549         parameters</H2
9550 ><P
9551 >Note that with Samba 2.0.5 there are four new parameters 
9552         to control this interaction.  These are :</P
9553 ><P
9554 ><TT
9555 CLASS="PARAMETER"
9556 ><I
9557 >security mask</I
9558 ></TT
9559 ></P
9560 ><P
9561 ><TT
9562 CLASS="PARAMETER"
9563 ><I
9564 >force security mode</I
9565 ></TT
9566 ></P
9567 ><P
9568 ><TT
9569 CLASS="PARAMETER"
9570 ><I
9571 >directory security mask</I
9572 ></TT
9573 ></P
9574 ><P
9575 ><TT
9576 CLASS="PARAMETER"
9577 ><I
9578 >force directory security mode</I
9579 ></TT
9580 ></P
9581 ><P
9582 >Once a user clicks <B
9583 CLASS="COMMAND"
9584 >"OK"</B
9585 > to apply the 
9586         permissions Samba maps the given permissions into a user/group/world 
9587         r/w/x triple set, and then will check the changed permissions for a 
9588         file against the bits set in the <A
9589 HREF="smb.conf.5.html#SECURITYMASK"
9590 TARGET="_top"
9591
9592         <TT
9593 CLASS="PARAMETER"
9594 ><I
9595 >security mask</I
9596 ></TT
9597 ></A
9598 > parameter. Any bits that 
9599         were changed that are not set to '1' in this parameter are left alone 
9600         in the file permissions.</P
9601 ><P
9602 >Essentially, zero bits in the <TT
9603 CLASS="PARAMETER"
9604 ><I
9605 >security mask</I
9606 ></TT
9607 >
9608         mask may be treated as a set of bits the user is <SPAN
9609 CLASS="emphasis"
9610 ><I
9611 CLASS="EMPHASIS"
9612 >not</I
9613 ></SPAN
9614
9615         allowed to change, and one bits are those the user is allowed to change.
9616         </P
9617 ><P
9618 >If not set explicitly this parameter is set to the same value as 
9619         the <A
9620 HREF="smb.conf.5.html#CREATEMASK"
9621 TARGET="_top"
9622 ><TT
9623 CLASS="PARAMETER"
9624 ><I
9625 >create mask
9626         </I
9627 ></TT
9628 ></A
9629 > parameter to provide compatibility with Samba 2.0.4 
9630         where this permission change facility was introduced. To allow a user to 
9631         modify all the user/group/world permissions on a file, set this parameter 
9632         to 0777.</P
9633 ><P
9634 >Next Samba checks the changed permissions for a file against 
9635         the bits set in the <A
9636 HREF="smb.conf.5.html#FORCESECURITYMODE"
9637 TARGET="_top"
9638 >       <TT
9639 CLASS="PARAMETER"
9640 ><I
9641 >force security mode</I
9642 ></TT
9643 ></A
9644 > parameter. Any bits 
9645         that were changed that correspond to bits set to '1' in this parameter 
9646         are forced to be set.</P
9647 ><P
9648 >Essentially, bits set in the <TT
9649 CLASS="PARAMETER"
9650 ><I
9651 >force security mode
9652         </I
9653 ></TT
9654 > parameter may be treated as a set of bits that, when 
9655         modifying security on a file, the user has always set to be 'on'.</P
9656 ><P
9657 >If not set explicitly this parameter is set to the same value 
9658         as the <A
9659 HREF="smb.conf.5.html#FORCECREATEMODE"
9660 TARGET="_top"
9661 ><TT
9662 CLASS="PARAMETER"
9663 ><I
9664 >force 
9665         create mode</I
9666 ></TT
9667 ></A
9668 > parameter to provide compatibility
9669         with Samba 2.0.4 where the permission change facility was introduced.
9670         To allow a user to modify all the user/group/world permissions on a file
9671         with no restrictions set this parameter to 000.</P
9672 ><P
9673 >The <TT
9674 CLASS="PARAMETER"
9675 ><I
9676 >security mask</I
9677 ></TT
9678 > and <TT
9679 CLASS="PARAMETER"
9680 ><I
9681 >force 
9682         security mode</I
9683 ></TT
9684 > parameters are applied to the change 
9685         request in that order.</P
9686 ><P
9687 >For a directory Samba will perform the same operations as 
9688         described above for a file except using the parameter <TT
9689 CLASS="PARAMETER"
9690 ><I
9691 >       directory security mask</I
9692 ></TT
9693 > instead of <TT
9694 CLASS="PARAMETER"
9695 ><I
9696 >security 
9697         mask</I
9698 ></TT
9699 >, and <TT
9700 CLASS="PARAMETER"
9701 ><I
9702 >force directory security mode
9703         </I
9704 ></TT
9705 > parameter instead of <TT
9706 CLASS="PARAMETER"
9707 ><I
9708 >force security mode
9709         </I
9710 ></TT
9711 >.</P
9712 ><P
9713 >The <TT
9714 CLASS="PARAMETER"
9715 ><I
9716 >directory security mask</I
9717 ></TT
9718 > parameter 
9719         by default is set to the same value as the <TT
9720 CLASS="PARAMETER"
9721 ><I
9722 >directory mask
9723         </I
9724 ></TT
9725 > parameter and the <TT
9726 CLASS="PARAMETER"
9727 ><I
9728 >force directory security 
9729         mode</I
9730 ></TT
9731 > parameter by default is set to the same value as 
9732         the <TT
9733 CLASS="PARAMETER"
9734 ><I
9735 >force directory mode</I
9736 ></TT
9737 > parameter to provide 
9738         compatibility with Samba 2.0.4 where the permission change facility 
9739         was introduced.</P
9740 ><P
9741 >In this way Samba enforces the permission restrictions that 
9742         an administrator can set on a Samba share, whilst still allowing users 
9743         to modify the permission bits within that restriction.</P
9744 ><P
9745 >If you want to set up a share that allows users full control
9746         in modifying the permission bits on their files and directories and
9747         doesn't force any particular bits to be set 'on', then set the following
9748         parameters in the <A
9749 HREF="smb.conf.5.html"
9750 TARGET="_top"
9751 ><TT
9752 CLASS="FILENAME"
9753 >smb.conf(5)
9754         </TT
9755 ></A
9756 > file in that share specific section :</P
9757 ><P
9758 ><TT
9759 CLASS="PARAMETER"
9760 ><I
9761 >security mask = 0777</I
9762 ></TT
9763 ></P
9764 ><P
9765 ><TT
9766 CLASS="PARAMETER"
9767 ><I
9768 >force security mode = 0</I
9769 ></TT
9770 ></P
9771 ><P
9772 ><TT
9773 CLASS="PARAMETER"
9774 ><I
9775 >directory security mask = 0777</I
9776 ></TT
9777 ></P
9778 ><P
9779 ><TT
9780 CLASS="PARAMETER"
9781 ><I
9782 >force directory security mode = 0</I
9783 ></TT
9784 ></P
9785 ><P
9786 >As described, in Samba 2.0.4 the parameters :</P
9787 ><P
9788 ><TT
9789 CLASS="PARAMETER"
9790 ><I
9791 >create mask</I
9792 ></TT
9793 ></P
9794 ><P
9795 ><TT
9796 CLASS="PARAMETER"
9797 ><I
9798 >force create mode</I
9799 ></TT
9800 ></P
9801 ><P
9802 ><TT
9803 CLASS="PARAMETER"
9804 ><I
9805 >directory mask</I
9806 ></TT
9807 ></P
9808 ><P
9809 ><TT
9810 CLASS="PARAMETER"
9811 ><I
9812 >force directory mode</I
9813 ></TT
9814 ></P
9815 ><P
9816 >were used instead of the parameters discussed here.</P
9817 ></DIV
9818 ><DIV
9819 CLASS="SECT1"
9820 ><HR><H2
9821 CLASS="SECT1"
9822 ><A
9823 NAME="AEN1755"
9824 ></A
9825 >11.7. Interaction with the standard Samba file attribute 
9826         mapping</H2
9827 ><P
9828 >Samba maps some of the DOS attribute bits (such as "read 
9829         only") into the UNIX permissions of a file. This means there can 
9830         be a conflict between the permission bits set via the security 
9831         dialog and the permission bits set by the file attribute mapping.
9832         </P
9833 ><P
9834 >One way this can show up is if a file has no UNIX read access
9835         for the owner it will show up as "read only" in the standard 
9836         file attributes tabbed dialog. Unfortunately this dialog is
9837         the same one that contains the security info in another tab.</P
9838 ><P
9839 >What this can mean is that if the owner changes the permissions
9840         to allow themselves read access using the security dialog, clicks
9841         <B
9842 CLASS="COMMAND"
9843 >"OK"</B
9844 > to get back to the standard attributes tab 
9845         dialog, and then clicks <B
9846 CLASS="COMMAND"
9847 >"OK"</B
9848 > on that dialog, then 
9849         NT will set the file permissions back to read-only (as that is what 
9850         the attributes still say in the dialog). This means that after setting 
9851         permissions and clicking <B
9852 CLASS="COMMAND"
9853 >"OK"</B
9854 > to get back to the 
9855         attributes dialog you should always hit <B
9856 CLASS="COMMAND"
9857 >"Cancel"</B
9858
9859         rather than <B
9860 CLASS="COMMAND"
9861 >"OK"</B
9862 > to ensure that your changes 
9863         are not overridden.</P
9864 ></DIV
9865 ></DIV
9866 ><DIV
9867 CLASS="CHAPTER"
9868 ><HR><H1
9869 ><A
9870 NAME="PAM"
9871 ></A
9872 >Chapter 12. Configuring PAM for distributed but centrally 
9873 managed authentication</H1
9874 ><DIV
9875 CLASS="SECT1"
9876 ><H2
9877 CLASS="SECT1"
9878 ><A
9879 NAME="AEN1776"
9880 ></A
9881 >12.1. Samba and PAM</H2
9882 ><P
9883 >A number of Unix systems (eg: Sun Solaris), as well as the 
9884 xxxxBSD family and Linux, now utilize the Pluggable Authentication 
9885 Modules (PAM) facility to provide all authentication, 
9886 authorization and resource control services. Prior to the 
9887 introduction of PAM, a decision to use an alternative to 
9888 the system password database (<TT
9889 CLASS="FILENAME"
9890 >/etc/passwd</TT
9891 >) 
9892 would require the provision of alternatives for all programs that provide 
9893 security services. Such a choice would involve provision of 
9894 alternatives to such programs as: <B
9895 CLASS="COMMAND"
9896 >login</B
9897 >, 
9898 <B
9899 CLASS="COMMAND"
9900 >passwd</B
9901 >, <B
9902 CLASS="COMMAND"
9903 >chown</B
9904 >, etc.</P
9905 ><P
9906 >PAM provides a mechanism that disconnects these security programs 
9907 from the underlying authentication/authorization infrastructure.
9908 PAM is configured either through one file <TT
9909 CLASS="FILENAME"
9910 >/etc/pam.conf</TT
9911 > (Solaris), 
9912 or by editing individual files that are located in <TT
9913 CLASS="FILENAME"
9914 >/etc/pam.d</TT
9915 >.</P
9916 ><P
9917 >The following is an example <TT
9918 CLASS="FILENAME"
9919 >/etc/pam.d/login</TT
9920 > configuration file. 
9921 This example had all options been uncommented is probably not usable 
9922 as it stacks many conditions before allowing successful completion 
9923 of the login process. Essentially all conditions can be disabled 
9924 by commenting them out except the calls to <TT
9925 CLASS="FILENAME"
9926 >pam_pwdb.so</TT
9927 >.</P
9928 ><P
9929 ><PRE
9930 CLASS="PROGRAMLISTING"
9931 >#%PAM-1.0
9932 # The PAM configuration file for the `login' service
9933 #
9934 auth            required        pam_securetty.so
9935 auth            required        pam_nologin.so
9936 # auth          required        pam_dialup.so
9937 # auth          optional        pam_mail.so
9938 auth            required        pam_pwdb.so shadow md5
9939 # account       requisite       pam_time.so
9940 account         required        pam_pwdb.so
9941 session         required        pam_pwdb.so
9942 # session       optional        pam_lastlog.so
9943 # password      required        pam_cracklib.so retry=3
9944 password        required        pam_pwdb.so shadow md5</PRE
9945 ></P
9946 ><P
9947 >PAM allows use of replacable modules. Those available on a 
9948 sample system include:</P
9949 ><P
9950 ><PRE
9951 CLASS="PROGRAMLISTING"
9952 >$ /bin/ls /lib/security
9953 pam_access.so    pam_ftp.so          pam_limits.so     
9954 pam_ncp_auth.so  pam_rhosts_auth.so  pam_stress.so     
9955 pam_cracklib.so  pam_group.so        pam_listfile.so   
9956 pam_nologin.so   pam_rootok.so       pam_tally.so      
9957 pam_deny.so      pam_issue.so        pam_mail.so       
9958 pam_permit.so    pam_securetty.so    pam_time.so       
9959 pam_dialup.so    pam_lastlog.so      pam_mkhomedir.so  
9960 pam_pwdb.so      pam_shells.so       pam_unix.so       
9961 pam_env.so       pam_ldap.so         pam_motd.so       
9962 pam_radius.so    pam_smbpass.so      pam_unix_acct.so  
9963 pam_wheel.so     pam_unix_auth.so    pam_unix_passwd.so
9964 pam_userdb.so    pam_warn.so         pam_unix_session.so</PRE
9965 ></P
9966 ><P
9967 >The following example for the login program replaces the use of 
9968 the <TT
9969 CLASS="FILENAME"
9970 >pam_pwdb.so</TT
9971 > module which uses the system 
9972 password database (<TT
9973 CLASS="FILENAME"
9974 >/etc/passwd</TT
9975 >,
9976 <TT
9977 CLASS="FILENAME"
9978 >/etc/shadow</TT
9979 >, <TT
9980 CLASS="FILENAME"
9981 >/etc/group</TT
9982 >) with 
9983 the module <TT
9984 CLASS="FILENAME"
9985 >pam_smbpass.so</TT
9986 > which uses the Samba 
9987 database which contains the Microsoft MD4 encrypted password 
9988 hashes. This database is stored in either 
9989 <TT
9990 CLASS="FILENAME"
9991 >/usr/local/samba/private/smbpasswd</TT
9992 >, 
9993 <TT
9994 CLASS="FILENAME"
9995 >/etc/samba/smbpasswd</TT
9996 >, or in 
9997 <TT
9998 CLASS="FILENAME"
9999 >/etc/samba.d/smbpasswd</TT
10000 >, depending on the 
10001 Samba implementation for your Unix/Linux system. The 
10002 <TT
10003 CLASS="FILENAME"
10004 >pam_smbpass.so</TT
10005 > module is provided by 
10006 Samba version 2.2.1 or later. It can be compiled by specifying the 
10007 <B
10008 CLASS="COMMAND"
10009 >--with-pam_smbpass</B
10010 > options when running Samba's
10011 <TT
10012 CLASS="FILENAME"
10013 >configure</TT
10014 > script.  For more information
10015 on the <TT
10016 CLASS="FILENAME"
10017 >pam_smbpass</TT
10018 > module, see the documentation
10019 in the <TT
10020 CLASS="FILENAME"
10021 >source/pam_smbpass</TT
10022 > directory of the Samba 
10023 source distribution.</P
10024 ><P
10025 ><PRE
10026 CLASS="PROGRAMLISTING"
10027 >#%PAM-1.0
10028 # The PAM configuration file for the `login' service
10029 #
10030 auth            required        pam_smbpass.so nodelay
10031 account         required        pam_smbpass.so nodelay
10032 session         required        pam_smbpass.so nodelay
10033 password        required        pam_smbpass.so nodelay</PRE
10034 ></P
10035 ><P
10036 >The following is the PAM configuration file for a particular 
10037 Linux system. The default condition uses <TT
10038 CLASS="FILENAME"
10039 >pam_pwdb.so</TT
10040 >.</P
10041 ><P
10042 ><PRE
10043 CLASS="PROGRAMLISTING"
10044 >#%PAM-1.0
10045 # The PAM configuration file for the `samba' service
10046 #
10047 auth       required     /lib/security/pam_pwdb.so nullok nodelay shadow audit
10048 account    required     /lib/security/pam_pwdb.so audit nodelay
10049 session    required     /lib/security/pam_pwdb.so nodelay
10050 password   required     /lib/security/pam_pwdb.so shadow md5</PRE
10051 ></P
10052 ><P
10053 >In the following example the decision has been made to use the 
10054 smbpasswd database even for basic samba authentication. Such a 
10055 decision could also be made for the passwd program and would 
10056 thus allow the smbpasswd passwords to be changed using the passwd 
10057 program.</P
10058 ><P
10059 ><PRE
10060 CLASS="PROGRAMLISTING"
10061 >#%PAM-1.0
10062 # The PAM configuration file for the `samba' service
10063 #
10064 auth       required     /lib/security/pam_smbpass.so nodelay
10065 account    required     /lib/security/pam_pwdb.so audit nodelay
10066 session    required     /lib/security/pam_pwdb.so nodelay
10067 password   required     /lib/security/pam_smbpass.so nodelay smbconf=/etc/samba.d/smb.conf</PRE
10068 ></P
10069 ><P
10070 >Note: PAM allows stacking of authentication mechanisms. It is 
10071 also possible to pass information obtained within one PAM module through 
10072 to the next module in the PAM stack. Please refer to the documentation for 
10073 your particular system implementation for details regarding the specific 
10074 capabilities of PAM in this environment. Some Linux implmentations also 
10075 provide the <TT
10076 CLASS="FILENAME"
10077 >pam_stack.so</TT
10078 > module that allows all 
10079 authentication to be configured in a single central file. The 
10080 <TT
10081 CLASS="FILENAME"
10082 >pam_stack.so</TT
10083 > method has some very devoted followers 
10084 on the basis that it allows for easier administration. As with all issues in 
10085 life though, every decision makes trade-offs, so you may want examine the 
10086 PAM documentation for further helpful information.</P
10087 ></DIV
10088 ><DIV
10089 CLASS="SECT1"
10090 ><HR><H2
10091 CLASS="SECT1"
10092 ><A
10093 NAME="AEN1820"
10094 ></A
10095 >12.2. Distributed Authentication</H2
10096 ><P
10097 >The astute administrator will realize from this that the 
10098 combination of <TT
10099 CLASS="FILENAME"
10100 >pam_smbpass.so</TT
10101 >, 
10102 <B
10103 CLASS="COMMAND"
10104 >winbindd</B
10105 >, and <B
10106 CLASS="COMMAND"
10107 >rsync</B
10108 > (see
10109 <A
10110 HREF="http://rsync.samba.org/"
10111 TARGET="_top"
10112 >http://rsync.samba.org/</A
10113 >)
10114 will allow the establishment of a centrally managed, distributed 
10115 user/password database that can also be used by all 
10116 PAM (eg: Linux) aware programs and applications. This arrangement 
10117 can have particularly potent advantages compared with the 
10118 use of Microsoft Active Directory Service (ADS) in so far as 
10119 reduction of wide area network authentication traffic.</P
10120 ></DIV
10121 ><DIV
10122 CLASS="SECT1"
10123 ><HR><H2
10124 CLASS="SECT1"
10125 ><A
10126 NAME="AEN1827"
10127 ></A
10128 >12.3. PAM Configuration in smb.conf</H2
10129 ><P
10130 >There is an option in smb.conf called <A
10131 HREF="smb.conf.5.html#OBEYPAMRESTRICTIONS"
10132 TARGET="_top"
10133 >obey pam restrictions</A
10134 >. 
10135 The following is from the on-line help for this option in SWAT;</P
10136 ><P
10137 >When Samba 2.2 is configure to enable PAM support (i.e. 
10138 <TT
10139 CLASS="CONSTANT"
10140 >--with-pam</TT
10141 >), this parameter will 
10142 control whether or not Samba should obey PAM's account 
10143 and session management directives. The default behavior 
10144 is to use PAM for clear text authentication only and to 
10145 ignore any account or session management. Note that Samba always 
10146 ignores PAM for authentication in the case of 
10147 <A
10148 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
10149 TARGET="_top"
10150 >encrypt passwords = yes</A
10151 >. 
10152 The reason is that PAM modules cannot support the challenge/response 
10153 authentication mechanism needed in the presence of SMB 
10154 password encryption. </P
10155 ><P
10156 >Default: <B
10157 CLASS="COMMAND"
10158 >obey pam restrictions = no</B
10159 ></P
10160 ></DIV
10161 ></DIV
10162 ><DIV
10163 CLASS="CHAPTER"
10164 ><HR><H1
10165 ><A
10166 NAME="MSDFS"
10167 ></A
10168 >Chapter 13. Hosting a Microsoft Distributed File System tree on Samba</H1
10169 ><DIV
10170 CLASS="SECT1"
10171 ><H2
10172 CLASS="SECT1"
10173 ><A
10174 NAME="AEN1847"
10175 ></A
10176 >13.1. Instructions</H2
10177 ><P
10178 >The Distributed File System (or Dfs) provides a means of 
10179         separating the logical view of files and directories that users 
10180         see from the actual physical locations of these resources on the 
10181         network. It allows for higher availability, smoother storage expansion, 
10182         load balancing etc. For more information about Dfs, refer to  <A
10183 HREF="http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp"
10184 TARGET="_top"
10185 >       Microsoft documentation</A
10186 >. </P
10187 ><P
10188 >This document explains how to host a Dfs tree on a Unix 
10189         machine (for Dfs-aware clients to browse) using Samba.</P
10190 ><P
10191 >To enable SMB-based DFS for Samba, configure it with the 
10192         <TT
10193 CLASS="PARAMETER"
10194 ><I
10195 >--with-msdfs</I
10196 ></TT
10197 > option. Once built, a 
10198         Samba server can be made a Dfs server by setting the global 
10199         boolean <A
10200 HREF="smb.conf.5.html#HOSTMSDFS"
10201 TARGET="_top"
10202 ><TT
10203 CLASS="PARAMETER"
10204 ><I
10205 >       host msdfs</I
10206 ></TT
10207 ></A
10208 > parameter in the <TT
10209 CLASS="FILENAME"
10210 >smb.conf
10211         </TT
10212 > file. You designate a share as a Dfs root using the share 
10213         level boolean <A
10214 HREF="smb.conf.5.html#MSDFSROOT"
10215 TARGET="_top"
10216 ><TT
10217 CLASS="PARAMETER"
10218 ><I
10219 >       msdfs root</I
10220 ></TT
10221 ></A
10222 > parameter. A Dfs root directory on 
10223         Samba hosts Dfs links in the form of symbolic links that point 
10224         to other servers. For example, a symbolic link
10225         <TT
10226 CLASS="FILENAME"
10227 >junction-&gt;msdfs:storage1\share1</TT
10228 > in 
10229         the share directory acts as the Dfs junction. When Dfs-aware 
10230         clients attempt to access the junction link, they are redirected 
10231         to the storage location (in this case, \\storage1\share1).</P
10232 ><P
10233 >Dfs trees on Samba work with all Dfs-aware clients ranging 
10234         from Windows 95 to 2000.</P
10235 ><P
10236 >Here's an example of setting up a Dfs tree on a Samba 
10237         server.</P
10238 ><P
10239 ><PRE
10240 CLASS="PROGRAMLISTING"
10241 ># The smb.conf file:
10242 [global]
10243         netbios name = SAMBA
10244         host msdfs   = yes
10245
10246 [dfs]
10247         path = /export/dfsroot
10248         msdfs root = yes
10249         </PRE
10250 ></P
10251 ><P
10252 >In the /export/dfsroot directory we set up our dfs links to 
10253         other servers on the network.</P
10254 ><P
10255 ><TT
10256 CLASS="PROMPT"
10257 >root# </TT
10258 ><TT
10259 CLASS="USERINPUT"
10260 ><B
10261 >cd /export/dfsroot</B
10262 ></TT
10263 ></P
10264 ><P
10265 ><TT
10266 CLASS="PROMPT"
10267 >root# </TT
10268 ><TT
10269 CLASS="USERINPUT"
10270 ><B
10271 >chown root /export/dfsroot</B
10272 ></TT
10273 ></P
10274 ><P
10275 ><TT
10276 CLASS="PROMPT"
10277 >root# </TT
10278 ><TT
10279 CLASS="USERINPUT"
10280 ><B
10281 >chmod 755 /export/dfsroot</B
10282 ></TT
10283 ></P
10284 ><P
10285 ><TT
10286 CLASS="PROMPT"
10287 >root# </TT
10288 ><TT
10289 CLASS="USERINPUT"
10290 ><B
10291 >ln -s msdfs:storageA\\shareA linka</B
10292 ></TT
10293 ></P
10294 ><P
10295 ><TT
10296 CLASS="PROMPT"
10297 >root# </TT
10298 ><TT
10299 CLASS="USERINPUT"
10300 ><B
10301 >ln -s msdfs:serverB\\share,serverC\\share linkb</B
10302 ></TT
10303 ></P
10304 ><P
10305 >You should set up the permissions and ownership of 
10306         the directory acting as the Dfs root such that only designated 
10307         users can create, delete or modify the msdfs links. Also note 
10308         that symlink names should be all lowercase. This limitation exists 
10309         to have Samba avoid trying all the case combinations to get at 
10310         the link name. Finally set up the symbolic links to point to the 
10311         network shares you want, and start Samba.</P
10312 ><P
10313 >Users on Dfs-aware clients can now browse the Dfs tree 
10314         on the Samba server at \\samba\dfs. Accessing 
10315         links linka or linkb (which appear as directories to the client) 
10316         takes users directly to the appropriate shares on the network.</P
10317 ><DIV
10318 CLASS="SECT2"
10319 ><HR><H3
10320 CLASS="SECT2"
10321 ><A
10322 NAME="AEN1882"
10323 ></A
10324 >13.1.1. Notes</H3
10325 ><P
10326 ></P
10327 ><UL
10328 ><LI
10329 ><P
10330 >Windows clients need to be rebooted 
10331                         if a previously mounted non-dfs share is made a dfs 
10332                         root or vice versa. A better way is to introduce a 
10333                         new share and make it the dfs root.</P
10334 ></LI
10335 ><LI
10336 ><P
10337 >Currently there's a restriction that msdfs 
10338                         symlink names should all be lowercase.</P
10339 ></LI
10340 ><LI
10341 ><P
10342 >For security purposes, the directory 
10343                         acting as the root of the Dfs tree should have ownership 
10344                         and permissions set so that only designated users can 
10345                         modify the symbolic links in the directory.</P
10346 ></LI
10347 ></UL
10348 ></DIV
10349 ></DIV
10350 ></DIV
10351 ><DIV
10352 CLASS="CHAPTER"
10353 ><HR><H1
10354 ><A
10355 NAME="PRINTING"
10356 ></A
10357 >Chapter 14. Printing Support</H1
10358 ><DIV
10359 CLASS="SECT1"
10360 ><H2
10361 CLASS="SECT1"
10362 ><A
10363 NAME="AEN1908"
10364 ></A
10365 >14.1. Introduction</H2
10366 ><P
10367 >Beginning with the 2.2.0 release, Samba supports 
10368 the native Windows NT printing mechanisms implemented via 
10369 MS-RPC (i.e. the SPOOLSS named pipe).  Previous versions of 
10370 Samba only supported LanMan printing calls.</P
10371 ><P
10372 >The additional functionality provided by the new 
10373 SPOOLSS support includes:</P
10374 ><P
10375 ></P
10376 ><UL
10377 ><LI
10378 ><P
10379 >Support for downloading printer driver 
10380         files to Windows 95/98/NT/2000 clients upon demand.
10381         </P
10382 ></LI
10383 ><LI
10384 ><P
10385 >Uploading of printer drivers via the 
10386         Windows NT Add Printer Wizard (APW) or the 
10387         Imprints tool set (refer to <A
10388 HREF="http://imprints.sourceforge.net"
10389 TARGET="_top"
10390 >http://imprints.sourceforge.net</A
10391 >). 
10392         </P
10393 ></LI
10394 ><LI
10395 ><P
10396 >Support for the native MS-RPC printing 
10397         calls such as StartDocPrinter, EnumJobs(), etc...  (See 
10398         the MSDN documentation at <A
10399 HREF="http://msdn.microsoft.com/"
10400 TARGET="_top"
10401 >http://msdn.microsoft.com/</A
10402
10403         for more information on the Win32 printing API)
10404         </P
10405 ></LI
10406 ><LI
10407 ><P
10408 >Support for NT Access Control Lists (ACL) 
10409         on printer objects</P
10410 ></LI
10411 ><LI
10412 ><P
10413 >Improved support for printer queue manipulation 
10414         through the use of an internal databases for spooled job 
10415         information</P
10416 ></LI
10417 ></UL
10418 ><P
10419 >There has been some initial confusion about what all this means
10420 and whether or not it is a requirement for printer drivers to be 
10421 installed on a Samba host in order to support printing from Windows 
10422 clients. As a side note, Samba does not use these drivers in any way to process 
10423 spooled files.  They are utilized entirely by the clients.</P
10424 ><P
10425 >The following MS KB article, may be of some help if you are dealing with
10426 Windows 2000 clients:  <SPAN
10427 CLASS="emphasis"
10428 ><I
10429 CLASS="EMPHASIS"
10430 >How to Add Printers with No User 
10431 Interaction in Windows 2000</I
10432 ></SPAN
10433 ></P
10434 ><P
10435 ><A
10436 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
10437 TARGET="_top"
10438 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
10439 ></P
10440 ></DIV
10441 ><DIV
10442 CLASS="SECT1"
10443 ><HR><H2
10444 CLASS="SECT1"
10445 ><A
10446 NAME="AEN1930"
10447 ></A
10448 >14.2. Configuration</H2
10449 ><DIV
10450 CLASS="WARNING"
10451 ><P
10452 ></P
10453 ><TABLE
10454 CLASS="WARNING"
10455 WIDTH="100%"
10456 BORDER="0"
10457 ><TR
10458 ><TD
10459 WIDTH="25"
10460 ALIGN="CENTER"
10461 VALIGN="TOP"
10462 ><IMG
10463 SRC="/docbook-dsssl/warning.gif"
10464 HSPACE="5"
10465 ALT="Warning"></TD
10466 ><TH
10467 ALIGN="LEFT"
10468 VALIGN="CENTER"
10469 ><B
10470 >[print$] vs. [printer$]</B
10471 ></TH
10472 ></TR
10473 ><TR
10474 ><TD
10475 >&nbsp;</TD
10476 ><TD
10477 ALIGN="LEFT"
10478 VALIGN="TOP"
10479 ><P
10480 >Previous versions of Samba recommended using a share named [printer$].  
10481 This name was taken from the printer$ service created by Windows 9x 
10482 clients when a printer was shared.  Windows 9x printer servers always have 
10483 a printer$ service which provides read-only access via no 
10484 password in order to support printer driver downloads.</P
10485 ><P
10486 >However, the initial implementation allowed for a 
10487 parameter named <TT
10488 CLASS="PARAMETER"
10489 ><I
10490 >printer driver location</I
10491 ></TT
10492
10493 to be used on a per share basis to specify the location of 
10494 the driver files associated with that printer.  Another 
10495 parameter named <TT
10496 CLASS="PARAMETER"
10497 ><I
10498 >printer driver</I
10499 ></TT
10500 > provided 
10501 a means of defining the printer driver name to be sent to 
10502 the client.</P
10503 ></TD
10504 ></TR
10505 ></TABLE
10506 ></DIV
10507 ><DIV
10508 CLASS="SECT2"
10509 ><HR><H3
10510 CLASS="SECT2"
10511 ><A
10512 NAME="AEN1938"
10513 ></A
10514 >14.2.1. Creating [print$]</H3
10515 ><P
10516 >In order to support the uploading of printer driver 
10517 files, you must first configure a file share named [print$].  
10518 The name of this share is hard coded in Samba's internals so 
10519 the name is very important (print$ is the service used by 
10520 Windows NT print servers to provide support for printer driver 
10521 download).</P
10522 ><P
10523 >You should modify the server's smb.conf file to add the global
10524 parameters and to create the 
10525 following file share (of course, some of the parameter values,
10526 such as 'path' are arbitrary and should be replaced with
10527 appropriate values for your site):</P
10528 ><P
10529 ><PRE
10530 CLASS="PROGRAMLISTING"
10531 >[global]
10532     ; members of the ntadmin group should be able
10533     ; to add drivers and set printer properties
10534     ; root is implicitly a 'printer admin'
10535     printer admin = @ntadmin
10536
10537 [print$]
10538     path = /usr/local/samba/printers
10539     guest ok = yes
10540     browseable = yes
10541     read only = yes
10542     ; since this share is configured as read only, then we need
10543     ; a 'write list'.  Check the file system permissions to make
10544     ; sure this account can copy files to the share.  If this
10545     ; is setup to a non-root account, then it should also exist
10546     ; as a 'printer admin'
10547     write list = @ntadmin,root</PRE
10548 ></P
10549 ><P
10550 >The <A
10551 HREF="smb.conf.5.html#WRITELIST"
10552 TARGET="_top"
10553 ><TT
10554 CLASS="PARAMETER"
10555 ><I
10556 >write list</I
10557 ></TT
10558 ></A
10559 > is used to allow administrative 
10560 level user accounts to have write access in order to update files 
10561 on the share.  See the <A
10562 HREF="smb.conf.5.html"
10563 TARGET="_top"
10564 >smb.conf(5) 
10565 man page</A
10566 > for more information on configuring file shares.</P
10567 ><P
10568 >The requirement for <A
10569 HREF="smb.conf.5.html#GUESTOK"
10570 TARGET="_top"
10571 ><B
10572 CLASS="COMMAND"
10573 >guest 
10574 ok = yes</B
10575 ></A
10576 > depends upon how your
10577 site is configured.  If users will be guaranteed to have 
10578 an account on the Samba host, then this is a non-issue.</P
10579 ><DIV
10580 CLASS="NOTE"
10581 ><P
10582 ></P
10583 ><TABLE
10584 CLASS="NOTE"
10585 WIDTH="100%"
10586 BORDER="0"
10587 ><TR
10588 ><TD
10589 WIDTH="25"
10590 ALIGN="CENTER"
10591 VALIGN="TOP"
10592 ><IMG
10593 SRC="/docbook-dsssl/note.gif"
10594 HSPACE="5"
10595 ALT="Note"></TD
10596 ><TH
10597 ALIGN="LEFT"
10598 VALIGN="CENTER"
10599 ><B
10600 >Author's Note</B
10601 ></TH
10602 ></TR
10603 ><TR
10604 ><TD
10605 >&nbsp;</TD
10606 ><TD
10607 ALIGN="LEFT"
10608 VALIGN="TOP"
10609 ><P
10610 >The non-issue is that if all your Windows NT users are guaranteed to be 
10611 authenticated by the Samba server (such as a domain member server and the NT 
10612 user has already been validated by the Domain Controller in 
10613 order to logon to the Windows NT console), then guest access 
10614 is not necessary.  Of course, in a workgroup environment where 
10615 you just want to be able to print without worrying about 
10616 silly accounts and security, then configure the share for 
10617 guest access.  You'll probably want to add <A
10618 HREF="smb.conf.5.html#MAPTOGUEST"
10619 TARGET="_top"
10620 ><B
10621 CLASS="COMMAND"
10622 >map to guest = Bad User</B
10623 ></A
10624 > in the [global] section as well.  Make sure 
10625 you understand what this parameter does before using it 
10626 though. --jerry</P
10627 ></TD
10628 ></TR
10629 ></TABLE
10630 ></DIV
10631 ><P
10632 >In order for a Windows NT print server to support 
10633 the downloading of driver files by multiple client architectures,
10634 it must create subdirectories within the [print$] service
10635 which correspond to each of the supported client architectures.
10636 Samba follows this model as well.</P
10637 ><P
10638 >Next create the directory tree below the [print$] share 
10639 for each architecture you wish to support.</P
10640 ><P
10641 ><PRE
10642 CLASS="PROGRAMLISTING"
10643 >[print$]-----
10644         |-W32X86           ; "Windows NT x86"
10645         |-WIN40            ; "Windows 95/98"
10646         |-W32ALPHA         ; "Windows NT Alpha_AXP"
10647         |-W32MIPS          ; "Windows NT R4000"
10648         |-W32PPC           ; "Windows NT PowerPC"</PRE
10649 ></P
10650 ><DIV
10651 CLASS="WARNING"
10652 ><P
10653 ></P
10654 ><TABLE
10655 CLASS="WARNING"
10656 WIDTH="100%"
10657 BORDER="0"
10658 ><TR
10659 ><TD
10660 WIDTH="25"
10661 ALIGN="CENTER"
10662 VALIGN="TOP"
10663 ><IMG
10664 SRC="/docbook-dsssl/warning.gif"
10665 HSPACE="5"
10666 ALT="Warning"></TD
10667 ><TH
10668 ALIGN="LEFT"
10669 VALIGN="CENTER"
10670 ><B
10671 >ATTENTION!  REQUIRED PERMISSIONS</B
10672 ></TH
10673 ></TR
10674 ><TR
10675 ><TD
10676 >&nbsp;</TD
10677 ><TD
10678 ALIGN="LEFT"
10679 VALIGN="TOP"
10680 ><P
10681 >In order to currently add a new driver to you Samba host, 
10682 one of two conditions must hold true:</P
10683 ><P
10684 ></P
10685 ><UL
10686 ><LI
10687 ><P
10688 >The account used to connect to the Samba host 
10689         must have a uid of 0 (i.e. a root account)</P
10690 ></LI
10691 ><LI
10692 ><P
10693 >The account used to connect to the Samba host
10694         must be a member of the <A
10695 HREF="smb.conf.5.html#PRINTERADMIN"
10696 TARGET="_top"
10697 ><TT
10698 CLASS="PARAMETER"
10699 ><I
10700 >printer 
10701         admin</I
10702 ></TT
10703 ></A
10704 > list.</P
10705 ></LI
10706 ></UL
10707 ><P
10708 >Of course, the connected account must still possess access
10709 to add files to the subdirectories beneath [print$]. Remember
10710 that all file shares are set to 'read only' by default.</P
10711 ></TD
10712 ></TR
10713 ></TABLE
10714 ></DIV
10715 ><P
10716 >Once you have created the required [print$] service and 
10717 associated subdirectories, simply log onto the Samba server using 
10718 a root (or <TT
10719 CLASS="PARAMETER"
10720 ><I
10721 >printer admin</I
10722 ></TT
10723 >) account
10724 from a Windows NT 4.0/2k client.  Open "Network Neighbourhood" or
10725 "My Network Places" and browse for the Samba host.  Once you have located
10726 the server, navigate to the "Printers..." folder.
10727 You should see an initial listing of printers
10728 that matches the printer shares defined on your Samba host.</P
10729 ></DIV
10730 ><DIV
10731 CLASS="SECT2"
10732 ><HR><H3
10733 CLASS="SECT2"
10734 ><A
10735 NAME="AEN1973"
10736 ></A
10737 >14.2.2. Setting Drivers for Existing Printers</H3
10738 ><P
10739 >The initial listing of printers in the Samba host's 
10740 Printers folder will have no real printer driver assigned 
10741 to them. This defaults to a NULL string to allow the use
10742 of the local Add Printer Wizard on NT/2000 clients.
10743 Attempting to view the printer properties for a printer
10744 which has this default driver assigned will result in 
10745 the error message:</P
10746 ><P
10747 ><SPAN
10748 CLASS="emphasis"
10749 ><I
10750 CLASS="EMPHASIS"
10751 >Device settings cannot be displayed.  The driver 
10752 for the specified printer is not installed, only spooler 
10753 properties will be displayed.  Do you want to install the 
10754 driver now?</I
10755 ></SPAN
10756 ></P
10757 ><P
10758 >Click "No" in the error dialog and you will be presented with
10759 the printer properties window.  The way to assign a driver to a 
10760 printer is to either</P
10761 ><P
10762 ></P
10763 ><UL
10764 ><LI
10765 ><P
10766 >Use the "New Driver..." button to install 
10767         a new printer driver, or</P
10768 ></LI
10769 ><LI
10770 ><P
10771 >Select a driver from the popup list of 
10772         installed drivers.  Initially this list will be empty.</P
10773 ></LI
10774 ></UL
10775 ><P
10776 >If you wish to install printer drivers for client 
10777 operating systems other than "Windows NT x86", you will need 
10778 to use the "Sharing" tab of the printer properties dialog.</P
10779 ><P
10780 >Assuming you have connected with a root account, you 
10781 will also be able modify other printer properties such as 
10782 ACLs and device settings using this dialog box.</P
10783 ><P
10784 >A few closing comments for this section, it is possible 
10785 on a Windows NT print server to have printers
10786 listed in the Printers folder which are not shared.  Samba does
10787 not make this distinction.  By definition, the only printers of
10788 which Samba is aware are those which are specified as shares in
10789 <TT
10790 CLASS="FILENAME"
10791 >smb.conf</TT
10792 >.</P
10793 ><P
10794 >Another interesting side note is that Windows NT clients do
10795 not use the SMB printer share, but rather can print directly 
10796 to any printer on another Windows NT host using MS-RPC.  This
10797 of course assumes that the printing client has the necessary
10798 privileges on the remote host serving the printer.  The default
10799 permissions assigned by Windows NT to a printer gives the "Print"
10800 permissions to the "Everyone" well-known group.</P
10801 ></DIV
10802 ><DIV
10803 CLASS="SECT2"
10804 ><HR><H3
10805 CLASS="SECT2"
10806 ><A
10807 NAME="AEN1989"
10808 ></A
10809 >14.2.3. Support a large number of printers</H3
10810 ><P
10811 >One issue that has arisen during the development
10812 phase of Samba 2.2 is the need to support driver downloads for
10813 100's of printers.  Using the Windows NT APW is somewhat 
10814 awkward to say the list.  If more than one printer are using the 
10815 same driver, the <A
10816 HREF="rpcclient.1.html"
10817 TARGET="_top"
10818 ><B
10819 CLASS="COMMAND"
10820 >rpcclient's
10821 setdriver command</B
10822 ></A
10823 > can be used to set the driver
10824 associated with an installed driver.  The following is example
10825 of how this could be accomplished:</P
10826 ><P
10827 ><PRE
10828 CLASS="PROGRAMLISTING"
10829
10830 <TT
10831 CLASS="PROMPT"
10832 >$ </TT
10833 >rpcclient pogo -U root%secret -c "enumdrivers"
10834 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
10835  
10836 [Windows NT x86]
10837 Printer Driver Info 1:
10838      Driver Name: [HP LaserJet 4000 Series PS]
10839  
10840 Printer Driver Info 1:
10841      Driver Name: [HP LaserJet 2100 Series PS]
10842  
10843 Printer Driver Info 1:
10844      Driver Name: [HP LaserJet 4Si/4SiMX PS]
10845                                   
10846 <TT
10847 CLASS="PROMPT"
10848 >$ </TT
10849 >rpcclient pogo -U root%secret -c "enumprinters"
10850 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
10851      flags:[0x800000]
10852      name:[\\POGO\hp-print]
10853      description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
10854      comment:[]
10855                                   
10856 <TT
10857 CLASS="PROMPT"
10858 >$ </TT
10859 >rpcclient pogo -U root%secret \
10860 <TT
10861 CLASS="PROMPT"
10862 >&gt; </TT
10863 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
10864 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
10865 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
10866 ></P
10867 ></DIV
10868 ><DIV
10869 CLASS="SECT2"
10870 ><HR><H3
10871 CLASS="SECT2"
10872 ><A
10873 NAME="AEN2000"
10874 ></A
10875 >14.2.4. Adding New Printers via the Windows NT APW</H3
10876 ><P
10877 >By default, Samba offers all printer shares defined in <TT
10878 CLASS="FILENAME"
10879 >smb.conf</TT
10880 >
10881 in the "Printers..." folder.  Also existing in this folder is the Windows NT 
10882 Add Printer Wizard icon.  The APW will be show only if</P
10883 ><P
10884 ></P
10885 ><UL
10886 ><LI
10887 ><P
10888 >The connected user is able to successfully
10889         execute an OpenPrinterEx(\\server) with administrative
10890         privileges (i.e. root or <TT
10891 CLASS="PARAMETER"
10892 ><I
10893 >printer admin</I
10894 ></TT
10895 >).
10896         </P
10897 ></LI
10898 ><LI
10899 ><P
10900 ><A
10901 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
10902 TARGET="_top"
10903 ><TT
10904 CLASS="PARAMETER"
10905 ><I
10906 >show 
10907         add printer wizard = yes</I
10908 ></TT
10909 ></A
10910 > (the default).
10911         </P
10912 ></LI
10913 ></UL
10914 ><P
10915 >In order to be able to use the APW to successfully add a printer to a Samba 
10916 server, the <A
10917 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
10918 TARGET="_top"
10919 ><TT
10920 CLASS="PARAMETER"
10921 ><I
10922 >add 
10923 printer command</I
10924 ></TT
10925 ></A
10926 > must have a defined value.  The program
10927 hook must successfully add the printer to the system (i.e. 
10928 <TT
10929 CLASS="FILENAME"
10930 >/etc/printcap</TT
10931 > or appropriate files) and 
10932 <TT
10933 CLASS="FILENAME"
10934 >smb.conf</TT
10935 > if necessary.</P
10936 ><P
10937 >When using the APW from a client, if the named printer share does 
10938 not exist, <B
10939 CLASS="COMMAND"
10940 >smbd</B
10941 > will execute the <TT
10942 CLASS="PARAMETER"
10943 ><I
10944 >add printer 
10945 command</I
10946 ></TT
10947 > and reparse to the <TT
10948 CLASS="FILENAME"
10949 >smb.conf</TT
10950 >
10951 to attempt to locate the new printer share.  If the share is still not defined,
10952 an error of "Access Denied" is returned to the client.  Note that the 
10953 <TT
10954 CLASS="PARAMETER"
10955 ><I
10956 >add printer program</I
10957 ></TT
10958 > is executed under the context
10959 of the connected user, not necessarily a root account.</P
10960 ><P
10961 >There is a complementary <A
10962 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
10963 TARGET="_top"
10964 ><TT
10965 CLASS="PARAMETER"
10966 ><I
10967 >delete
10968 printer command</I
10969 ></TT
10970 ></A
10971 > for removing entries from the "Printers..."
10972 folder.</P
10973 ><P
10974 >The following is an example <A
10975 HREF="smb.conf.5.html#ADDPRINTERCOMMAN"
10976 TARGET="_top"
10977 ><TT
10978 CLASS="PARAMETER"
10979 ><I
10980 >add printer command</I
10981 ></TT
10982 ></A
10983 > script. It adds the appropriate entries to <TT
10984 CLASS="FILENAME"
10985 >/etc/printcap.local</TT
10986 > (change that to what you need) and returns a line of 'Done' which is needed for the whole process to work.</P
10987 ><PRE
10988 CLASS="PROGRAMLISTING"
10989 >#!/bin/sh
10990
10991 # Script to insert a new printer entry into printcap.local
10992 #
10993 # $1, printer name, used as the descriptive name
10994 # $2, share name, used as the printer name for Linux
10995 # $3, port name
10996 # $4, driver name
10997 # $5, location, used for the device file of the printer
10998 # $6, win9x location
10999
11000 #
11001 # Make sure we use the location that RedHat uses for local printer defs
11002 PRINTCAP=/etc/printcap.local
11003 DATE=`date +%Y%m%d-%H%M%S`
11004 LP=lp
11005 RESTART="service lpd restart"
11006
11007 # Keep a copy
11008 cp $PRINTCAP $PRINTCAP.$DATE
11009 # Add the printer to $PRINTCAP
11010 echo ""                                                 &#62;&#62; $PRINTCAP
11011 echo "$2|$1:\\"                                         &#62;&#62; $PRINTCAP
11012 echo "  :sd=/var/spool/lpd/$2:\\"                       &#62;&#62; $PRINTCAP
11013 echo "  :mx=0:ml=0:sh:\\"                               &#62;&#62; $PRINTCAP
11014 echo "  :lp=/usr/local/samba/var/print/$5.prn:"         &#62;&#62; $PRINTCAP
11015
11016 touch "/usr/local/samba/var/print/$5.prn" &#62;&#62; /tmp/printadd.$$ 2&#62;&#38;1
11017 chown $LP "/usr/local/samba/var/print/$5.prn" &#62;&#62; /tmp/printadd.$$ 2&#62;&#38;1
11018
11019 mkdir /var/spool/lpd/$2
11020 chmod 700 /var/spool/lpd/$2
11021 chown $LP /var/spool/lpd/$2
11022 #echo $1 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
11023 #echo $2 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
11024 #echo $3 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
11025 #echo $4 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
11026 #echo $5 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
11027 #echo $6 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
11028 $RESTART &#62;&#62; "/usr/local/samba/var/print/$5.prn"
11029 # Not sure if this is needed
11030 touch /usr/local/samba/lib/smb.conf
11031 #
11032 # You need to return a value, but I am not sure what it means.
11033 #
11034 echo "Done"
11035 exit 0</PRE
11036 ></DIV
11037 ><DIV
11038 CLASS="SECT2"
11039 ><HR><H3
11040 CLASS="SECT2"
11041 ><A
11042 NAME="AEN2030"
11043 ></A
11044 >14.2.5. Samba and Printer Ports</H3
11045 ><P
11046 >Windows NT/2000 print servers associate a port with each printer.  These normally
11047 take the form of LPT1:, COM1:, FILE:, etc...  Samba must also support the
11048 concept of ports associated with a printer.  By default, only one printer port,
11049 named "Samba Printer Port", exists on a system.  Samba does not really a port in
11050 order to print, rather it is a requirement of Windows clients.  </P
11051 ><P
11052 >Note that Samba does not support the concept of "Printer Pooling" internally 
11053 either.  This is when a logical printer is assigned to multiple ports as 
11054 a form of load balancing or fail over.</P
11055 ><P
11056 >If you require that multiple ports be defined for some reason,
11057 <TT
11058 CLASS="FILENAME"
11059 >smb.conf</TT
11060 > possesses a <A
11061 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
11062 TARGET="_top"
11063 ><TT
11064 CLASS="PARAMETER"
11065 ><I
11066 >enumports 
11067 command</I
11068 ></TT
11069 ></A
11070 > which can be used to define an external program 
11071 that generates a listing of ports on a system.</P
11072 ></DIV
11073 ></DIV
11074 ><DIV
11075 CLASS="SECT1"
11076 ><HR><H2
11077 CLASS="SECT1"
11078 ><A
11079 NAME="AEN2038"
11080 ></A
11081 >14.3. The Imprints Toolset</H2
11082 ><P
11083 >The Imprints tool set provides a UNIX equivalent of the 
11084         Windows NT Add Printer Wizard.  For complete information, please 
11085         refer to the Imprints web site at <A
11086 HREF="http://imprints.sourceforge.net/"
11087 TARGET="_top"
11088 >       http://imprints.sourceforge.net/</A
11089 > as well as the documentation 
11090         included with the imprints source distribution.  This section will 
11091         only provide a brief introduction to the features of Imprints.</P
11092 ><DIV
11093 CLASS="SECT2"
11094 ><HR><H3
11095 CLASS="SECT2"
11096 ><A
11097 NAME="AEN2042"
11098 ></A
11099 >14.3.1. What is Imprints?</H3
11100 ><P
11101 >Imprints is a collection of tools for supporting the goals 
11102                 of</P
11103 ><P
11104 ></P
11105 ><UL
11106 ><LI
11107 ><P
11108 >Providing a central repository information 
11109                         regarding Windows NT and 95/98 printer driver packages</P
11110 ></LI
11111 ><LI
11112 ><P
11113 >Providing the tools necessary for creating 
11114                         the Imprints printer driver packages.</P
11115 ></LI
11116 ><LI
11117 ><P
11118 >Providing an installation client which 
11119                         will obtain and install printer drivers on remote Samba 
11120                         and Windows NT 4 print servers.</P
11121 ></LI
11122 ></UL
11123 ></DIV
11124 ><DIV
11125 CLASS="SECT2"
11126 ><HR><H3
11127 CLASS="SECT2"
11128 ><A
11129 NAME="AEN2052"
11130 ></A
11131 >14.3.2. Creating Printer Driver Packages</H3
11132 ><P
11133 >The process of creating printer driver packages is beyond
11134                 the scope of this document (refer to Imprints.txt also included
11135                 with the Samba distribution for more information).  In short,
11136                 an Imprints driver package is a gzipped tarball containing the
11137                 driver files, related INF files, and a control file needed by the
11138                 installation client.</P
11139 ></DIV
11140 ><DIV
11141 CLASS="SECT2"
11142 ><HR><H3
11143 CLASS="SECT2"
11144 ><A
11145 NAME="AEN2055"
11146 ></A
11147 >14.3.3. The Imprints server</H3
11148 ><P
11149 >The Imprints server is really a database server that 
11150                 may be queried via standard HTTP mechanisms.  Each printer 
11151                 entry in the database has an associated URL for the actual
11152                 downloading of the package.  Each package is digitally signed
11153                 via GnuPG which can be used to verify that package downloaded
11154                 is actually the one referred in the Imprints database.  It is 
11155                 <SPAN
11156 CLASS="emphasis"
11157 ><I
11158 CLASS="EMPHASIS"
11159 >not</I
11160 ></SPAN
11161 > recommended that this security check 
11162                 be disabled.</P
11163 ></DIV
11164 ><DIV
11165 CLASS="SECT2"
11166 ><HR><H3
11167 CLASS="SECT2"
11168 ><A
11169 NAME="AEN2059"
11170 ></A
11171 >14.3.4. The Installation Client</H3
11172 ><P
11173 >More information regarding the Imprints installation client 
11174                 is available in the <TT
11175 CLASS="FILENAME"
11176 >Imprints-Client-HOWTO.ps</TT
11177
11178                 file included with the imprints source package.</P
11179 ><P
11180 >The Imprints installation client comes in two forms.</P
11181 ><P
11182 ></P
11183 ><UL
11184 ><LI
11185 ><P
11186 >a set of command line Perl scripts</P
11187 ></LI
11188 ><LI
11189 ><P
11190 >a GTK+ based graphical interface to 
11191                         the command line perl scripts</P
11192 ></LI
11193 ></UL
11194 ><P
11195 >The installation client (in both forms) provides a means
11196                 of querying the Imprints database server for a matching
11197                 list of known printer model names as well as a means to 
11198                 download and install the drivers on remote Samba and Windows
11199                 NT print servers.</P
11200 ><P
11201 >The basic installation process is in four steps and 
11202                 perl code is wrapped around <B
11203 CLASS="COMMAND"
11204 >smbclient</B
11205
11206                 and <B
11207 CLASS="COMMAND"
11208 >rpcclient</B
11209 >.</P
11210 ><P
11211 ><PRE
11212 CLASS="PROGRAMLISTING"
11213 >       
11214 foreach (supported architecture for a given driver)
11215 {
11216      1.  rpcclient: Get the appropriate upload directory 
11217          on the remote server
11218      2.  smbclient: Upload the driver files
11219      3.  rpcclient: Issues an AddPrinterDriver() MS-RPC
11220 }
11221         
11222 4.  rpcclient: Issue an AddPrinterEx() MS-RPC to actually
11223     create the printer</PRE
11224 ></P
11225 ><P
11226 >One of the problems encountered when implementing 
11227                 the Imprints tool set was the name space issues between 
11228                 various supported client architectures.  For example, Windows 
11229                 NT includes a driver named "Apple LaserWriter II NTX v51.8" 
11230                 and Windows 95 calls its version of this driver "Apple 
11231                 LaserWriter II NTX"</P
11232 ><P
11233 >The problem is how to know what client drivers have 
11234                 been uploaded for a printer.  As astute reader will remember 
11235                 that the Windows NT Printer Properties dialog only includes 
11236                 space for one printer driver name.  A quick look in the 
11237                 Windows NT 4.0 system registry at</P
11238 ><P
11239 ><TT
11240 CLASS="FILENAME"
11241 >HKLM\System\CurrentControlSet\Control\Print\Environment
11242                 </TT
11243 ></P
11244 ><P
11245 >will reveal that Windows NT always uses the NT driver 
11246                 name.  This is ok as Windows NT always requires that at least 
11247                 the Windows NT version of the printer driver is present.  
11248                 However, Samba does not have the requirement internally.  
11249                 Therefore, how can you use the NT driver name if is has not 
11250                 already been installed?</P
11251 ><P
11252 >The way of sidestepping this limitation is to require 
11253                 that all Imprints printer driver packages include both the Intel 
11254                 Windows NT and 95/98 printer drivers and that NT driver is 
11255                 installed first.</P
11256 ></DIV
11257 ></DIV
11258 ><DIV
11259 CLASS="SECT1"
11260 ><HR><H2
11261 CLASS="SECT1"
11262 ><A
11263 NAME="AEN2081"
11264 ></A
11265 >14.4. Diagnosis</H2
11266 ><DIV
11267 CLASS="SECT2"
11268 ><H3
11269 CLASS="SECT2"
11270 ><A
11271 NAME="AEN2083"
11272 ></A
11273 >14.4.1. Introduction</H3
11274 ><P
11275 >This is a short description of how to debug printing problems with
11276 Samba. This describes how to debug problems with printing from a SMB
11277 client to a Samba server, not the other way around. For the reverse
11278 see the examples/printing directory.</P
11279 ><P
11280 >Ok, so you want to print to a Samba server from your PC. The first
11281 thing you need to understand is that Samba does not actually do any
11282 printing itself, it just acts as a middleman between your PC client
11283 and your Unix printing subsystem. Samba receives the file from the PC
11284 then passes the file to a external "print command". What print command
11285 you use is up to you.</P
11286 ><P
11287 >The whole things is controlled using options in smb.conf. The most
11288 relevant options (which you should look up in the smb.conf man page)
11289 are:</P
11290 ><P
11291 ><PRE
11292 CLASS="PROGRAMLISTING"
11293 >      [global]
11294         print command     - send a file to a spooler
11295         lpq command       - get spool queue status
11296         lprm command      - remove a job
11297       [printers]
11298         path = /var/spool/lpd/samba</PRE
11299 ></P
11300 ><P
11301 >The following are nice to know about:</P
11302 ><P
11303 ><PRE
11304 CLASS="PROGRAMLISTING"
11305 >        queuepause command   - stop a printer or print queue
11306         queueresume command  - start a printer or print queue</PRE
11307 ></P
11308 ><P
11309 >Example:</P
11310 ><P
11311 ><PRE
11312 CLASS="PROGRAMLISTING"
11313 >        print command = /usr/bin/lpr -r -P%p %s
11314         lpq command   = /usr/bin/lpq    -P%p %s
11315         lprm command  = /usr/bin/lprm   -P%p %j
11316         queuepause command = /usr/sbin/lpc -P%p stop
11317         queuepause command = /usr/sbin/lpc -P%p start</PRE
11318 ></P
11319 ><P
11320 >Samba should set reasonable defaults for these depending on your
11321 system type, but it isn't clairvoyant. It is not uncommon that you
11322 have to tweak these for local conditions.  The commands should
11323 always have fully specified pathnames,  as the smdb may not have
11324 the correct PATH values.</P
11325 ><P
11326 >When you send a job to Samba to be printed,  it will make a temporary
11327 copy of it in the directory specified in the [printers] section.
11328 and it should be periodically cleaned out.  The lpr -r option
11329 requests that the temporary copy be removed after printing; If
11330 printing fails then you might find leftover files in this directory,
11331 and it should be periodically cleaned out.  Samba used the lpq
11332 command to determine the "job number" assigned to your print job
11333 by the spooler.</P
11334 ><P
11335 >The %&gt;letter&lt; are "macros" that get dynamically replaced with appropriate
11336 values when they are used. The %s gets replaced with the name of the spool
11337 file that Samba creates and the %p gets replaced with the name of the
11338 printer. The %j gets replaced with the "job number" which comes from
11339 the lpq output.</P
11340 ></DIV
11341 ><DIV
11342 CLASS="SECT2"
11343 ><HR><H3
11344 CLASS="SECT2"
11345 ><A
11346 NAME="AEN2099"
11347 ></A
11348 >14.4.2. Debugging printer problems</H3
11349 ><P
11350 >One way to debug printing problems is to start by replacing these
11351 command with shell scripts that record the arguments and the contents
11352 of the print file. A simple example of this kind of things might
11353 be:</P
11354 ><P
11355 ><PRE
11356 CLASS="PROGRAMLISTING"
11357 >       print command = /tmp/saveprint %p %s
11358
11359     #!/bin/saveprint
11360     # we make sure that we are the right user
11361     /usr/bin/id -p &#62;/tmp/tmp.print
11362     # we run the command and save the error messages
11363     # replace the command with the one appropriate for your system
11364     /usr/bin/lpr -r -P$1 $2 2&#62;&#62;&#38;/tmp/tmp.print</PRE
11365 ></P
11366 ><P
11367 >Then you print a file and try removing it.  You may find that the
11368 print queue needs to be stopped in order to see the queue status
11369 and remove the job:</P
11370 ><P
11371 ><PRE
11372 CLASS="PROGRAMLISTING"
11373 >&#13;h4: {42} % echo hi &#62;/tmp/hi
11374 h4: {43} % smbclient //localhost/lw4
11375 added interface ip=10.0.0.4 bcast=10.0.0.255 nmask=255.255.255.0
11376 Password: 
11377 Domain=[ASTART] OS=[Unix] Server=[Samba 2.0.7]
11378 smb: \&#62; print /tmp/hi
11379 putting file /tmp/hi as hi-17534 (0.0 kb/s) (average 0.0 kb/s)
11380 smb: \&#62; queue
11381 1049     3            hi-17534
11382 smb: \&#62; cancel 1049
11383 Error cancelling job 1049 : code 0
11384 smb: \&#62; cancel 1049
11385 Job 1049 cancelled
11386 smb: \&#62; queue
11387 smb: \&#62; exit</PRE
11388 ></P
11389 ><P
11390 >The 'code 0' indicates that the job was removed.  The comment
11391 by the  smbclient is a bit misleading on this.
11392 You can observe the command output and then and look at the
11393 /tmp/tmp.print file to see what the results are.  You can quickly
11394 find out if the problem is with your printing system.  Often people
11395 have problems with their /etc/printcap file or permissions on
11396 various print queues.</P
11397 ></DIV
11398 ><DIV
11399 CLASS="SECT2"
11400 ><HR><H3
11401 CLASS="SECT2"
11402 ><A
11403 NAME="AEN2108"
11404 ></A
11405 >14.4.3. What printers do I have?</H3
11406 ><P
11407 >You can use the 'testprns' program to check to see if the printer
11408 name you are using is recognized by Samba.  For example,  you can
11409 use:</P
11410 ><P
11411 ><PRE
11412 CLASS="PROGRAMLISTING"
11413 >    testprns printer /etc/printcap</PRE
11414 ></P
11415 ><P
11416 >Samba can get its printcap information from a file or from a program.
11417 You can try the following to see the format of the extracted
11418 information:</P
11419 ><P
11420 ><PRE
11421 CLASS="PROGRAMLISTING"
11422 >    testprns -a printer /etc/printcap
11423
11424     testprns -a printer '|/bin/cat printcap'</PRE
11425 ></P
11426 ></DIV
11427 ><DIV
11428 CLASS="SECT2"
11429 ><HR><H3
11430 CLASS="SECT2"
11431 ><A
11432 NAME="AEN2116"
11433 ></A
11434 >14.4.4. Setting up printcap and print servers</H3
11435 ><P
11436 >You may need to set up some printcaps for your Samba system to use.
11437 It is strongly recommended that you use the facilities provided by
11438 the print spooler to set up queues and printcap information.</P
11439 ><P
11440 >Samba requires either a printcap or program to deliver printcap
11441 information.  This printcap information has the format:</P
11442 ><P
11443 ><PRE
11444 CLASS="PROGRAMLISTING"
11445 >  name|alias1|alias2...:option=value:...</PRE
11446 ></P
11447 ><P
11448 >For almost all printing systems, the printer 'name' must be composed
11449 only of alphanumeric or underscore '_' characters.  Some systems also
11450 allow hyphens ('-') as well.  An alias is an alternative name for the
11451 printer,  and an alias with a space in it is used as a 'comment'
11452 about the printer.  The printcap format optionally uses a \ at the end of lines
11453 to extend the printcap to multiple lines.</P
11454 ><P
11455 >Here are some examples of printcap files:</P
11456 ><P
11457 ><P
11458 ></P
11459 ><OL
11460 TYPE="1"
11461 ><LI
11462 ><P
11463 >pr              just printer name</P
11464 ></LI
11465 ><LI
11466 ><P
11467 >pr|alias        printer name and alias</P
11468 ></LI
11469 ><LI
11470 ><P
11471 >pr|My Printer   printer name, alias used as comment</P
11472 ></LI
11473 ><LI
11474 ><P
11475 >pr:sh:\        Same as pr:sh:cm= testing
11476   :cm= \ 
11477   testing</P
11478 ></LI
11479 ><LI
11480 ><P
11481 >pr:sh           Same as pr:sh:cm= testing
11482   :cm= testing</P
11483 ></LI
11484 ></OL
11485 ></P
11486 ><P
11487 >Samba reads the printcap information when first started.  If you make
11488 changes in the printcap information, then you must do the following:</P
11489 ><P
11490 ></P
11491 ><OL
11492 TYPE="1"
11493 ><LI
11494 ><P
11495 >make sure that the print spooler is aware of these changes.
11496 The LPRng system uses the 'lpc reread' command to do this.</P
11497 ></LI
11498 ><LI
11499 ><P
11500 >make sure that the spool queues, etc., exist and have the
11501 correct permissions.  The LPRng system uses the 'checkpc -f'
11502 command to do this.</P
11503 ></LI
11504 ><LI
11505 ><P
11506 >You now should send a SIGHUP signal to the smbd server to have
11507 it reread the printcap information.</P
11508 ></LI
11509 ></OL
11510 ></DIV
11511 ><DIV
11512 CLASS="SECT2"
11513 ><HR><H3
11514 CLASS="SECT2"
11515 ><A
11516 NAME="AEN2144"
11517 ></A
11518 >14.4.5. Job sent, no output</H3
11519 ><P
11520 >This is the most frustrating part of printing.  You may have sent the
11521 job,  verified that the job was forwarded,  set up a wrapper around
11522 the command to send the file,  but there was no output from the printer.</P
11523 ><P
11524 >First,  check to make sure that the job REALLY is getting to the
11525 right print queue.  If you are using a BSD or LPRng print spooler,
11526 you can temporarily stop the printing of jobs.  Jobs can still be
11527 submitted, but they will not be printed.  Use:</P
11528 ><P
11529 ><PRE
11530 CLASS="PROGRAMLISTING"
11531 >  lpc -Pprinter stop</PRE
11532 ></P
11533 ><P
11534 >Now submit a print job and then use 'lpq -Pprinter' to see if the
11535 job is in the print queue.  If it is not in the print queue then
11536 you will have to find out why it is not being accepted for printing.</P
11537 ><P
11538 >Next, you may want to check to see what the format of the job really
11539 was.  With the assistance of the system administrator you can view
11540 the submitted jobs files.  You may be surprised to find that these
11541 are not in what you would expect to call a printable format.
11542 You can use the UNIX 'file' utitily to determine what the job
11543 format actually is:</P
11544 ><P
11545 ><PRE
11546 CLASS="PROGRAMLISTING"
11547 >    cd /var/spool/lpd/printer   # spool directory of print jobs
11548     ls                          # find job files
11549     file dfA001myhost</PRE
11550 ></P
11551 ><P
11552 >You should make sure that your printer supports this format OR that
11553 your system administrator has installed a 'print filter' that will
11554 convert the file to a format appropriate for your printer.</P
11555 ></DIV
11556 ><DIV
11557 CLASS="SECT2"
11558 ><HR><H3
11559 CLASS="SECT2"
11560 ><A
11561 NAME="AEN2155"
11562 ></A
11563 >14.4.6. Job sent, strange output</H3
11564 ><P
11565 >Once you have the job printing, you can then start worrying about
11566 making it print nicely.</P
11567 ><P
11568 >The most common problem is extra pages of output: banner pages
11569 OR blank pages at the end.</P
11570 ><P
11571 >If you are getting banner pages,  check and make sure that the
11572 printcap option or printer option is configured for no banners.
11573 If you have a printcap,  this is the :sh (suppress header or banner
11574 page) option.  You should have the following in your printer.</P
11575 ><P
11576 ><PRE
11577 CLASS="PROGRAMLISTING"
11578 >   printer: ... :sh</PRE
11579 ></P
11580 ><P
11581 >If you have this option and are still getting banner pages,  there
11582 is a strong chance that your printer is generating them for you
11583 automatically.  You should make sure that banner printing is disabled
11584 for the printer.  This usually requires using the printer setup software
11585 or procedures supplied by the printer manufacturer.</P
11586 ><P
11587 >If you get an extra page of output,  this could be due to problems
11588 with your job format,  or if you are generating PostScript jobs,
11589 incorrect setting on your printer driver on the MicroSoft client.
11590 For example, under Win95 there is a option:</P
11591 ><P
11592 ><PRE
11593 CLASS="PROGRAMLISTING"
11594 >  Printers|Printer Name|(Right Click)Properties|Postscript|Advanced|</PRE
11595 ></P
11596 ><P
11597 >that allows you to choose if a Ctrl-D is appended to all jobs.
11598 This is a very bad thing to do, as most spooling systems will
11599 automatically add a ^D to the end of the job if it is detected as
11600 PostScript.  The multiple ^D may cause an additional page of output.</P
11601 ></DIV
11602 ><DIV
11603 CLASS="SECT2"
11604 ><HR><H3
11605 CLASS="SECT2"
11606 ><A
11607 NAME="AEN2167"
11608 ></A
11609 >14.4.7. Raw PostScript printed</H3
11610 ><P
11611 >This is a problem that is usually caused by either the print spooling
11612 system putting information at the start of the print job that makes
11613 the printer think the job is a text file, or your printer simply
11614 does not support PostScript.  You may need to enable 'Automatic
11615 Format Detection' on your printer.</P
11616 ></DIV
11617 ><DIV
11618 CLASS="SECT2"
11619 ><HR><H3
11620 CLASS="SECT2"
11621 ><A
11622 NAME="AEN2170"
11623 ></A
11624 >14.4.8. Advanced Printing</H3
11625 ><P
11626 >Note that you can do some pretty magic things by using your
11627 imagination with the "print command" option and some shell scripts.
11628 Doing print accounting is easy by passing the %U option to a print
11629 command shell script. You could even make the print command detect
11630 the type of output and its size and send it to an appropriate
11631 printer.</P
11632 ></DIV
11633 ><DIV
11634 CLASS="SECT2"
11635 ><HR><H3
11636 CLASS="SECT2"
11637 ><A
11638 NAME="AEN2173"
11639 ></A
11640 >14.4.9. Real debugging</H3
11641 ><P
11642 >If the above debug tips don't help, then maybe you need to bring in
11643 the bug guns, system tracing. See Tracing.txt in this directory.</P
11644 ></DIV
11645 ></DIV
11646 ></DIV
11647 ><DIV
11648 CLASS="CHAPTER"
11649 ><HR><H1
11650 ><A
11651 NAME="SECURITYLEVELS"
11652 ></A
11653 >Chapter 15. Security levels</H1
11654 ><DIV
11655 CLASS="SECT1"
11656 ><H2
11657 CLASS="SECT1"
11658 ><A
11659 NAME="AEN2186"
11660 ></A
11661 >15.1. Introduction</H2
11662 ><P
11663 >Samba supports the following options to the global smb.conf parameter</P
11664 ><P
11665 ><PRE
11666 CLASS="PROGRAMLISTING"
11667 >[global]
11668 <A
11669 HREF="smb.conf.5.html#SECURITY"
11670 TARGET="_top"
11671 ><TT
11672 CLASS="PARAMETER"
11673 ><I
11674 >security</I
11675 ></TT
11676 ></A
11677 > = [share|user(default)|server|domain|ads]</PRE
11678 ></P
11679 ><P
11680 >Please refer to the smb.conf man page for usage information and to the document
11681 <A
11682 HREF="DOMAIN_MEMBER.html"
11683 TARGET="_top"
11684 >DOMAIN_MEMBER.html</A
11685 > for further background details
11686 on domain mode security.  The Windows 2000 Kerberos domain security model
11687 (security = ads) is described in the <A
11688 HREF="ADS-HOWTO.html"
11689 TARGET="_top"
11690 >ADS-HOWTO.html</A
11691 >.</P
11692 ><P
11693 >Of the above, "security = server" means that Samba reports to clients that
11694 it is running in "user mode" but actually passes off all authentication
11695 requests to another "user mode" server. This requires an additional
11696 parameter "password server =" that points to the real authentication server.
11697 That real authentication server can be another Samba server or can be a
11698 Windows NT server, the later natively capable of encrypted password support.</P
11699 ></DIV
11700 ><DIV
11701 CLASS="SECT1"
11702 ><HR><H2
11703 CLASS="SECT1"
11704 ><A
11705 NAME="AEN2197"
11706 ></A
11707 >15.2. More complete description of security levels</H2
11708 ><P
11709 >A SMB server tells the client at startup what "security level" it is
11710 running. There are two options "share level" and "user level". Which
11711 of these two the client receives affects the way the client then tries
11712 to authenticate itself. It does not directly affect (to any great
11713 extent) the way the Samba server does security. I know this is
11714 strange, but it fits in with the client/server approach of SMB. In SMB
11715 everything is initiated and controlled by the client, and the server
11716 can only tell the client what is available and whether an action is
11717 allowed. </P
11718 ><P
11719 >I'll describe user level security first, as its simpler. In user level
11720 security the client will send a "session setup" command directly after
11721 the protocol negotiation. This contains a username and password. The
11722 server can either accept or reject that username/password
11723 combination. Note that at this stage the server has no idea what
11724 share the client will eventually try to connect to, so it can't base
11725 the "accept/reject" on anything other than:</P
11726 ><P
11727 ></P
11728 ><OL
11729 TYPE="1"
11730 ><LI
11731 ><P
11732 >the username/password</P
11733 ></LI
11734 ><LI
11735 ><P
11736 >the machine that the client is coming from</P
11737 ></LI
11738 ></OL
11739 ><P
11740 >If the server accepts the username/password then the client expects to
11741 be able to mount any share (using a "tree connection") without
11742 specifying a password. It expects that all access rights will be as
11743 the username/password specified in the "session setup". </P
11744 ><P
11745 >It is also possible for a client to send multiple "session setup"
11746 requests. When the server responds it gives the client a "uid" to use
11747 as an authentication tag for that username/password. The client can
11748 maintain multiple authentication contexts in this way (WinDD is an
11749 example of an application that does this)</P
11750 ><P
11751 >Ok, now for share level security. In share level security the client
11752 authenticates itself separately for each share. It will send a
11753 password along with each "tree connection" (share mount). It does not
11754 explicitly send a username with this operation. The client is
11755 expecting a password to be associated with each share, independent of
11756 the user. This means that samba has to work out what username the
11757 client probably wants to use. It is never explicitly sent the
11758 username. Some commercial SMB servers such as NT actually associate
11759 passwords directly with shares in share level security, but samba
11760 always uses the unix authentication scheme where it is a
11761 username/password that is authenticated, not a "share/password".</P
11762 ><P
11763 >Many clients send a "session setup" even if the server is in share
11764 level security. They normally send a valid username but no
11765 password. Samba records this username in a list of "possible
11766 usernames". When the client then does a "tree connection" it also adds
11767 to this list the name of the share they try to connect to (useful for
11768 home directories) and any users listed in the "user =" smb.conf
11769 line. The password is then checked in turn against these "possible
11770 usernames". If a match is found then the client is authenticated as
11771 that user.</P
11772 ><P
11773 >Finally "server level" security. In server level security the samba
11774 server reports to the client that it is in user level security. The
11775 client then does a "session setup" as described earlier. The samba
11776 server takes the username/password that the client sends and attempts
11777 to login to the "password server" by sending exactly the same
11778 username/password that it got from the client. If that server is in
11779 user level security and accepts the password then samba accepts the
11780 clients connection. This allows the samba server to use another SMB
11781 server as the "password server". </P
11782 ><P
11783 >You should also note that at the very start of all this, where the
11784 server tells the client what security level it is in, it also tells
11785 the client if it supports encryption. If it does then it supplies the
11786 client with a random "cryptkey". The client will then send all
11787 passwords in encrypted form. You have to compile samba with encryption
11788 enabled to support this feature, and you have to maintain a separate
11789 smbpasswd file with SMB style encrypted passwords. It is
11790 cryptographically impossible to translate from unix style encryption
11791 to SMB style encryption, although there are some fairly simple management
11792 schemes by which the two could be kept in sync.</P
11793 ></DIV
11794 ></DIV
11795 ><DIV
11796 CLASS="CHAPTER"
11797 ><HR><H1
11798 ><A
11799 NAME="WINBIND"
11800 ></A
11801 >Chapter 16. Unified Logons between Windows NT and UNIX using Winbind</H1
11802 ><DIV
11803 CLASS="SECT1"
11804 ><H2
11805 CLASS="SECT1"
11806 ><A
11807 NAME="AEN2249"
11808 ></A
11809 >16.1. Abstract</H2
11810 ><P
11811 >Integration of UNIX and Microsoft Windows NT through 
11812         a unified logon has been considered a "holy grail" in heterogeneous 
11813         computing environments for a long time. We present 
11814         <SPAN
11815 CLASS="emphasis"
11816 ><I
11817 CLASS="EMPHASIS"
11818 >winbind</I
11819 ></SPAN
11820 >, a component of the Samba suite 
11821         of programs as a solution to the unified logon problem. Winbind 
11822         uses a UNIX implementation 
11823         of Microsoft RPC calls, Pluggable Authentication Modules, and the Name 
11824         Service Switch to allow Windows NT domain users to appear and operate 
11825         as UNIX users on a UNIX machine. This paper describes the winbind 
11826         system, explaining the functionality it provides, how it is configured, 
11827         and how it works internally.</P
11828 ></DIV
11829 ><DIV
11830 CLASS="SECT1"
11831 ><HR><H2
11832 CLASS="SECT1"
11833 ><A
11834 NAME="AEN2253"
11835 ></A
11836 >16.2. Introduction</H2
11837 ><P
11838 >It is well known that UNIX and Microsoft Windows NT have 
11839         different models for representing user and group information and 
11840         use different technologies for implementing them. This fact has 
11841         made it difficult to integrate the two systems in a satisfactory 
11842         manner.</P
11843 ><P
11844 >One common solution in use today has been to create 
11845         identically named user accounts on both the UNIX and Windows systems 
11846         and use the Samba suite of programs to provide file and print services 
11847         between the two. This solution is far from perfect however, as 
11848         adding and deleting users on both sets of machines becomes a chore 
11849         and two sets of passwords are required both of which
11850         can lead to synchronization problems between the UNIX and Windows 
11851         systems and confusion for users.</P
11852 ><P
11853 >We divide the unified logon problem for UNIX machines into 
11854         three smaller problems:</P
11855 ><P
11856 ></P
11857 ><UL
11858 ><LI
11859 ><P
11860 >Obtaining Windows NT user and group information
11861                 </P
11862 ></LI
11863 ><LI
11864 ><P
11865 >Authenticating Windows NT users
11866                 </P
11867 ></LI
11868 ><LI
11869 ><P
11870 >Password changing for Windows NT users
11871                 </P
11872 ></LI
11873 ></UL
11874 ><P
11875 >Ideally, a prospective solution to the unified logon problem 
11876         would satisfy all the above components without duplication of 
11877         information on the UNIX machines and without creating additional 
11878         tasks for the system administrator when maintaining users and 
11879         groups on either system. The winbind system provides a simple 
11880         and elegant solution to all three components of the unified logon 
11881         problem.</P
11882 ></DIV
11883 ><DIV
11884 CLASS="SECT1"
11885 ><HR><H2
11886 CLASS="SECT1"
11887 ><A
11888 NAME="AEN2266"
11889 ></A
11890 >16.3. What Winbind Provides</H2
11891 ><P
11892 >Winbind unifies UNIX and Windows NT account management by 
11893         allowing a UNIX box to become a full member of a NT domain. Once 
11894         this is done the UNIX box will see NT users and groups as if 
11895         they were native UNIX users and groups, allowing the NT domain 
11896         to be used in much the same manner that NIS+ is used within 
11897         UNIX-only environments.</P
11898 ><P
11899 >The end result is that whenever any 
11900         program on the UNIX machine asks the operating system to lookup 
11901         a user or group name, the query will be resolved by asking the 
11902         NT domain controller for the specified domain to do the lookup.
11903         Because Winbind hooks into the operating system at a low level 
11904         (via the NSS name resolution modules in the C library) this 
11905         redirection to the NT domain controller is completely 
11906         transparent.</P
11907 ><P
11908 >Users on the UNIX machine can then use NT user and group 
11909         names as they would use "native" UNIX names. They can chown files 
11910         so that they are owned by NT domain users or even login to the 
11911         UNIX machine and run a UNIX X-Window session as a domain user.</P
11912 ><P
11913 >The only obvious indication that Winbind is being used is 
11914         that user and group names take the form DOMAIN\user and 
11915         DOMAIN\group. This is necessary as it allows Winbind to determine 
11916         that redirection to a domain controller is wanted for a particular 
11917         lookup and which trusted domain is being referenced.</P
11918 ><P
11919 >Additionally, Winbind provides an authentication service 
11920         that hooks into the Pluggable Authentication Modules (PAM) system 
11921         to provide authentication via a NT domain to any PAM enabled 
11922         applications. This capability solves the problem of synchronizing 
11923         passwords between systems since all passwords are stored in a single 
11924         location (on the domain controller).</P
11925 ><DIV
11926 CLASS="SECT2"
11927 ><HR><H3
11928 CLASS="SECT2"
11929 ><A
11930 NAME="AEN2273"
11931 ></A
11932 >16.3.1. Target Uses</H3
11933 ><P
11934 >Winbind is targeted at organizations that have an 
11935                 existing NT based domain infrastructure into which they wish 
11936                 to put UNIX workstations or servers. Winbind will allow these 
11937                 organizations to deploy UNIX workstations without having to 
11938                 maintain a separate account infrastructure. This greatly 
11939                 simplifies the administrative overhead of deploying UNIX 
11940                 workstations into a NT based organization.</P
11941 ><P
11942 >Another interesting way in which we expect Winbind to 
11943                 be used is as a central part of UNIX based appliances. Appliances 
11944                 that provide file and print services to Microsoft based networks 
11945                 will be able to use Winbind to provide seamless integration of 
11946                 the appliance into the domain.</P
11947 ></DIV
11948 ></DIV
11949 ><DIV
11950 CLASS="SECT1"
11951 ><HR><H2
11952 CLASS="SECT1"
11953 ><A
11954 NAME="AEN2277"
11955 ></A
11956 >16.4. How Winbind Works</H2
11957 ><P
11958 >The winbind system is designed around a client/server 
11959         architecture. A long running <B
11960 CLASS="COMMAND"
11961 >winbindd</B
11962 > daemon 
11963         listens on a UNIX domain socket waiting for requests
11964         to arrive. These requests are generated by the NSS and PAM 
11965         clients and processed sequentially.</P
11966 ><P
11967 >The technologies used to implement winbind are described 
11968         in detail below.</P
11969 ><DIV
11970 CLASS="SECT2"
11971 ><HR><H3
11972 CLASS="SECT2"
11973 ><A
11974 NAME="AEN2282"
11975 ></A
11976 >16.4.1. Microsoft Remote Procedure Calls</H3
11977 ><P
11978 >Over the last two years, efforts have been underway 
11979                 by various Samba Team members to decode various aspects of 
11980                 the Microsoft Remote Procedure Call (MSRPC) system. This 
11981                 system is used for most network related operations between 
11982                 Windows NT machines including remote management, user authentication
11983                 and print spooling. Although initially this work was done 
11984                 to aid the implementation of Primary Domain Controller (PDC) 
11985                 functionality in Samba, it has also yielded a body of code which 
11986                 can be used for other purposes.</P
11987 ><P
11988 >Winbind uses various MSRPC calls to enumerate domain users 
11989                 and groups and to obtain detailed information about individual 
11990                 users or groups. Other MSRPC calls can be used to authenticate 
11991                 NT domain users and to change user passwords. By directly querying 
11992                 a Windows PDC for user and group information, winbind maps the 
11993                 NT account information onto UNIX user and group names.</P
11994 ></DIV
11995 ><DIV
11996 CLASS="SECT2"
11997 ><HR><H3
11998 CLASS="SECT2"
11999 ><A
12000 NAME="AEN2286"
12001 ></A
12002 >16.4.2. Name Service Switch</H3
12003 ><P
12004 >The Name Service Switch, or NSS, is a feature that is 
12005                 present in many UNIX operating systems. It allows system 
12006                 information such as hostnames, mail aliases and user information 
12007                 to be resolved from different sources. For example, a standalone 
12008                 UNIX workstation may resolve system information from a series of 
12009                 flat files stored on the local filesystem. A networked workstation 
12010                 may first attempt to resolve system information from local files, 
12011                 and then consult a NIS database for user information or a DNS server 
12012                 for hostname information.</P
12013 ><P
12014 >The NSS application programming interface allows winbind 
12015                 to present itself as a source of system information when 
12016                 resolving UNIX usernames and groups.  Winbind uses this interface, 
12017                 and information obtained from a Windows NT server using MSRPC 
12018                 calls to provide a new source of account enumeration.  Using standard 
12019                 UNIX library calls, one can enumerate the users and groups on
12020                 a UNIX machine running winbind and see all users and groups in 
12021                 a NT domain plus any trusted domain as though they were local 
12022                 users and groups.</P
12023 ><P
12024 >The primary control file for NSS is 
12025                 <TT
12026 CLASS="FILENAME"
12027 >/etc/nsswitch.conf</TT
12028 >. 
12029                 When a UNIX application makes a request to do a lookup 
12030                 the C library looks in <TT
12031 CLASS="FILENAME"
12032 >/etc/nsswitch.conf</TT
12033
12034                 for a line which matches the service type being requested, for 
12035                 example the "passwd" service type is used when user or group names 
12036                 are looked up. This     config line species which implementations 
12037                 of that service should be tried and in what order. If the passwd 
12038                 config line is:</P
12039 ><P
12040 ><B
12041 CLASS="COMMAND"
12042 >passwd: files example</B
12043 ></P
12044 ><P
12045 >then the C library will first load a module called 
12046                 <TT
12047 CLASS="FILENAME"
12048 >/lib/libnss_files.so</TT
12049 > followed by
12050                 the module <TT
12051 CLASS="FILENAME"
12052 >/lib/libnss_example.so</TT
12053 >. The 
12054                 C library will dynamically load each of these modules in turn 
12055                 and call resolver functions within the modules to try to resolve 
12056                 the request. Once the request is resolved the C library returns the
12057                 result to the application.</P
12058 ><P
12059 >This NSS interface provides a very easy way for Winbind 
12060                 to hook into the operating system. All that needs to be done 
12061                 is to put <TT
12062 CLASS="FILENAME"
12063 >libnss_winbind.so</TT
12064 > in <TT
12065 CLASS="FILENAME"
12066 >/lib/</TT
12067
12068                 then add "winbind" into <TT
12069 CLASS="FILENAME"
12070 >/etc/nsswitch.conf</TT
12071 > at 
12072                 the appropriate place. The C library will then call Winbind to 
12073                 resolve user and group names.</P
12074 ></DIV
12075 ><DIV
12076 CLASS="SECT2"
12077 ><HR><H3
12078 CLASS="SECT2"
12079 ><A
12080 NAME="AEN2302"
12081 ></A
12082 >16.4.3. Pluggable Authentication Modules</H3
12083 ><P
12084 >Pluggable Authentication Modules, also known as PAM, 
12085                 is a system for abstracting authentication and authorization 
12086                 technologies. With a PAM module it is possible to specify different 
12087                 authentication methods for different system applications without 
12088                 having to recompile these applications. PAM is also useful
12089                 for implementing a particular policy for authorization. For example, 
12090                 a system administrator may only allow console logins from users 
12091                 stored in the local password file but only allow users resolved from 
12092                 a NIS database to log in over the network.</P
12093 ><P
12094 >Winbind uses the authentication management and password 
12095                 management PAM interface to integrate Windows NT users into a 
12096                 UNIX system. This allows Windows NT users to log in to a UNIX 
12097                 machine and be authenticated against a suitable Primary Domain 
12098                 Controller. These users can also change their passwords and have 
12099                 this change take effect directly on the Primary Domain Controller.
12100                 </P
12101 ><P
12102 >PAM is configured by providing control files in the directory 
12103                 <TT
12104 CLASS="FILENAME"
12105 >/etc/pam.d/</TT
12106 > for each of the services that 
12107                 require authentication. When an authentication request is made 
12108                 by an application the PAM code in the C library looks up this
12109                 control file to determine what modules to load to do the 
12110                 authentication check and in what order. This interface makes adding 
12111                 a new authentication service for Winbind very easy, all that needs 
12112                 to be done is that the <TT
12113 CLASS="FILENAME"
12114 >pam_winbind.so</TT
12115 > module 
12116                 is copied to <TT
12117 CLASS="FILENAME"
12118 >/lib/security/</TT
12119 > and the PAM 
12120                 control files for relevant services are updated to allow 
12121                 authentication via winbind. See the PAM documentation
12122                 for more details.</P
12123 ></DIV
12124 ><DIV
12125 CLASS="SECT2"
12126 ><HR><H3
12127 CLASS="SECT2"
12128 ><A
12129 NAME="AEN2310"
12130 ></A
12131 >16.4.4. User and Group ID Allocation</H3
12132 ><P
12133 >When a user or group is created under Windows NT 
12134                 is it allocated a numerical relative identifier (RID). This is 
12135                 slightly different to UNIX which has a range of numbers that are 
12136                 used to identify users, and the same range in which to identify 
12137                 groups. It is winbind's job to convert RIDs to UNIX id numbers and
12138                 vice versa.  When winbind is configured it is given part of the UNIX 
12139                 user id space and a part of the UNIX group id space in which to 
12140                 store Windows NT users and groups. If a Windows NT user is 
12141                 resolved for the first time, it is allocated the next UNIX id from 
12142                 the range. The same process applies for Windows NT groups. Over 
12143                 time, winbind will have mapped all Windows NT users and groups
12144                 to UNIX user ids and group ids.</P
12145 ><P
12146 >The results of this mapping are stored persistently in 
12147                 an ID mapping database held in a tdb database). This ensures that 
12148                 RIDs are mapped to UNIX IDs in a consistent way.</P
12149 ></DIV
12150 ><DIV
12151 CLASS="SECT2"
12152 ><HR><H3
12153 CLASS="SECT2"
12154 ><A
12155 NAME="AEN2314"
12156 ></A
12157 >16.4.5. Result Caching</H3
12158 ><P
12159 >An active system can generate a lot of user and group 
12160                 name lookups. To reduce the network cost of these lookups winbind 
12161                 uses a caching scheme based on the SAM sequence number supplied 
12162                 by NT domain controllers.  User or group information returned 
12163                 by a PDC is cached by winbind along with a sequence number also 
12164                 returned by the PDC. This sequence number is incremented by 
12165                 Windows NT whenever any user or group information is modified. If 
12166                 a cached entry has expired, the sequence number is requested from 
12167                 the PDC and compared against the sequence number of the cached entry. 
12168                 If the sequence numbers do not match, then the cached information 
12169                 is discarded and up to date information is requested directly 
12170                 from the PDC.</P
12171 ></DIV
12172 ></DIV
12173 ><DIV
12174 CLASS="SECT1"
12175 ><HR><H2
12176 CLASS="SECT1"
12177 ><A
12178 NAME="AEN2317"
12179 ></A
12180 >16.5. Installation and Configuration</H2
12181 ><P
12182 >Many thanks to John Trostel <A
12183 HREF="mailto:jtrostel@snapserver.com"
12184 TARGET="_top"
12185 >jtrostel@snapserver.com</A
12186 >
12187 for providing the HOWTO for this section.</P
12188 ><P
12189 >This HOWTO describes how to get winbind services up and running 
12190 to control access and authenticate users on your Linux box using 
12191 the winbind services which come with SAMBA 2.2.2.</P
12192 ><P
12193 >There is also some Solaris specific information in 
12194 <TT
12195 CLASS="FILENAME"
12196 >docs/textdocs/Solaris-Winbind-HOWTO.txt</TT
12197 >.
12198 Future revisions of this document will incorporate that
12199 information.</P
12200 ><DIV
12201 CLASS="SECT2"
12202 ><HR><H3
12203 CLASS="SECT2"
12204 ><A
12205 NAME="AEN2324"
12206 ></A
12207 >16.5.1. Introduction</H3
12208 ><P
12209 >This HOWTO describes the procedures used to get winbind up and 
12210 running on my RedHat 7.1 system.  Winbind is capable of providing access 
12211 and authentication control for Windows Domain users through an NT 
12212 or Win2K PDC for 'regular' services, such as telnet a nd ftp, as
12213 well for SAMBA services.</P
12214 ><P
12215 >This HOWTO has been written from a 'RedHat-centric' perspective, so if 
12216 you are using another distribution, you may have to modify the instructions 
12217 somewhat to fit the way your distribution works.</P
12218 ><P
12219 ></P
12220 ><UL
12221 ><LI
12222 ><P
12223 >       <SPAN
12224 CLASS="emphasis"
12225 ><I
12226 CLASS="EMPHASIS"
12227 >Why should I to this?</I
12228 ></SPAN
12229 >
12230         </P
12231 ><P
12232 >This allows the SAMBA administrator to rely on the 
12233         authentication mechanisms on the NT/Win2K PDC for the authentication 
12234         of domain members.  NT/Win2K users no longer need to have separate 
12235         accounts on the SAMBA server.
12236         </P
12237 ></LI
12238 ><LI
12239 ><P
12240 >       <SPAN
12241 CLASS="emphasis"
12242 ><I
12243 CLASS="EMPHASIS"
12244 >Who should be reading this document?</I
12245 ></SPAN
12246 >
12247         </P
12248 ><P
12249 >       This HOWTO is designed for system administrators.  If you are 
12250         implementing SAMBA on a file server and wish to (fairly easily) 
12251         integrate existing NT/Win2K users from your PDC onto the
12252         SAMBA server, this HOWTO is for you.  That said, I am no NT or PAM 
12253         expert, so you may find a better or easier way to accomplish 
12254         these tasks.
12255         </P
12256 ></LI
12257 ></UL
12258 ></DIV
12259 ><DIV
12260 CLASS="SECT2"
12261 ><HR><H3
12262 CLASS="SECT2"
12263 ><A
12264 NAME="AEN2337"
12265 ></A
12266 >16.5.2. Requirements</H3
12267 ><P
12268 >If you have a samba configuration file that you are currently 
12269 using... <SPAN
12270 CLASS="emphasis"
12271 ><I
12272 CLASS="EMPHASIS"
12273 >BACK IT UP!</I
12274 ></SPAN
12275 >  If your system already uses PAM, 
12276 <SPAN
12277 CLASS="emphasis"
12278 ><I
12279 CLASS="EMPHASIS"
12280 >back up the <TT
12281 CLASS="FILENAME"
12282 >/etc/pam.d</TT
12283 > directory 
12284 contents!</I
12285 ></SPAN
12286 > If you haven't already made a boot disk, 
12287 <SPAN
12288 CLASS="emphasis"
12289 ><I
12290 CLASS="EMPHASIS"
12291 >MAKE ONE NOW!</I
12292 ></SPAN
12293 ></P
12294 ><P
12295 >Messing with the pam configuration files can make it nearly impossible 
12296 to log in to yourmachine. That's why you want to be able to boot back 
12297 into your machine in single user mode and restore your 
12298 <TT
12299 CLASS="FILENAME"
12300 >/etc/pam.d</TT
12301 > back to the original state they were in if 
12302 you get frustrated with the way things are going.  ;-)</P
12303 ><P
12304 >The latest version of SAMBA (version 3.0 as of this writing), now 
12305 includes a functioning winbindd daemon.  Please refer to the 
12306 <A
12307 HREF="http://samba.org/"
12308 TARGET="_top"
12309 >main SAMBA web page</A
12310 > or, 
12311 better yet, your closest SAMBA mirror site for instructions on 
12312 downloading the source code.</P
12313 ><P
12314 >To allow Domain users the ability to access SAMBA shares and 
12315 files, as well as potentially other services provided by your 
12316 SAMBA machine, PAM (pluggable authentication modules) must
12317 be setup properly on your machine.  In order to compile the 
12318 winbind modules, you should have at least the pam libraries resident 
12319 on your system.  For recent RedHat systems (7.1, for instance), that 
12320 means <TT
12321 CLASS="FILENAME"
12322 >pam-0.74-22</TT
12323 >.  For best results, it is helpful to also
12324 install the development packages in <TT
12325 CLASS="FILENAME"
12326 >pam-devel-0.74-22</TT
12327 >.</P
12328 ></DIV
12329 ><DIV
12330 CLASS="SECT2"
12331 ><HR><H3
12332 CLASS="SECT2"
12333 ><A
12334 NAME="AEN2351"
12335 ></A
12336 >16.5.3. Testing Things Out</H3
12337 ><P
12338 >Before starting, it is probably best to kill off all the SAMBA 
12339 related daemons running on your server.  Kill off all <B
12340 CLASS="COMMAND"
12341 >smbd</B
12342 >, 
12343 <B
12344 CLASS="COMMAND"
12345 >nmbd</B
12346 >, and <B
12347 CLASS="COMMAND"
12348 >winbindd</B
12349 > processes that may 
12350 be running.  To use PAM, you will want to make sure that you have the 
12351 standard PAM package (for RedHat) which supplies the <TT
12352 CLASS="FILENAME"
12353 >/etc/pam.d</TT
12354
12355 directory structure, including the pam modules are used by pam-aware 
12356 services, several pam libraries, and the <TT
12357 CLASS="FILENAME"
12358 >/usr/doc</TT
12359
12360 and <TT
12361 CLASS="FILENAME"
12362 >/usr/man</TT
12363 > entries for pam.  Winbind built better 
12364 in SAMBA if the pam-devel package was also installed.  This package includes 
12365 the header files needed to compile pam-aware applications. For instance, 
12366 my RedHat system has both <TT
12367 CLASS="FILENAME"
12368 >pam-0.74-22</TT
12369 > and
12370 <TT
12371 CLASS="FILENAME"
12372 >pam-devel-0.74-22</TT
12373 > RPMs installed.</P
12374 ><DIV
12375 CLASS="SECT3"
12376 ><HR><H4
12377 CLASS="SECT3"
12378 ><A
12379 NAME="AEN2362"
12380 ></A
12381 >16.5.3.1. Configure and compile SAMBA</H4
12382 ><P
12383 >The configuration and compilation of SAMBA is pretty straightforward.
12384 The first three steps may not be necessary depending upon
12385 whether or not you have previously built the Samba binaries.</P
12386 ><P
12387 ><PRE
12388 CLASS="PROGRAMLISTING"
12389 ><TT
12390 CLASS="PROMPT"
12391 >root#</TT
12392 > <B
12393 CLASS="COMMAND"
12394 >autoconf</B
12395 >
12396 <TT
12397 CLASS="PROMPT"
12398 >root#</TT
12399 > <B
12400 CLASS="COMMAND"
12401 >make clean</B
12402 >
12403 <TT
12404 CLASS="PROMPT"
12405 >root#</TT
12406 > <B
12407 CLASS="COMMAND"
12408 >rm config.cache</B
12409 >
12410 <TT
12411 CLASS="PROMPT"
12412 >root#</TT
12413 > <B
12414 CLASS="COMMAND"
12415 >./configure --with-winbind</B
12416 >
12417 <TT
12418 CLASS="PROMPT"
12419 >root#</TT
12420 > <B
12421 CLASS="COMMAND"
12422 >make</B
12423 >
12424 <TT
12425 CLASS="PROMPT"
12426 >root#</TT
12427 > <B
12428 CLASS="COMMAND"
12429 >make install</B
12430 ></PRE
12431 ></P
12432 ><P
12433 >This will, by default, install SAMBA in <TT
12434 CLASS="FILENAME"
12435 >/usr/local/samba</TT
12436 >.
12437 See the main SAMBA documentation if you want to install SAMBA somewhere else.
12438 It will also build the winbindd executable and libraries. </P
12439 ></DIV
12440 ><DIV
12441 CLASS="SECT3"
12442 ><HR><H4
12443 CLASS="SECT3"
12444 ><A
12445 NAME="AEN2381"
12446 ></A
12447 >16.5.3.2. Configure <TT
12448 CLASS="FILENAME"
12449 >nsswitch.conf</TT
12450 > and the 
12451 winbind libraries</H4
12452 ><P
12453 >The libraries needed to run the <B
12454 CLASS="COMMAND"
12455 >winbindd</B
12456 > daemon 
12457 through nsswitch need to be copied to their proper locations, so</P
12458 ><P
12459 ><TT
12460 CLASS="PROMPT"
12461 >root#</TT
12462 > <B
12463 CLASS="COMMAND"
12464 >cp ../samba/source/nsswitch/libnss_winbind.so /lib</B
12465 ></P
12466 ><P
12467 >I also found it necessary to make the following symbolic link:</P
12468 ><P
12469 ><TT
12470 CLASS="PROMPT"
12471 >root#</TT
12472 > <B
12473 CLASS="COMMAND"
12474 >ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2</B
12475 ></P
12476 ><P
12477 >And, in the case of Sun solaris:</P
12478 ><P
12479 ><TT
12480 CLASS="PROMPT"
12481 >root#</TT
12482 > <B
12483 CLASS="COMMAND"
12484 >ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1</B
12485 >
12486 <TT
12487 CLASS="PROMPT"
12488 >root#</TT
12489 > <B
12490 CLASS="COMMAND"
12491 >ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.1</B
12492 >
12493 <TT
12494 CLASS="PROMPT"
12495 >root#</TT
12496 > <B
12497 CLASS="COMMAND"
12498 >ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.2</B
12499 ></P
12500 ><P
12501 >Now, as root you need to edit <TT
12502 CLASS="FILENAME"
12503 >/etc/nsswitch.conf</TT
12504 > to 
12505 allow user and group entries to be visible from the <B
12506 CLASS="COMMAND"
12507 >winbindd</B
12508
12509 daemon.  My <TT
12510 CLASS="FILENAME"
12511 >/etc/nsswitch.conf</TT
12512 > file look like 
12513 this after editing:</P
12514 ><P
12515 ><PRE
12516 CLASS="PROGRAMLISTING"
12517 >       passwd:     files winbind
12518         shadow:     files 
12519         group:      files winbind</PRE
12520 ></P
12521 ><P
12522 >       
12523 The libraries needed by the winbind daemon will be automatically 
12524 entered into the <B
12525 CLASS="COMMAND"
12526 >ldconfig</B
12527 > cache the next time 
12528 your system reboots, but it 
12529 is faster (and you don't need to reboot) if you do it manually:</P
12530 ><P
12531 ><TT
12532 CLASS="PROMPT"
12533 >root#</TT
12534 > <B
12535 CLASS="COMMAND"
12536 >/sbin/ldconfig -v | grep winbind</B
12537 ></P
12538 ><P
12539 >This makes <TT
12540 CLASS="FILENAME"
12541 >libnss_winbind</TT
12542 > available to winbindd 
12543 and echos back a check to you.</P
12544 ></DIV
12545 ><DIV
12546 CLASS="SECT3"
12547 ><HR><H4
12548 CLASS="SECT3"
12549 ><A
12550 NAME="AEN2414"
12551 ></A
12552 >16.5.3.3. Configure smb.conf</H4
12553 ><P
12554 >Several parameters are needed in the smb.conf file to control 
12555 the behavior of <B
12556 CLASS="COMMAND"
12557 >winbindd</B
12558 >. Configure 
12559 <TT
12560 CLASS="FILENAME"
12561 >smb.conf</TT
12562 > These are described in more detail in 
12563 the <A
12564 HREF="winbindd.8.html"
12565 TARGET="_top"
12566 >winbindd(8)</A
12567 > man page.  My 
12568 <TT
12569 CLASS="FILENAME"
12570 >smb.conf</TT
12571 > file was modified to
12572 include the following entries in the [global] section:</P
12573 ><P
12574 ><PRE
12575 CLASS="PROGRAMLISTING"
12576 >[global]
12577      &#60;...&#62;
12578      # separate domain and username with '+', like DOMAIN+username
12579      <A
12580 HREF="winbindd.8.html#WINBINDSEPARATOR"
12581 TARGET="_top"
12582 >winbind separator</A
12583 > = +
12584      # use uids from 10000 to 20000 for domain users
12585      <A
12586 HREF="winbindd.8.html#WINBINDUID"
12587 TARGET="_top"
12588 >winbind uid</A
12589 > = 10000-20000
12590      # use gids from 10000 to 20000 for domain groups
12591      <A
12592 HREF="winbindd.8.html#WINBINDGID"
12593 TARGET="_top"
12594 >winbind gid</A
12595 > = 10000-20000
12596      # allow enumeration of winbind users and groups
12597      <A
12598 HREF="winbindd.8.html#WINBINDENUMUSERS"
12599 TARGET="_top"
12600 >winbind enum users</A
12601 > = yes
12602      <A
12603 HREF="winbindd.8.html#WINBINDENUMGROUP"
12604 TARGET="_top"
12605 >winbind enum groups</A
12606 > = yes
12607      # give winbind users a real shell (only needed if they have telnet access)
12608      <A
12609 HREF="winbindd.8.html#TEMPLATEHOMEDIR"
12610 TARGET="_top"
12611 >template homedir</A
12612 > = /home/winnt/%D/%U
12613      <A
12614 HREF="winbindd.8.html#TEMPLATESHELL"
12615 TARGET="_top"
12616 >template shell</A
12617 > = /bin/bash</PRE
12618 ></P
12619 ></DIV
12620 ><DIV
12621 CLASS="SECT3"
12622 ><HR><H4
12623 CLASS="SECT3"
12624 ><A
12625 NAME="AEN2430"
12626 ></A
12627 >16.5.3.4. Join the SAMBA server to the PDC domain</H4
12628 ><P
12629 >Enter the following command to make the SAMBA server join the 
12630 PDC domain, where <TT
12631 CLASS="REPLACEABLE"
12632 ><I
12633 >DOMAIN</I
12634 ></TT
12635 > is the name of 
12636 your Windows domain and <TT
12637 CLASS="REPLACEABLE"
12638 ><I
12639 >Administrator</I
12640 ></TT
12641 > is 
12642 a domain user who has administrative privileges in the domain.</P
12643 ><P
12644 ><TT
12645 CLASS="PROMPT"
12646 >root#</TT
12647 > <B
12648 CLASS="COMMAND"
12649 >/usr/local/samba/bin/net rpc join -S PDC -U Administrator</B
12650 ></P
12651 ><P
12652 >The proper response to the command should be: "Joined the domain 
12653 <TT
12654 CLASS="REPLACEABLE"
12655 ><I
12656 >DOMAIN</I
12657 ></TT
12658 >" where <TT
12659 CLASS="REPLACEABLE"
12660 ><I
12661 >DOMAIN</I
12662 ></TT
12663
12664 is your DOMAIN name.</P
12665 ></DIV
12666 ><DIV
12667 CLASS="SECT3"
12668 ><HR><H4
12669 CLASS="SECT3"
12670 ><A
12671 NAME="AEN2441"
12672 ></A
12673 >16.5.3.5. Start up the winbindd daemon and test it!</H4
12674 ><P
12675 >Eventually, you will want to modify your smb startup script to 
12676 automatically invoke the winbindd daemon when the other parts of 
12677 SAMBA start, but it is possible to test out just the winbind
12678 portion first.  To start up winbind services, enter the following 
12679 command as root:</P
12680 ><P
12681 ><TT
12682 CLASS="PROMPT"
12683 >root#</TT
12684 > <B
12685 CLASS="COMMAND"
12686 >/usr/local/samba/bin/winbindd</B
12687 ></P
12688 ><P
12689 >I'm always paranoid and like to make sure the daemon 
12690 is really running...</P
12691 ><P
12692 ><TT
12693 CLASS="PROMPT"
12694 >root#</TT
12695 > <B
12696 CLASS="COMMAND"
12697 >ps -ae | grep winbindd</B
12698 ></P
12699 ><P
12700 >This command should produce output like this, if the daemon is running</P
12701 ><P
12702 >3025 ?        00:00:00 winbindd</P
12703 ><P
12704 >Now... for the real test, try to get some information about the 
12705 users on your PDC</P
12706 ><P
12707 ><TT
12708 CLASS="PROMPT"
12709 >root#</TT
12710 > <B
12711 CLASS="COMMAND"
12712 >/usr/local/samba/bin/wbinfo -u</B
12713 ></P
12714 ><P
12715 >       
12716 This should echo back a list of users on your Windows users on 
12717 your PDC.  For example, I get the following response:</P
12718 ><P
12719 ><PRE
12720 CLASS="PROGRAMLISTING"
12721 >CEO+Administrator
12722 CEO+burdell
12723 CEO+Guest
12724 CEO+jt-ad
12725 CEO+krbtgt
12726 CEO+TsInternetUser</PRE
12727 ></P
12728 ><P
12729 >Obviously, I have named my domain 'CEO' and my <TT
12730 CLASS="PARAMETER"
12731 ><I
12732 >winbind
12733 separator</I
12734 ></TT
12735 > is '+'.</P
12736 ><P
12737 >You can do the same sort of thing to get group information from 
12738 the PDC:</P
12739 ><P
12740 ><PRE
12741 CLASS="PROGRAMLISTING"
12742 ><TT
12743 CLASS="PROMPT"
12744 >root#</TT
12745 > <B
12746 CLASS="COMMAND"
12747 >/usr/local/samba/bin/wbinfo -g</B
12748 >
12749 CEO+Domain Admins
12750 CEO+Domain Users
12751 CEO+Domain Guests
12752 CEO+Domain Computers
12753 CEO+Domain Controllers
12754 CEO+Cert Publishers
12755 CEO+Schema Admins
12756 CEO+Enterprise Admins
12757 CEO+Group Policy Creator Owners</PRE
12758 ></P
12759 ><P
12760 >The function 'getent' can now be used to get unified 
12761 lists of both local and PDC users and groups.
12762 Try the following command:</P
12763 ><P
12764 ><TT
12765 CLASS="PROMPT"
12766 >root#</TT
12767 > <B
12768 CLASS="COMMAND"
12769 >getent passwd</B
12770 ></P
12771 ><P
12772 >You should get a list that looks like your <TT
12773 CLASS="FILENAME"
12774 >/etc/passwd</TT
12775
12776 list followed by the domain users with their new uids, gids, home 
12777 directories and default shells.</P
12778 ><P
12779 >The same thing can be done for groups with the command</P
12780 ><P
12781 ><TT
12782 CLASS="PROMPT"
12783 >root#</TT
12784 > <B
12785 CLASS="COMMAND"
12786 >getent group</B
12787 ></P
12788 ></DIV
12789 ><DIV
12790 CLASS="SECT3"
12791 ><HR><H4
12792 CLASS="SECT3"
12793 ><A
12794 NAME="AEN2477"
12795 ></A
12796 >16.5.3.6. Fix the init.d startup scripts</H4
12797 ><DIV
12798 CLASS="SECT4"
12799 ><H5
12800 CLASS="SECT4"
12801 ><A
12802 NAME="AEN2479"
12803 ></A
12804 >16.5.3.6.1. Linux</H5
12805 ><P
12806 >The <B
12807 CLASS="COMMAND"
12808 >winbindd</B
12809 > daemon needs to start up after the 
12810 <B
12811 CLASS="COMMAND"
12812 >smbd</B
12813 > and <B
12814 CLASS="COMMAND"
12815 >nmbd</B
12816 > daemons are running.  
12817 To accomplish this task, you need to modify the startup scripts of your system. They are located at <TT
12818 CLASS="FILENAME"
12819 >/etc/init.d/smb</TT
12820 > in RedHat and 
12821 <TT
12822 CLASS="FILENAME"
12823 >/etc/init.d/samba</TT
12824 > in Debian.
12825 script to add commands to invoke this daemon in the proper sequence.  My 
12826 startup script starts up <B
12827 CLASS="COMMAND"
12828 >smbd</B
12829 >, 
12830 <B
12831 CLASS="COMMAND"
12832 >nmbd</B
12833 >, and <B
12834 CLASS="COMMAND"
12835 >winbindd</B
12836 > from the 
12837 <TT
12838 CLASS="FILENAME"
12839 >/usr/local/samba/bin</TT
12840 > directory directly.  The 'start' 
12841 function in the script looks like this:</P
12842 ><P
12843 ><PRE
12844 CLASS="PROGRAMLISTING"
12845 >start() {
12846         KIND="SMB"
12847         echo -n $"Starting $KIND services: "
12848         daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
12849         RETVAL=$?
12850         echo
12851         KIND="NMB"
12852         echo -n $"Starting $KIND services: "
12853         daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
12854         RETVAL2=$?
12855         echo
12856         KIND="Winbind"
12857         echo -n $"Starting $KIND services: "
12858         daemon /usr/local/samba/bin/winbindd
12859         RETVAL3=$?
12860         echo
12861         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; touch /var/lock/subsys/smb || \
12862            RETVAL=1
12863         return $RETVAL
12864 }</PRE
12865 ></P
12866 ><P
12867 >The 'stop' function has a corresponding entry to shut down the 
12868 services and look s like this:</P
12869 ><P
12870 ><PRE
12871 CLASS="PROGRAMLISTING"
12872 >stop() {
12873         KIND="SMB"
12874         echo -n $"Shutting down $KIND services: "
12875         killproc smbd
12876         RETVAL=$?
12877         echo
12878         KIND="NMB"
12879         echo -n $"Shutting down $KIND services: "
12880         killproc nmbd
12881         RETVAL2=$?
12882         echo
12883         KIND="Winbind"
12884         echo -n $"Shutting down $KIND services: "
12885         killproc winbindd
12886         RETVAL3=$?
12887         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; rm -f /var/lock/subsys/smb
12888         echo ""
12889         return $RETVAL
12890 }</PRE
12891 ></P
12892 ></DIV
12893 ><DIV
12894 CLASS="SECT4"
12895 ><HR><H5
12896 CLASS="SECT4"
12897 ><A
12898 NAME="AEN2496"
12899 ></A
12900 >16.5.3.6.2. Solaris</H5
12901 ><P
12902 >On solaris, you need to modify the 
12903 <TT
12904 CLASS="FILENAME"
12905 >/etc/init.d/samba.server</TT
12906 > startup script. It usually 
12907 only starts smbd and nmbd but should now start winbindd too. If you 
12908 have samba installed in <TT
12909 CLASS="FILENAME"
12910 >/usr/local/samba/bin</TT
12911 >, 
12912 the file could contains something like this:</P
12913 ><P
12914 ><PRE
12915 CLASS="PROGRAMLISTING"
12916 >##
12917 ## samba.server
12918 ##
12919
12920 if [ ! -d /usr/bin ]
12921 then                    # /usr not mounted
12922         exit
12923 fi
12924
12925 killproc() {            # kill the named process(es)
12926         pid=`/usr/bin/ps -e |
12927              /usr/bin/grep -w $1 |
12928              /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
12929         [ "$pid" != "" ] &#38;&#38; kill $pid
12930 }
12931  
12932 # Start/stop processes required for samba server
12933
12934 case "$1" in
12935
12936 'start')
12937 #
12938 # Edit these lines to suit your installation (paths, workgroup, host)
12939 #
12940 echo Starting SMBD
12941    /usr/local/samba/bin/smbd -D -s \
12942         /usr/local/samba/smb.conf
12943
12944 echo Starting NMBD
12945    /usr/local/samba/bin/nmbd -D -l \
12946         /usr/local/samba/var/log -s /usr/local/samba/smb.conf
12947
12948 echo Starting Winbind Daemon
12949    /usr/local/samba/bin/winbindd
12950    ;;
12951
12952 'stop')
12953    killproc nmbd
12954    killproc smbd
12955    killproc winbindd
12956    ;;
12957
12958 *)
12959    echo "Usage: /etc/init.d/samba.server { start | stop }"
12960    ;;
12961 esac</PRE
12962 ></P
12963 ></DIV
12964 ><DIV
12965 CLASS="SECT4"
12966 ><HR><H5
12967 CLASS="SECT4"
12968 ><A
12969 NAME="AEN2503"
12970 ></A
12971 >16.5.3.6.3. Restarting</H5
12972 ><P
12973 >If you restart the <B
12974 CLASS="COMMAND"
12975 >smbd</B
12976 >, <B
12977 CLASS="COMMAND"
12978 >nmbd</B
12979 >, 
12980 and <B
12981 CLASS="COMMAND"
12982 >winbindd</B
12983 > daemons at this point, you
12984 should be able to connect to the samba server as a domain member just as
12985 if you were a local user.</P
12986 ></DIV
12987 ></DIV
12988 ><DIV
12989 CLASS="SECT3"
12990 ><HR><H4
12991 CLASS="SECT3"
12992 ><A
12993 NAME="AEN2509"
12994 ></A
12995 >16.5.3.7. Configure Winbind and PAM</H4
12996 ><P
12997 >If you have made it this far, you know that winbindd and samba are working
12998 together.  If you want to use winbind to provide authentication for other 
12999 services, keep reading.  The pam configuration files need to be altered in
13000 this step.  (Did you remember to make backups of your original 
13001 <TT
13002 CLASS="FILENAME"
13003 >/etc/pam.d</TT
13004 > files? If not, do it now.)</P
13005 ><P
13006 >You will need a pam module to use winbindd with these other services.  This 
13007 module will be compiled in the <TT
13008 CLASS="FILENAME"
13009 >../source/nsswitch</TT
13010 > directory
13011 by invoking the command</P
13012 ><P
13013 ><TT
13014 CLASS="PROMPT"
13015 >root#</TT
13016 > <B
13017 CLASS="COMMAND"
13018 >make nsswitch/pam_winbind.so</B
13019 ></P
13020 ><P
13021 >from the <TT
13022 CLASS="FILENAME"
13023 >../source</TT
13024 > directory.  The
13025 <TT
13026 CLASS="FILENAME"
13027 >pam_winbind.so</TT
13028 > file should be copied to the location of
13029 your other pam security modules.  On my RedHat system, this was the
13030 <TT
13031 CLASS="FILENAME"
13032 >/lib/security</TT
13033 > directory. On Solaris, the pam security 
13034 modules reside in <TT
13035 CLASS="FILENAME"
13036 >/usr/lib/security</TT
13037 >.</P
13038 ><P
13039 ><TT
13040 CLASS="PROMPT"
13041 >root#</TT
13042 > <B
13043 CLASS="COMMAND"
13044 >cp ../samba/source/nsswitch/pam_winbind.so /lib/security</B
13045 ></P
13046 ><DIV
13047 CLASS="SECT4"
13048 ><HR><H5
13049 CLASS="SECT4"
13050 ><A
13051 NAME="AEN2526"
13052 ></A
13053 >16.5.3.7.1. Linux/FreeBSD-specific PAM configuration</H5
13054 ><P
13055 >The <TT
13056 CLASS="FILENAME"
13057 >/etc/pam.d/samba</TT
13058 > file does not need to be changed. I 
13059 just left this fileas it was:</P
13060 ><P
13061 ><PRE
13062 CLASS="PROGRAMLISTING"
13063 >auth    required        /lib/security/pam_stack.so service=system-auth
13064 account required        /lib/security/pam_stack.so service=system-auth</PRE
13065 ></P
13066 ><P
13067 >The other services that I modified to allow the use of winbind 
13068 as an authentication service were the normal login on the console (or a terminal 
13069 session), telnet logins, and ftp service.  In order to enable these 
13070 services, you may first need to change the entries in 
13071 <TT
13072 CLASS="FILENAME"
13073 >/etc/xinetd.d</TT
13074 > (or <TT
13075 CLASS="FILENAME"
13076 >/etc/inetd.conf</TT
13077 >).  
13078 RedHat 7.1 uses the new xinetd.d structure, in this case you need 
13079 to change the lines in <TT
13080 CLASS="FILENAME"
13081 >/etc/xinetd.d/telnet</TT
13082
13083 and <TT
13084 CLASS="FILENAME"
13085 >/etc/xinetd.d/wu-ftp</TT
13086 > from </P
13087 ><P
13088 ><PRE
13089 CLASS="PROGRAMLISTING"
13090 >enable = no</PRE
13091 ></P
13092 ><P
13093 >to</P
13094 ><P
13095 ><PRE
13096 CLASS="PROGRAMLISTING"
13097 >enable = yes</PRE
13098 ></P
13099 ><P
13100 >       
13101 For ftp services to work properly, you will also need to either 
13102 have individual directories for the domain users already present on 
13103 the server, or change the home directory template to a general
13104 directory for all domain users.  These can be easily set using 
13105 the <TT
13106 CLASS="FILENAME"
13107 >smb.conf</TT
13108 > global entry 
13109 <B
13110 CLASS="COMMAND"
13111 >template homedir</B
13112 >.</P
13113 ><P
13114 >The <TT
13115 CLASS="FILENAME"
13116 >/etc/pam.d/ftp</TT
13117 > file can be changed 
13118 to allow winbind ftp access in a manner similar to the
13119 samba file.  My <TT
13120 CLASS="FILENAME"
13121 >/etc/pam.d/ftp</TT
13122 > file was 
13123 changed to look like this:</P
13124 ><P
13125 ><PRE
13126 CLASS="PROGRAMLISTING"
13127 >auth       required     /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
13128 auth       sufficient   /lib/security/pam_winbind.so
13129 auth       required     /lib/security/pam_stack.so service=system-auth
13130 auth       required     /lib/security/pam_shells.so
13131 account    sufficient   /lib/security/pam_winbind.so
13132 account    required     /lib/security/pam_stack.so service=system-auth
13133 session    required     /lib/security/pam_stack.so service=system-auth</PRE
13134 ></P
13135 ><P
13136 >The <TT
13137 CLASS="FILENAME"
13138 >/etc/pam.d/login</TT
13139 > file can be changed nearly the 
13140 same way.  It now looks like this:</P
13141 ><P
13142 ><PRE
13143 CLASS="PROGRAMLISTING"
13144 >auth       required     /lib/security/pam_securetty.so
13145 auth       sufficient   /lib/security/pam_winbind.so
13146 auth       sufficient   /lib/security/pam_unix.so use_first_pass
13147 auth       required     /lib/security/pam_stack.so service=system-auth
13148 auth       required     /lib/security/pam_nologin.so
13149 account    sufficient   /lib/security/pam_winbind.so
13150 account    required     /lib/security/pam_stack.so service=system-auth
13151 password   required     /lib/security/pam_stack.so service=system-auth
13152 session    required     /lib/security/pam_stack.so service=system-auth
13153 session    optional     /lib/security/pam_console.so</PRE
13154 ></P
13155 ><P
13156 >In this case, I added the <B
13157 CLASS="COMMAND"
13158 >auth sufficient /lib/security/pam_winbind.so</B
13159
13160 lines as before, but also added the <B
13161 CLASS="COMMAND"
13162 >required pam_securetty.so</B
13163
13164 above it, to disallow root logins over the network.  I also added a 
13165 <B
13166 CLASS="COMMAND"
13167 >sufficient /lib/security/pam_unix.so use_first_pass</B
13168 >
13169 line after the <B
13170 CLASS="COMMAND"
13171 >winbind.so</B
13172 > line to get rid of annoying 
13173 double prompts for passwords.</P
13174 ></DIV
13175 ><DIV
13176 CLASS="SECT4"
13177 ><HR><H5
13178 CLASS="SECT4"
13179 ><A
13180 NAME="AEN2559"
13181 ></A
13182 >16.5.3.7.2. Solaris-specific configuration</H5
13183 ><P
13184 >The /etc/pam.conf needs to be changed. I changed this file so that my Domain
13185 users can logon both locally as well as telnet.The following are the changes
13186 that I made.You can customize the pam.conf file as per your requirements,but
13187 be sure of those changes because in the worst case it will leave your system
13188 nearly impossible to boot.</P
13189 ><P
13190 ><PRE
13191 CLASS="PROGRAMLISTING"
13192 >#
13193 #ident  "@(#)pam.conf   1.14    99/09/16 SMI"
13194 #
13195 # Copyright (c) 1996-1999, Sun Microsystems, Inc.
13196 # All Rights Reserved.
13197 #
13198 # PAM configuration
13199 #
13200 # Authentication management
13201 #
13202 login   auth required   /usr/lib/security/pam_winbind.so
13203 login   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass 
13204 login   auth required   /usr/lib/security/$ISA/pam_dial_auth.so.1 try_first_pass 
13205 #
13206 rlogin  auth sufficient /usr/lib/security/pam_winbind.so
13207 rlogin  auth sufficient /usr/lib/security/$ISA/pam_rhosts_auth.so.1
13208 rlogin  auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
13209 #
13210 dtlogin auth sufficient /usr/lib/security/pam_winbind.so
13211 dtlogin auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
13212 #
13213 rsh     auth required   /usr/lib/security/$ISA/pam_rhosts_auth.so.1
13214 other   auth sufficient /usr/lib/security/pam_winbind.so
13215 other   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
13216 #
13217 # Account management
13218 #
13219 login   account sufficient      /usr/lib/security/pam_winbind.so
13220 login   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
13221 login   account required        /usr/lib/security/$ISA/pam_unix.so.1 
13222 #
13223 dtlogin account sufficient      /usr/lib/security/pam_winbind.so
13224 dtlogin account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
13225 dtlogin account required        /usr/lib/security/$ISA/pam_unix.so.1 
13226 #
13227 other   account sufficient      /usr/lib/security/pam_winbind.so
13228 other   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
13229 other   account required        /usr/lib/security/$ISA/pam_unix.so.1 
13230 #
13231 # Session management
13232 #
13233 other   session required        /usr/lib/security/$ISA/pam_unix.so.1 
13234 #
13235 # Password management
13236 #
13237 #other   password sufficient     /usr/lib/security/pam_winbind.so
13238 other   password required       /usr/lib/security/$ISA/pam_unix.so.1 
13239 dtsession auth required /usr/lib/security/$ISA/pam_unix.so.1
13240 #
13241 # Support for Kerberos V5 authentication (uncomment to use Kerberos)
13242 #
13243 #rlogin auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
13244 #login  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
13245 #dtlogin        auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
13246 #other  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
13247 #dtlogin        account optional /usr/lib/security/$ISA/pam_krb5.so.1
13248 #other  account optional /usr/lib/security/$ISA/pam_krb5.so.1
13249 #other  session optional /usr/lib/security/$ISA/pam_krb5.so.1
13250 #other  password optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass</PRE
13251 ></P
13252 ><P
13253 >I also added a try_first_pass line after the winbind.so line to get rid of
13254 annoying double prompts for passwords.</P
13255 ><P
13256 >Now restart your Samba &#38; try connecting through your application that you
13257 configured in the pam.conf.</P
13258 ></DIV
13259 ></DIV
13260 ></DIV
13261 ></DIV
13262 ><DIV
13263 CLASS="SECT1"
13264 ><HR><H2
13265 CLASS="SECT1"
13266 ><A
13267 NAME="AEN2566"
13268 ></A
13269 >16.6. Limitations</H2
13270 ><P
13271 >Winbind has a number of limitations in its current 
13272         released version that we hope to overcome in future 
13273         releases:</P
13274 ><P
13275 ></P
13276 ><UL
13277 ><LI
13278 ><P
13279 >Winbind is currently only available for 
13280                 the Linux operating system, although ports to other operating 
13281                 systems are certainly possible. For such ports to be feasible, 
13282                 we require the C library of the target operating system to 
13283                 support the Name Service Switch and Pluggable Authentication
13284                 Modules systems. This is becoming more common as NSS and 
13285                 PAM gain        support among UNIX vendors.</P
13286 ></LI
13287 ><LI
13288 ><P
13289 >The mappings of Windows NT RIDs to UNIX ids 
13290                 is not made algorithmically and depends on the order in which 
13291                 unmapped users or groups are seen by winbind. It may be difficult 
13292                 to recover the mappings of rid to UNIX id mapping if the file 
13293                 containing this information is corrupted or destroyed.</P
13294 ></LI
13295 ><LI
13296 ><P
13297 >Currently the winbind PAM module does not take 
13298                 into account possible workstation and logon time restrictions 
13299                 that may be been set for Windows NT users.</P
13300 ></LI
13301 ></UL
13302 ></DIV
13303 ><DIV
13304 CLASS="SECT1"
13305 ><HR><H2
13306 CLASS="SECT1"
13307 ><A
13308 NAME="AEN2576"
13309 ></A
13310 >16.7. Conclusion</H2
13311 ><P
13312 >The winbind system, through the use of the Name Service 
13313         Switch, Pluggable Authentication Modules, and appropriate 
13314         Microsoft RPC calls have allowed us to provide seamless 
13315         integration of Microsoft Windows NT domain users on a
13316         UNIX system. The result is a great reduction in the administrative 
13317         cost of running a mixed UNIX and NT network.</P
13318 ></DIV
13319 ></DIV
13320 ><DIV
13321 CLASS="CHAPTER"
13322 ><HR><H1
13323 ><A
13324 NAME="PDB-MYSQL"
13325 ></A
13326 >Chapter 17. Passdb MySQL plugin</H1
13327 ><DIV
13328 CLASS="SECT1"
13329 ><H2
13330 CLASS="SECT1"
13331 ><A
13332 NAME="AEN2590"
13333 ></A
13334 >17.1. Building</H2
13335 ><P
13336 >To build the plugin, run <B
13337 CLASS="COMMAND"
13338 >make bin/pdb_mysql.so</B
13339 >
13340 in the <TT
13341 CLASS="FILENAME"
13342 >source/</TT
13343 > directory of samba distribution. </P
13344 ><P
13345 >Next, copy pdb_mysql.so to any location you want. I 
13346 strongly recommend installing it in $PREFIX/lib or /usr/lib/samba/</P
13347 ></DIV
13348 ><DIV
13349 CLASS="SECT1"
13350 ><HR><H2
13351 CLASS="SECT1"
13352 ><A
13353 NAME="AEN2596"
13354 ></A
13355 >17.2. Configuring</H2
13356 ><P
13357 >This plugin lacks some good documentation, but here is some short info:</P
13358 ><P
13359 >Add a the following to the <B
13360 CLASS="COMMAND"
13361 >passdb backend</B
13362 > variable in your <TT
13363 CLASS="FILENAME"
13364 >smb.conf</TT
13365 >:
13366 <PRE
13367 CLASS="PROGRAMLISTING"
13368 >passdb backend = [other-plugins] plugin:/location/to/pdb_mysql.so:identifier [other-plugins]</PRE
13369 ></P
13370 ><P
13371 >The identifier can be any string you like, as long as it doesn't collide with 
13372 the identifiers of other plugins or other instances of pdb_mysql. If you 
13373 specify multiple pdb_mysql.so entries in 'passdb backend', you also need to 
13374 use different identifiers!</P
13375 ><P
13376 >Additional options can be given thru the smb.conf file in the [global] section.</P
13377 ><P
13378 ><PRE
13379 CLASS="PROGRAMLISTING"
13380 >identifier:mysql host                     - host name, defaults to 'localhost'
13381 identifier:mysql password
13382 identifier:mysql user                     - defaults to 'samba'
13383 identifier:mysql database                 - defaults to 'samba'
13384 identifier:mysql port                     - defaults to 3306
13385 identifier:table                          - Name of the table containing users</PRE
13386 ></P
13387 ><P
13388 >Names of the columns in this table(I've added column types those columns should have first):</P
13389 ><P
13390 ><PRE
13391 CLASS="PROGRAMLISTING"
13392 >identifier:logon time column             - int(9)
13393 identifier:logoff time column            - int(9)
13394 identifier:kickoff time column           - int(9)
13395 identifier:pass last set time column     - int(9)
13396 identifier:pass can change time column   - int(9)
13397 identifier:pass must change time column  - int(9)
13398 identifier:username column               - varchar(255) - unix username
13399 identifier:domain column                 - varchar(255) - NT domain user is part of
13400 identifier:nt username column            - varchar(255) - NT username
13401 identifier:fullname column            - varchar(255) - Full name of user
13402 identifier:home dir column               - varchar(255) - Unix homedir path
13403 identifier:dir drive column              - varchar(2) - Directory drive path (eg: 'H:')
13404 identifier:logon script column           - varchar(255) - Batch file to run on client side when logging on
13405 identifier:profile path column           - varchar(255) - Path of profile
13406 identifier:acct desc column              - varchar(255) - Some ASCII NT user data
13407 identifier:workstations column           - varchar(255) - Workstations user can logon to (or NULL for all)
13408 identifier:unknown string column         - varchar(255) - unknown string
13409 identifier:munged dial column            - varchar(255) - ?
13410 identifier:uid column                    - int(9) - Unix user ID (uid)
13411 identifier:gid column                    - int(9) - Unix user group (gid)
13412 identifier:user sid column               - varchar(255) - NT user SID
13413 identifier:group sid column              - varchar(255) - NT group ID
13414 identifier:lanman pass column            - varchar(255) - encrypted lanman password
13415 identifier:nt pass column                - varchar(255) - encrypted nt passwd
13416 identifier:plaintext pass column         - varchar(255) - plaintext password
13417 identifier:acct control column           - int(9) - nt user data
13418 identifier:unknown 3 column              - int(9) - unknown
13419 identifier:logon divs column             - int(9) - ?
13420 identifier:hours len column              - int(9) - ?
13421 identifier:unknown 5 column              - int(9) - unknown
13422 identifier:unknown 6 column              - int(9) - unknown</PRE
13423 ></P
13424 ><P
13425 >Eventually, you can put a colon (:) after the name of each column, which 
13426 should specify the column to update when updating the table. You can also
13427 specify nothing behind the colon - then the data from the field will not be 
13428 updated. </P
13429 ></DIV
13430 ><DIV
13431 CLASS="SECT1"
13432 ><HR><H2
13433 CLASS="SECT1"
13434 ><A
13435 NAME="AEN2611"
13436 ></A
13437 >17.3. Using plaintext passwords or encrypted password</H2
13438 ><P
13439 >I strongly discourage the use of plaintext passwords, however, you can use them:</P
13440 ><P
13441 >If you would like to use plaintext passwords, set 'identifier:lanman pass column' and 'identifier:nt pass column' to 'NULL' (without the quotes) and 'identifier:plaintext pass column' to the name of the column containing the plaintext passwords. </P
13442 ><P
13443 >If you use encrypted passwords, set the 'identifier:plaintext pass column' to 'NULL' (without the quotes). This is the default.</P
13444 ></DIV
13445 ><DIV
13446 CLASS="SECT1"
13447 ><HR><H2
13448 CLASS="SECT1"
13449 ><A
13450 NAME="AEN2616"
13451 ></A
13452 >17.4. Getting non-column data from the table</H2
13453 ><P
13454 >It is possible to have not all data in the database and making some 'constant'.</P
13455 ><P
13456 >For example, you can set 'identifier:fullname column' to : 
13457 <B
13458 CLASS="COMMAND"
13459 >CONCAT(First_name,' ',Sur_name)</B
13460 ></P
13461 ><P
13462 >Or, set 'identifier:workstations column' to :
13463 <B
13464 CLASS="COMMAND"
13465 >NULL</B
13466 ></P
13467 ><P
13468 >See the MySQL documentation for more language constructs.</P
13469 ></DIV
13470 ></DIV
13471 ><DIV
13472 CLASS="CHAPTER"
13473 ><HR><H1
13474 ><A
13475 NAME="PDB-XML"
13476 ></A
13477 >Chapter 18. Passdb XML plugin</H1
13478 ><DIV
13479 CLASS="SECT1"
13480 ><H2
13481 CLASS="SECT1"
13482 ><A
13483 NAME="AEN2635"
13484 ></A
13485 >18.1. Building</H2
13486 ><P
13487 >This module requires libxml2 to be installed.</P
13488 ><P
13489 >To build pdb_xml, run: <B
13490 CLASS="COMMAND"
13491 >make bin/pdb_xml.so</B
13492 > in 
13493 the directory <TT
13494 CLASS="FILENAME"
13495 >source/</TT
13496 >. </P
13497 ></DIV
13498 ><DIV
13499 CLASS="SECT1"
13500 ><HR><H2
13501 CLASS="SECT1"
13502 ><A
13503 NAME="AEN2641"
13504 ></A
13505 >18.2. Usage</H2
13506 ><P
13507 >The usage of pdb_xml is pretty straightforward. To export data, use:
13508
13509 <B
13510 CLASS="COMMAND"
13511 >pdbedit -e plugin:/usr/lib/samba/pdb_xml.so:filename</B
13512 >
13513
13514 (where filename is the name of the file to put the data in)</P
13515 ><P
13516 >To import data, use:
13517 <B
13518 CLASS="COMMAND"
13519 >pdbedit -i plugin:/usr/lib/samba/pdb_xml.so:filename -e current-pdb</B
13520 >
13521
13522 Where filename is the name to read the data from and current-pdb to put it in.</P
13523 ></DIV
13524 ></DIV
13525 ><DIV
13526 CLASS="CHAPTER"
13527 ><HR><H1
13528 ><A
13529 NAME="SAMBA-LDAP-HOWTO"
13530 ></A
13531 >Chapter 19. Storing Samba's User/Machine Account information in an LDAP Directory</H1
13532 ><DIV
13533 CLASS="SECT1"
13534 ><H2
13535 CLASS="SECT1"
13536 ><A
13537 NAME="AEN2664"
13538 ></A
13539 >19.1. Purpose</H2
13540 ><P
13541 >This document describes how to use an LDAP directory for storing Samba user
13542 account information traditionally stored in the smbpasswd(5) file.  It is
13543 assumed that the reader already has a basic understanding of LDAP concepts
13544 and has a working directory server already installed.  For more information
13545 on LDAP architectures and Directories, please refer to the following sites.</P
13546 ><P
13547 ></P
13548 ><UL
13549 ><LI
13550 ><P
13551 >OpenLDAP - <A
13552 HREF="http://www.openldap.org/"
13553 TARGET="_top"
13554 >http://www.openldap.org/</A
13555 ></P
13556 ></LI
13557 ><LI
13558 ><P
13559 >iPlanet Directory Server - <A
13560 HREF="http://iplanet.netscape.com/directory"
13561 TARGET="_top"
13562 >http://iplanet.netscape.com/directory</A
13563 ></P
13564 ></LI
13565 ></UL
13566 ><P
13567 >Note that <A
13568 HREF="http://www.ora.com/"
13569 TARGET="_top"
13570 >O'Reilly Publishing</A
13571 > is working on
13572 a guide to LDAP for System Administrators which has a planned release date of
13573 early summer, 2002.</P
13574 ><P
13575 >Two additional Samba resources which may prove to be helpful are</P
13576 ><P
13577 ></P
13578 ><UL
13579 ><LI
13580 ><P
13581 >The <A
13582 HREF="http://www.unav.es/cti/ldap-smb/ldap-smb-2_2-howto.html"
13583 TARGET="_top"
13584 >Samba-PDC-LDAP-HOWTO</A
13585 >
13586         maintained by Ignacio Coupeau.</P
13587 ></LI
13588 ><LI
13589 ><P
13590 >The NT migration scripts from <A
13591 HREF="http://samba.idealx.org/"
13592 TARGET="_top"
13593 >IDEALX</A
13594 > that are
13595         geared to manage users and group in such a Samba-LDAP Domain Controller configuration.
13596         </P
13597 ></LI
13598 ></UL
13599 ></DIV
13600 ><DIV
13601 CLASS="SECT1"
13602 ><HR><H2
13603 CLASS="SECT1"
13604 ><A
13605 NAME="AEN2684"
13606 ></A
13607 >19.2. Introduction</H2
13608 ><P
13609 >Traditionally, when configuring <A
13610 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
13611 TARGET="_top"
13612 >"encrypt
13613 passwords = yes"</A
13614 > in Samba's <TT
13615 CLASS="FILENAME"
13616 >smb.conf</TT
13617 > file, user account
13618 information such as username, LM/NT password hashes, password change times, and account
13619 flags have been stored in the <TT
13620 CLASS="FILENAME"
13621 >smbpasswd(5)</TT
13622 > file.  There are several
13623 disadvantages to this approach for sites with very large numbers of users (counted
13624 in the thousands).</P
13625 ><P
13626 ></P
13627 ><UL
13628 ><LI
13629 ><P
13630 >The first is that all lookups must be performed sequentially.  Given that
13631 there are approximately two lookups per domain logon (one for a normal
13632 session connection such as when mapping a network drive or printer), this
13633 is a performance bottleneck for lareg sites.  What is needed is an indexed approach
13634 such as is used in databases.</P
13635 ></LI
13636 ><LI
13637 ><P
13638 >The second problem is that administrators who desired to replicate a
13639 smbpasswd file to more than one Samba server were left to use external
13640 tools such as <B
13641 CLASS="COMMAND"
13642 >rsync(1)</B
13643 > and <B
13644 CLASS="COMMAND"
13645 >ssh(1)</B
13646 >
13647 and wrote custom, in-house scripts.</P
13648 ></LI
13649 ><LI
13650 ><P
13651 >And finally, the amount of information which is stored in an
13652 smbpasswd entry leaves no room for additional attributes such as
13653 a home directory, password expiration time, or even a Relative
13654 Identified (RID).</P
13655 ></LI
13656 ></UL
13657 ><P
13658 >As a result of these defeciencies, a more robust means of storing user attributes
13659 used by smbd was developed.  The API which defines access to user accounts
13660 is commonly referred to as the samdb interface (previously this was called the passdb
13661 API, and is still so named in the CVS trees). In Samba 2.2.3, enabling support
13662 for a samdb backend (e.g. <TT
13663 CLASS="PARAMETER"
13664 ><I
13665 >--with-ldapsam</I
13666 ></TT
13667 > or
13668 <TT
13669 CLASS="PARAMETER"
13670 ><I
13671 >--with-tdbsam</I
13672 ></TT
13673 >) requires compile time support.</P
13674 ><P
13675 >When compiling Samba to include the <TT
13676 CLASS="PARAMETER"
13677 ><I
13678 >--with-ldapsam</I
13679 ></TT
13680 > autoconf
13681 option, smbd (and associated tools) will store and lookup user accounts in
13682 an LDAP directory.  In reality, this is very easy to understand.  If you are
13683 comfortable with using an smbpasswd file, simply replace "smbpasswd" with
13684 "LDAP directory" in all the documentation.</P
13685 ><P
13686 >There are a few points to stress about what the <TT
13687 CLASS="PARAMETER"
13688 ><I
13689 >--with-ldapsam</I
13690 ></TT
13691 >
13692 does not provide.  The LDAP support referred to in the this documentation does not
13693 include:</P
13694 ><P
13695 ></P
13696 ><UL
13697 ><LI
13698 ><P
13699 >A means of retrieving user account information from
13700         an Windows 2000 Active Directory server.</P
13701 ></LI
13702 ><LI
13703 ><P
13704 >A means of replacing /etc/passwd.</P
13705 ></LI
13706 ></UL
13707 ><P
13708 >The second item can be accomplished by using LDAP NSS and PAM modules.  LGPL
13709 versions of these libraries can be obtained from PADL Software
13710 (<A
13711 HREF="http://www.padl.com/"
13712 TARGET="_top"
13713 >http://www.padl.com/</A
13714 >).  However,
13715 the details of configuring these packages are beyond the scope of this document.</P
13716 ></DIV
13717 ><DIV
13718 CLASS="SECT1"
13719 ><HR><H2
13720 CLASS="SECT1"
13721 ><A
13722 NAME="AEN2713"
13723 ></A
13724 >19.3. Supported LDAP Servers</H2
13725 ><P
13726 >The LDAP samdb code in 2.2.3 has been developed and tested using the OpenLDAP
13727 2.0 server and client libraries.  The same code should be able to work with
13728 Netscape's Directory Server and client SDK. However, due to lack of testing
13729 so far, there are bound to be compile errors and bugs.  These should not be
13730 hard to fix. If you are so inclined, please be sure to forward all patches to
13731 <A
13732 HREF="samba-patches@samba.org"
13733 TARGET="_top"
13734 >samba-patches@samba.org</A
13735 > and
13736 <A
13737 HREF="jerry@samba.org"
13738 TARGET="_top"
13739 >jerry@samba.org</A
13740 >.</P
13741 ></DIV
13742 ><DIV
13743 CLASS="SECT1"
13744 ><HR><H2
13745 CLASS="SECT1"
13746 ><A
13747 NAME="AEN2718"
13748 ></A
13749 >19.4. Schema and Relationship to the RFC 2307 posixAccount</H2
13750 ><P
13751 >Samba 2.2.3 includes the necessary schema file for OpenLDAP 2.0 in
13752 <TT
13753 CLASS="FILENAME"
13754 >examples/LDAP/samba.schema</TT
13755 >.  (Note that this schema
13756 file has been modified since the experimental support initially included
13757 in 2.2.2).  The sambaAccount objectclass is given here:</P
13758 ><P
13759 ><PRE
13760 CLASS="PROGRAMLISTING"
13761 >objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL
13762      DESC 'Samba Account'
13763      MUST ( uid $ rid )
13764      MAY  ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $
13765             logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $
13766             displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $
13767             description $ userWorkstations $ primaryGroupID $ domain ))</PRE
13768 ></P
13769 ><P
13770 >The samba.schema file has been formatted for OpenLDAP 2.0.  The OID's are
13771 owned by the Samba Team and as such is legal to be openly published.
13772 If you translate the schema to be used with Netscape DS, please
13773 submit the modified schema file as a patch to <A
13774 HREF="jerry@samba.org"
13775 TARGET="_top"
13776 >jerry@samba.org</A
13777 ></P
13778 ><P
13779 >Just as the smbpasswd file is mean to store information which supplements a
13780 user's <TT
13781 CLASS="FILENAME"
13782 >/etc/passwd</TT
13783 > entry, so is the sambaAccount object
13784 meant to supplement the UNIX user account information.  A sambaAccount is a
13785 <TT
13786 CLASS="CONSTANT"
13787 >STRUCTURAL</TT
13788 > objectclass so it can be stored individually
13789 in the directory.  However, there are several fields (e.g. uid) which overlap
13790 with the posixAccount objectclass outlined in RFC2307.  This is by design.</P
13791 ><P
13792 >In order to store all user account information (UNIX and Samba) in the directory,
13793 it is necessary to use the sambaAccount and posixAccount objectclasses in
13794 combination.  However, smbd will still obtain the user's UNIX account
13795 information via the standard C library calls (e.g. getpwnam(), et. al.).
13796 This means that the Samba server must also have the LDAP NSS library installed
13797 and functioning correctly.  This division of information makes it possible to
13798 store all Samba account information in LDAP, but still maintain UNIX account
13799 information in NIS while the network is transitioning to a full LDAP infrastructure.</P
13800 ></DIV
13801 ><DIV
13802 CLASS="SECT1"
13803 ><HR><H2
13804 CLASS="SECT1"
13805 ><A
13806 NAME="AEN2730"
13807 ></A
13808 >19.5. Configuring Samba with LDAP</H2
13809 ><DIV
13810 CLASS="SECT2"
13811 ><H3
13812 CLASS="SECT2"
13813 ><A
13814 NAME="AEN2732"
13815 ></A
13816 >19.5.1. OpenLDAP configuration</H3
13817 ><P
13818 >To include support for the sambaAccount object in an OpenLDAP directory
13819 server, first copy the samba.schema file to slapd's configuration directory.</P
13820 ><P
13821 ><TT
13822 CLASS="PROMPT"
13823 >root# </TT
13824 ><B
13825 CLASS="COMMAND"
13826 >cp samba.schema /etc/openldap/schema/</B
13827 ></P
13828 ><P
13829 >Next, include the <TT
13830 CLASS="FILENAME"
13831 >samba.schema</TT
13832 > file in <TT
13833 CLASS="FILENAME"
13834 >slapd.conf</TT
13835 >.
13836 The sambaAccount object contains two attributes which depend upon other schema
13837 files.  The 'uid' attribute is defined in <TT
13838 CLASS="FILENAME"
13839 >cosine.schema</TT
13840 > and
13841 the 'displayName' attribute is defined in the <TT
13842 CLASS="FILENAME"
13843 >inetorgperson.schema</TT
13844 >
13845 file.  Both of these must be included before the <TT
13846 CLASS="FILENAME"
13847 >samba.schema</TT
13848 > file.</P
13849 ><P
13850 ><PRE
13851 CLASS="PROGRAMLISTING"
13852 >## /etc/openldap/slapd.conf
13853
13854 ## schema files (core.schema is required by default)
13855 include            /etc/openldap/schema/core.schema
13856
13857 ## needed for sambaAccount
13858 include            /etc/openldap/schema/cosine.schema
13859 include            /etc/openldap/schema/inetorgperson.schema
13860 include            /etc/openldap/schema/samba.schema
13861
13862 ## uncomment this line if you want to support the RFC2307 (NIS) schema
13863 ## include         /etc/openldap/schema/nis.schema
13864
13865 ....</PRE
13866 ></P
13867 ><P
13868 >It is recommended that you maintain some indices on some of the most usefull attributes,
13869 like in the following example, to speed up searches made on sambaAccount objectclasses
13870 (and possibly posixAccount and posixGroup as well).</P
13871 ><P
13872 ><PRE
13873 CLASS="PROGRAMLISTING"
13874 ># Indices to maintain
13875 ## required by OpenLDAP 2.0
13876 index objectclass   eq
13877
13878 ## support pb_getsampwnam()
13879 index uid           pres,eq
13880 ## support pdb_getsambapwrid()
13881 index rid           eq
13882
13883 ## uncomment these if you are storing posixAccount and
13884 ## posixGroup entries in the directory as well
13885 ##index uidNumber     eq
13886 ##index gidNumber     eq
13887 ##index cn            eq
13888 ##index memberUid     eq</PRE
13889 ></P
13890 ></DIV
13891 ><DIV
13892 CLASS="SECT2"
13893 ><HR><H3
13894 CLASS="SECT2"
13895 ><A
13896 NAME="AEN2749"
13897 ></A
13898 >19.5.2. Configuring Samba</H3
13899 ><P
13900 >The following parameters are available in smb.conf only with <TT
13901 CLASS="PARAMETER"
13902 ><I
13903 >--with-ldapsam</I
13904 ></TT
13905 >
13906 was included with compiling Samba.</P
13907 ><P
13908 ></P
13909 ><UL
13910 ><LI
13911 ><P
13912 ><A
13913 HREF="smb.conf.5.html#LDAPSSL"
13914 TARGET="_top"
13915 >ldap ssl</A
13916 ></P
13917 ></LI
13918 ><LI
13919 ><P
13920 ><A
13921 HREF="smb.conf.5.html#LDAPSERVER"
13922 TARGET="_top"
13923 >ldap server</A
13924 ></P
13925 ></LI
13926 ><LI
13927 ><P
13928 ><A
13929 HREF="smb.conf.5.html#LDAPADMINDN"
13930 TARGET="_top"
13931 >ldap admin dn</A
13932 ></P
13933 ></LI
13934 ><LI
13935 ><P
13936 ><A
13937 HREF="smb.conf.5.html#LDAPSUFFIX"
13938 TARGET="_top"
13939 >ldap suffix</A
13940 ></P
13941 ></LI
13942 ><LI
13943 ><P
13944 ><A
13945 HREF="smb.conf.5.html#LDAPFILTER"
13946 TARGET="_top"
13947 >ldap filter</A
13948 ></P
13949 ></LI
13950 ><LI
13951 ><P
13952 ><A
13953 HREF="smb.conf.5.html#LDAPPORT"
13954 TARGET="_top"
13955 >ldap port</A
13956 ></P
13957 ></LI
13958 ></UL
13959 ><P
13960 >These are described in the <A
13961 HREF="smb.conf.5.html"
13962 TARGET="_top"
13963 >smb.conf(5)</A
13964 > man
13965 page and so will not be repeated here.  However, a sample smb.conf file for
13966 use with an LDAP directory could appear as</P
13967 ><P
13968 ><PRE
13969 CLASS="PROGRAMLISTING"
13970 >## /usr/local/samba/lib/smb.conf
13971 [global]
13972      security = user
13973      encrypt passwords = yes
13974
13975      netbios name = TASHTEGO
13976      workgroup = NARNIA
13977
13978      # ldap related parameters
13979
13980      # define the DN to use when binding to the directory servers
13981      # The password for this DN is not stored in smb.conf.  Rather it
13982      # must be set by using 'smbpasswd -w <TT
13983 CLASS="REPLACEABLE"
13984 ><I
13985 >secretpw</I
13986 ></TT
13987 >' to store the
13988      # passphrase in the secrets.tdb file.  If the "ldap admin dn" values
13989      # changes, this password will need to be reset.
13990      ldap admin dn = "cn=Samba Manager,ou=people,dc=samba,dc=org"
13991
13992      #  specify the LDAP server's hostname (defaults to locahost)
13993      ldap server = ahab.samba.org
13994
13995      # Define the SSL option when connecting to the directory
13996      # ('off', 'start tls', or 'on' (default))
13997      ldap ssl = start tls
13998
13999      # define the port to use in the LDAP session (defaults to 636 when
14000      # "ldap ssl = on")
14001      ldap port = 389
14002
14003      # specify the base DN to use when searching the directory
14004      ldap suffix = "ou=people,dc=samba,dc=org"
14005
14006      # generally the default ldap search filter is ok
14007      # ldap filter = "(&amp;(uid=%u)(objectclass=sambaAccount))"</PRE
14008 ></P
14009 ></DIV
14010 ></DIV
14011 ><DIV
14012 CLASS="SECT1"
14013 ><HR><H2
14014 CLASS="SECT1"
14015 ><A
14016 NAME="AEN2777"
14017 ></A
14018 >19.6. Accounts and Groups management</H2
14019 ><P
14020 >As users accounts are managed thru the sambaAccount objectclass, you should
14021 modify you existing administration tools to deal with sambaAccount attributes.</P
14022 ><P
14023 >Machines accounts are managed with the sambaAccount objectclass, just
14024 like users accounts. However, it's up to you to stored thoses accounts
14025 in a different tree of you LDAP namespace: you should use
14026 "ou=Groups,dc=plainjoe,dc=org" to store groups and
14027 "ou=People,dc=plainjoe,dc=org" to store users. Just configure your
14028 NSS and PAM accordingly (usually, in the /etc/ldap.conf configuration
14029 file).</P
14030 ><P
14031 >In Samba release 2.2.3, the group management system is based on posix
14032 groups. This meand that Samba make usage of the posixGroup objectclass.
14033 For now, there is no NT-like group system management (global and local
14034 groups).</P
14035 ></DIV
14036 ><DIV
14037 CLASS="SECT1"
14038 ><HR><H2
14039 CLASS="SECT1"
14040 ><A
14041 NAME="AEN2782"
14042 ></A
14043 >19.7. Security and sambaAccount</H2
14044 ><P
14045 >There are two important points to remember when discussing the security
14046 of sambaAccount entries in the directory.</P
14047 ><P
14048 ></P
14049 ><UL
14050 ><LI
14051 ><P
14052 ><SPAN
14053 CLASS="emphasis"
14054 ><I
14055 CLASS="EMPHASIS"
14056 >Never</I
14057 ></SPAN
14058 > retrieve the lmPassword or
14059         ntPassword attribute values over an unencrypted LDAP session.</P
14060 ></LI
14061 ><LI
14062 ><P
14063 ><SPAN
14064 CLASS="emphasis"
14065 ><I
14066 CLASS="EMPHASIS"
14067 >Never</I
14068 ></SPAN
14069 > allow non-admin users to
14070         view the lmPassword or ntPassword attribute values.</P
14071 ></LI
14072 ></UL
14073 ><P
14074 >These password hashes are clear text equivalents and can be used to impersonate
14075 the user without deriving the original clear text strings.  For more information
14076 on the details of LM/NT password hashes, refer to the <A
14077 HREF="ENCRYPTION.html"
14078 TARGET="_top"
14079 >ENCRYPTION chapter</A
14080 > of the Samba-HOWTO-Collection.</P
14081 ><P
14082 >To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults
14083 to require an encrypted session (<B
14084 CLASS="COMMAND"
14085 >ldap ssl = on</B
14086 >) using
14087 the default port of 636
14088 when contacting the directory server.  When using an OpenLDAP 2.0 server, it
14089 is possible to use the use the StartTLS LDAP extended  operation in the place of
14090 LDAPS.  In either case, you are strongly discouraged to disable this security
14091 (<B
14092 CLASS="COMMAND"
14093 >ldap ssl = off</B
14094 >).</P
14095 ><P
14096 >Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS
14097 extended operation.  However, the OpenLDAP library still provides support for
14098 the older method of securing communication between clients and servers.</P
14099 ><P
14100 >The second security precaution is to prevent non-administrative users from
14101 harvesting password hashes from the directory.  This can be done using the
14102 following ACL in <TT
14103 CLASS="FILENAME"
14104 >slapd.conf</TT
14105 >:</P
14106 ><P
14107 ><PRE
14108 CLASS="PROGRAMLISTING"
14109 >## allow the "ldap admin dn" access, but deny everyone else
14110 access to attrs=lmPassword,ntPassword
14111      by dn="cn=Samba Admin,ou=people,dc=plainjoe,dc=org" write
14112      by * none</PRE
14113 ></P
14114 ></DIV
14115 ><DIV
14116 CLASS="SECT1"
14117 ><HR><H2
14118 CLASS="SECT1"
14119 ><A
14120 NAME="AEN2802"
14121 ></A
14122 >19.8. LDAP specials attributes for sambaAccounts</H2
14123 ><P
14124 >The sambaAccount objectclass is composed of the following attributes:</P
14125 ><P
14126 ></P
14127 ><UL
14128 ><LI
14129 ><P
14130 ><TT
14131 CLASS="CONSTANT"
14132 >lmPassword</TT
14133 >: the LANMAN password 16-byte hash stored as a character
14134         representation of a hexidecimal string.</P
14135 ></LI
14136 ><LI
14137 ><P
14138 ><TT
14139 CLASS="CONSTANT"
14140 >ntPassword</TT
14141 >: the NT password hash 16-byte stored as a character
14142         representation of a hexidecimal string.</P
14143 ></LI
14144 ><LI
14145 ><P
14146 ><TT
14147 CLASS="CONSTANT"
14148 >pwdLastSet</TT
14149 >: The integer time in seconds since 1970 when the
14150         <TT
14151 CLASS="CONSTANT"
14152 >lmPassword</TT
14153 > and <TT
14154 CLASS="CONSTANT"
14155 >ntPassword</TT
14156 > attributes were last set.
14157         </P
14158 ></LI
14159 ><LI
14160 ><P
14161 ><TT
14162 CLASS="CONSTANT"
14163 >acctFlags</TT
14164 >: string of 11 characters surrounded by square brackets []
14165         representing account flags such as U (user), W(workstation), X(no password expiration), and
14166         D(disabled).</P
14167 ></LI
14168 ><LI
14169 ><P
14170 ><TT
14171 CLASS="CONSTANT"
14172 >logonTime</TT
14173 >: Integer value currently unused</P
14174 ></LI
14175 ><LI
14176 ><P
14177 ><TT
14178 CLASS="CONSTANT"
14179 >logoffTime</TT
14180 >: Integer value currently unused</P
14181 ></LI
14182 ><LI
14183 ><P
14184 ><TT
14185 CLASS="CONSTANT"
14186 >kickoffTime</TT
14187 >: Integer value currently unused</P
14188 ></LI
14189 ><LI
14190 ><P
14191 ><TT
14192 CLASS="CONSTANT"
14193 >pwdCanChange</TT
14194 >: Integer value currently unused</P
14195 ></LI
14196 ><LI
14197 ><P
14198 ><TT
14199 CLASS="CONSTANT"
14200 >pwdMustChange</TT
14201 >: Integer value currently unused</P
14202 ></LI
14203 ><LI
14204 ><P
14205 ><TT
14206 CLASS="CONSTANT"
14207 >homeDrive</TT
14208 >: specifies the drive letter to which to map the
14209         UNC path specified by homeDirectory. The drive letter must be specified in the form "X:"
14210         where X is the letter of the drive to map. Refer to the "logon drive" parameter in the
14211         smb.conf(5) man page for more information.</P
14212 ></LI
14213 ><LI
14214 ><P
14215 ><TT
14216 CLASS="CONSTANT"
14217 >scriptPath</TT
14218 >: The scriptPath property specifies the path of
14219         the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path
14220         is relative to the netlogon share.  Refer to the "logon script" parameter in the
14221         smb.conf(5) man page for more information.</P
14222 ></LI
14223 ><LI
14224 ><P
14225 ><TT
14226 CLASS="CONSTANT"
14227 >profilePath</TT
14228 >: specifies a path to the user's profile.
14229         This value can be a null string, a local absolute path, or a UNC path.  Refer to the
14230         "logon path" parameter in the smb.conf(5) man page for more information.</P
14231 ></LI
14232 ><LI
14233 ><P
14234 ><TT
14235 CLASS="CONSTANT"
14236 >smbHome</TT
14237 >: The homeDirectory property specifies the path of
14238         the home directory for the user. The string can be null. If homeDrive is set and specifies
14239         a drive letter, homeDirectory should be a UNC path. The path must be a network
14240         UNC path of the form \\server\share\directory. This value can be a null string.
14241         Refer to the "logon home" parameter in the smb.conf(5) man page for more information.
14242         </P
14243 ></LI
14244 ><LI
14245 ><P
14246 ><TT
14247 CLASS="CONSTANT"
14248 >userWorkstation</TT
14249 >: character string value currently unused.
14250         </P
14251 ></LI
14252 ><LI
14253 ><P
14254 ><TT
14255 CLASS="CONSTANT"
14256 >rid</TT
14257 >: the integer representation of the user's relative identifier
14258         (RID).</P
14259 ></LI
14260 ><LI
14261 ><P
14262 ><TT
14263 CLASS="CONSTANT"
14264 >primaryGroupID</TT
14265 >: the relative identifier (RID) of the primary group
14266         of the user.</P
14267 ></LI
14268 ></UL
14269 ><P
14270 >The majority of these parameters are only used when Samba is acting as a PDC of
14271 a domain (refer to the <A
14272 HREF="Samba-PDC-HOWTO.html"
14273 TARGET="_top"
14274 >Samba-PDC-HOWTO</A
14275 > for details on
14276 how to configure Samba as a Primary Domain Controller). The following four attributes
14277 are only stored with the sambaAccount entry if the values are non-default values:</P
14278 ><P
14279 ></P
14280 ><UL
14281 ><LI
14282 ><P
14283 >smbHome</P
14284 ></LI
14285 ><LI
14286 ><P
14287 >scriptPath</P
14288 ></LI
14289 ><LI
14290 ><P
14291 >logonPath</P
14292 ></LI
14293 ><LI
14294 ><P
14295 >homeDrive</P
14296 ></LI
14297 ></UL
14298 ><P
14299 >These attributes are only stored with the sambaAccount entry if
14300 the values are non-default values.  For example, assume TASHTEGO has now been
14301 configured as a PDC and that <B
14302 CLASS="COMMAND"
14303 >logon home = \\%L\%u</B
14304 > was defined in
14305 its <TT
14306 CLASS="FILENAME"
14307 >smb.conf</TT
14308 > file. When a user named "becky" logons to the domain,
14309 the <TT
14310 CLASS="PARAMETER"
14311 ><I
14312 >logon home</I
14313 ></TT
14314 > string is expanded to \\TASHTEGO\becky.
14315 If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org",
14316 this value is used.  However, if this attribute does not exist, then the value
14317 of the <TT
14318 CLASS="PARAMETER"
14319 ><I
14320 >logon home</I
14321 ></TT
14322 > parameter is used in its place.  Samba
14323 will only write the attribute value to the directory entry is the value is
14324 something other than the default (e.g. \\MOBY\becky).</P
14325 ></DIV
14326 ><DIV
14327 CLASS="SECT1"
14328 ><HR><H2
14329 CLASS="SECT1"
14330 ><A
14331 NAME="AEN2872"
14332 ></A
14333 >19.9. Example LDIF Entries for a sambaAccount</H2
14334 ><P
14335 >The following is a working LDIF with the inclusion of the posixAccount objectclass:</P
14336 ><P
14337 ><PRE
14338 CLASS="PROGRAMLISTING"
14339 >dn: uid=guest2, ou=people,dc=plainjoe,dc=org
14340 ntPassword: 878D8014606CDA29677A44EFA1353FC7
14341 pwdMustChange: 2147483647
14342 primaryGroupID: 1201
14343 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
14344 pwdLastSet: 1010179124
14345 logonTime: 0
14346 objectClass: sambaAccount
14347 uid: guest2
14348 kickoffTime: 2147483647
14349 acctFlags: [UX         ]
14350 logoffTime: 2147483647
14351 rid: 19006
14352 pwdCanChange: 0</PRE
14353 ></P
14354 ><P
14355 >The following is an LDIF entry for using both the sambaAccount and
14356 posixAccount objectclasses:</P
14357 ><P
14358 ><PRE
14359 CLASS="PROGRAMLISTING"
14360 >dn: uid=gcarter, ou=people,dc=plainjoe,dc=org
14361 logonTime: 0
14362 displayName: Gerald Carter
14363 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
14364 primaryGroupID: 1201
14365 objectClass: posixAccount
14366 objectClass: sambaAccount
14367 acctFlags: [UX         ]
14368 userPassword: {crypt}BpM2ej8Rkzogo
14369 uid: gcarter
14370 uidNumber: 9000
14371 cn: Gerald Carter
14372 loginShell: /bin/bash
14373 logoffTime: 2147483647
14374 gidNumber: 100
14375 kickoffTime: 2147483647
14376 pwdLastSet: 1010179230
14377 rid: 19000
14378 homeDirectory: /home/tashtego/gcarter
14379 pwdCanChange: 0
14380 pwdMustChange: 2147483647
14381 ntPassword: 878D8014606CDA29677A44EFA1353FC7</PRE
14382 ></P
14383 ></DIV
14384 ><DIV
14385 CLASS="SECT1"
14386 ><HR><H2
14387 CLASS="SECT1"
14388 ><A
14389 NAME="AEN2880"
14390 ></A
14391 >19.10. Comments</H2
14392 ><P
14393 >Please mail all comments regarding this HOWTO to <A
14394 HREF="mailto:jerry@samba.org"
14395 TARGET="_top"
14396 >jerry@samba.org</A
14397 >.  This documents was
14398 last updated to reflect the Samba 2.2.3 release.&#13;</P
14399 ></DIV
14400 ></DIV
14401 ><DIV
14402 CLASS="CHAPTER"
14403 ><HR><H1
14404 ><A
14405 NAME="CVS-ACCESS"
14406 ></A
14407 >Chapter 20. HOWTO Access Samba source code via CVS</H1
14408 ><DIV
14409 CLASS="SECT1"
14410 ><H2
14411 CLASS="SECT1"
14412 ><A
14413 NAME="AEN2891"
14414 ></A
14415 >20.1. Introduction</H2
14416 ><P
14417 >Samba is developed in an open environment.  Developers use CVS
14418 (Concurrent Versioning System) to "checkin" (also known as 
14419 "commit") new source code.  Samba's various CVS branches can
14420 be accessed via anonymous CVS using the instructions
14421 detailed in this chapter.</P
14422 ><P
14423 >This document is a modified version of the instructions found at
14424 <A
14425 HREF="http://samba.org/samba/cvs.html"
14426 TARGET="_top"
14427 >http://samba.org/samba/cvs.html</A
14428 ></P
14429 ></DIV
14430 ><DIV
14431 CLASS="SECT1"
14432 ><HR><H2
14433 CLASS="SECT1"
14434 ><A
14435 NAME="AEN2896"
14436 ></A
14437 >20.2. CVS Access to samba.org</H2
14438 ><P
14439 >The machine samba.org runs a publicly accessible CVS 
14440 repository for access to the source code of several packages, 
14441 including samba, rsync and jitterbug. There are two main ways of 
14442 accessing the CVS server on this host.</P
14443 ><DIV
14444 CLASS="SECT2"
14445 ><HR><H3
14446 CLASS="SECT2"
14447 ><A
14448 NAME="AEN2899"
14449 ></A
14450 >20.2.1. Access via CVSweb</H3
14451 ><P
14452 >You can access the source code via your 
14453 favourite WWW browser. This allows you to access the contents of 
14454 individual files in the repository and also to look at the revision 
14455 history and commit logs of individual files. You can also ask for a diff 
14456 listing between any two versions on the repository.</P
14457 ><P
14458 >Use the URL : <A
14459 HREF="http://samba.org/cgi-bin/cvsweb"
14460 TARGET="_top"
14461 >http://samba.org/cgi-bin/cvsweb</A
14462 ></P
14463 ></DIV
14464 ><DIV
14465 CLASS="SECT2"
14466 ><HR><H3
14467 CLASS="SECT2"
14468 ><A
14469 NAME="AEN2904"
14470 ></A
14471 >20.2.2. Access via cvs</H3
14472 ><P
14473 >You can also access the source code via a 
14474 normal cvs client.  This gives you much more control over you can 
14475 do with the repository and allows you to checkout whole source trees 
14476 and keep them up to date via normal cvs commands. This is the 
14477 preferred method of access if you are a developer and not
14478 just a casual browser.</P
14479 ><P
14480 >To download the latest cvs source code, point your
14481 browser at the URL : <A
14482 HREF="http://www.cyclic.com/"
14483 TARGET="_top"
14484 >http://www.cyclic.com/</A
14485 >.
14486 and click on the 'How to get cvs' link. CVS is free software under 
14487 the GNU GPL (as is Samba).  Note that there are several graphical CVS clients
14488 which provide a graphical interface to the sometimes mundane CVS commands.
14489 Links to theses clients are also available from http://www.cyclic.com.</P
14490 ><P
14491 >To gain access via anonymous cvs use the following steps. 
14492 For this example it is assumed that you want a copy of the 
14493 samba source code. For the other source code repositories 
14494 on this system just substitute the correct package name</P
14495 ><P
14496 ></P
14497 ><OL
14498 TYPE="1"
14499 ><LI
14500 ><P
14501 >       Install a recent copy of cvs. All you really need is a 
14502         copy of the cvs client binary. 
14503         </P
14504 ></LI
14505 ><LI
14506 ><P
14507 >       Run the command 
14508         </P
14509 ><P
14510 >       <B
14511 CLASS="COMMAND"
14512 >cvs -d :pserver:cvs@samba.org:/cvsroot login</B
14513 >
14514         </P
14515 ><P
14516 >       When it asks you for a password type <TT
14517 CLASS="USERINPUT"
14518 ><B
14519 >cvs</B
14520 ></TT
14521 >.
14522         </P
14523 ></LI
14524 ><LI
14525 ><P
14526 >       Run the command 
14527         </P
14528 ><P
14529 >       <B
14530 CLASS="COMMAND"
14531 >cvs -d :pserver:cvs@samba.org:/cvsroot co samba</B
14532 >
14533         </P
14534 ><P
14535 >       This will create a directory called samba containing the 
14536         latest samba source code (i.e. the HEAD tagged cvs branch). This 
14537         currently corresponds to the 3.0 development tree. 
14538         </P
14539 ><P
14540 >       CVS branches other HEAD can be obtained by using the <TT
14541 CLASS="PARAMETER"
14542 ><I
14543 >-r</I
14544 ></TT
14545 >
14546         and defining a tag name.  A list of branch tag names can be found on the
14547         "Development" page of the samba web site.  A common request is to obtain the
14548         latest 2.2 release code.  This could be done by using the following command.
14549         </P
14550 ><P
14551 >       <B
14552 CLASS="COMMAND"
14553 >cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_2_2 samba</B
14554 >
14555         </P
14556 ></LI
14557 ><LI
14558 ><P
14559 >       Whenever you want to merge in the latest code changes use 
14560         the following command from within the samba directory: 
14561         </P
14562 ><P
14563 >       <B
14564 CLASS="COMMAND"
14565 >cvs update -d -P</B
14566 >
14567         </P
14568 ></LI
14569 ></OL
14570 ></DIV
14571 ></DIV
14572 ></DIV
14573 ><DIV
14574 CLASS="CHAPTER"
14575 ><HR><H1
14576 ><A
14577 NAME="GROUPMAPPING"
14578 ></A
14579 >Chapter 21. Group mapping HOWTO</H1
14580 ><P
14581
14582 Starting with Samba 3.0 alpha 2, a new group mapping function is available. The
14583 current method (likely to change) to manage the groups is a new command called
14584 <B
14585 CLASS="COMMAND"
14586 >smbgroupedit</B
14587 >.</P
14588 ><P
14589 >The first immediate reason to use the group mapping on a PDC, is that
14590 the <B
14591 CLASS="COMMAND"
14592 >domain admin group</B
14593 > of <TT
14594 CLASS="FILENAME"
14595 >smb.conf</TT
14596 > is 
14597 now gone. This parameter was used to give the listed users local admin rights 
14598 on their workstations. It was some magic stuff that simply worked but didn't
14599 scale very well for complex setups.</P
14600 ><P
14601 >Let me explain how it works on NT/W2K, to have this magic fade away.
14602 When installing NT/W2K on a computer, the installer program creates some users
14603 and groups. Notably the 'Administrators' group, and gives to that group some
14604 privileges like the ability to change the date and time or to kill any process
14605 (or close too) running on the local machine. The 'Administrator' user is a
14606 member of the 'Administrators' group, and thus 'inherit' the 'Administrators'
14607 group privileges. If a 'joe' user is created and become a member of the
14608 'Administrator' group, 'joe' has exactly the same rights as 'Administrator'.</P
14609 ><P
14610 >When a NT/W2K machine is joined to a domain, during that phase, the "Domain
14611 Administrators' group of the PDC is added to the 'Administrators' group of the
14612 workstation. Every members of the 'Domain Administrators' group 'inherit' the
14613 rights of the 'Administrators' group when logging on the workstation.</P
14614 ><P
14615 >You are now wondering how to make some of your samba PDC users members of the
14616 'Domain Administrators' ? That's really easy.</P
14617 ><P
14618 ></P
14619 ><OL
14620 TYPE="1"
14621 ><LI
14622 ><P
14623 >create a unix group (usually in <TT
14624 CLASS="FILENAME"
14625 >/etc/group</TT
14626 >), let's call it domadm</P
14627 ></LI
14628 ><LI
14629 ><P
14630 >add to this group the users that must be Administrators. For example if you want joe,john and mary, your entry in <TT
14631 CLASS="FILENAME"
14632 >/etc/group</TT
14633 > will look like:</P
14634 ><P
14635 ><PRE
14636 CLASS="PROGRAMLISTING"
14637 >domadm:x:502:joe,john,mary</PRE
14638 ></P
14639 ></LI
14640 ><LI
14641 ><P
14642 >Map this domadm group to the <B
14643 CLASS="COMMAND"
14644 >domain admins</B
14645 > group by running the command:</P
14646 ><P
14647 ><B
14648 CLASS="COMMAND"
14649 >smbgroupedit -c "Domain Admins" -u domadm</B
14650 ></P
14651 ></LI
14652 ></OL
14653 ><P
14654 >You're set, joe, john and mary are domain administrators !</P
14655 ><P
14656 >Like the Domain Admins group, you can map any arbitrary Unix group to any NT
14657 group. You can also make any Unix group a domain group. For example, on a domain
14658 member machine (an NT/W2K or a samba server running winbind), you would like to
14659 give access to a certain directory to some users who are member of a group on
14660 your samba PDC. Flag that group as a domain group by running:</P
14661 ><P
14662 ><B
14663 CLASS="COMMAND"
14664 >smbgroupedit -a unixgroup -td</B
14665 ></P
14666 ><P
14667 >You can list the various groups in the mapping database like this</P
14668 ><P
14669 ><B
14670 CLASS="COMMAND"
14671 >smbgroupedit -v</B
14672 ></P
14673 ></DIV
14674 ><DIV
14675 CLASS="CHAPTER"
14676 ><HR><H1
14677 ><A
14678 NAME="SPEED"
14679 ></A
14680 >Chapter 22. Samba performance issues</H1
14681 ><DIV
14682 CLASS="SECT1"
14683 ><H2
14684 CLASS="SECT1"
14685 ><A
14686 NAME="AEN2982"
14687 ></A
14688 >22.1. Comparisons</H2
14689 ><P
14690 >The Samba server uses TCP to talk to the client. Thus if you are
14691 trying to see if it performs well you should really compare it to
14692 programs that use the same protocol. The most readily available
14693 programs for file transfer that use TCP are ftp or another TCP based
14694 SMB server.</P
14695 ><P
14696 >If you want to test against something like a NT or WfWg server then
14697 you will have to disable all but TCP on either the client or
14698 server. Otherwise you may well be using a totally different protocol
14699 (such as Netbeui) and comparisons may not be valid.</P
14700 ><P
14701 >Generally you should find that Samba performs similarly to ftp at raw
14702 transfer speed. It should perform quite a bit faster than NFS,
14703 although this very much depends on your system.</P
14704 ><P
14705 >Several people have done comparisons between Samba and Novell, NFS or
14706 WinNT. In some cases Samba performed the best, in others the worst. I
14707 suspect the biggest factor is not Samba vs some other system but the
14708 hardware and drivers used on the various systems. Given similar
14709 hardware Samba should certainly be competitive in speed with other
14710 systems.</P
14711 ></DIV
14712 ><DIV
14713 CLASS="SECT1"
14714 ><HR><H2
14715 CLASS="SECT1"
14716 ><A
14717 NAME="AEN2988"
14718 ></A
14719 >22.2. Oplocks</H2
14720 ><DIV
14721 CLASS="SECT2"
14722 ><H3
14723 CLASS="SECT2"
14724 ><A
14725 NAME="AEN2990"
14726 ></A
14727 >22.2.1. Overview</H3
14728 ><P
14729 >Oplocks are the way that SMB clients get permission from a server to
14730 locally cache file operations. If a server grants an oplock
14731 (opportunistic lock) then the client is free to assume that it is the
14732 only one accessing the file and it will agressively cache file
14733 data. With some oplock types the client may even cache file open/close
14734 operations. This can give enormous performance benefits.</P
14735 ><P
14736 >With the release of Samba 1.9.18 we now correctly support opportunistic 
14737 locks. This is turned on by default, and can be turned off on a share-
14738 by-share basis by setting the parameter :</P
14739 ><P
14740 ><B
14741 CLASS="COMMAND"
14742 >oplocks = False</B
14743 ></P
14744 ><P
14745 >We recommend that you leave oplocks on however, as current benchmark
14746 tests with NetBench seem to give approximately a 30% improvement in
14747 speed with them on. This is on average however, and the actual 
14748 improvement seen can be orders of magnitude greater, depending on
14749 what the client redirector is doing.</P
14750 ><P
14751 >Previous to Samba 1.9.18 there was a 'fake oplocks' option. This
14752 option has been left in the code for backwards compatibility reasons
14753 but it's use is now deprecated. A short summary of what the old
14754 code did follows.</P
14755 ></DIV
14756 ><DIV
14757 CLASS="SECT2"
14758 ><HR><H3
14759 CLASS="SECT2"
14760 ><A
14761 NAME="AEN2998"
14762 ></A
14763 >22.2.2. Level2 Oplocks</H3
14764 ><P
14765 >With Samba 2.0.5 a new capability - level2 (read only) oplocks is
14766 supported (although the option is off by default - see the smb.conf
14767 man page for details). Turning on level2 oplocks (on a share-by-share basis)
14768 by setting the parameter :</P
14769 ><P
14770 ><B
14771 CLASS="COMMAND"
14772 >level2 oplocks = true</B
14773 ></P
14774 ><P
14775 >should speed concurrent access to files that are not commonly written
14776 to, such as application serving shares (ie. shares that contain common
14777 .EXE files - such as a Microsoft Office share) as it allows clients to
14778 read-ahread cache copies of these files.</P
14779 ></DIV
14780 ><DIV
14781 CLASS="SECT2"
14782 ><HR><H3
14783 CLASS="SECT2"
14784 ><A
14785 NAME="AEN3004"
14786 ></A
14787 >22.2.3. Old 'fake oplocks' option - deprecated</H3
14788 ><P
14789 >Samba can also fake oplocks, by granting a oplock whenever a client 
14790 asks for one. This is controlled using the smb.conf option "fake 
14791 oplocks". If you set "fake oplocks = yes" then you are telling the 
14792 client that it may agressively cache the file data for all opens.</P
14793 ><P
14794 >Enabling 'fake oplocks' on all read-only shares or shares that you know
14795 will only be accessed from one client at a time you will see a big
14796 performance improvement on many operations. If you enable this option
14797 on shares where multiple clients may be accessing the files read-write
14798 at the same time you can get data corruption.</P
14799 ></DIV
14800 ></DIV
14801 ><DIV
14802 CLASS="SECT1"
14803 ><HR><H2
14804 CLASS="SECT1"
14805 ><A
14806 NAME="AEN3008"
14807 ></A
14808 >22.3. Socket options</H2
14809 ><P
14810 >There are a number of socket options that can greatly affect the
14811 performance of a TCP based server like Samba.</P
14812 ><P
14813 >The socket options that Samba uses are settable both on the command
14814 line with the -O option, or in the smb.conf file.</P
14815 ><P
14816 >The "socket options" section of the smb.conf manual page describes how
14817 to set these and gives recommendations.</P
14818 ><P
14819 >Getting the socket options right can make a big difference to your
14820 performance, but getting them wrong can degrade it by just as
14821 much. The correct settings are very dependent on your local network.</P
14822 ><P
14823 >The socket option TCP_NODELAY is the one that seems to make the
14824 biggest single difference for most networks. Many people report that
14825 adding "socket options = TCP_NODELAY" doubles the read performance of
14826 a Samba drive. The best explanation I have seen for this is that the
14827 Microsoft TCP/IP stack is slow in sending tcp ACKs.</P
14828 ></DIV
14829 ><DIV
14830 CLASS="SECT1"
14831 ><HR><H2
14832 CLASS="SECT1"
14833 ><A
14834 NAME="AEN3015"
14835 ></A
14836 >22.4. Read size</H2
14837 ><P
14838 >The option "read size" affects the overlap of disk reads/writes with
14839 network reads/writes. If the amount of data being transferred in
14840 several of the SMB commands (currently SMBwrite, SMBwriteX and
14841 SMBreadbraw) is larger than this value then the server begins writing
14842 the data before it has received the whole packet from the network, or
14843 in the case of SMBreadbraw, it begins writing to the network before
14844 all the data has been read from disk.</P
14845 ><P
14846 >This overlapping works best when the speeds of disk and network access
14847 are similar, having very little effect when the speed of one is much
14848 greater than the other.</P
14849 ><P
14850 >The default value is 16384, but very little experimentation has been
14851 done yet to determine the optimal value, and it is likely that the best
14852 value will vary greatly between systems anyway. A value over 65536 is
14853 pointless and will cause you to allocate memory unnecessarily.</P
14854 ></DIV
14855 ><DIV
14856 CLASS="SECT1"
14857 ><HR><H2
14858 CLASS="SECT1"
14859 ><A
14860 NAME="AEN3020"
14861 ></A
14862 >22.5. Max xmit</H2
14863 ><P
14864 >At startup the client and server negotiate a "maximum transmit" size,
14865 which limits the size of nearly all SMB commands. You can set the
14866 maximum size that Samba will negotiate using the "max xmit = " option
14867 in smb.conf. Note that this is the maximum size of SMB request that 
14868 Samba will accept, but not the maximum size that the *client* will accept.
14869 The client maximum receive size is sent to Samba by the client and Samba
14870 honours this limit.</P
14871 ><P
14872 >It defaults to 65536 bytes (the maximum), but it is possible that some
14873 clients may perform better with a smaller transmit unit. Trying values
14874 of less than 2048 is likely to cause severe problems.</P
14875 ><P
14876 >In most cases the default is the best option.</P
14877 ></DIV
14878 ><DIV
14879 CLASS="SECT1"
14880 ><HR><H2
14881 CLASS="SECT1"
14882 ><A
14883 NAME="AEN3025"
14884 ></A
14885 >22.6. Locking</H2
14886 ><P
14887 >By default Samba does not implement strict locking on each read/write
14888 call (although it did in previous versions). If you enable strict
14889 locking (using "strict locking = yes") then you may find that you
14890 suffer a severe performance hit on some systems.</P
14891 ><P
14892 >The performance hit will probably be greater on NFS mounted
14893 filesystems, but could be quite high even on local disks.</P
14894 ></DIV
14895 ><DIV
14896 CLASS="SECT1"
14897 ><HR><H2
14898 CLASS="SECT1"
14899 ><A
14900 NAME="AEN3029"
14901 ></A
14902 >22.7. Share modes</H2
14903 ><P
14904 >Some people find that opening files is very slow. This is often
14905 because of the "share modes" code needed to fully implement the dos
14906 share modes stuff. You can disable this code using "share modes =
14907 no". This will gain you a lot in opening and closing files but will
14908 mean that (in some cases) the system won't force a second user of a
14909 file to open the file read-only if the first has it open
14910 read-write. For many applications that do their own locking this
14911 doesn't matter, but for some it may. Most Windows applications
14912 depend heavily on "share modes" working correctly and it is
14913 recommended that the Samba share mode support be left at the
14914 default of "on".</P
14915 ><P
14916 >The share mode code in Samba has been re-written in the 1.9.17
14917 release following tests with the Ziff-Davis NetBench PC Benchmarking
14918 tool. It is now believed that Samba 1.9.17 implements share modes
14919 similarly to Windows NT.</P
14920 ><P
14921 >NOTE: In the most recent versions of Samba there is an option to use
14922 shared memory via mmap() to implement the share modes. This makes
14923 things much faster. See the Makefile for how to enable this.</P
14924 ></DIV
14925 ><DIV
14926 CLASS="SECT1"
14927 ><HR><H2
14928 CLASS="SECT1"
14929 ><A
14930 NAME="AEN3034"
14931 ></A
14932 >22.8. Log level</H2
14933 ><P
14934 >If you set the log level (also known as "debug level") higher than 2
14935 then you may suffer a large drop in performance. This is because the
14936 server flushes the log file after each operation, which can be very
14937 expensive. </P
14938 ></DIV
14939 ><DIV
14940 CLASS="SECT1"
14941 ><HR><H2
14942 CLASS="SECT1"
14943 ><A
14944 NAME="AEN3037"
14945 ></A
14946 >22.9. Wide lines</H2
14947 ><P
14948 >The "wide links" option is now enabled by default, but if you disable
14949 it (for better security) then you may suffer a performance hit in
14950 resolving filenames. The performance loss is lessened if you have
14951 "getwd cache = yes", which is now the default.</P
14952 ></DIV
14953 ><DIV
14954 CLASS="SECT1"
14955 ><HR><H2
14956 CLASS="SECT1"
14957 ><A
14958 NAME="AEN3040"
14959 ></A
14960 >22.10. Read raw</H2
14961 ><P
14962 >The "read raw" operation is designed to be an optimised, low-latency
14963 file read operation. A server may choose to not support it,
14964 however. and Samba makes support for "read raw" optional, with it
14965 being enabled by default.</P
14966 ><P
14967 >In some cases clients don't handle "read raw" very well and actually
14968 get lower performance using it than they get using the conventional
14969 read operations. </P
14970 ><P
14971 >So you might like to try "read raw = no" and see what happens on your
14972 network. It might lower, raise or not affect your performance. Only
14973 testing can really tell.</P
14974 ></DIV
14975 ><DIV
14976 CLASS="SECT1"
14977 ><HR><H2
14978 CLASS="SECT1"
14979 ><A
14980 NAME="AEN3045"
14981 ></A
14982 >22.11. Write raw</H2
14983 ><P
14984 >The "write raw" operation is designed to be an optimised, low-latency
14985 file write operation. A server may choose to not support it,
14986 however. and Samba makes support for "write raw" optional, with it
14987 being enabled by default.</P
14988 ><P
14989 >Some machines may find "write raw" slower than normal write, in which
14990 case you may wish to change this option.</P
14991 ></DIV
14992 ><DIV
14993 CLASS="SECT1"
14994 ><HR><H2
14995 CLASS="SECT1"
14996 ><A
14997 NAME="AEN3049"
14998 ></A
14999 >22.12. Read prediction</H2
15000 ><P
15001 >Samba can do read prediction on some of the SMB commands. Read
15002 prediction means that Samba reads some extra data on the last file it
15003 read while waiting for the next SMB command to arrive. It can then
15004 respond more quickly when the next read request arrives.</P
15005 ><P
15006 >This is disabled by default. You can enable it by using "read
15007 prediction = yes".</P
15008 ><P
15009 >Note that read prediction is only used on files that were opened read
15010 only.</P
15011 ><P
15012 >Read prediction should particularly help for those silly clients (such
15013 as "Write" under NT) which do lots of very small reads on a file.</P
15014 ><P
15015 >Samba will not read ahead more data than the amount specified in the
15016 "read size" option. It always reads ahead on 1k block boundaries.</P
15017 ></DIV
15018 ><DIV
15019 CLASS="SECT1"
15020 ><HR><H2
15021 CLASS="SECT1"
15022 ><A
15023 NAME="AEN3056"
15024 ></A
15025 >22.13. Memory mapping</H2
15026 ><P
15027 >Samba supports reading files via memory mapping them. One some
15028 machines this can give a large boost to performance, on others it
15029 makes not difference at all, and on some it may reduce performance.</P
15030 ><P
15031 >To enable you you have to recompile Samba with the -DUSE_MMAP option
15032 on the FLAGS line of the Makefile.</P
15033 ><P
15034 >Note that memory mapping is only used on files opened read only, and
15035 is not used by the "read raw" operation. Thus you may find memory
15036 mapping is more effective if you disable "read raw" using "read raw =
15037 no".</P
15038 ></DIV
15039 ><DIV
15040 CLASS="SECT1"
15041 ><HR><H2
15042 CLASS="SECT1"
15043 ><A
15044 NAME="AEN3061"
15045 ></A
15046 >22.14. Slow Clients</H2
15047 ><P
15048 >One person has reported that setting the protocol to COREPLUS rather
15049 than LANMAN2 gave a dramatic speed improvement (from 10k/s to 150k/s).</P
15050 ><P
15051 >I suspect that his PC's (386sx16 based) were asking for more data than
15052 they could chew. I suspect a similar speed could be had by setting
15053 "read raw = no" and "max xmit = 2048", instead of changing the
15054 protocol. Lowering the "read size" might also help.</P
15055 ></DIV
15056 ><DIV
15057 CLASS="SECT1"
15058 ><HR><H2
15059 CLASS="SECT1"
15060 ><A
15061 NAME="AEN3065"
15062 ></A
15063 >22.15. Slow Logins</H2
15064 ><P
15065 >Slow logins are almost always due to the password checking time. Using
15066 the lowest practical "password level" will improve things a lot. You
15067 could also enable the "UFC crypt" option in the Makefile.</P
15068 ></DIV
15069 ><DIV
15070 CLASS="SECT1"
15071 ><HR><H2
15072 CLASS="SECT1"
15073 ><A
15074 NAME="AEN3068"
15075 ></A
15076 >22.16. Client tuning</H2
15077 ><P
15078 >Often a speed problem can be traced to the client. The client (for
15079 example Windows for Workgroups) can often be tuned for better TCP
15080 performance.</P
15081 ><P
15082 >See your client docs for details. In particular, I have heard rumours
15083 that the WfWg options TCPWINDOWSIZE and TCPSEGMENTSIZE can have a
15084 large impact on performance.</P
15085 ><P
15086 >Also note that some people have found that setting DefaultRcvWindow in
15087 the [MSTCP] section of the SYSTEM.INI file under WfWg to 3072 gives a
15088 big improvement. I don't know why.</P
15089 ><P
15090 >My own experience wth DefaultRcvWindow is that I get much better
15091 performance with a large value (16384 or larger). Other people have
15092 reported that anything over 3072 slows things down enourmously. One
15093 person even reported a speed drop of a factor of 30 when he went from
15094 3072 to 8192. I don't know why.</P
15095 ><P
15096 >It probably depends a lot on your hardware, and the type of unix box
15097 you have at the other end of the link.</P
15098 ><P
15099 >Paul Cochrane has done some testing on client side tuning and come 
15100 to the following conclusions:</P
15101 ><P
15102 >Install the W2setup.exe file from www.microsoft.com. This is an 
15103 update for the winsock stack and utilities which improve performance.</P
15104 ><P
15105 >Configure the win95 TCPIP registry settings to give better 
15106 perfomance. I use a program called MTUSPEED.exe which I got off the 
15107 net. There are various other utilities of this type freely available. 
15108 The setting which give the best performance for me are:</P
15109 ><P
15110 ></P
15111 ><OL
15112 TYPE="1"
15113 ><LI
15114 ><P
15115 >MaxMTU                  Remove</P
15116 ></LI
15117 ><LI
15118 ><P
15119 >RWIN                    Remove</P
15120 ></LI
15121 ><LI
15122 ><P
15123 >MTUAutoDiscover         Disable</P
15124 ></LI
15125 ><LI
15126 ><P
15127 >MTUBlackHoleDetect      Disable</P
15128 ></LI
15129 ><LI
15130 ><P
15131 >Time To Live            Enabled</P
15132 ></LI
15133 ><LI
15134 ><P
15135 >Time To Live - HOPS     32</P
15136 ></LI
15137 ><LI
15138 ><P
15139 >NDI Cache Size          0</P
15140 ></LI
15141 ></OL
15142 ><P
15143 >I tried virtually all of the items mentioned in the document and 
15144 the only one which made a difference to me was the socket options. It 
15145 turned out I was better off without any!!!!!</P
15146 ><P
15147 >In terms of overall speed of transfer, between various win95 clients 
15148 and a DX2-66 20MB server with a crappy NE2000 compatible and old IDE 
15149 drive (Kernel 2.0.30). The transfer rate was reasonable for 10 baseT.</P
15150 ><P
15151 >FIXME
15152 The figures are:          Put              Get 
15153 P166 client 3Com card:    420-440kB/s      500-520kB/s
15154 P100 client 3Com card:    390-410kB/s      490-510kB/s
15155 DX4-75 client NE2000:     370-380kB/s      330-350kB/s</P
15156 ><P
15157 >I based these test on transfer two files a 4.5MB text file and a 15MB 
15158 textfile. The results arn't bad considering the hardware Samba is 
15159 running on. It's a crap machine!!!!</P
15160 ><P
15161 >The updates mentioned in 1 and 2 brought up the transfer rates from 
15162 just over 100kB/s in some clients.</P
15163 ><P
15164 >A new client is a P333 connected via a 100MB/s card and hub. The 
15165 transfer rates from this were good: 450-500kB/s on put and 600+kB/s 
15166 on get.</P
15167 ><P
15168 >Looking at standard FTP throughput, Samba is a bit slower (100kB/s 
15169 upwards). I suppose there is more going on in the samba protocol, but 
15170 if it could get up to the rate of FTP the perfomance would be quite 
15171 staggering.</P
15172 ></DIV
15173 ><DIV
15174 CLASS="SECT1"
15175 ><HR><H2
15176 CLASS="SECT1"
15177 ><A
15178 NAME="AEN3100"
15179 ></A
15180 >22.17. My Results</H2
15181 ><P
15182 >Some people want to see real numbers in a document like this, so here
15183 they are. I have a 486sx33 client running WfWg 3.11 with the 3.11b
15184 tcp/ip stack. It has a slow IDE drive and 20Mb of ram. It has a SMC
15185 Elite-16 ISA bus ethernet card. The only WfWg tuning I've done is to
15186 set DefaultRcvWindow in the [MSTCP] section of system.ini to 16384. My
15187 server is a 486dx3-66 running Linux. It also has 20Mb of ram and a SMC
15188 Elite-16 card. You can see my server config in the examples/tridge/
15189 subdirectory of the distribution.</P
15190 ><P
15191 >I get 490k/s on reading a 8Mb file with copy.
15192 I get 441k/s writing the same file to the samba server.</P
15193 ><P
15194 >Of course, there's a lot more to benchmarks than 2 raw throughput
15195 figures, but it gives you a ballpark figure.</P
15196 ><P
15197 >I've also tested Win95 and WinNT, and found WinNT gave me the best
15198 speed as a samba client. The fastest client of all (for me) is
15199 smbclient running on another linux box. Maybe I'll add those results
15200 here someday ...</P
15201 ></DIV
15202 ></DIV
15203 ></DIV
15204 ><DIV
15205 CLASS="PART"
15206 ><A
15207 NAME="AEN3106"
15208 ></A
15209 ><DIV
15210 CLASS="TITLEPAGE"
15211 ><H1
15212 CLASS="TITLE"
15213 >IV. Appendixes</H1
15214 ><DIV
15215 CLASS="TOC"
15216 ><DL
15217 ><DT
15218 ><B
15219 >Table of Contents</B
15220 ></DT
15221 ><DT
15222 >23. <A
15223 HREF="#PORTABILITY"
15224 >Portability</A
15225 ></DT
15226 ><DD
15227 ><DL
15228 ><DT
15229 >23.1. <A
15230 HREF="#AEN3115"
15231 >HPUX</A
15232 ></DT
15233 ><DT
15234 >23.2. <A
15235 HREF="#AEN3121"
15236 >SCO Unix</A
15237 ></DT
15238 ><DT
15239 >23.3. <A
15240 HREF="#AEN3125"
15241 >DNIX</A
15242 ></DT
15243 ><DT
15244 >23.4. <A
15245 HREF="#AEN3154"
15246 >RedHat Linux Rembrandt-II</A
15247 ></DT
15248 ></DL
15249 ></DD
15250 ><DT
15251 >24. <A
15252 HREF="#OTHER-CLIENTS"
15253 >Samba and other CIFS clients</A
15254 ></DT
15255 ><DD
15256 ><DL
15257 ><DT
15258 >24.1. <A
15259 HREF="#AEN3175"
15260 >Macintosh clients?</A
15261 ></DT
15262 ><DT
15263 >24.2. <A
15264 HREF="#AEN3184"
15265 >OS2 Client</A
15266 ></DT
15267 ><DD
15268 ><DL
15269 ><DT
15270 >24.2.1. <A
15271 HREF="#AEN3186"
15272 >How can I configure OS/2 Warp Connect or 
15273                 OS/2 Warp 4 as a client for Samba?</A
15274 ></DT
15275 ><DT
15276 >24.2.2. <A
15277 HREF="#AEN3201"
15278 >How can I configure OS/2 Warp 3 (not Connect), 
15279                 OS/2 1.2, 1.3 or 2.x for Samba?</A
15280 ></DT
15281 ><DT
15282 >24.2.3. <A
15283 HREF="#AEN3210"
15284 >Are there any other issues when OS/2 (any version) 
15285                 is used as a client?</A
15286 ></DT
15287 ><DT
15288 >24.2.4. <A
15289 HREF="#AEN3214"
15290 >How do I get printer driver download working 
15291                 for OS/2 clients?</A
15292 ></DT
15293 ></DL
15294 ></DD
15295 ><DT
15296 >24.3. <A
15297 HREF="#AEN3224"
15298 >Windows for Workgroups</A
15299 ></DT
15300 ><DD
15301 ><DL
15302 ><DT
15303 >24.3.1. <A
15304 HREF="#AEN3226"
15305 >Use latest TCP/IP stack from Microsoft</A
15306 ></DT
15307 ><DT
15308 >24.3.2. <A
15309 HREF="#AEN3231"
15310 >Delete .pwl files after password change</A
15311 ></DT
15312 ><DT
15313 >24.3.3. <A
15314 HREF="#AEN3236"
15315 >Configure WfW password handling</A
15316 ></DT
15317 ><DT
15318 >24.3.4. <A
15319 HREF="#AEN3240"
15320 >Case handling of passwords</A
15321 ></DT
15322 ></DL
15323 ></DD
15324 ><DT
15325 >24.4. <A
15326 HREF="#AEN3245"
15327 >Windows '95/'98</A
15328 ></DT
15329 ><DT
15330 >24.5. <A
15331 HREF="#AEN3261"
15332 >Windows 2000 Service Pack 2</A
15333 ></DT
15334 ></DL
15335 ></DD
15336 ><DT
15337 >25. <A
15338 HREF="#BUGREPORT"
15339 >Reporting Bugs</A
15340 ></DT
15341 ><DD
15342 ><DL
15343 ><DT
15344 >25.1. <A
15345 HREF="#AEN3285"
15346 >Introduction</A
15347 ></DT
15348 ><DT
15349 >25.2. <A
15350 HREF="#AEN3295"
15351 >General info</A
15352 ></DT
15353 ><DT
15354 >25.3. <A
15355 HREF="#AEN3301"
15356 >Debug levels</A
15357 ></DT
15358 ><DT
15359 >25.4. <A
15360 HREF="#AEN3318"
15361 >Internal errors</A
15362 ></DT
15363 ><DT
15364 >25.5. <A
15365 HREF="#AEN3328"
15366 >Attaching to a running process</A
15367 ></DT
15368 ><DT
15369 >25.6. <A
15370 HREF="#AEN3331"
15371 >Patches</A
15372 ></DT
15373 ></DL
15374 ></DD
15375 ><DT
15376 >26. <A
15377 HREF="#DIAGNOSIS"
15378 >Diagnosing your samba server</A
15379 ></DT
15380 ><DD
15381 ><DL
15382 ><DT
15383 >26.1. <A
15384 HREF="#AEN3354"
15385 >Introduction</A
15386 ></DT
15387 ><DT
15388 >26.2. <A
15389 HREF="#AEN3359"
15390 >Assumptions</A
15391 ></DT
15392 ><DT
15393 >26.3. <A
15394 HREF="#AEN3369"
15395 >Tests</A
15396 ></DT
15397 ><DD
15398 ><DL
15399 ><DT
15400 >26.3.1. <A
15401 HREF="#AEN3371"
15402 >Test 1</A
15403 ></DT
15404 ><DT
15405 >26.3.2. <A
15406 HREF="#AEN3377"
15407 >Test 2</A
15408 ></DT
15409 ><DT
15410 >26.3.3. <A
15411 HREF="#AEN3383"
15412 >Test 3</A
15413 ></DT
15414 ><DT
15415 >26.3.4. <A
15416 HREF="#AEN3398"
15417 >Test 4</A
15418 ></DT
15419 ><DT
15420 >26.3.5. <A
15421 HREF="#AEN3403"
15422 >Test 5</A
15423 ></DT
15424 ><DT
15425 >26.3.6. <A
15426 HREF="#AEN3409"
15427 >Test 6</A
15428 ></DT
15429 ><DT
15430 >26.3.7. <A
15431 HREF="#AEN3417"
15432 >Test 7</A
15433 ></DT
15434 ><DT
15435 >26.3.8. <A
15436 HREF="#AEN3443"
15437 >Test 8</A
15438 ></DT
15439 ><DT
15440 >26.3.9. <A
15441 HREF="#AEN3460"
15442 >Test 9</A
15443 ></DT
15444 ><DT
15445 >26.3.10. <A
15446 HREF="#AEN3468"
15447 >Test 10</A
15448 ></DT
15449 ><DT
15450 >26.3.11. <A
15451 HREF="#AEN3474"
15452 >Test 11</A
15453 ></DT
15454 ></DL
15455 ></DD
15456 ><DT
15457 >26.4. <A
15458 HREF="#AEN3479"
15459 >Still having troubles?</A
15460 ></DT
15461 ></DL
15462 ></DD
15463 ></DL
15464 ></DIV
15465 ></DIV
15466 ><DIV
15467 CLASS="CHAPTER"
15468 ><HR><H1
15469 ><A
15470 NAME="PORTABILITY"
15471 ></A
15472 >Chapter 23. Portability</H1
15473 ><P
15474 >Samba works on a wide range of platforms but the interface all the 
15475 platforms provide is not always compatible. This chapter contains 
15476 platform-specific information about compiling and using samba.</P
15477 ><DIV
15478 CLASS="SECT1"
15479 ><HR><H2
15480 CLASS="SECT1"
15481 ><A
15482 NAME="AEN3115"
15483 ></A
15484 >23.1. HPUX</H2
15485 ><P
15486 >HP's implementation of supplementary groups is, er, non-standard (for
15487 hysterical reasons).  There are two group files, /etc/group and
15488 /etc/logingroup; the system maps UIDs to numbers using the former, but
15489 initgroups() reads the latter.  Most system admins who know the ropes
15490 symlink /etc/group to /etc/logingroup (hard link doesn't work for reasons
15491 too stupid to go into here).  initgroups() will complain if one of the
15492 groups you're in in /etc/logingroup has what it considers to be an invalid
15493 ID, which means outside the range [0..UID_MAX], where UID_MAX is (I think)
15494 60000 currently on HP-UX.  This precludes -2 and 65534, the usual 'nobody'
15495 GIDs.</P
15496 ><P
15497 >If you encounter this problem, make sure that the programs that are failing 
15498 to initgroups() be run as users not in any groups with GIDs outside the 
15499 allowed range.</P
15500 ><P
15501 >This is documented in the HP manual pages under setgroups(2) and passwd(4).</P
15502 ><P
15503 >On HPUX you must use gcc or the HP Ansi compiler. The free compiler
15504 that comes with HP-UX is not Ansi compliant and cannot compile
15505 Samba.</P
15506 ></DIV
15507 ><DIV
15508 CLASS="SECT1"
15509 ><HR><H2
15510 CLASS="SECT1"
15511 ><A
15512 NAME="AEN3121"
15513 ></A
15514 >23.2. SCO Unix</H2
15515 ><P
15516
15517 If you run an old version of  SCO Unix then you may need to get important 
15518 TCP/IP patches for Samba to work correctly. Without the patch, you may 
15519 encounter corrupt data transfers using samba.</P
15520 ><P
15521 >The patch you need is UOD385 Connection Drivers SLS. It is available from
15522 SCO (ftp.sco.com, directory SLS, files uod385a.Z and uod385a.ltr.Z).</P
15523 ></DIV
15524 ><DIV
15525 CLASS="SECT1"
15526 ><HR><H2
15527 CLASS="SECT1"
15528 ><A
15529 NAME="AEN3125"
15530 ></A
15531 >23.3. DNIX</H2
15532 ><P
15533 >DNIX has a problem with seteuid() and setegid(). These routines are
15534 needed for Samba to work correctly, but they were left out of the DNIX
15535 C library for some reason.</P
15536 ><P
15537 >For this reason Samba by default defines the macro NO_EID in the DNIX
15538 section of includes.h. This works around the problem in a limited way,
15539 but it is far from ideal, some things still won't work right.</P
15540 ><P
15541
15542 To fix the problem properly you need to assemble the following two
15543 functions and then either add them to your C library or link them into
15544 Samba.</P
15545 ><P
15546
15547 put this in the file <TT
15548 CLASS="FILENAME"
15549 >setegid.s</TT
15550 >:</P
15551 ><P
15552 ><PRE
15553 CLASS="PROGRAMLISTING"
15554 >        .globl  _setegid
15555 _setegid:
15556         moveq   #47,d0
15557         movl    #100,a0
15558         moveq   #1,d1
15559         movl    4(sp),a1
15560         trap    #9
15561         bccs    1$
15562         jmp     cerror
15563 1$:
15564         clrl    d0
15565         rts</PRE
15566 ></P
15567 ><P
15568 >put this in the file <TT
15569 CLASS="FILENAME"
15570 >seteuid.s</TT
15571 >:</P
15572 ><P
15573 ><PRE
15574 CLASS="PROGRAMLISTING"
15575 >        .globl  _seteuid
15576 _seteuid:
15577         moveq   #47,d0
15578         movl    #100,a0
15579         moveq   #0,d1
15580         movl    4(sp),a1
15581         trap    #9
15582         bccs    1$
15583         jmp     cerror
15584 1$:
15585         clrl    d0
15586         rts</PRE
15587 ></P
15588 ><P
15589 >after creating the above files you then assemble them using</P
15590 ><P
15591 ><B
15592 CLASS="COMMAND"
15593 >as seteuid.s</B
15594 ></P
15595 ><P
15596 ><B
15597 CLASS="COMMAND"
15598 >as setegid.s</B
15599 ></P
15600 ><P
15601 >that should produce the files <TT
15602 CLASS="FILENAME"
15603 >seteuid.o</TT
15604 > and 
15605 <TT
15606 CLASS="FILENAME"
15607 >setegid.o</TT
15608 ></P
15609 ><P
15610 >then you need to add these to the LIBSM line in the DNIX section of
15611 the Samba Makefile. Your LIBSM line will then look something like this:</P
15612 ><P
15613 ><PRE
15614 CLASS="PROGRAMLISTING"
15615 >LIBSM = setegid.o seteuid.o -ln</PRE
15616 ></P
15617 ><P
15618
15619 You should then remove the line:</P
15620 ><P
15621 ><PRE
15622 CLASS="PROGRAMLISTING"
15623 >#define NO_EID</PRE
15624 ></P
15625 ><P
15626 >from the DNIX section of <TT
15627 CLASS="FILENAME"
15628 >includes.h</TT
15629 ></P
15630 ></DIV
15631 ><DIV
15632 CLASS="SECT1"
15633 ><HR><H2
15634 CLASS="SECT1"
15635 ><A
15636 NAME="AEN3154"
15637 ></A
15638 >23.4. RedHat Linux Rembrandt-II</H2
15639 ><P
15640 >By default RedHat Rembrandt-II during installation adds an
15641 entry to /etc/hosts as follows:
15642 <PRE
15643 CLASS="PROGRAMLISTING"
15644 >       127.0.0.1 loopback "hostname"."domainname"</PRE
15645 ></P
15646 ><P
15647 >This causes Samba to loop back onto the loopback interface.
15648 The result is that Samba fails to communicate correctly with
15649 the world and therefor may fail to correctly negotiate who
15650 is the master browse list holder and who is the master browser.</P
15651 ><P
15652 >Corrective Action:     Delete the entry after the word loopback
15653         in the line starting 127.0.0.1</P
15654 ></DIV
15655 ></DIV
15656 ><DIV
15657 CLASS="CHAPTER"
15658 ><HR><H1
15659 ><A
15660 NAME="OTHER-CLIENTS"
15661 ></A
15662 >Chapter 24. Samba and other CIFS clients</H1
15663 ><P
15664 >This chapter contains client-specific information.</P
15665 ><DIV
15666 CLASS="SECT1"
15667 ><HR><H2
15668 CLASS="SECT1"
15669 ><A
15670 NAME="AEN3175"
15671 ></A
15672 >24.1. Macintosh clients?</H2
15673 ><P
15674 >Yes. <A
15675 HREF="http://www.thursby.com/"
15676 TARGET="_top"
15677 >Thursby</A
15678 > now have a CIFS Client / Server called DAVE - see</P
15679 ><P
15680 >They test it against Windows 95, Windows NT and samba for
15681 compatibility issues.  At the time of writing, DAVE was at version
15682 1.0.1. The 1.0.0 to 1.0.1 update is available as a free download from
15683 the Thursby web site (the speed of finder copies has been greatly
15684 enhanced, and there are bug-fixes included).</P
15685 ><P
15686
15687 Alternatives - There are two free implementations of AppleTalk for
15688 several kinds of UNIX machnes, and several more commercial ones.
15689 These products allow you to run file services and print services
15690 natively to Macintosh users, with no additional support required on
15691 the Macintosh.  The two free omplementations are 
15692 <A
15693 HREF="http://www.umich.edu/~rsug/netatalk/"
15694 TARGET="_top"
15695 >Netatalk</A
15696 >, and 
15697 <A
15698 HREF="http://www.cs.mu.oz.au/appletalk/atalk.html"
15699 TARGET="_top"
15700 >CAP</A
15701 >.  
15702 What Samba offers MS
15703 Windows users, these packages offer to Macs.  For more info on these
15704 packages, Samba, and Linux (and other UNIX-based systems) see
15705 <A
15706 HREF="http://www.eats.com/linux_mac_win.html"
15707 TARGET="_top"
15708 >http://www.eats.com/linux_mac_win.html</A
15709 ></P
15710 ></DIV
15711 ><DIV
15712 CLASS="SECT1"
15713 ><HR><H2
15714 CLASS="SECT1"
15715 ><A
15716 NAME="AEN3184"
15717 ></A
15718 >24.2. OS2 Client</H2
15719 ><DIV
15720 CLASS="SECT2"
15721 ><H3
15722 CLASS="SECT2"
15723 ><A
15724 NAME="AEN3186"
15725 ></A
15726 >24.2.1. How can I configure OS/2 Warp Connect or 
15727                 OS/2 Warp 4 as a client for Samba?</H3
15728 ><P
15729 >A more complete answer to this question can be 
15730                 found on <A
15731 HREF="http://carol.wins.uva.nl/~leeuw/samba/warp.html"
15732 TARGET="_top"
15733 >               http://carol.wins.uva.nl/~leeuw/samba/warp.html</A
15734 >.</P
15735 ><P
15736 >Basically, you need three components:</P
15737 ><P
15738 ></P
15739 ><UL
15740 ><LI
15741 ><P
15742 >The File and Print Client ('IBM Peer')
15743                         </P
15744 ></LI
15745 ><LI
15746 ><P
15747 >TCP/IP ('Internet support') 
15748                         </P
15749 ></LI
15750 ><LI
15751 ><P
15752 >The "NetBIOS over TCP/IP" driver ('TCPBEUI')
15753                         </P
15754 ></LI
15755 ></UL
15756 ><P
15757 >Installing the first two together with the base operating 
15758                 system on a blank system is explained in the Warp manual. If Warp 
15759                 has already been installed, but you now want to install the 
15760                 networking support, use the "Selective Install for Networking" 
15761                 object in the "System Setup" folder.</P
15762 ><P
15763 >Adding the "NetBIOS over TCP/IP" driver is not described 
15764                 in the manual and just barely in the online documentation. Start 
15765                 MPTS.EXE, click on OK, click on "Configure LAPS" and click 
15766                 on "IBM OS/2 NETBIOS OVER TCP/IP" in  'Protocols'.  This line 
15767                 is then moved to 'Current Configuration'. Select that line, 
15768                 click on "Change number" and increase it from 0 to 1. Save this
15769                 configuration.</P
15770 ><P
15771 >If the Samba server(s) is not on your local subnet, you 
15772                 can optionally add IP names and addresses of these servers 
15773                 to the "Names List", or specify a  WINS server ('NetBIOS 
15774                 Nameserver' in IBM and RFC terminology). For Warp Connect you 
15775                 may need to download an update for 'IBM Peer' to bring it on 
15776                 the same level as Warp 4. See the webpage mentioned above.</P
15777 ></DIV
15778 ><DIV
15779 CLASS="SECT2"
15780 ><HR><H3
15781 CLASS="SECT2"
15782 ><A
15783 NAME="AEN3201"
15784 ></A
15785 >24.2.2. How can I configure OS/2 Warp 3 (not Connect), 
15786                 OS/2 1.2, 1.3 or 2.x for Samba?</H3
15787 ><P
15788 >You can use the free Microsoft LAN Manager 2.2c Client 
15789                 for OS/2 from 
15790                 <A
15791 HREF="ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/"
15792 TARGET="_top"
15793 >               ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/</A
15794 >.
15795         See <A
15796 HREF="http://carol.wins.uva.nl/~leeuw/lanman.html"
15797 TARGET="_top"
15798 >               http://carol.wins.uva.nl/~leeuw/lanman.html</A
15799 > for 
15800                 more information on how to install and use this client. In 
15801                 a nutshell, edit the file \OS2VER in the root directory of 
15802                 the OS/2 boot partition and add the lines:</P
15803 ><P
15804 ><PRE
15805 CLASS="PROGRAMLISTING"
15806 >               20=setup.exe
15807                 20=netwksta.sys
15808                 20=netvdd.sys
15809                 </PRE
15810 ></P
15811 ><P
15812 >before you install the client. Also, don't use the 
15813                 included NE2000 driver because it is buggy. Try the NE2000 
15814                 or NS2000 driver from 
15815                 <A
15816 HREF="ftp://ftp.cdrom.com/pub/os2/network/ndis/"
15817 TARGET="_top"
15818 >               ftp://ftp.cdrom.com/pub/os2/network/ndis/</A
15819 > instead.
15820                 </P
15821 ></DIV
15822 ><DIV
15823 CLASS="SECT2"
15824 ><HR><H3
15825 CLASS="SECT2"
15826 ><A
15827 NAME="AEN3210"
15828 ></A
15829 >24.2.3. Are there any other issues when OS/2 (any version) 
15830                 is used as a client?</H3
15831 ><P
15832 >When you do a NET VIEW or use the "File and Print 
15833                 Client Resource Browser", no Samba servers show up. This can 
15834                 be fixed by a patch from <A
15835 HREF="http://carol.wins.uva.nl/~leeuw/samba/fix.html"
15836 TARGET="_top"
15837 >               http://carol.wins.uva.nl/~leeuw/samba/fix.html</A
15838 >.
15839                 The patch will be included in a later version of Samba. It also 
15840                 fixes a couple of other problems, such as preserving long 
15841                 filenames when objects are dragged from the Workplace Shell 
15842                 to the Samba server. </P
15843 ></DIV
15844 ><DIV
15845 CLASS="SECT2"
15846 ><HR><H3
15847 CLASS="SECT2"
15848 ><A
15849 NAME="AEN3214"
15850 ></A
15851 >24.2.4. How do I get printer driver download working 
15852                 for OS/2 clients?</H3
15853 ><P
15854 >First, create a share called [PRINTDRV] that is 
15855                 world-readable.  Copy your OS/2 driver files there.  Note 
15856                 that the .EA_ files must still be separate, so you will need 
15857                 to use the original install files, and not copy an installed 
15858                 driver from an OS/2 system.</P
15859 ><P
15860 >Install the NT driver first for that printer.  Then, 
15861                 add to your smb.conf a parameter, os2 driver map = 
15862                 <TT
15863 CLASS="REPLACEABLE"
15864 ><I
15865 >filename</I
15866 ></TT
15867 >".  Then, in the file 
15868                 specified by <TT
15869 CLASS="REPLACEABLE"
15870 ><I
15871 >filename</I
15872 ></TT
15873 >, map the 
15874                 name of the NT driver name to the OS/2 driver name as 
15875                 follows:</P
15876 ><P
15877 ><B
15878 CLASS="COMMAND"
15879 >nt driver name = os2 "driver 
15880                 name"."device name"</B
15881 >, e.g.:
15882                 HP LaserJet 5L = LASERJET.HP LaserJet 5L</P
15883 ><P
15884 >You can have multiple drivers mapped in this file.</P
15885 ><P
15886 >If you only specify the OS/2 driver name, and not the 
15887                 device name, the first attempt to download the driver will 
15888                 actually download the files, but the OS/2 client will tell 
15889                 you the driver is not available.  On the second attempt, it 
15890                 will work.  This is fixed simply by adding the device name
15891                  to the mapping, after which it will work on the first attempt.
15892                 </P
15893 ></DIV
15894 ></DIV
15895 ><DIV
15896 CLASS="SECT1"
15897 ><HR><H2
15898 CLASS="SECT1"
15899 ><A
15900 NAME="AEN3224"
15901 ></A
15902 >24.3. Windows for Workgroups</H2
15903 ><DIV
15904 CLASS="SECT2"
15905 ><H3
15906 CLASS="SECT2"
15907 ><A
15908 NAME="AEN3226"
15909 ></A
15910 >24.3.1. Use latest TCP/IP stack from Microsoft</H3
15911 ><P
15912 >Use the latest TCP/IP stack from microsoft if you use Windows
15913 for workgroups.</P
15914 ><P
15915 >The early TCP/IP stacks had lots of bugs.</P
15916 ><P
15917
15918 Microsoft has released an incremental upgrade to their TCP/IP 32-Bit
15919 VxD drivers.  The latest release can be found on their ftp site at
15920 ftp.microsoft.com, located in /peropsys/windows/public/tcpip/wfwt32.exe.
15921 There is an update.txt file there that describes the problems that were
15922 fixed.  New files include WINSOCK.DLL, TELNET.EXE, WSOCK.386, VNBT.386,
15923 WSTCP.386, TRACERT.EXE, NETSTAT.EXE, and NBTSTAT.EXE.</P
15924 ></DIV
15925 ><DIV
15926 CLASS="SECT2"
15927 ><HR><H3
15928 CLASS="SECT2"
15929 ><A
15930 NAME="AEN3231"
15931 ></A
15932 >24.3.2. Delete .pwl files after password change</H3
15933 ><P
15934 >WfWg does a lousy job with passwords. I find that if I change my
15935 password on either the unix box or the PC the safest thing to do is to
15936 delete the .pwl files in the windows directory. The PC will complain about not finding the files, but will soon get over it, allowing you to enter the new password.</P
15937 ><P
15938
15939 If you don't do this you may find that WfWg remembers and uses the old
15940 password, even if you told it a new one.</P
15941 ><P
15942
15943 Often WfWg will totally ignore a password you give it in a dialog box.</P
15944 ></DIV
15945 ><DIV
15946 CLASS="SECT2"
15947 ><HR><H3
15948 CLASS="SECT2"
15949 ><A
15950 NAME="AEN3236"
15951 ></A
15952 >24.3.3. Configure WfW password handling</H3
15953 ><P
15954 >There is a program call admincfg.exe
15955 on the last disk (disk 8) of the WFW 3.11 disk set.  To install it
15956 type EXPAND A:\ADMINCFG.EX_ C:\WINDOWS\ADMINCFG.EXE Then add an icon
15957 for it via the "Progam Manager" "New" Menu.  This program allows you
15958 to control how WFW handles passwords.  ie disable Password Caching etc
15959 for use with <B
15960 CLASS="COMMAND"
15961 >security = user</B
15962 ></P
15963 ></DIV
15964 ><DIV
15965 CLASS="SECT2"
15966 ><HR><H3
15967 CLASS="SECT2"
15968 ><A
15969 NAME="AEN3240"
15970 ></A
15971 >24.3.4. Case handling of passwords</H3
15972 ><P
15973 >Windows for Workgroups uppercases the password before sending it to the server. Unix passwords can be case-sensitive though. Check the <A
15974 HREF="smb.conf.5.html"
15975 TARGET="_top"
15976 >smb.conf(5)</A
15977 > information on <B
15978 CLASS="COMMAND"
15979 >password level</B
15980 > to specify what characters samba should try to uppercase when checking.</P
15981 ></DIV
15982 ></DIV
15983 ><DIV
15984 CLASS="SECT1"
15985 ><HR><H2
15986 CLASS="SECT1"
15987 ><A
15988 NAME="AEN3245"
15989 ></A
15990 >24.4. Windows '95/'98</H2
15991 ><P
15992 >When using Windows 95 OEM SR2 the following updates are recommended where Samba
15993 is being used. Please NOTE that the above change will affect you once these
15994 updates  have been installed.</P
15995 ><P
15996
15997 There are more updates than the ones mentioned here. You are referred to the
15998 Microsoft Web site for all currently available updates to your specific version
15999 of Windows 95.</P
16000 ><P
16001 ></P
16002 ><OL
16003 TYPE="1"
16004 ><LI
16005 ><P
16006 >Kernel Update: KRNLUPD.EXE</P
16007 ></LI
16008 ><LI
16009 ><P
16010 >Ping Fix: PINGUPD.EXE</P
16011 ></LI
16012 ><LI
16013 ><P
16014 >RPC Update: RPCRTUPD.EXE</P
16015 ></LI
16016 ><LI
16017 ><P
16018 >TCP/IP Update: VIPUPD.EXE</P
16019 ></LI
16020 ><LI
16021 ><P
16022 >Redirector Update: VRDRUPD.EXE</P
16023 ></LI
16024 ></OL
16025 ><P
16026 >Also, if using MS OutLook it is desirable to install the OLEUPD.EXE fix. This
16027 fix may stop your machine from hanging for an extended period when exiting
16028 OutLook and you may also notice a significant speedup when accessing network
16029 neighborhood services.</P
16030 ></DIV
16031 ><DIV
16032 CLASS="SECT1"
16033 ><HR><H2
16034 CLASS="SECT1"
16035 ><A
16036 NAME="AEN3261"
16037 ></A
16038 >24.5. Windows 2000 Service Pack 2</H2
16039 ><P
16040
16041 There are several annoyances with Windows 2000 SP2. One of which
16042 only appears when using a Samba server to host user profiles
16043 to Windows 2000 SP2 clients in a Windows domain.  This assumes
16044 that Samba is a member of the domain, but the problem will
16045 likely occur if it is not.</P
16046 ><P
16047
16048 In order to server profiles successfully to Windows 2000 SP2 
16049 clients (when not operating as a PDC), Samba must have 
16050 <B
16051 CLASS="COMMAND"
16052 >nt acl support = no</B
16053 >
16054 added to the file share which houses the roaming profiles.
16055 If this is not done, then the Windows 2000 SP2 client will
16056 complain about not being able to access the profile (Access 
16057 Denied) and create multiple copies of it on disk (DOMAIN.user.001,
16058 DOMAIN.user.002, etc...).  See the 
16059 <A
16060 HREF="smb.conf.5.html"
16061 TARGET="_top"
16062 >smb.conf(5)</A
16063 > man page
16064 for more details on this option.  Also note that the 
16065 <B
16066 CLASS="COMMAND"
16067 >nt acl support</B
16068 > parameter was formally a global parameter in
16069 releases prior to Samba 2.2.2.</P
16070 ><P
16071
16072 The following is a minimal profile share:</P
16073 ><P
16074 ><PRE
16075 CLASS="PROGRAMLISTING"
16076 >       [profile]
16077                 path = /export/profile
16078                 create mask = 0600
16079                 directory mask = 0700
16080                 nt acl support = no
16081                 read only = no</PRE
16082 ></P
16083 ><P
16084 >The reason for this bug is that the Win2k SP2 client copies
16085 the security descriptor for the profile which contains
16086 the Samba server's SID, and not the domain SID.  The client
16087 compares the SID for SAMBA\user and realizes it is
16088 different that the one assigned to DOMAIN\user.  Hence the reason
16089 for the "access denied" message.</P
16090 ><P
16091 >By disabling the <B
16092 CLASS="COMMAND"
16093 >nt acl support</B
16094 > parameter, Samba will send
16095 the Win2k client a response to the QuerySecurityDescriptor
16096 trans2 call which causes the client to set a default ACL
16097 for the profile. This default ACL includes </P
16098 ><P
16099 ><B
16100 CLASS="COMMAND"
16101 >DOMAIN\user    "Full Control"</B
16102 ></P
16103 ><P
16104 ><SPAN
16105 CLASS="emphasis"
16106 ><I
16107 CLASS="EMPHASIS"
16108 >NOTE : This bug does not occur when using winbind to
16109 create accounts on the Samba host for Domain users.</I
16110 ></SPAN
16111 ></P
16112 ></DIV
16113 ></DIV
16114 ><DIV
16115 CLASS="CHAPTER"
16116 ><HR><H1
16117 ><A
16118 NAME="BUGREPORT"
16119 ></A
16120 >Chapter 25. Reporting Bugs</H1
16121 ><DIV
16122 CLASS="SECT1"
16123 ><H2
16124 CLASS="SECT1"
16125 ><A
16126 NAME="AEN3285"
16127 ></A
16128 >25.1. Introduction</H2
16129 ><P
16130 >The email address for bug reports for stable releases is <A
16131 HREF="samba@samba.org"
16132 TARGET="_top"
16133 >samba@samba.org</A
16134 >. 
16135 Bug reports for alpha releases should go to <A
16136 HREF="mailto:samba-technical@samba.org"
16137 TARGET="_top"
16138 >samba-technical@samba.org</A
16139 >.</P
16140 ><P
16141 >Please take the time to read this file before you submit a bug
16142 report. Also, please see if it has changed between releases, as we
16143 may be changing the bug reporting mechanism at some time.</P
16144 ><P
16145 >Please also do as much as you can yourself to help track down the
16146 bug. Samba is maintained by a dedicated group of people who volunteer
16147 their time, skills and efforts. We receive far more mail about it than
16148 we can possibly answer, so you have a much higher chance of an answer
16149 and a fix if you send us a "developer friendly" bug report that lets
16150 us fix it fast. </P
16151 ><P
16152 >Do not assume that if you post the bug to the comp.protocols.smb
16153 newsgroup or the mailing list that we will read it. If you suspect that your 
16154 problem is not a bug but a configuration problem then it is better to send 
16155 it to the Samba mailing list, as there are (at last count) 5000 other users on
16156 that list that may be able to help you.</P
16157 ><P
16158 >You may also like to look though the recent mailing list archives,
16159 which are conveniently accessible on the Samba web pages
16160 at <A
16161 HREF="http://samba.org/samba/"
16162 TARGET="_top"
16163 >http://samba.org/samba/</A
16164 >.</P
16165 ></DIV
16166 ><DIV
16167 CLASS="SECT1"
16168 ><HR><H2
16169 CLASS="SECT1"
16170 ><A
16171 NAME="AEN3295"
16172 ></A
16173 >25.2. General info</H2
16174 ><P
16175 >Before submitting a bug report check your config for silly
16176 errors. Look in your log files for obvious messages that tell you that
16177 you've misconfigured something and run testparm to test your config
16178 file for correct syntax.</P
16179 ><P
16180 >Have you run through the <A
16181 HREF="Diagnosis.html"
16182 TARGET="_top"
16183 >diagnosis</A
16184 >? 
16185 This is very important.</P
16186 ><P
16187 >If you include part of a log file with your bug report then be sure to
16188 annotate it with exactly what you were doing on the client at the
16189 time, and exactly what the results were.</P
16190 ></DIV
16191 ><DIV
16192 CLASS="SECT1"
16193 ><HR><H2
16194 CLASS="SECT1"
16195 ><A
16196 NAME="AEN3301"
16197 ></A
16198 >25.3. Debug levels</H2
16199 ><P
16200 >If the bug has anything to do with Samba behaving incorrectly as a
16201 server (like refusing to open a file) then the log files will probably
16202 be very useful. Depending on the problem a log level of between 3 and
16203 10 showing the problem may be appropriate. A higher level givesmore
16204 detail, but may use too much disk space.</P
16205 ><P
16206 >To set the debug level use <B
16207 CLASS="COMMAND"
16208 >log level =</B
16209 > in your 
16210 <TT
16211 CLASS="FILENAME"
16212 >smb.conf</TT
16213 >. You may also find it useful to set the log 
16214 level higher for just one machine and keep separate logs for each machine. 
16215 To do this use:</P
16216 ><P
16217 ><PRE
16218 CLASS="PROGRAMLISTING"
16219 >log level = 10
16220 log file = /usr/local/samba/lib/log.%m
16221 include = /usr/local/samba/lib/smb.conf.%m</PRE
16222 ></P
16223 ><P
16224 >then create a file 
16225 <TT
16226 CLASS="FILENAME"
16227 >/usr/local/samba/lib/smb.conf.machine</TT
16228 > where
16229 "machine" is the name of the client you wish to debug. In that file
16230 put any smb.conf commands you want, for example 
16231 <B
16232 CLASS="COMMAND"
16233 >log level=</B
16234 > may be useful. This also allows you to 
16235 experiment with different security systems, protocol levels etc on just 
16236 one machine.</P
16237 ><P
16238 >The <TT
16239 CLASS="FILENAME"
16240 >smb.conf</TT
16241 > entry <B
16242 CLASS="COMMAND"
16243 >log level =</B
16244
16245 is synonymous with the entry <B
16246 CLASS="COMMAND"
16247 >debuglevel =</B
16248 > that has been 
16249 used in older versions of Samba and is being retained for backwards 
16250 compatibility of smb.conf files.</P
16251 ><P
16252 >As the <B
16253 CLASS="COMMAND"
16254 >log level =</B
16255 > value is increased you will record 
16256 a significantly increasing level of debugging information. For most 
16257 debugging operations you may not need a setting higher than 3. Nearly 
16258 all bugs can be tracked at a setting of 10, but be prepared for a VERY 
16259 large volume of log data.</P
16260 ></DIV
16261 ><DIV
16262 CLASS="SECT1"
16263 ><HR><H2
16264 CLASS="SECT1"
16265 ><A
16266 NAME="AEN3318"
16267 ></A
16268 >25.4. Internal errors</H2
16269 ><P
16270 >If you get a "INTERNAL ERROR" message in your log files it means that
16271 Samba got an unexpected signal while running. It is probably a
16272 segmentation fault and almost certainly means a bug in Samba (unless
16273 you have faulty hardware or system software)</P
16274 ><P
16275 >If the message came from smbd then it will probably be accompanied by
16276 a message which details the last SMB message received by smbd. This
16277 info is often very useful in tracking down the problem so please
16278 include it in your bug report.</P
16279 ><P
16280 >You should also detail how to reproduce the problem, if
16281 possible. Please make this reasonably detailed.</P
16282 ><P
16283 >You may also find that a core file appeared in a "corefiles"
16284 subdirectory of the directory where you keep your samba log
16285 files. This file is the most useful tool for tracking down the bug. To
16286 use it you do this:</P
16287 ><P
16288 ><B
16289 CLASS="COMMAND"
16290 >gdb smbd core</B
16291 ></P
16292 ><P
16293 >adding appropriate paths to smbd and core so gdb can find them. If you
16294 don't have gdb then try "dbx". Then within the debugger use the
16295 command "where" to give a stack trace of where the problem
16296 occurred. Include this in your mail.</P
16297 ><P
16298 >If you known any assembly language then do a "disass" of the routine
16299 where the problem occurred (if its in a library routine then
16300 disassemble the routine that called it) and try to work out exactly
16301 where the problem is by looking at the surrounding code. Even if you
16302 don't know assembly then incuding this info in the bug report can be
16303 useful. </P
16304 ></DIV
16305 ><DIV
16306 CLASS="SECT1"
16307 ><HR><H2
16308 CLASS="SECT1"
16309 ><A
16310 NAME="AEN3328"
16311 ></A
16312 >25.5. Attaching to a running process</H2
16313 ><P
16314 >Unfortunately some unixes (in particular some recent linux kernels)
16315 refuse to dump a core file if the task has changed uid (which smbd
16316 does often). To debug with this sort of system you could try to attach
16317 to the running process using "gdb smbd PID" where you get PID from
16318 smbstatus. Then use "c" to continue and try to cause the core dump
16319 using the client. The debugger should catch the fault and tell you
16320 where it occurred.</P
16321 ></DIV
16322 ><DIV
16323 CLASS="SECT1"
16324 ><HR><H2
16325 CLASS="SECT1"
16326 ><A
16327 NAME="AEN3331"
16328 ></A
16329 >25.6. Patches</H2
16330 ><P
16331 >The best sort of bug report is one that includes a fix! If you send us
16332 patches please use <B
16333 CLASS="COMMAND"
16334 >diff -u</B
16335 > format if your version of 
16336 diff supports it, otherwise use <B
16337 CLASS="COMMAND"
16338 >diff -c4</B
16339 >. Make sure 
16340 your do the diff against a clean version of the source and let me know 
16341 exactly what version you used. </P
16342 ></DIV
16343 ></DIV
16344 ><DIV
16345 CLASS="CHAPTER"
16346 ><HR><H1
16347 ><A
16348 NAME="DIAGNOSIS"
16349 ></A
16350 >Chapter 26. Diagnosing your samba server</H1
16351 ><DIV
16352 CLASS="SECT1"
16353 ><H2
16354 CLASS="SECT1"
16355 ><A
16356 NAME="AEN3354"
16357 ></A
16358 >26.1. Introduction</H2
16359 ><P
16360 >This file contains a list of tests you can perform to validate your
16361 Samba server. It also tells you what the likely cause of the problem
16362 is if it fails any one of these steps. If it passes all these tests
16363 then it is probably working fine.</P
16364 ><P
16365 >You should do ALL the tests, in the order shown. We have tried to
16366 carefully choose them so later tests only use capabilities verified in
16367 the earlier tests.</P
16368 ><P
16369 >If you send one of the samba mailing lists  an email saying "it doesn't work"
16370 and you have not followed this test procedure then you should not be surprised
16371 your email is ignored.</P
16372 ></DIV
16373 ><DIV
16374 CLASS="SECT1"
16375 ><HR><H2
16376 CLASS="SECT1"
16377 ><A
16378 NAME="AEN3359"
16379 ></A
16380 >26.2. Assumptions</H2
16381 ><P
16382 >In all of the tests it is assumed you have a Samba server called 
16383 BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP.</P
16384 ><P
16385 >The procedure is similar for other types of clients.</P
16386 ><P
16387 >It is also assumed you know the name of an available share in your
16388 smb.conf. I will assume this share is called "tmp". You can add a
16389 "tmp" share like by adding the following to smb.conf:</P
16390 ><P
16391 ><PRE
16392 CLASS="PROGRAMLISTING"
16393 >&#13;[tmp]
16394  comment = temporary files 
16395  path = /tmp
16396  read only = yes&#13;</PRE
16397 ></P
16398 ><P
16399 >THESE TESTS ASSUME VERSION 3.0.0 OR LATER OF THE SAMBA SUITE. SOME
16400 COMMANDS SHOWN DID NOT EXIST IN EARLIER VERSIONS</P
16401 ><P
16402 >Please pay attention to the error messages you receive. If any error message
16403 reports that your server is being unfriendly you should first check that you
16404 IP name resolution is correctly set up. eg: Make sure your /etc/resolv.conf
16405 file points to name servers that really do exist.</P
16406 ><P
16407 >Also, if you do not have DNS server access for name resolution please check
16408 that the settings for your smb.conf file results in "dns proxy = no". The
16409 best way to check this is with "testparm smb.conf"</P
16410 ></DIV
16411 ><DIV
16412 CLASS="SECT1"
16413 ><HR><H2
16414 CLASS="SECT1"
16415 ><A
16416 NAME="AEN3369"
16417 ></A
16418 >26.3. Tests</H2
16419 ><DIV
16420 CLASS="SECT2"
16421 ><H3
16422 CLASS="SECT2"
16423 ><A
16424 NAME="AEN3371"
16425 ></A
16426 >26.3.1. Test 1</H3
16427 ><P
16428 >In the directory in which you store your smb.conf file, run the command
16429 "testparm smb.conf". If it reports any errors then your smb.conf
16430 configuration file is faulty.</P
16431 ><P
16432 >Note:  Your smb.conf file may be located in: <TT
16433 CLASS="FILENAME"
16434 >/etc/samba</TT
16435 >
16436         Or in:   <TT
16437 CLASS="FILENAME"
16438 >/usr/local/samba/lib</TT
16439 ></P
16440 ></DIV
16441 ><DIV
16442 CLASS="SECT2"
16443 ><HR><H3
16444 CLASS="SECT2"
16445 ><A
16446 NAME="AEN3377"
16447 ></A
16448 >26.3.2. Test 2</H3
16449 ><P
16450 >Run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from
16451 the unix box. If you don't get a valid response then your TCP/IP
16452 software is not correctly installed. </P
16453 ><P
16454 >Note that you will need to start a "dos prompt" window on the PC to
16455 run ping.</P
16456 ><P
16457 >If you get a message saying "host not found" or similar then your DNS
16458 software or /etc/hosts file is not correctly setup. It is possible to
16459 run samba without DNS entries for the server and client, but I assume
16460 you do have correct entries for the remainder of these tests. </P
16461 ><P
16462 >Another reason why ping might fail is if your host is running firewall 
16463 software. You will need to relax the rules to let in the workstation
16464 in question, perhaps by allowing access from another subnet (on Linux
16465 this is done via the ipfwadm program.)</P
16466 ></DIV
16467 ><DIV
16468 CLASS="SECT2"
16469 ><HR><H3
16470 CLASS="SECT2"
16471 ><A
16472 NAME="AEN3383"
16473 ></A
16474 >26.3.3. Test 3</H3
16475 ><P
16476 >Run the command "smbclient -L BIGSERVER" on the unix box. You
16477 should get a list of available shares back. </P
16478 ><P
16479 >If you get a error message containing the string "Bad password" then
16480 you probably have either an incorrect "hosts allow", "hosts deny" or
16481 "valid users" line in your smb.conf, or your guest account is not
16482 valid. Check what your guest account is using "testparm" and
16483 temporarily remove any "hosts allow", "hosts deny", "valid users" or
16484 "invalid users" lines.</P
16485 ><P
16486 >If you get a "connection refused" response then the smbd server may
16487 not be running. If you installed it in inetd.conf then you probably edited
16488 that file incorrectly. If you installed it as a daemon then check that
16489 it is running, and check that the netbios-ssn port is in a LISTEN
16490 state using "netstat -a".</P
16491 ><P
16492 >If you get a "session request failed" then the server refused the
16493 connection. If it says "Your server software is being unfriendly" then
16494 its probably because you have invalid command line parameters to smbd,
16495 or a similar fatal problem with the initial startup of smbd. Also
16496 check your config file (smb.conf) for syntax errors with "testparm"
16497 and that the various directories where samba keeps its log and lock
16498 files exist.</P
16499 ><P
16500 >There are a number of reasons for which smbd may refuse or decline
16501 a session request. The most common of these involve one or more of
16502 the following smb.conf file entries:</P
16503 ><P
16504 ><PRE
16505 CLASS="PROGRAMLISTING"
16506 >       hosts deny = ALL
16507         hosts allow = xxx.xxx.xxx.xxx/yy
16508         bind interfaces only = Yes</PRE
16509 ></P
16510 ><P
16511 >In the above, no allowance has been made for any session requests that
16512 will automatically translate to the loopback adaptor address 127.0.0.1.
16513 To solve this problem change these lines to:</P
16514 ><P
16515 ><PRE
16516 CLASS="PROGRAMLISTING"
16517 >       hosts deny = ALL
16518         hosts allow = xxx.xxx.xxx.xxx/yy 127.</PRE
16519 ></P
16520 ><P
16521 >Do NOT use the "bind interfaces only" parameter where you may wish to
16522 use the samba password change facility, or where smbclient may need to
16523 access local service for name resolution or for local resource
16524 connections. (Note: the "bind interfaces only" parameter deficiency
16525 where it will not allow connections to the loopback address will be
16526 fixed soon).</P
16527 ><P
16528 >Another common cause of these two errors is having something already running 
16529 on port 139, such as Samba (ie: smbd is running from inetd already) or
16530 something like Digital's Pathworks. Check your inetd.conf file before trying
16531 to start smbd as a daemon, it can avoid a lot of frustration!</P
16532 ><P
16533 >And yet another possible cause for failure of TEST 3 is when the subnet mask
16534 and / or broadcast address settings are incorrect. Please check that the
16535 network interface IP Address / Broadcast Address / Subnet Mask settings are
16536 correct and that Samba has correctly noted these in the log.nmb file.</P
16537 ></DIV
16538 ><DIV
16539 CLASS="SECT2"
16540 ><HR><H3
16541 CLASS="SECT2"
16542 ><A
16543 NAME="AEN3398"
16544 ></A
16545 >26.3.4. Test 4</H3
16546 ><P
16547 >Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
16548 IP address of your Samba server back.</P
16549 ><P
16550 >If you don't then nmbd is incorrectly installed. Check your inetd.conf
16551 if you run it from there, or that the daemon is running and listening
16552 to udp port 137.</P
16553 ><P
16554 >One common problem is that many inetd implementations can't take many
16555 parameters on the command line. If this is the case then create a
16556 one-line script that contains the right parameters and run that from
16557 inetd.</P
16558 ></DIV
16559 ><DIV
16560 CLASS="SECT2"
16561 ><HR><H3
16562 CLASS="SECT2"
16563 ><A
16564 NAME="AEN3403"
16565 ></A
16566 >26.3.5. Test 5</H3
16567 ><P
16568 >run the command <B
16569 CLASS="COMMAND"
16570 >nmblookup -B ACLIENT '*'</B
16571 ></P
16572 ><P
16573 >You should get the PCs IP address back. If you don't then the client
16574 software on the PC isn't installed correctly, or isn't started, or you
16575 got the name of the PC wrong. </P
16576 ><P
16577 >If ACLIENT doesn't resolve via DNS then use the IP address of the
16578 client in the above test.</P
16579 ></DIV
16580 ><DIV
16581 CLASS="SECT2"
16582 ><HR><H3
16583 CLASS="SECT2"
16584 ><A
16585 NAME="AEN3409"
16586 ></A
16587 >26.3.6. Test 6</H3
16588 ><P
16589 >Run the command <B
16590 CLASS="COMMAND"
16591 >nmblookup -d 2 '*'</B
16592 ></P
16593 ><P
16594 >This time we are trying the same as the previous test but are trying
16595 it via a broadcast to the default broadcast address. A number of
16596 Netbios/TCPIP hosts on the network should respond, although Samba may
16597 not catch all of the responses in the short time it listens. You
16598 should see "got a positive name query response" messages from several
16599 hosts.</P
16600 ><P
16601 >If this doesn't give a similar result to the previous test then
16602 nmblookup isn't correctly getting your broadcast address through its
16603 automatic mechanism. In this case you should experiment use the
16604 "interfaces" option in smb.conf to manually configure your IP
16605 address, broadcast and netmask. </P
16606 ><P
16607 >If your PC and server aren't on the same subnet then you will need to
16608 use the -B option to set the broadcast address to the that of the PCs
16609 subnet.</P
16610 ><P
16611 >This test will probably fail if your subnet mask and broadcast address are
16612 not correct. (Refer to TEST 3 notes above).</P
16613 ></DIV
16614 ><DIV
16615 CLASS="SECT2"
16616 ><HR><H3
16617 CLASS="SECT2"
16618 ><A
16619 NAME="AEN3417"
16620 ></A
16621 >26.3.7. Test 7</H3
16622 ><P
16623 >Run the command <B
16624 CLASS="COMMAND"
16625 >smbclient //BIGSERVER/TMP</B
16626 >. You should 
16627 then be prompted for a password. You should use the password of the account
16628 you are logged into the unix box with. If you want to test with
16629 another account then add the -U &gt;accountname&lt; option to the end of
16630 the command line.  eg: 
16631 <B
16632 CLASS="COMMAND"
16633 >smbclient //bigserver/tmp -Ujohndoe</B
16634 ></P
16635 ><P
16636 >Note: It is possible to specify the password along with the username
16637 as follows:
16638 <B
16639 CLASS="COMMAND"
16640 >smbclient //bigserver/tmp -Ujohndoe%secret</B
16641 ></P
16642 ><P
16643 >Once you enter the password you should get the "smb&#62;" prompt. If you
16644 don't then look at the error message. If it says "invalid network
16645 name" then the service "tmp" is not correctly setup in your smb.conf.</P
16646 ><P
16647 >If it says "bad password" then the likely causes are:</P
16648 ><P
16649 ></P
16650 ><OL
16651 TYPE="1"
16652 ><LI
16653 ><P
16654 >       you have shadow passords (or some other password system) but didn't
16655         compile in support for them in smbd
16656         </P
16657 ></LI
16658 ><LI
16659 ><P
16660 >       your "valid users" configuration is incorrect
16661         </P
16662 ></LI
16663 ><LI
16664 ><P
16665 >       you have a mixed case password and you haven't enabled the "password
16666         level" option at a high enough level
16667         </P
16668 ></LI
16669 ><LI
16670 ><P
16671 >       the "path =" line in smb.conf is incorrect. Check it with testparm
16672         </P
16673 ></LI
16674 ><LI
16675 ><P
16676 >       you enabled password encryption but didn't create the SMB encrypted
16677         password file
16678         </P
16679 ></LI
16680 ></OL
16681 ><P
16682 >Once connected you should be able to use the commands 
16683 <B
16684 CLASS="COMMAND"
16685 >dir</B
16686 > <B
16687 CLASS="COMMAND"
16688 >get</B
16689 > <B
16690 CLASS="COMMAND"
16691 >put</B
16692 > etc. 
16693 Type <B
16694 CLASS="COMMAND"
16695 >help &gt;command&lt;</B
16696 > for instructions. You should
16697 especially check that the amount of free disk space shown is correct
16698 when you type <B
16699 CLASS="COMMAND"
16700 >dir</B
16701 >.</P
16702 ></DIV
16703 ><DIV
16704 CLASS="SECT2"
16705 ><HR><H3
16706 CLASS="SECT2"
16707 ><A
16708 NAME="AEN3443"
16709 ></A
16710 >26.3.8. Test 8</H3
16711 ><P
16712 >On the PC type the command <B
16713 CLASS="COMMAND"
16714 >net view \\BIGSERVER</B
16715 >. You will 
16716 need to do this from within a "dos prompt" window. You should get back a 
16717 list of available shares on the server.</P
16718 ><P
16719 >If you get a "network name not found" or similar error then netbios
16720 name resolution is not working. This is usually caused by a problem in
16721 nmbd. To overcome it you could do one of the following (you only need
16722 to choose one of them):</P
16723 ><P
16724 ></P
16725 ><OL
16726 TYPE="1"
16727 ><LI
16728 ><P
16729 >       fixup the nmbd installation</P
16730 ></LI
16731 ><LI
16732 ><P
16733 >       add the IP address of BIGSERVER to the "wins server" box in the
16734         advanced tcp/ip setup on the PC.</P
16735 ></LI
16736 ><LI
16737 ><P
16738 >       enable windows name resolution via DNS in the advanced section of
16739         the tcp/ip setup</P
16740 ></LI
16741 ><LI
16742 ><P
16743 >       add BIGSERVER to your lmhosts file on the PC.</P
16744 ></LI
16745 ></OL
16746 ><P
16747 >If you get a "invalid network name" or "bad password error" then the
16748 same fixes apply as they did for the "smbclient -L" test above. In
16749 particular, make sure your "hosts allow" line is correct (see the man
16750 pages)</P
16751 ><P
16752 >Also, do not overlook that fact that when the workstation requests the
16753 connection to the samba server it will attempt to connect using the 
16754 name with which you logged onto your Windows machine. You need to make
16755 sure that an account exists on your Samba server with that exact same
16756 name and password.</P
16757 ><P
16758 >If you get "specified computer is not receiving requests" or similar
16759 it probably means that the host is not contactable via tcp services.
16760 Check to see if the host is running tcp wrappers, and if so add an entry in
16761 the hosts.allow file for your client (or subnet, etc.)</P
16762 ></DIV
16763 ><DIV
16764 CLASS="SECT2"
16765 ><HR><H3
16766 CLASS="SECT2"
16767 ><A
16768 NAME="AEN3460"
16769 ></A
16770 >26.3.9. Test 9</H3
16771 ><P
16772 >Run the command <B
16773 CLASS="COMMAND"
16774 >net use x: \\BIGSERVER\TMP</B
16775 >. You should 
16776 be prompted for a password then you should get a "command completed 
16777 successfully" message. If not then your PC software is incorrectly 
16778 installed or your smb.conf is incorrect. make sure your "hosts allow" 
16779 and other config lines in smb.conf are correct.</P
16780 ><P
16781 >It's also possible that the server can't work out what user name to
16782 connect you as. To see if this is the problem add the line "user =
16783 USERNAME" to the [tmp] section of smb.conf where "USERNAME" is the
16784 username corresponding to the password you typed. If you find this
16785 fixes things you may need the username mapping option. </P
16786 ><P
16787 >It might also be the case that your client only sends encrypted passwords 
16788 and you have <B
16789 CLASS="COMMAND"
16790 >encrypt passwords = no</B
16791 > in <TT
16792 CLASS="FILENAME"
16793 >smb.conf</TT
16794 >.
16795 Turn it back on to fix.</P
16796 ></DIV
16797 ><DIV
16798 CLASS="SECT2"
16799 ><HR><H3
16800 CLASS="SECT2"
16801 ><A
16802 NAME="AEN3468"
16803 ></A
16804 >26.3.10. Test 10</H3
16805 ><P
16806 >Run the command <B
16807 CLASS="COMMAND"
16808 >nmblookup -M TESTGROUP</B
16809 > where 
16810 TESTGROUP is the name of the workgroup that your Samba server and 
16811 Windows PCs belong to. You should get back the IP address of the 
16812 master browser for that workgroup.</P
16813 ><P
16814 >If you don't then the election process has failed. Wait a minute to
16815 see if it is just being slow then try again. If it still fails after
16816 that then look at the browsing options you have set in smb.conf. Make
16817 sure you have <B
16818 CLASS="COMMAND"
16819 >preferred master = yes</B
16820 > to ensure that 
16821 an election is held at startup.</P
16822 ></DIV
16823 ><DIV
16824 CLASS="SECT2"
16825 ><HR><H3
16826 CLASS="SECT2"
16827 ><A
16828 NAME="AEN3474"
16829 ></A
16830 >26.3.11. Test 11</H3
16831 ><P
16832 >From file manager try to browse the server. Your samba server should
16833 appear in the browse list of your local workgroup (or the one you
16834 specified in smb.conf). You should be able to double click on the name
16835 of the server and get a list of shares. If you get a "invalid
16836 password" error when you do then you are probably running WinNT and it
16837 is refusing to browse a server that has no encrypted password
16838 capability and is in user level security mode. In this case either set
16839 <B
16840 CLASS="COMMAND"
16841 >security = server</B
16842 > AND 
16843 <B
16844 CLASS="COMMAND"
16845 >password server = Windows_NT_Machine</B
16846 > in your
16847 smb.conf file, or enable encrypted passwords AFTER compiling in support
16848 for encrypted passwords (refer to the Makefile).</P
16849 ></DIV
16850 ></DIV
16851 ><DIV
16852 CLASS="SECT1"
16853 ><HR><H2
16854 CLASS="SECT1"
16855 ><A
16856 NAME="AEN3479"
16857 ></A
16858 >26.4. Still having troubles?</H2
16859 ><P
16860 >Try the mailing list or newsgroup, or use the ethereal utility to
16861 sniff the problem. The official samba mailing list can be reached at
16862 <A
16863 HREF="mailto:samba@samba.org"
16864 TARGET="_top"
16865 >samba@samba.org</A
16866 >. To find 
16867 out more about samba and how to subscribe to the mailing list check 
16868 out the samba web page at 
16869 <A
16870 HREF="http://samba.org/samba"
16871 TARGET="_top"
16872 >http://samba.org/samba</A
16873 ></P
16874 ><P
16875 >Also look at the other docs in the Samba package!</P
16876 ></DIV
16877 ></DIV
16878 ></DIV
16879 ></DIV
16880 ></BODY
16881 ></HTML
16882 >