Some update and Fixes for typos.
[kai/samba.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.7"></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 >SAMBA Project Documentation</A
28 ></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 > : Wed Jan 15</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 > or 
63 <A
64 HREF="mailto:jelmer@samba.org"
65 TARGET="_top"
66 >jelmer@samba.org</A
67 >.</P
68 ><P
69 >This documentation is distributed under the GNU General Public License (GPL) 
70 version 2.  A copy of the license is included with the Samba source
71 distribution.  A copy can be found on-line at <A
72 HREF="http://www.fsf.org/licenses/gpl.txt"
73 TARGET="_top"
74 >http://www.fsf.org/licenses/gpl.txt</A
75 ></P
76 ><P
77 >Cheers, jerry</P
78 ><DIV
79 CLASS="TOC"
80 ><DL
81 ><DT
82 ><B
83 >Table of Contents</B
84 ></DT
85 ><DT
86 >I. <A
87 HREF="#INTRODUCTION"
88 >General installation</A
89 ></DT
90 ><DD
91 ><DL
92 ><DT
93 >1. <A
94 HREF="#INSTALL"
95 >How to Install and Test SAMBA</A
96 ></DT
97 ><DD
98 ><DL
99 ><DT
100 >1.1. <A
101 HREF="#AEN26"
102 >Obtaining and installing samba</A
103 ></DT
104 ><DT
105 >1.2. <A
106 HREF="#AEN31"
107 >Configuring samba</A
108 ></DT
109 ><DT
110 >1.3. <A
111 HREF="#AEN64"
112 >Try listing the shares available on your 
113         server</A
114 ></DT
115 ><DT
116 >1.4. <A
117 HREF="#AEN73"
118 >Try connecting with the unix client</A
119 ></DT
120 ><DT
121 >1.5. <A
122 HREF="#AEN89"
123 >Try connecting from a DOS, WfWg, Win9x, WinNT, 
124         Win2k, OS/2, etc... client</A
125 ></DT
126 ><DT
127 >1.6. <A
128 HREF="#AEN103"
129 >What If Things Don't Work?</A
130 ></DT
131 ></DL
132 ></DD
133 ><DT
134 >2. <A
135 HREF="#BROWSING-QUICK"
136 >Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</A
137 ></DT
138 ><DD
139 ><DL
140 ><DT
141 >2.1. <A
142 HREF="#AEN130"
143 >Discussion</A
144 ></DT
145 ><DT
146 >2.2. <A
147 HREF="#AEN139"
148 >How browsing functions and how to deploy stable and 
149 dependable browsing using Samba</A
150 ></DT
151 ><DT
152 >2.3. <A
153 HREF="#AEN149"
154 >Use of the "Remote Announce" parameter</A
155 ></DT
156 ><DT
157 >2.4. <A
158 HREF="#AEN163"
159 >Use of the "Remote Browse Sync" parameter</A
160 ></DT
161 ><DT
162 >2.5. <A
163 HREF="#AEN168"
164 >Use of WINS</A
165 ></DT
166 ><DT
167 >2.6. <A
168 HREF="#AEN179"
169 >Do NOT use more than one (1) protocol on MS Windows machines</A
170 ></DT
171 ><DT
172 >2.7. <A
173 HREF="#AEN187"
174 >Name Resolution Order</A
175 ></DT
176 ></DL
177 ></DD
178 ><DT
179 >3. <A
180 HREF="#PASSDB"
181 >User information database</A
182 ></DT
183 ><DD
184 ><DL
185 ><DT
186 >3.1. <A
187 HREF="#AEN244"
188 >Introduction</A
189 ></DT
190 ><DT
191 >3.2. <A
192 HREF="#AEN251"
193 >Important Notes About Security</A
194 ></DT
195 ><DT
196 >3.3. <A
197 HREF="#AEN289"
198 >The smbpasswd Command</A
199 ></DT
200 ><DT
201 >3.4. <A
202 HREF="#AEN320"
203 >Plain text</A
204 ></DT
205 ><DT
206 >3.5. <A
207 HREF="#AEN325"
208 >TDB</A
209 ></DT
210 ><DT
211 >3.6. <A
212 HREF="#AEN328"
213 >LDAP</A
214 ></DT
215 ><DT
216 >3.7. <A
217 HREF="#AEN546"
218 >MySQL</A
219 ></DT
220 ><DT
221 >3.8. <A
222 HREF="#AEN588"
223 >XML</A
224 ></DT
225 ></DL
226 ></DD
227 ></DL
228 ></DD
229 ><DT
230 >II. <A
231 HREF="#TYPE"
232 >Type of installation</A
233 ></DT
234 ><DD
235 ><DL
236 ><DT
237 >4. <A
238 HREF="#SERVERTYPE"
239 >Nomenclature of Server Types</A
240 ></DT
241 ><DD
242 ><DL
243 ><DT
244 >4.1. <A
245 HREF="#AEN626"
246 >Stand Alone Server</A
247 ></DT
248 ><DT
249 >4.2. <A
250 HREF="#AEN633"
251 >Domain Member Server</A
252 ></DT
253 ><DT
254 >4.3. <A
255 HREF="#AEN639"
256 >Domain Controller</A
257 ></DT
258 ></DL
259 ></DD
260 ><DT
261 >5. <A
262 HREF="#SECURITYLEVELS"
263 >Samba as Stand-Alone Server</A
264 ></DT
265 ><DD
266 ><DL
267 ><DT
268 >5.1. <A
269 HREF="#AEN668"
270 >User and Share security level</A
271 ></DT
272 ></DL
273 ></DD
274 ><DT
275 >6. <A
276 HREF="#SAMBA-PDC"
277 >Samba as an NT4 or Win2k Primary Domain Controller</A
278 ></DT
279 ><DD
280 ><DL
281 ><DT
282 >6.1. <A
283 HREF="#AEN772"
284 >Prerequisite Reading</A
285 ></DT
286 ><DT
287 >6.2. <A
288 HREF="#AEN777"
289 >Background</A
290 ></DT
291 ><DT
292 >6.3. <A
293 HREF="#AEN817"
294 >Configuring the Samba Domain Controller</A
295 ></DT
296 ><DT
297 >6.4. <A
298 HREF="#AEN859"
299 >Creating Machine Trust Accounts and Joining Clients to the Domain</A
300 ></DT
301 ><DT
302 >6.5. <A
303 HREF="#AEN967"
304 >Common Problems and Errors</A
305 ></DT
306 ><DT
307 >6.6. <A
308 HREF="#AEN1013"
309 >What other help can I get?</A
310 ></DT
311 ><DT
312 >6.7. <A
313 HREF="#AEN1127"
314 >Domain Control for Windows 9x/ME</A
315 ></DT
316 ></DL
317 ></DD
318 ><DT
319 >7. <A
320 HREF="#SAMBA-BDC"
321 >Samba Backup Domain Controller to Samba Domain Control</A
322 ></DT
323 ><DD
324 ><DL
325 ><DT
326 >7.1. <A
327 HREF="#AEN1180"
328 >Prerequisite Reading</A
329 ></DT
330 ><DT
331 >7.2. <A
332 HREF="#AEN1184"
333 >Background</A
334 ></DT
335 ><DT
336 >7.3. <A
337 HREF="#AEN1192"
338 >What qualifies a Domain Controller on the network?</A
339 ></DT
340 ><DT
341 >7.4. <A
342 HREF="#AEN1201"
343 >Can Samba be a Backup Domain Controller to an NT PDC?</A
344 ></DT
345 ><DT
346 >7.5. <A
347 HREF="#AEN1206"
348 >How do I set up a Samba BDC?</A
349 ></DT
350 ></DL
351 ></DD
352 ><DT
353 >8. <A
354 HREF="#ADS"
355 >Samba as a ADS domain member</A
356 ></DT
357 ><DD
358 ><DL
359 ><DT
360 >8.1. <A
361 HREF="#AEN1238"
362 >Setup your <TT
363 CLASS="FILENAME"
364 >smb.conf</TT
365 ></A
366 ></DT
367 ><DT
368 >8.2. <A
369 HREF="#AEN1249"
370 >Setup your <TT
371 CLASS="FILENAME"
372 >/etc/krb5.conf</TT
373 ></A
374 ></DT
375 ><DT
376 >8.3. <A
377 HREF="#AEN1260"
378 >Create the computer account</A
379 ></DT
380 ><DT
381 >8.4. <A
382 HREF="#AEN1272"
383 >Test your server setup</A
384 ></DT
385 ><DT
386 >8.5. <A
387 HREF="#AEN1277"
388 >Testing with smbclient</A
389 ></DT
390 ><DT
391 >8.6. <A
392 HREF="#AEN1280"
393 >Notes</A
394 ></DT
395 ></DL
396 ></DD
397 ><DT
398 >9. <A
399 HREF="#DOMAIN-SECURITY"
400 >Samba as a NT4 or Win2k domain member</A
401 ></DT
402 ><DD
403 ><DL
404 ><DT
405 >9.1. <A
406 HREF="#AEN1302"
407 >Joining an NT Domain with Samba 3.0</A
408 ></DT
409 ><DT
410 >9.2. <A
411 HREF="#AEN1356"
412 >Why is this better than security = server?</A
413 ></DT
414 ></DL
415 ></DD
416 ></DL
417 ></DD
418 ><DT
419 >III. <A
420 HREF="#OPTIONAL"
421 >Advanced Configuration</A
422 ></DT
423 ><DD
424 ><DL
425 ><DT
426 >10. <A
427 HREF="#ADVANCEDNETWORKMANAGEMENT"
428 >Advanced Network Manangement Information</A
429 ></DT
430 ><DD
431 ><DL
432 ><DT
433 >10.1. <A
434 HREF="#AEN1388"
435 >Remote Server Administration</A
436 ></DT
437 ></DL
438 ></DD
439 ><DT
440 >11. <A
441 HREF="#UNIX-PERMISSIONS"
442 >UNIX Permission Bits and Windows NT Access Control Lists</A
443 ></DT
444 ><DD
445 ><DL
446 ><DT
447 >11.1. <A
448 HREF="#AEN1416"
449 >Viewing and changing UNIX permissions using the NT 
450         security dialogs</A
451 ></DT
452 ><DT
453 >11.2. <A
454 HREF="#AEN1420"
455 >How to view file security on a Samba share</A
456 ></DT
457 ><DT
458 >11.3. <A
459 HREF="#AEN1431"
460 >Viewing file ownership</A
461 ></DT
462 ><DT
463 >11.4. <A
464 HREF="#AEN1451"
465 >Viewing file or directory permissions</A
466 ></DT
467 ><DT
468 >11.5. <A
469 HREF="#AEN1487"
470 >Modifying file or directory permissions</A
471 ></DT
472 ><DT
473 >11.6. <A
474 HREF="#AEN1509"
475 >Interaction with the standard Samba create mask 
476         parameters</A
477 ></DT
478 ><DT
479 >11.7. <A
480 HREF="#AEN1563"
481 >Interaction with the standard Samba file attribute 
482         mapping</A
483 ></DT
484 ></DL
485 ></DD
486 ><DT
487 >12. <A
488 HREF="#GROUPMAPPING"
489 >Group mapping HOWTO</A
490 ></DT
491 ><DT
492 >13. <A
493 HREF="#PAM"
494 >Configuring PAM for distributed but centrally 
495 managed authentication</A
496 ></DT
497 ><DD
498 ><DL
499 ><DT
500 >13.1. <A
501 HREF="#AEN1619"
502 >Samba and PAM</A
503 ></DT
504 ><DT
505 >13.2. <A
506 HREF="#AEN1668"
507 >Distributed Authentication</A
508 ></DT
509 ><DT
510 >13.3. <A
511 HREF="#AEN1673"
512 >PAM Configuration in smb.conf</A
513 ></DT
514 ></DL
515 ></DD
516 ><DT
517 >14. <A
518 HREF="#PRINTING"
519 >Printing Support</A
520 ></DT
521 ><DD
522 ><DL
523 ><DT
524 >14.1. <A
525 HREF="#AEN1699"
526 >Introduction</A
527 ></DT
528 ><DT
529 >14.2. <A
530 HREF="#AEN1721"
531 >Configuration</A
532 ></DT
533 ><DT
534 >14.3. <A
535 HREF="#AEN1829"
536 >The Imprints Toolset</A
537 ></DT
538 ><DT
539 >14.4. <A
540 HREF="#AEN1872"
541 >Diagnosis</A
542 ></DT
543 ></DL
544 ></DD
545 ><DT
546 >15. <A
547 HREF="#CUPS-PRINTING"
548 >CUPS Printing Support</A
549 ></DT
550 ><DD
551 ><DL
552 ><DT
553 >15.1. <A
554 HREF="#AEN1984"
555 >Introduction</A
556 ></DT
557 ><DT
558 >15.2. <A
559 HREF="#AEN1989"
560 >CUPS - RAW Print Through  Mode</A
561 ></DT
562 ><DT
563 >15.3. <A
564 HREF="#AEN2044"
565 >The CUPS Filter Chains</A
566 ></DT
567 ><DT
568 >15.4. <A
569 HREF="#AEN2083"
570 >CUPS Print Drivers and Devices</A
571 ></DT
572 ><DT
573 >15.5. <A
574 HREF="#AEN2160"
575 >Limiting the number of pages users can print</A
576 ></DT
577 ><DT
578 >15.6. <A
579 HREF="#AEN2249"
580 >Advanced Postscript Printing from MS Windows</A
581 ></DT
582 ><DT
583 >15.7. <A
584 HREF="#AEN2264"
585 >Auto-Deletion of CUPS spool files</A
586 ></DT
587 ></DL
588 ></DD
589 ><DT
590 >16. <A
591 HREF="#WINBIND"
592 >Unified Logons between Windows NT and UNIX using Winbind</A
593 ></DT
594 ><DD
595 ><DL
596 ><DT
597 >16.1. <A
598 HREF="#AEN2326"
599 >Abstract</A
600 ></DT
601 ><DT
602 >16.2. <A
603 HREF="#AEN2330"
604 >Introduction</A
605 ></DT
606 ><DT
607 >16.3. <A
608 HREF="#AEN2343"
609 >What Winbind Provides</A
610 ></DT
611 ><DT
612 >16.4. <A
613 HREF="#AEN2354"
614 >How Winbind Works</A
615 ></DT
616 ><DT
617 >16.5. <A
618 HREF="#AEN2397"
619 >Installation and Configuration</A
620 ></DT
621 ><DT
622 >16.6. <A
623 HREF="#AEN2654"
624 >Limitations</A
625 ></DT
626 ><DT
627 >16.7. <A
628 HREF="#AEN2664"
629 >Conclusion</A
630 ></DT
631 ></DL
632 ></DD
633 ><DT
634 >17. <A
635 HREF="#POLICYMGMT"
636 >Policy Management - Hows and Whys</A
637 ></DT
638 ><DD
639 ><DL
640 ><DT
641 >17.1. <A
642 HREF="#AEN2678"
643 >System Policies</A
644 ></DT
645 ></DL
646 ></DD
647 ><DT
648 >18. <A
649 HREF="#PROFILEMGMT"
650 >Profile Management</A
651 ></DT
652 ><DD
653 ><DL
654 ><DT
655 >18.1. <A
656 HREF="#AEN2761"
657 >Roaming Profiles</A
658 ></DT
659 ></DL
660 ></DD
661 ><DT
662 >19. <A
663 HREF="#INTEGRATE-MS-NETWORKS"
664 >Integrating MS Windows networks with Samba</A
665 ></DT
666 ><DD
667 ><DL
668 ><DT
669 >19.1. <A
670 HREF="#AEN2975"
671 >Name Resolution in a pure Unix/Linux world</A
672 ></DT
673 ><DT
674 >19.2. <A
675 HREF="#AEN3038"
676 >Name resolution as used within MS Windows networking</A
677 ></DT
678 ></DL
679 ></DD
680 ><DT
681 >20. <A
682 HREF="#IMPROVED-BROWSING"
683 >Improved browsing in samba</A
684 ></DT
685 ><DD
686 ><DL
687 ><DT
688 >20.1. <A
689 HREF="#AEN3090"
690 >Overview of browsing</A
691 ></DT
692 ><DT
693 >20.2. <A
694 HREF="#AEN3095"
695 >Browsing support in samba</A
696 ></DT
697 ><DT
698 >20.3. <A
699 HREF="#AEN3103"
700 >Problem resolution</A
701 ></DT
702 ><DT
703 >20.4. <A
704 HREF="#AEN3112"
705 >Browsing across subnets</A
706 ></DT
707 ><DT
708 >20.5. <A
709 HREF="#AEN3152"
710 >Setting up a WINS server</A
711 ></DT
712 ><DT
713 >20.6. <A
714 HREF="#AEN3171"
715 >Setting up Browsing in a WORKGROUP</A
716 ></DT
717 ><DT
718 >20.7. <A
719 HREF="#AEN3189"
720 >Setting up Browsing in a DOMAIN</A
721 ></DT
722 ><DT
723 >20.8. <A
724 HREF="#AEN3199"
725 >Forcing samba to be the master</A
726 ></DT
727 ><DT
728 >20.9. <A
729 HREF="#AEN3208"
730 >Making samba the domain master</A
731 ></DT
732 ><DT
733 >20.10. <A
734 HREF="#AEN3226"
735 >Note about broadcast addresses</A
736 ></DT
737 ><DT
738 >20.11. <A
739 HREF="#AEN3229"
740 >Multiple interfaces</A
741 ></DT
742 ></DL
743 ></DD
744 ><DT
745 >21. <A
746 HREF="#MSDFS"
747 >Hosting a Microsoft Distributed File System tree on Samba</A
748 ></DT
749 ><DD
750 ><DL
751 ><DT
752 >21.1. <A
753 HREF="#AEN3243"
754 >Instructions</A
755 ></DT
756 ></DL
757 ></DD
758 ><DT
759 >22. <A
760 HREF="#VFS"
761 >Stackable VFS modules</A
762 ></DT
763 ><DD
764 ><DL
765 ><DT
766 >22.1. <A
767 HREF="#AEN3302"
768 >Introduction and configuration</A
769 ></DT
770 ><DT
771 >22.2. <A
772 HREF="#AEN3311"
773 >Included modules</A
774 ></DT
775 ><DT
776 >22.3. <A
777 HREF="#AEN3365"
778 >VFS modules available elsewhere</A
779 ></DT
780 ></DL
781 ></DD
782 ><DT
783 >23. <A
784 HREF="#SECURING-SAMBA"
785 >Securing Samba</A
786 ></DT
787 ><DD
788 ><DL
789 ><DT
790 >23.1. <A
791 HREF="#AEN3391"
792 >Introduction</A
793 ></DT
794 ><DT
795 >23.2. <A
796 HREF="#AEN3394"
797 >Using host based protection</A
798 ></DT
799 ><DT
800 >23.3. <A
801 HREF="#AEN3401"
802 >Using interface protection</A
803 ></DT
804 ><DT
805 >23.4. <A
806 HREF="#AEN3410"
807 >Using a firewall</A
808 ></DT
809 ><DT
810 >23.5. <A
811 HREF="#AEN3417"
812 >Using a IPC$ share deny</A
813 ></DT
814 ><DT
815 >23.6. <A
816 HREF="#AEN3426"
817 >Upgrading Samba</A
818 ></DT
819 ></DL
820 ></DD
821 ><DT
822 >24. <A
823 HREF="#UNICODE"
824 >Unicode/Charsets</A
825 ></DT
826 ><DD
827 ><DL
828 ><DT
829 >24.1. <A
830 HREF="#AEN3440"
831 >What are charsets and unicode?</A
832 ></DT
833 ><DT
834 >24.2. <A
835 HREF="#AEN3449"
836 >Samba and charsets</A
837 ></DT
838 ></DL
839 ></DD
840 ></DL
841 ></DD
842 ><DT
843 >IV. <A
844 HREF="#APPENDIXES"
845 >Appendixes</A
846 ></DT
847 ><DD
848 ><DL
849 ><DT
850 >25. <A
851 HREF="#SPEED"
852 >Samba performance issues</A
853 ></DT
854 ><DD
855 ><DL
856 ><DT
857 >25.1. <A
858 HREF="#AEN3486"
859 >Comparisons</A
860 ></DT
861 ><DT
862 >25.2. <A
863 HREF="#AEN3492"
864 >Socket options</A
865 ></DT
866 ><DT
867 >25.3. <A
868 HREF="#AEN3499"
869 >Read size</A
870 ></DT
871 ><DT
872 >25.4. <A
873 HREF="#AEN3504"
874 >Max xmit</A
875 ></DT
876 ><DT
877 >25.5. <A
878 HREF="#AEN3509"
879 >Log level</A
880 ></DT
881 ><DT
882 >25.6. <A
883 HREF="#AEN3512"
884 >Read raw</A
885 ></DT
886 ><DT
887 >25.7. <A
888 HREF="#AEN3517"
889 >Write raw</A
890 ></DT
891 ><DT
892 >25.8. <A
893 HREF="#AEN3521"
894 >Slow Clients</A
895 ></DT
896 ><DT
897 >25.9. <A
898 HREF="#AEN3525"
899 >Slow Logins</A
900 ></DT
901 ><DT
902 >25.10. <A
903 HREF="#AEN3528"
904 >Client tuning</A
905 ></DT
906 ></DL
907 ></DD
908 ><DT
909 >26. <A
910 HREF="#PORTABILITY"
911 >Portability</A
912 ></DT
913 ><DD
914 ><DL
915 ><DT
916 >26.1. <A
917 HREF="#AEN3568"
918 >HPUX</A
919 ></DT
920 ><DT
921 >26.2. <A
922 HREF="#AEN3574"
923 >SCO Unix</A
924 ></DT
925 ><DT
926 >26.3. <A
927 HREF="#AEN3578"
928 >DNIX</A
929 ></DT
930 ><DT
931 >26.4. <A
932 HREF="#AEN3607"
933 >RedHat Linux Rembrandt-II</A
934 ></DT
935 ><DT
936 >26.5. <A
937 HREF="#AEN3613"
938 >AIX</A
939 ></DT
940 ></DL
941 ></DD
942 ><DT
943 >27. <A
944 HREF="#OTHER-CLIENTS"
945 >Samba and other CIFS clients</A
946 ></DT
947 ><DD
948 ><DL
949 ><DT
950 >27.1. <A
951 HREF="#AEN3633"
952 >Macintosh clients?</A
953 ></DT
954 ><DT
955 >27.2. <A
956 HREF="#AEN3642"
957 >OS2 Client</A
958 ></DT
959 ><DT
960 >27.3. <A
961 HREF="#AEN3682"
962 >Windows for Workgroups</A
963 ></DT
964 ><DT
965 >27.4. <A
966 HREF="#AEN3706"
967 >Windows '95/'98</A
968 ></DT
969 ><DT
970 >27.5. <A
971 HREF="#AEN3722"
972 >Windows 2000 Service Pack 2</A
973 ></DT
974 ></DL
975 ></DD
976 ><DT
977 >28. <A
978 HREF="#COMPILING"
979 >How to compile SAMBA</A
980 ></DT
981 ><DD
982 ><DL
983 ><DT
984 >28.1. <A
985 HREF="#AEN3749"
986 >Access Samba source code via CVS</A
987 ></DT
988 ><DT
989 >28.2. <A
990 HREF="#AEN3792"
991 >Accessing the samba sources via rsync and ftp</A
992 ></DT
993 ><DT
994 >28.3. <A
995 HREF="#AEN3798"
996 >Building the Binaries</A
997 ></DT
998 ><DT
999 >28.4. <A
1000 HREF="#AEN3855"
1001 >Starting the smbd and nmbd</A
1002 ></DT
1003 ></DL
1004 ></DD
1005 ><DT
1006 >29. <A
1007 HREF="#BUGREPORT"
1008 >Reporting Bugs</A
1009 ></DT
1010 ><DD
1011 ><DL
1012 ><DT
1013 >29.1. <A
1014 HREF="#AEN3917"
1015 >Introduction</A
1016 ></DT
1017 ><DT
1018 >29.2. <A
1019 HREF="#AEN3927"
1020 >General info</A
1021 ></DT
1022 ><DT
1023 >29.3. <A
1024 HREF="#AEN3933"
1025 >Debug levels</A
1026 ></DT
1027 ><DT
1028 >29.4. <A
1029 HREF="#AEN3950"
1030 >Internal errors</A
1031 ></DT
1032 ><DT
1033 >29.5. <A
1034 HREF="#AEN3960"
1035 >Attaching to a running process</A
1036 ></DT
1037 ><DT
1038 >29.6. <A
1039 HREF="#AEN3963"
1040 >Patches</A
1041 ></DT
1042 ></DL
1043 ></DD
1044 ><DT
1045 >30. <A
1046 HREF="#DIAGNOSIS"
1047 >The samba checklist</A
1048 ></DT
1049 ><DD
1050 ><DL
1051 ><DT
1052 >30.1. <A
1053 HREF="#AEN3986"
1054 >Introduction</A
1055 ></DT
1056 ><DT
1057 >30.2. <A
1058 HREF="#AEN3991"
1059 >Assumptions</A
1060 ></DT
1061 ><DT
1062 >30.3. <A
1063 HREF="#AEN4001"
1064 >Tests</A
1065 ></DT
1066 ><DT
1067 >30.4. <A
1068 HREF="#AEN4111"
1069 >Still having troubles?</A
1070 ></DT
1071 ></DL
1072 ></DD
1073 ></DL
1074 ></DD
1075 ></DL
1076 ></DIV
1077 ><DIV
1078 CLASS="PART"
1079 ><A
1080 NAME="INTRODUCTION"
1081 ></A
1082 ><DIV
1083 CLASS="TITLEPAGE"
1084 ><H1
1085 CLASS="TITLE"
1086 >I. General installation</H1
1087 ><DIV
1088 CLASS="PARTINTRO"
1089 ><A
1090 NAME="AEN21"
1091 ></A
1092 ><H1
1093 >Introduction</H1
1094 ><P
1095 >This part contains general info on how to install samba 
1096 and how to configure the parts of samba you will most likely need.
1097 PLEASE read this.</P
1098 ></DIV
1099 ><DIV
1100 CLASS="TOC"
1101 ><DL
1102 ><DT
1103 ><B
1104 >Table of Contents</B
1105 ></DT
1106 ><DT
1107 >1. <A
1108 HREF="#INSTALL"
1109 >How to Install and Test SAMBA</A
1110 ></DT
1111 ><DD
1112 ><DL
1113 ><DT
1114 >1.1. <A
1115 HREF="#AEN26"
1116 >Obtaining and installing samba</A
1117 ></DT
1118 ><DT
1119 >1.2. <A
1120 HREF="#AEN31"
1121 >Configuring samba</A
1122 ></DT
1123 ><DD
1124 ><DL
1125 ><DT
1126 >1.2.1. <A
1127 HREF="#AEN36"
1128 >Editing the smb.conf file</A
1129 ></DT
1130 ><DT
1131 >1.2.2. <A
1132 HREF="#AEN58"
1133 >SWAT</A
1134 ></DT
1135 ></DL
1136 ></DD
1137 ><DT
1138 >1.3. <A
1139 HREF="#AEN64"
1140 >Try listing the shares available on your 
1141         server</A
1142 ></DT
1143 ><DT
1144 >1.4. <A
1145 HREF="#AEN73"
1146 >Try connecting with the unix client</A
1147 ></DT
1148 ><DT
1149 >1.5. <A
1150 HREF="#AEN89"
1151 >Try connecting from a DOS, WfWg, Win9x, WinNT, 
1152         Win2k, OS/2, etc... client</A
1153 ></DT
1154 ><DT
1155 >1.6. <A
1156 HREF="#AEN103"
1157 >What If Things Don't Work?</A
1158 ></DT
1159 ><DD
1160 ><DL
1161 ><DT
1162 >1.6.1. <A
1163 HREF="#AEN108"
1164 >Scope IDs</A
1165 ></DT
1166 ><DT
1167 >1.6.2. <A
1168 HREF="#AEN111"
1169 >Locking</A
1170 ></DT
1171 ></DL
1172 ></DD
1173 ></DL
1174 ></DD
1175 ><DT
1176 >2. <A
1177 HREF="#BROWSING-QUICK"
1178 >Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</A
1179 ></DT
1180 ><DD
1181 ><DL
1182 ><DT
1183 >2.1. <A
1184 HREF="#AEN130"
1185 >Discussion</A
1186 ></DT
1187 ><DT
1188 >2.2. <A
1189 HREF="#AEN139"
1190 >How browsing functions and how to deploy stable and 
1191 dependable browsing using Samba</A
1192 ></DT
1193 ><DT
1194 >2.3. <A
1195 HREF="#AEN149"
1196 >Use of the "Remote Announce" parameter</A
1197 ></DT
1198 ><DT
1199 >2.4. <A
1200 HREF="#AEN163"
1201 >Use of the "Remote Browse Sync" parameter</A
1202 ></DT
1203 ><DT
1204 >2.5. <A
1205 HREF="#AEN168"
1206 >Use of WINS</A
1207 ></DT
1208 ><DT
1209 >2.6. <A
1210 HREF="#AEN179"
1211 >Do NOT use more than one (1) protocol on MS Windows machines</A
1212 ></DT
1213 ><DT
1214 >2.7. <A
1215 HREF="#AEN187"
1216 >Name Resolution Order</A
1217 ></DT
1218 ></DL
1219 ></DD
1220 ><DT
1221 >3. <A
1222 HREF="#PASSDB"
1223 >User information database</A
1224 ></DT
1225 ><DD
1226 ><DL
1227 ><DT
1228 >3.1. <A
1229 HREF="#AEN244"
1230 >Introduction</A
1231 ></DT
1232 ><DT
1233 >3.2. <A
1234 HREF="#AEN251"
1235 >Important Notes About Security</A
1236 ></DT
1237 ><DD
1238 ><DL
1239 ><DT
1240 >3.2.1. <A
1241 HREF="#AEN277"
1242 >Advantages of SMB Encryption</A
1243 ></DT
1244 ><DT
1245 >3.2.2. <A
1246 HREF="#AEN283"
1247 >Advantages of non-encrypted passwords</A
1248 ></DT
1249 ></DL
1250 ></DD
1251 ><DT
1252 >3.3. <A
1253 HREF="#AEN289"
1254 >The smbpasswd Command</A
1255 ></DT
1256 ><DT
1257 >3.4. <A
1258 HREF="#AEN320"
1259 >Plain text</A
1260 ></DT
1261 ><DT
1262 >3.5. <A
1263 HREF="#AEN325"
1264 >TDB</A
1265 ></DT
1266 ><DT
1267 >3.6. <A
1268 HREF="#AEN328"
1269 >LDAP</A
1270 ></DT
1271 ><DD
1272 ><DL
1273 ><DT
1274 >3.6.1. <A
1275 HREF="#AEN330"
1276 >Introduction</A
1277 ></DT
1278 ><DT
1279 >3.6.2. <A
1280 HREF="#AEN350"
1281 >Introduction</A
1282 ></DT
1283 ><DT
1284 >3.6.3. <A
1285 HREF="#AEN379"
1286 >Supported LDAP Servers</A
1287 ></DT
1288 ><DT
1289 >3.6.4. <A
1290 HREF="#AEN384"
1291 >Schema and Relationship to the RFC 2307 posixAccount</A
1292 ></DT
1293 ><DT
1294 >3.6.5. <A
1295 HREF="#AEN396"
1296 >Configuring Samba with LDAP</A
1297 ></DT
1298 ><DT
1299 >3.6.6. <A
1300 HREF="#AEN443"
1301 >Accounts and Groups management</A
1302 ></DT
1303 ><DT
1304 >3.6.7. <A
1305 HREF="#AEN448"
1306 >Security and sambaAccount</A
1307 ></DT
1308 ><DT
1309 >3.6.8. <A
1310 HREF="#AEN468"
1311 >LDAP specials attributes for sambaAccounts</A
1312 ></DT
1313 ><DT
1314 >3.6.9. <A
1315 HREF="#AEN538"
1316 >Example LDIF Entries for a sambaAccount</A
1317 ></DT
1318 ></DL
1319 ></DD
1320 ><DT
1321 >3.7. <A
1322 HREF="#AEN546"
1323 >MySQL</A
1324 ></DT
1325 ><DD
1326 ><DL
1327 ><DT
1328 >3.7.1. <A
1329 HREF="#AEN548"
1330 >Creating the database</A
1331 ></DT
1332 ><DT
1333 >3.7.2. <A
1334 HREF="#AEN558"
1335 >Configuring</A
1336 ></DT
1337 ><DT
1338 >3.7.3. <A
1339 HREF="#AEN575"
1340 >Using plaintext passwords or encrypted password</A
1341 ></DT
1342 ><DT
1343 >3.7.4. <A
1344 HREF="#AEN580"
1345 >Getting non-column data from the table</A
1346 ></DT
1347 ></DL
1348 ></DD
1349 ><DT
1350 >3.8. <A
1351 HREF="#AEN588"
1352 >XML</A
1353 ></DT
1354 ></DL
1355 ></DD
1356 ></DL
1357 ></DIV
1358 ></DIV
1359 ><DIV
1360 CLASS="CHAPTER"
1361 ><HR><H1
1362 ><A
1363 NAME="INSTALL"
1364 ></A
1365 >Chapter 1. How to Install and Test SAMBA</H1
1366 ><DIV
1367 CLASS="SECT1"
1368 ><H2
1369 CLASS="SECT1"
1370 ><A
1371 NAME="AEN26"
1372 >1.1. Obtaining and installing samba</A
1373 ></H2
1374 ><P
1375 >Binary packages of samba are included in almost any Linux or 
1376         Unix distribution. There are also some packages available at 
1377         <A
1378 HREF="http://samba.org/"
1379 TARGET="_top"
1380 >the samba homepage</A
1381 >
1382         </P
1383 ><P
1384 >If you need to compile samba from source, check the 
1385         appropriate appendix chapter.</P
1386 ></DIV
1387 ><DIV
1388 CLASS="SECT1"
1389 ><HR><H2
1390 CLASS="SECT1"
1391 ><A
1392 NAME="AEN31"
1393 >1.2. Configuring samba</A
1394 ></H2
1395 ><P
1396 >Samba's configuration is stored in the smb.conf file, 
1397         that usually resides in <TT
1398 CLASS="FILENAME"
1399 >/etc/samba/smb.conf</TT
1400
1401         or <TT
1402 CLASS="FILENAME"
1403 >/usr/local/samba/lib/smb.conf</TT
1404 >. You can either 
1405         edit this file yourself or do it using one of the many graphical 
1406         tools that are available, such as the web-based interface swat, that 
1407         is included with samba.</P
1408 ><DIV
1409 CLASS="SECT2"
1410 ><HR><H3
1411 CLASS="SECT2"
1412 ><A
1413 NAME="AEN36"
1414 >1.2.1. Editing the smb.conf file</A
1415 ></H3
1416 ><P
1417 >There are sample configuration files in the examples 
1418         subdirectory in the distribution. I suggest you read them 
1419         carefully so you can see how the options go together in 
1420         practice. See the man page for all the options.</P
1421 ><P
1422 >The simplest useful configuration file would be 
1423         something like this:</P
1424 ><P
1425 ><PRE
1426 CLASS="PROGRAMLISTING"
1427 >       [global]
1428            workgroup = MYGROUP
1429
1430            [homes]
1431               guest ok = no
1432               read only = no
1433         </PRE
1434 ></P
1435 ><P
1436 >which would allow connections by anyone with an 
1437         account on the server, using either their login name or 
1438         "homes" as the service name. (Note that I also set the 
1439         workgroup that Samba is part of. See BROWSING.txt for details)</P
1440 ><P
1441 >Note that <B
1442 CLASS="COMMAND"
1443 >make install</B
1444 > will not install 
1445         a <TT
1446 CLASS="FILENAME"
1447 >smb.conf</TT
1448 > file. You need to create it 
1449         yourself. </P
1450 ><P
1451 >Make sure you put the smb.conf file in the same place 
1452         you specified in the<TT
1453 CLASS="FILENAME"
1454 >Makefile</TT
1455 > (the default is to 
1456         look for it in <TT
1457 CLASS="FILENAME"
1458 >/usr/local/samba/lib/</TT
1459 >).</P
1460 ><P
1461 >For more information about security settings for the 
1462         [homes] share please refer to the document UNIX_SECURITY.txt.</P
1463 ><DIV
1464 CLASS="SECT3"
1465 ><HR><H4
1466 CLASS="SECT3"
1467 ><A
1468 NAME="AEN50"
1469 >1.2.1.1. Test your config file with 
1470         <B
1471 CLASS="COMMAND"
1472 >testparm</B
1473 ></A
1474 ></H4
1475 ><P
1476 >It's important that you test the validity of your
1477         <TT
1478 CLASS="FILENAME"
1479 >smb.conf</TT
1480 > file using the testparm program. 
1481         If testparm runs OK then it will list the loaded services. If 
1482         not it will give an error message.</P
1483 ><P
1484 >Make sure it runs OK and that the services look 
1485         reasonable before proceeding. </P
1486 ><P
1487 >Always run testparm again when you change 
1488         <TT
1489 CLASS="FILENAME"
1490 >smb.conf</TT
1491 >!</P
1492 ></DIV
1493 ></DIV
1494 ><DIV
1495 CLASS="SECT2"
1496 ><HR><H3
1497 CLASS="SECT2"
1498 ><A
1499 NAME="AEN58"
1500 >1.2.2. SWAT</A
1501 ></H3
1502 ><P
1503 >       SWAT is a web-based interface that helps you configure samba. 
1504         SWAT might not be available in the samba package on your platform, 
1505         but in a seperate package. Please read the swat manpage 
1506         on compiling, installing and configuring swat from source.
1507         </P
1508 ><P
1509 >To launch SWAT just run your favorite web browser and 
1510         point it at "http://localhost:901/". Replace <VAR
1511 CLASS="REPLACEABLE"
1512 >localhost</VAR
1513 > with the name of the computer you are running samba on if you 
1514         are running samba on a different computer then your browser.</P
1515 ><P
1516 >Note that you can attach to SWAT from any IP connected 
1517         machine but connecting from a remote machine leaves your 
1518         connection open to password sniffing as passwords will be sent 
1519         in the clear over the wire. </P
1520 ></DIV
1521 ></DIV
1522 ><DIV
1523 CLASS="SECT1"
1524 ><HR><H2
1525 CLASS="SECT1"
1526 ><A
1527 NAME="AEN64"
1528 >1.3. Try listing the shares available on your 
1529         server</A
1530 ></H2
1531 ><P
1532 ><SAMP
1533 CLASS="PROMPT"
1534 >$ </SAMP
1535 ><KBD
1536 CLASS="USERINPUT"
1537 >smbclient -L 
1538         <VAR
1539 CLASS="REPLACEABLE"
1540 >yourhostname</VAR
1541 ></KBD
1542 ></P
1543 ><P
1544 >You should get back a list of shares available on 
1545         your server. If you don't then something is incorrectly setup. 
1546         Note that this method can also be used to see what shares 
1547         are available on other LanManager clients (such as WfWg).</P
1548 ><P
1549 >If you choose user level security then you may find 
1550         that Samba requests a password before it will list the shares. 
1551         See the <B
1552 CLASS="COMMAND"
1553 >smbclient</B
1554 > man page for details. (you 
1555         can force it to list the shares without a password by
1556         adding the option -U% to the command line. This will not work 
1557         with non-Samba servers)</P
1558 ></DIV
1559 ><DIV
1560 CLASS="SECT1"
1561 ><HR><H2
1562 CLASS="SECT1"
1563 ><A
1564 NAME="AEN73"
1565 >1.4. Try connecting with the unix client</A
1566 ></H2
1567 ><P
1568 ><SAMP
1569 CLASS="PROMPT"
1570 >$ </SAMP
1571 ><KBD
1572 CLASS="USERINPUT"
1573 >smbclient <VAR
1574 CLASS="REPLACEABLE"
1575 >       //yourhostname/aservice</VAR
1576 ></KBD
1577 ></P
1578 ><P
1579 >Typically the <VAR
1580 CLASS="REPLACEABLE"
1581 >yourhostname</VAR
1582
1583         would be the name of the host where you installed <B
1584 CLASS="COMMAND"
1585 >       smbd</B
1586 >. The <VAR
1587 CLASS="REPLACEABLE"
1588 >aservice</VAR
1589 > is 
1590         any service you have defined in the <TT
1591 CLASS="FILENAME"
1592 >smb.conf</TT
1593
1594         file. Try your user name if you just have a [homes] section
1595         in <TT
1596 CLASS="FILENAME"
1597 >smb.conf</TT
1598 >.</P
1599 ><P
1600 >For example if your unix host is bambi and your login 
1601         name is fred you would type:</P
1602 ><P
1603 ><SAMP
1604 CLASS="PROMPT"
1605 >$ </SAMP
1606 ><KBD
1607 CLASS="USERINPUT"
1608 >smbclient //bambi/fred
1609         </KBD
1610 ></P
1611 ></DIV
1612 ><DIV
1613 CLASS="SECT1"
1614 ><HR><H2
1615 CLASS="SECT1"
1616 ><A
1617 NAME="AEN89"
1618 >1.5. Try connecting from a DOS, WfWg, Win9x, WinNT, 
1619         Win2k, OS/2, etc... client</A
1620 ></H2
1621 ><P
1622 >Try mounting disks. eg:</P
1623 ><P
1624 ><SAMP
1625 CLASS="PROMPT"
1626 >C:\WINDOWS\&#62; </SAMP
1627 ><KBD
1628 CLASS="USERINPUT"
1629 >net use d: \\servername\service
1630         </KBD
1631 ></P
1632 ><P
1633 >Try printing. eg:</P
1634 ><P
1635 ><SAMP
1636 CLASS="PROMPT"
1637 >C:\WINDOWS\&#62; </SAMP
1638 ><KBD
1639 CLASS="USERINPUT"
1640 >net use lpt1:
1641         \\servername\spoolservice</KBD
1642 ></P
1643 ><P
1644 ><SAMP
1645 CLASS="PROMPT"
1646 >C:\WINDOWS\&#62; </SAMP
1647 ><KBD
1648 CLASS="USERINPUT"
1649 >print filename
1650         </KBD
1651 ></P
1652 ><P
1653 >Celebrate, or send me a bug report!</P
1654 ></DIV
1655 ><DIV
1656 CLASS="SECT1"
1657 ><HR><H2
1658 CLASS="SECT1"
1659 ><A
1660 NAME="AEN103"
1661 >1.6. What If Things Don't Work?</A
1662 ></H2
1663 ><P
1664 >Then you might read the file HOWTO chapter Diagnosis and the 
1665         FAQ. If you are still stuck then try the mailing list or 
1666         newsgroup (look in the README for details). Samba has been 
1667         successfully installed at thousands of sites worldwide, so maybe 
1668         someone else has hit your problem and has overcome it. You could 
1669         also use the WWW site to scan back issues of the samba-digest.</P
1670 ><P
1671 >When you fix the problem <SPAN
1672 CLASS="emphasis"
1673 ><I
1674 CLASS="EMPHASIS"
1675 >please</I
1676 ></SPAN
1677 > send some 
1678         updates of the documentation (or source code) to one of 
1679         the documentation maintainers or the list.
1680         </P
1681 ><DIV
1682 CLASS="SECT2"
1683 ><HR><H3
1684 CLASS="SECT2"
1685 ><A
1686 NAME="AEN108"
1687 >1.6.1. Scope IDs</A
1688 ></H3
1689 ><P
1690 >By default Samba uses a blank scope ID. This means 
1691                 all your windows boxes must also have a blank scope ID. 
1692                 If you really want to use a non-blank scope ID then you will 
1693                 need to use the 'netbios scope' smb.conf option.
1694         All your PCs will need to have the same setting for 
1695                 this to work. I do not recommend scope IDs.</P
1696 ></DIV
1697 ><DIV
1698 CLASS="SECT2"
1699 ><HR><H3
1700 CLASS="SECT2"
1701 ><A
1702 NAME="AEN111"
1703 >1.6.2. Locking</A
1704 ></H3
1705 ><P
1706 >One area which sometimes causes trouble is locking.</P
1707 ><P
1708 >There are two types of locking which need to be 
1709                 performed by a SMB server. The first is "record locking" 
1710                 which allows a client to lock a range of bytes in a open file. 
1711                 The second is the "deny modes" that are specified when a file 
1712                 is open.</P
1713 ><P
1714 >Record locking semantics under Unix is very
1715                 different from record locking under Windows. Versions
1716                 of Samba before 2.2 have tried to use the native
1717                 fcntl() unix system call to implement proper record
1718                 locking between different Samba clients. This can not
1719                 be fully correct due to several reasons. The simplest
1720                 is the fact that a Windows client is allowed to lock a
1721                 byte range up to 2^32 or 2^64, depending on the client
1722                 OS. The unix locking only supports byte ranges up to
1723                 2^31. So it is not possible to correctly satisfy a
1724                 lock request above 2^31. There are many more
1725                 differences, too many to be listed here.</P
1726 ><P
1727 >Samba 2.2 and above implements record locking
1728                 completely independent of the underlying unix
1729                 system. If a byte range lock that the client requests
1730                 happens to fall into the range 0-2^31, Samba hands
1731                 this request down to the Unix system. All other locks
1732                 can not be seen by unix anyway.</P
1733 ><P
1734 >Strictly a SMB server should check for locks before 
1735                 every read and write call on a file. Unfortunately with the 
1736                 way fcntl() works this can be slow and may overstress the 
1737                 rpc.lockd. It is also almost always unnecessary as clients 
1738                 are supposed to independently make locking calls before reads 
1739                 and writes anyway if locking is important to them. By default 
1740                 Samba only makes locking calls when explicitly asked
1741                 to by a client, but if you set "strict locking = yes" then it will
1742                 make lock checking calls on every read and write. </P
1743 ><P
1744 >You can also disable by range locking completely 
1745                 using "locking = no". This is useful for those shares that 
1746                 don't support locking or don't need it (such as cdroms). In 
1747                 this case Samba fakes the return codes of locking calls to 
1748                 tell clients that everything is OK.</P
1749 ><P
1750 >The second class of locking is the "deny modes". These 
1751                 are set by an application when it opens a file to determine 
1752                 what types of access should be allowed simultaneously with 
1753                 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE 
1754                 or DENY_ALL. There are also special compatibility modes called 
1755                 DENY_FCB and  DENY_DOS.</P
1756 ></DIV
1757 ></DIV
1758 ></DIV
1759 ><DIV
1760 CLASS="CHAPTER"
1761 ><HR><H1
1762 ><A
1763 NAME="BROWSING-QUICK"
1764 ></A
1765 >Chapter 2. Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</H1
1766 ><P
1767 >This document should be read in conjunction with Browsing and may
1768 be taken as the fast track guide to implementing browsing across subnets
1769 and / or across workgroups (or domains). WINS is the best tool for resolution
1770 of NetBIOS names to IP addesses. WINS is NOT involved in browse list handling
1771 except by way of name to address mapping.</P
1772 ><P
1773 >Note: MS Windows 2000 and later can be configured to operate with NO NetBIOS 
1774 over TCP/IP. Samba-3 and later also supports this mode of operation.</P
1775 ><DIV
1776 CLASS="SECT1"
1777 ><HR><H2
1778 CLASS="SECT1"
1779 ><A
1780 NAME="AEN130"
1781 >2.1. Discussion</A
1782 ></H2
1783 ><P
1784 >Firstly, all MS Windows networking is based on SMB (Server Message
1785 Block) based messaging. SMB messaging may be implemented using NetBIOS or 
1786 without NetBIOS. Samba implements NetBIOS by encapsulating it over TCP/IP.
1787 MS Windows products can do likewise. NetBIOS based networking uses broadcast
1788 messaging to affect browse list management. When running NetBIOS over
1789 TCP/IP this uses UDP based messaging. UDP messages can be broadcast or unicast.</P
1790 ><P
1791 >Normally, only unicast UDP messaging can be forwarded by routers. The
1792 "remote announce" parameter to smb.conf helps to project browse announcements
1793 to remote network segments via unicast UDP. Similarly, the "remote browse sync"
1794 parameter of smb.conf implements browse list collation using unicast UDP.</P
1795 ><P
1796 >Secondly, in those networks where Samba is the only SMB server technology
1797 wherever possible nmbd should be configured on one (1) machine as the WINS
1798 server. This makes it easy to manage the browsing environment. If each network
1799 segment is configured with it's own Samba WINS server, then the only way to
1800 get cross segment browsing to work is by using the "remote announce" and
1801 the "remote browse sync" parameters to your smb.conf file.</P
1802 ><P
1803 >If only one WINS server is used for an entire multi-segment network then
1804 the use of the "remote announce" and the "remote browse sync" parameters
1805 should NOT be necessary.</P
1806 ><P
1807 >As of Samba-3 WINS replication is being worked on. The bulk of the code has
1808 been committed, but it still needs maturation.</P
1809 ><P
1810 >Right now samba WINS does not support MS-WINS replication. This means that
1811 when setting up Samba as a WINS server there must only be one nmbd configured
1812 as a WINS server on the network. Some sites have used multiple Samba WINS
1813 servers for redundancy (one server per subnet) and then used "remote browse
1814 sync" and "remote announce" to affect browse list collation across all
1815 segments. Note that this means clients will only resolve local names,
1816 and must be configured to use DNS to resolve names on other subnets in
1817 order to resolve the IP addresses of the servers they can see on other
1818 subnets. This setup is not recommended, but is mentioned as a practical
1819 consideration (ie: an 'if all else fails' scenario).</P
1820 ><P
1821 >Lastly, take note that browse lists are a collection of unreliable broadcast
1822 messages that are repeated at intervals of not more than 15 minutes. This means
1823 that it will take time to establish a browse list and it can take up to 45
1824 minutes to stabilise, particularly across network segments.</P
1825 ></DIV
1826 ><DIV
1827 CLASS="SECT1"
1828 ><HR><H2
1829 CLASS="SECT1"
1830 ><A
1831 NAME="AEN139"
1832 >2.2. How browsing functions and how to deploy stable and 
1833 dependable browsing using Samba</A
1834 ></H2
1835 ><P
1836 >As stated above, MS Windows machines register their NetBIOS names 
1837 (i.e.: the machine name for each service type in operation) on start 
1838 up. Also, as stated above, the exact method by which this name registration 
1839 takes place is determined by whether or not the MS Windows client/server 
1840 has been given a WINS server address, whether or not LMHOSTS lookup 
1841 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.</P
1842 ><P
1843 >In the case where there is no WINS server all name registrations as 
1844 well as name lookups are done by UDP broadcast. This isolates name 
1845 resolution to the local subnet, unless LMHOSTS is used to list all 
1846 names and IP addresses. In such situations Samba provides a means by 
1847 which the samba server name may be forcibly injected into the browse 
1848 list of a remote MS Windows network (using the "remote announce" parameter).</P
1849 ><P
1850 >Where a WINS server is used, the MS Windows client will use UDP 
1851 unicast to register with the WINS server. Such packets can be routed 
1852 and thus WINS allows name resolution to function across routed networks.</P
1853 ><P
1854 >During the startup process an election will take place to create a 
1855 local master browser if one does not already exist. On each NetBIOS network 
1856 one machine will be elected to function as the domain master browser. This 
1857 domain browsing has nothing to do with MS security domain control. 
1858 Instead, the domain master browser serves the role of contacting each local 
1859 master browser (found by asking WINS or from LMHOSTS) and exchanging browse 
1860 list contents. This way every master browser will eventually obtain a complete 
1861 list of all machines that are on the network. Every 11-15 minutes an election 
1862 is held to determine which machine will be the master browser. By the nature of 
1863 the election criteria used, the machine with the highest uptime, or the 
1864 most senior protocol version, or other criteria, will win the election 
1865 as domain master browser.</P
1866 ><P
1867 >Clients wishing to browse the network make use of this list, but also depend 
1868 on the availability of correct name resolution to the respective IP 
1869 address/addresses. </P
1870 ><P
1871 >Any configuration that breaks name resolution and/or browsing intrinsics 
1872 will annoy users because they will have to put up with protracted 
1873 inability to use the network services.</P
1874 ><P
1875 >Samba supports a feature that allows forced synchonisation 
1876 of browse lists across routed networks using the "remote 
1877 browse sync" parameter in the smb.conf file. This causes Samba 
1878 to contact the local master browser on a remote network and 
1879 to request browse list synchronisation. This effectively bridges 
1880 two networks that are separated by routers. The two remote 
1881 networks may use either broadcast based name resolution or WINS 
1882 based name resolution, but it should be noted that the "remote 
1883 browse sync" parameter provides browse list synchronisation - and 
1884 that is distinct from name to address resolution, in other 
1885 words, for cross subnet browsing to function correctly it is 
1886 essential that a name to address resolution mechanism be provided. 
1887 This mechanism could be via DNS, <TT
1888 CLASS="FILENAME"
1889 >/etc/hosts</TT
1890 >, 
1891 and so on.</P
1892 ></DIV
1893 ><DIV
1894 CLASS="SECT1"
1895 ><HR><H2
1896 CLASS="SECT1"
1897 ><A
1898 NAME="AEN149"
1899 >2.3. Use of the "Remote Announce" parameter</A
1900 ></H2
1901 ><P
1902 >The "remote announce" parameter of smb.conf can be used to forcibly ensure
1903 that all the NetBIOS names on a network get announced to a remote network.
1904 The syntax of the "remote announce" parameter is:
1905 <PRE
1906 CLASS="PROGRAMLISTING"
1907 >       remote announce = a.b.c.d [e.f.g.h] ...</PRE
1908 >
1909 _or_
1910 <PRE
1911 CLASS="PROGRAMLISTING"
1912 >       remote announce = a.b.c.d/WORKGROUP [e.f.g.h/WORKGROUP] ...</PRE
1913 >
1914
1915 where:
1916 <P
1917 ></P
1918 ><DIV
1919 CLASS="VARIABLELIST"
1920 ><DL
1921 ><DT
1922 >a.b.c.d and e.f.g.h</DT
1923 ><DD
1924 ><P
1925 >is either the LMB (Local Master Browser) IP address
1926 or the broadcst address of the remote network.
1927 ie: the LMB is at 192.168.1.10, or the address
1928 could be given as 192.168.1.255 where the netmask
1929 is assumed to be 24 bits (255.255.255.0).
1930 When the remote announcement is made to the broadcast
1931 address of the remote network every host will receive
1932 our announcements. This is noisy and therefore
1933 undesirable but may be necessary if we do NOT know
1934 the IP address of the remote LMB.</P
1935 ></DD
1936 ><DT
1937 >WORKGROUP</DT
1938 ><DD
1939 ><P
1940 >is optional and can be either our own workgroup
1941 or that of the remote network. If you use the
1942 workgroup name of the remote network then our
1943 NetBIOS machine names will end up looking like
1944 they belong to that workgroup, this may cause
1945 name resolution problems and should be avoided.</P
1946 ></DD
1947 ></DL
1948 ></DIV
1949 ></P
1950 ></DIV
1951 ><DIV
1952 CLASS="SECT1"
1953 ><HR><H2
1954 CLASS="SECT1"
1955 ><A
1956 NAME="AEN163"
1957 >2.4. Use of the "Remote Browse Sync" parameter</A
1958 ></H2
1959 ><P
1960 >The "remote browse sync" parameter of smb.conf is used to announce to
1961 another LMB that it must synchronise it's NetBIOS name list with our
1962 Samba LMB. It works ONLY if the Samba server that has this option is
1963 simultaneously the LMB on it's network segment.</P
1964 ><P
1965 >The syntax of the "remote browse  sync" parameter is:
1966
1967 <PRE
1968 CLASS="PROGRAMLISTING"
1969 >remote browse sync = a.b.c.d</PRE
1970 >
1971
1972 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
1973 ></DIV
1974 ><DIV
1975 CLASS="SECT1"
1976 ><HR><H2
1977 CLASS="SECT1"
1978 ><A
1979 NAME="AEN168"
1980 >2.5. Use of WINS</A
1981 ></H2
1982 ><P
1983 >Use of WINS (either Samba WINS _or_ MS Windows NT Server WINS) is highly
1984 recommended. Every NetBIOS machine registers it's name together with a
1985 name_type value for each of of several types of service it has available.
1986 eg: It registers it's name directly as a unique (the type 0x03) name.
1987 It also registers it's name if it is running the lanmanager compatible
1988 server service (used to make shares and printers available to other users)
1989 by registering the server (the type 0x20) name.</P
1990 ><P
1991 >All NetBIOS names are up to 15 characters in length. The name_type variable
1992 is added to the end of the name - thus creating a 16 character name. Any
1993 name that is shorter than 15 characters is padded with spaces to the 15th
1994 character. ie: All NetBIOS names are 16 characters long (including the
1995 name_type information).</P
1996 ><P
1997 >WINS can store these 16 character names as they get registered. A client
1998 that wants to log onto the network can ask the WINS server for a list
1999 of all names that have registered the NetLogon service name_type. This saves
2000 broadcast traffic and greatly expedites logon processing. Since broadcast
2001 name resolution can not be used across network segments this type of
2002 information can only be provided via WINS _or_ via statically configured
2003 "lmhosts" files that must reside on all clients in the absence of WINS.</P
2004 ><P
2005 >WINS also serves the purpose of forcing browse list synchronisation by all
2006 LMB's. LMB's must synchronise their browse list with the DMB (domain master
2007 browser) and WINS helps the LMB to identify it's DMB. By definition this
2008 will work only within a single workgroup. Note that the domain master browser
2009 has NOTHING to do with what is referred to as an MS Windows NT Domain. The
2010 later is a reference to a security environment while the DMB refers to the
2011 master controller for browse list information only.</P
2012 ><P
2013 >Use of WINS will work correctly only if EVERY client TCP/IP protocol stack
2014 has been configured to use the WINS server/s. Any client that has not been
2015 configured to use the WINS server will continue to use only broadcast based
2016 name registration so that WINS may NEVER get to know about it. In any case,
2017 machines that have not registered with a WINS server will fail name to address
2018 lookup attempts by other clients and will therefore cause workstation access
2019 errors.</P
2020 ><P
2021 >To configure Samba as a WINS server just add "wins support = yes" to the
2022 smb.conf file [globals] section.</P
2023 ><P
2024 >To configure Samba to register with a WINS server just add
2025 "wins server = a.b.c.d" to your smb.conf file [globals] section.</P
2026 ><P
2027 ><SPAN
2028 CLASS="emphasis"
2029 ><I
2030 CLASS="EMPHASIS"
2031 >DO NOT EVER</I
2032 ></SPAN
2033 > use both "wins support = yes" together
2034 with "wins server = a.b.c.d" particularly not using it's own IP address.
2035 Specifying both will cause nmbd to refuse to start!</P
2036 ></DIV
2037 ><DIV
2038 CLASS="SECT1"
2039 ><HR><H2
2040 CLASS="SECT1"
2041 ><A
2042 NAME="AEN179"
2043 >2.6. Do NOT use more than one (1) protocol on MS Windows machines</A
2044 ></H2
2045 ><P
2046 >A very common cause of browsing problems results from installing more than
2047 one protocol on an MS Windows machine.</P
2048 ><P
2049 >Every NetBIOS machine takes part in a process of electing the LMB (and DMB)
2050 every 15 minutes. A set of election criteria is used to determine the order
2051 of precidence for winning this election process. A machine running Samba or
2052 Windows NT will be biased so that the most suitable machine will predictably
2053 win and thus retain it's role.</P
2054 ><P
2055 >The election process is "fought out" so to speak over every NetBIOS network
2056 interface. In the case of a Windows 9x machine that has both TCP/IP and IPX
2057 installed and has NetBIOS enabled over both protocols the election will be
2058 decided over both protocols. As often happens, if the Windows 9x machine is
2059 the only one with both protocols then the LMB may be won on the NetBIOS
2060 interface over the IPX protocol. Samba will then lose the LMB role as Windows
2061 9x will insist it knows who the LMB is. Samba will then cease to function
2062 as an LMB and thus browse list operation on all TCP/IP only machines will
2063 fail.</P
2064 ><P
2065 ><SPAN
2066 CLASS="emphasis"
2067 ><I
2068 CLASS="EMPHASIS"
2069 >Windows 95, 98, 98se, Me are referred to generically as Windows 9x.
2070 The Windows NT4, 2000, XP and 2003 use common protocols. These are roughly
2071 referred to as the WinNT family, but it should be recognised that 2000 and
2072 XP/2003 introduce new protocol extensions that cause them to behave 
2073 differently from MS Windows NT4. Generally, where a server does NOT support
2074 the newer or extended protocol, these will fall back to the NT4 protocols.</I
2075 ></SPAN
2076 ></P
2077 ><P
2078 >The safest rule of all to follow it this - USE ONLY ONE PROTOCOL!</P
2079 ></DIV
2080 ><DIV
2081 CLASS="SECT1"
2082 ><HR><H2
2083 CLASS="SECT1"
2084 ><A
2085 NAME="AEN187"
2086 >2.7. Name Resolution Order</A
2087 ></H2
2088 ><P
2089 >Resolution of NetBIOS names to IP addresses can take place using a number
2090 of methods. The only ones that can provide NetBIOS name_type information
2091 are:</P
2092 ><P
2093 ></P
2094 ><TABLE
2095 BORDER="0"
2096 ><TBODY
2097 ><TR
2098 ><TD
2099 >WINS: the best tool!</TD
2100 ></TR
2101 ><TR
2102 ><TD
2103 >LMHOSTS: is static and hard to maintain.</TD
2104 ></TR
2105 ><TR
2106 ><TD
2107 >Broadcast: uses UDP and can not resolve names across remote segments.</TD
2108 ></TR
2109 ></TBODY
2110 ></TABLE
2111 ><P
2112 ></P
2113 ><P
2114 >Alternative means of name resolution includes:</P
2115 ><P
2116 ></P
2117 ><TABLE
2118 BORDER="0"
2119 ><TBODY
2120 ><TR
2121 ><TD
2122 >/etc/hosts: is static, hard to maintain, and lacks name_type info</TD
2123 ></TR
2124 ><TR
2125 ><TD
2126 >DNS: is a good choice but lacks essential name_type info.</TD
2127 ></TR
2128 ></TBODY
2129 ></TABLE
2130 ><P
2131 ></P
2132 ><P
2133 >Many sites want to restrict DNS lookups and want to avoid broadcast name
2134 resolution traffic. The "name resolve order" parameter is of great help here.
2135 The syntax of the "name resolve order" parameter is:
2136 <PRE
2137 CLASS="PROGRAMLISTING"
2138 >name resolve order = wins lmhosts bcast host</PRE
2139 >
2140 _or_
2141 <PRE
2142 CLASS="PROGRAMLISTING"
2143 >name resolve order = wins lmhosts      (eliminates bcast and host)</PRE
2144 >
2145 The default is:
2146 <PRE
2147 CLASS="PROGRAMLISTING"
2148 >name  resolve order = host lmhost wins bcast</PRE
2149 >.
2150 where "host" refers the the native methods used by the Unix system
2151 to implement the gethostbyname() function call. This is normally
2152 controlled by <TT
2153 CLASS="FILENAME"
2154 >/etc/host.conf</TT
2155 >, <TT
2156 CLASS="FILENAME"
2157 >/etc/nsswitch.conf</TT
2158 > and <TT
2159 CLASS="FILENAME"
2160 >/etc/resolv.conf</TT
2161 >.</P
2162 ></DIV
2163 ></DIV
2164 ><DIV
2165 CLASS="CHAPTER"
2166 ><HR><H1
2167 ><A
2168 NAME="PASSDB"
2169 ></A
2170 >Chapter 3. User information database</H1
2171 ><DIV
2172 CLASS="SECT1"
2173 ><H2
2174 CLASS="SECT1"
2175 ><A
2176 NAME="AEN244"
2177 >3.1. Introduction</A
2178 ></H2
2179 ><P
2180 >Old windows clients send plain text passwords over the wire. 
2181         Samba can check these passwords by crypting them and comparing them 
2182         to the hash stored in the unix user database.
2183         </P
2184 ><P
2185 >       Newer windows clients send encrypted passwords (so-called 
2186         Lanman and NT hashes) over 
2187         the wire, instead of plain text passwords. The newest clients 
2188         will only send encrypted passwords and refuse to send plain text 
2189         passwords, unless their registry is tweaked.
2190         </P
2191 ><P
2192 >These passwords can't be converted to unix style encrypted 
2193         passwords. Because of that you can't use the standard unix 
2194         user database, and you have to store the Lanman and NT hashes 
2195         somewhere else. </P
2196 ><P
2197 >Next to a differently encrypted passwords, 
2198         windows also stores certain data for each user 
2199         that is not stored in a unix user database, e.g. 
2200         workstations the user may logon from, the location where his/her 
2201         profile is stored, etc.
2202         Samba retrieves and stores this information using a "passdb backend".
2203         Commonly
2204         available backends are LDAP, plain text file, MySQL and nisplus.
2205         For more information, see the documentation about the 
2206         <B
2207 CLASS="COMMAND"
2208 >passdb backend = </B
2209 > parameter.
2210         </P
2211 ></DIV
2212 ><DIV
2213 CLASS="SECT1"
2214 ><HR><H2
2215 CLASS="SECT1"
2216 ><A
2217 NAME="AEN251"
2218 >3.2. Important Notes About Security</A
2219 ></H2
2220 ><P
2221 >The unix and SMB password encryption techniques seem similar 
2222         on the surface. This similarity is, however, only skin deep. The unix 
2223         scheme typically sends clear text passwords over the network when 
2224         logging in. This is bad. The SMB encryption scheme never sends the 
2225         cleartext password over the network but it does store the 16 byte 
2226         hashed values on disk. This is also bad. Why? Because the 16 byte hashed 
2227         values are a "password equivalent". You cannot derive the user's 
2228         password from them, but they could potentially be used in a modified 
2229         client to gain access to a server. This would require considerable 
2230         technical knowledge on behalf of the attacker but is perfectly possible. 
2231         You should thus treat the data stored in whatever 
2232         passdb backend you use (smbpasswd file, ldap, mysql) as though it contained the 
2233         cleartext passwords of all your users. Its contents must be kept 
2234         secret, and the file should be protected accordingly.</P
2235 ><P
2236 >Ideally we would like a password scheme which neither requires 
2237         plain text passwords on the net or on disk. Unfortunately this 
2238         is not available as Samba is stuck with being compatible with 
2239         other SMB systems (WinNT, WfWg, Win95 etc). </P
2240 ><DIV
2241 CLASS="WARNING"
2242 ><P
2243 ></P
2244 ><TABLE
2245 CLASS="WARNING"
2246 WIDTH="100%"
2247 BORDER="0"
2248 ><TR
2249 ><TD
2250 WIDTH="25"
2251 ALIGN="CENTER"
2252 VALIGN="TOP"
2253 ><IMG
2254 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
2255 HSPACE="5"
2256 ALT="Warning"></TD
2257 ><TD
2258 ALIGN="LEFT"
2259 VALIGN="TOP"
2260 ><P
2261 >Note that Windows NT 4.0 Service pack 3 changed the 
2262                 default for permissible authentication so that plaintext 
2263                 passwords are <SPAN
2264 CLASS="emphasis"
2265 ><I
2266 CLASS="EMPHASIS"
2267 >never</I
2268 ></SPAN
2269 > sent over the wire. 
2270                 The solution to this is either to switch to encrypted passwords 
2271                 with Samba or edit the Windows NT registry to re-enable plaintext 
2272                 passwords. See the document WinNT.txt for details on how to do 
2273                 this.</P
2274 ><P
2275 >Other Microsoft operating systems which also exhibit 
2276                 this behavior includes</P
2277 ><P
2278 > These versions of MS Windows do not support full domain
2279                 security protocols, although they may log onto a domain environment.
2280                 Of these Only MS Windows XP Home does NOT support domain logons.</P
2281 ><P
2282 ></P
2283 ><TABLE
2284 BORDER="0"
2285 ><TBODY
2286 ><TR
2287 ><TD
2288 >MS DOS Network client 3.0 with 
2289                         the basic network redirector installed</TD
2290 ></TR
2291 ><TR
2292 ><TD
2293 >Windows 95 with the network redirector 
2294                         update installed</TD
2295 ></TR
2296 ><TR
2297 ><TD
2298 >Windows 98 [se]</TD
2299 ></TR
2300 ><TR
2301 ><TD
2302 >Windows Me</TD
2303 ></TR
2304 ><TR
2305 ><TD
2306 >Windows XP Home</TD
2307 ></TR
2308 ></TBODY
2309 ></TABLE
2310 ><P
2311 ></P
2312 ><P
2313 > The following versions of MS Windows fully support domain
2314                 security protocols.</P
2315 ><P
2316 ></P
2317 ><TABLE
2318 BORDER="0"
2319 ><TBODY
2320 ><TR
2321 ><TD
2322 >Windows NT 3.5x</TD
2323 ></TR
2324 ><TR
2325 ><TD
2326 >Windows NT 4.0</TD
2327 ></TR
2328 ><TR
2329 ><TD
2330 >Windows 2000 Professional</TD
2331 ></TR
2332 ><TR
2333 ><TD
2334 >Windows 200x Server/Advanced Server</TD
2335 ></TR
2336 ><TR
2337 ><TD
2338 >Windows XP Professional</TD
2339 ></TR
2340 ></TBODY
2341 ></TABLE
2342 ><P
2343 ></P
2344 ><P
2345 ><SPAN
2346 CLASS="emphasis"
2347 ><I
2348 CLASS="EMPHASIS"
2349 >Note :</I
2350 ></SPAN
2351 >All current release of 
2352                 Microsoft SMB/CIFS clients support authentication via the
2353                 SMB Challenge/Response mechanism described here.  Enabling
2354                 clear text authentication does not disable the ability
2355                 of the client to participate in encrypted authentication.</P
2356 ><P
2357 >MS Windows clients will cache the encrypted password alone.
2358                 Even when plain text passwords are re-enabled, through the appropriate
2359                 registry change, the plain text password is NEVER cached. This means that
2360                 in the event that a network connections should become disconnected (broken)
2361                 only the cached (encrypted) password will be sent to the resource server
2362                 to affect a auto-reconnect. If the resource server does not support encrypted
2363                 passwords the auto-reconnect will fail. <SPAN
2364 CLASS="emphasis"
2365 ><I
2366 CLASS="EMPHASIS"
2367 >USE OF ENCRYPTED PASSWORDS
2368                 IS STRONGLY ADVISED.</I
2369 ></SPAN
2370 ></P
2371 ></TD
2372 ></TR
2373 ></TABLE
2374 ></DIV
2375 ><DIV
2376 CLASS="SECT2"
2377 ><HR><H3
2378 CLASS="SECT2"
2379 ><A
2380 NAME="AEN277"
2381 >3.2.1. Advantages of SMB Encryption</A
2382 ></H3
2383 ><P
2384 ></P
2385 ><TABLE
2386 BORDER="0"
2387 ><TBODY
2388 ><TR
2389 ><TD
2390 >Plain text passwords are not passed across 
2391                         the network. Someone using a network sniffer cannot just 
2392                         record passwords going to the SMB server.</TD
2393 ></TR
2394 ><TR
2395 ><TD
2396 >WinNT doesn't like talking to a server 
2397                         that SM not support encrypted passwords. It will refuse 
2398                         to browse the server if the server is also in user level 
2399                         security mode. It will insist on prompting the user for the 
2400                         password on each connection, which is very annoying. The
2401                         only things you can do to stop this is to use SMB encryption.
2402                         </TD
2403 ></TR
2404 ><TR
2405 ><TD
2406 >Encrypted password support allows auto-matic share
2407                         (resource) reconnects.</TD
2408 ></TR
2409 ></TBODY
2410 ></TABLE
2411 ><P
2412 ></P
2413 ></DIV
2414 ><DIV
2415 CLASS="SECT2"
2416 ><HR><H3
2417 CLASS="SECT2"
2418 ><A
2419 NAME="AEN283"
2420 >3.2.2. Advantages of non-encrypted passwords</A
2421 ></H3
2422 ><P
2423 ></P
2424 ><TABLE
2425 BORDER="0"
2426 ><TBODY
2427 ><TR
2428 ><TD
2429 >Plain text passwords are not kept 
2430                         on disk, and are NOT cached in memory. </TD
2431 ></TR
2432 ><TR
2433 ><TD
2434 >Uses same password file as other unix 
2435                         services such as login and ftp</TD
2436 ></TR
2437 ><TR
2438 ><TD
2439 >Use of other services (such as telnet and ftp) which
2440                         send plain text passwords over the net, so sending them for SMB
2441                         isn't such a big deal.</TD
2442 ></TR
2443 ></TBODY
2444 ></TABLE
2445 ><P
2446 ></P
2447 ></DIV
2448 ></DIV
2449 ><DIV
2450 CLASS="SECT1"
2451 ><HR><H2
2452 CLASS="SECT1"
2453 ><A
2454 NAME="AEN289"
2455 >3.3. The smbpasswd Command</A
2456 ></H2
2457 ><P
2458 >The smbpasswd utility is a utility similar to the 
2459         <B
2460 CLASS="COMMAND"
2461 >passwd</B
2462 > or <B
2463 CLASS="COMMAND"
2464 >yppasswd</B
2465 > programs.
2466         It maintains the two 32 byte password fields in the passdb backend. </P
2467 ><P
2468 ><B
2469 CLASS="COMMAND"
2470 >smbpasswd</B
2471 > works in a client-server mode 
2472         where it contacts the local smbd to change the user's password on its 
2473         behalf. This has enormous benefits - as follows.</P
2474 ><P
2475 ><B
2476 CLASS="COMMAND"
2477 >smbpasswd</B
2478 > has the capability 
2479         to change passwords on Windows NT servers (this only works when 
2480         the request is sent to the NT Primary Domain Controller if you 
2481         are changing an NT Domain user's password).</P
2482 ><P
2483 >To run smbpasswd as a normal user just type :</P
2484 ><P
2485 ><SAMP
2486 CLASS="PROMPT"
2487 >$ </SAMP
2488 ><KBD
2489 CLASS="USERINPUT"
2490 >smbpasswd</KBD
2491 ></P
2492 ><P
2493 ><SAMP
2494 CLASS="PROMPT"
2495 >Old SMB password: </SAMP
2496 ><KBD
2497 CLASS="USERINPUT"
2498 >&#60;type old value here - 
2499         or hit return if there was no old password&#62;</KBD
2500 ></P
2501 ><P
2502 ><SAMP
2503 CLASS="PROMPT"
2504 >New SMB Password: </SAMP
2505 ><KBD
2506 CLASS="USERINPUT"
2507 >&#60;type new value&#62;
2508         </KBD
2509 ></P
2510 ><P
2511 ><SAMP
2512 CLASS="PROMPT"
2513 >Repeat New SMB Password: </SAMP
2514 ><KBD
2515 CLASS="USERINPUT"
2516 >&#60;re-type new value
2517         </KBD
2518 ></P
2519 ><P
2520 >If the old value does not match the current value stored for 
2521         that user, or the two new values do not match each other, then the 
2522         password will not be changed.</P
2523 ><P
2524 >If invoked by an ordinary user it will only allow the user 
2525         to change his or her own Samba password.</P
2526 ><P
2527 >If run by the root user smbpasswd may take an optional 
2528         argument, specifying the user name whose SMB password you wish to 
2529         change.  Note that when run as root smbpasswd does not prompt for 
2530         or check the old password value, thus allowing root to set passwords 
2531         for users who have forgotten their passwords.</P
2532 ><P
2533 ><B
2534 CLASS="COMMAND"
2535 >smbpasswd</B
2536 > is designed to work in the same way 
2537         and be familiar to UNIX users who use the <B
2538 CLASS="COMMAND"
2539 >passwd</B
2540 > or 
2541         <B
2542 CLASS="COMMAND"
2543 >yppasswd</B
2544 > commands.</P
2545 ><P
2546 >For more details on using <B
2547 CLASS="COMMAND"
2548 >smbpasswd</B
2549 > refer 
2550         to the man page which will always be the definitive reference.</P
2551 ></DIV
2552 ><DIV
2553 CLASS="SECT1"
2554 ><HR><H2
2555 CLASS="SECT1"
2556 ><A
2557 NAME="AEN320"
2558 >3.4. Plain text</A
2559 ></H2
2560 ><P
2561 >Older versions of samba retrieved user information from the unix user database 
2562 and eventually some other fields from the file <TT
2563 CLASS="FILENAME"
2564 >/etc/samba/smbpasswd</TT
2565 >
2566 or <TT
2567 CLASS="FILENAME"
2568 >/etc/smbpasswd</TT
2569 >. When password encryption is disabled, no 
2570 data is stored at all.</P
2571 ></DIV
2572 ><DIV
2573 CLASS="SECT1"
2574 ><HR><H2
2575 CLASS="SECT1"
2576 ><A
2577 NAME="AEN325"
2578 >3.5. TDB</A
2579 ></H2
2580 ><P
2581 >Samba can also store the user data in a "TDB" (Trivial Database). Using this backend 
2582 doesn't require any additional configuration. This backend is recommended for new installations who 
2583 don't require LDAP.</P
2584 ></DIV
2585 ><DIV
2586 CLASS="SECT1"
2587 ><HR><H2
2588 CLASS="SECT1"
2589 ><A
2590 NAME="AEN328"
2591 >3.6. LDAP</A
2592 ></H2
2593 ><DIV
2594 CLASS="SECT2"
2595 ><H3
2596 CLASS="SECT2"
2597 ><A
2598 NAME="AEN330"
2599 >3.6.1. Introduction</A
2600 ></H3
2601 ><P
2602 >This document describes how to use an LDAP directory for storing Samba user
2603 account information traditionally stored in the smbpasswd(5) file.  It is
2604 assumed that the reader already has a basic understanding of LDAP concepts
2605 and has a working directory server already installed.  For more information
2606 on LDAP architectures and Directories, please refer to the following sites.</P
2607 ><P
2608 ></P
2609 ><UL
2610 ><LI
2611 ><P
2612 >OpenLDAP - <A
2613 HREF="http://www.openldap.org/"
2614 TARGET="_top"
2615 >http://www.openldap.org/</A
2616 ></P
2617 ></LI
2618 ><LI
2619 ><P
2620 >iPlanet Directory Server - <A
2621 HREF="http://iplanet.netscape.com/directory"
2622 TARGET="_top"
2623 >http://iplanet.netscape.com/directory</A
2624 ></P
2625 ></LI
2626 ></UL
2627 ><P
2628 >Note that <A
2629 HREF="http://www.ora.com/"
2630 TARGET="_top"
2631 >O'Reilly Publishing</A
2632 > is working on
2633 a guide to LDAP for System Administrators which has a planned release date of
2634 early summer, 2002.</P
2635 ><P
2636 >Two additional Samba resources which may prove to be helpful are</P
2637 ><P
2638 ></P
2639 ><UL
2640 ><LI
2641 ><P
2642 >The <A
2643 HREF="http://www.unav.es/cti/ldap-smb/ldap-smb-3-howto.html"
2644 TARGET="_top"
2645 >Samba-PDC-LDAP-HOWTO</A
2646 >
2647         maintained by Ignacio Coupeau.</P
2648 ></LI
2649 ><LI
2650 ><P
2651 >The NT migration scripts from <A
2652 HREF="http://samba.idealx.org/"
2653 TARGET="_top"
2654 >IDEALX</A
2655 > that are
2656         geared to manage users and group in such a Samba-LDAP Domain Controller configuration.
2657         </P
2658 ></LI
2659 ></UL
2660 ></DIV
2661 ><DIV
2662 CLASS="SECT2"
2663 ><HR><H3
2664 CLASS="SECT2"
2665 ><A
2666 NAME="AEN350"
2667 >3.6.2. Introduction</A
2668 ></H3
2669 ><P
2670 >Traditionally, when configuring <A
2671 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
2672 TARGET="_top"
2673 >"encrypt
2674 passwords = yes"</A
2675 > in Samba's <TT
2676 CLASS="FILENAME"
2677 >smb.conf</TT
2678 > file, user account
2679 information such as username, LM/NT password hashes, password change times, and account
2680 flags have been stored in the <TT
2681 CLASS="FILENAME"
2682 >smbpasswd(5)</TT
2683 > file.  There are several
2684 disadvantages to this approach for sites with very large numbers of users (counted
2685 in the thousands).</P
2686 ><P
2687 ></P
2688 ><UL
2689 ><LI
2690 ><P
2691 >The first is that all lookups must be performed sequentially.  Given that
2692 there are approximately two lookups per domain logon (one for a normal
2693 session connection such as when mapping a network drive or printer), this
2694 is a performance bottleneck for lareg sites.  What is needed is an indexed approach
2695 such as is used in databases.</P
2696 ></LI
2697 ><LI
2698 ><P
2699 >The second problem is that administrators who desired to replicate a
2700 smbpasswd file to more than one Samba server were left to use external
2701 tools such as <B
2702 CLASS="COMMAND"
2703 >rsync(1)</B
2704 > and <B
2705 CLASS="COMMAND"
2706 >ssh(1)</B
2707 >
2708 and wrote custom, in-house scripts.</P
2709 ></LI
2710 ><LI
2711 ><P
2712 >And finally, the amount of information which is stored in an
2713 smbpasswd entry leaves no room for additional attributes such as
2714 a home directory, password expiration time, or even a Relative
2715 Identified (RID).</P
2716 ></LI
2717 ></UL
2718 ><P
2719 >As a result of these defeciencies, a more robust means of storing user attributes
2720 used by smbd was developed.  The API which defines access to user accounts
2721 is commonly referred to as the samdb interface (previously this was called the passdb
2722 API, and is still so named in the CVS trees). In Samba 2.2.3, enabling support
2723 for a samdb backend (e.g. <VAR
2724 CLASS="PARAMETER"
2725 >--with-ldapsam</VAR
2726 > or
2727 <VAR
2728 CLASS="PARAMETER"
2729 >--with-tdbsam</VAR
2730 >) requires compile time support.</P
2731 ><P
2732 >When compiling Samba to include the <VAR
2733 CLASS="PARAMETER"
2734 >--with-ldapsam</VAR
2735 > autoconf
2736 option, smbd (and associated tools) will store and lookup user accounts in
2737 an LDAP directory.  In reality, this is very easy to understand.  If you are
2738 comfortable with using an smbpasswd file, simply replace "smbpasswd" with
2739 "LDAP directory" in all the documentation.</P
2740 ><P
2741 >There are a few points to stress about what the <VAR
2742 CLASS="PARAMETER"
2743 >--with-ldapsam</VAR
2744 >
2745 does not provide.  The LDAP support referred to in the this documentation does not
2746 include:</P
2747 ><P
2748 ></P
2749 ><UL
2750 ><LI
2751 ><P
2752 >A means of retrieving user account information from
2753         an Windows 2000 Active Directory server.</P
2754 ></LI
2755 ><LI
2756 ><P
2757 >A means of replacing /etc/passwd.</P
2758 ></LI
2759 ></UL
2760 ><P
2761 >The second item can be accomplished by using LDAP NSS and PAM modules.  LGPL
2762 versions of these libraries can be obtained from PADL Software
2763 (<A
2764 HREF="http://www.padl.com/"
2765 TARGET="_top"
2766 >http://www.padl.com/</A
2767 >).  However,
2768 the details of configuring these packages are beyond the scope of this document.</P
2769 ></DIV
2770 ><DIV
2771 CLASS="SECT2"
2772 ><HR><H3
2773 CLASS="SECT2"
2774 ><A
2775 NAME="AEN379"
2776 >3.6.3. Supported LDAP Servers</A
2777 ></H3
2778 ><P
2779 >The LDAP samdb code in 2.2.3 (and later) has been developed and tested
2780 using the OpenLDAP 2.0 server and client libraries. 
2781 The same code should be able to work with Netscape's Directory Server
2782 and client SDK. However, due to lack of testing so far, there are bound
2783 to be compile errors and bugs.  These should not be hard to fix.
2784 If you are so inclined, please be sure to forward all patches to
2785 <A
2786 HREF="samba-patches@samba.org"
2787 TARGET="_top"
2788 >samba-patches@samba.org</A
2789 > and
2790 <A
2791 HREF="jerry@samba.org"
2792 TARGET="_top"
2793 >jerry@samba.org</A
2794 >.</P
2795 ></DIV
2796 ><DIV
2797 CLASS="SECT2"
2798 ><HR><H3
2799 CLASS="SECT2"
2800 ><A
2801 NAME="AEN384"
2802 >3.6.4. Schema and Relationship to the RFC 2307 posixAccount</A
2803 ></H3
2804 ><P
2805 >Samba 3.0 includes the necessary schema file for OpenLDAP 2.0 in
2806 <TT
2807 CLASS="FILENAME"
2808 >examples/LDAP/samba.schema</TT
2809 >.  The sambaAccount objectclass is given here:</P
2810 ><P
2811 ><PRE
2812 CLASS="PROGRAMLISTING"
2813 >objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL
2814      DESC 'Samba Account'
2815      MUST ( uid $ rid )
2816      MAY  ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $
2817             logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $
2818             displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $
2819             description $ userWorkstations $ primaryGroupID $ domain ))</PRE
2820 ></P
2821 ><P
2822 >The samba.schema file has been formatted for OpenLDAP 2.0.  The OID's are
2823 owned by the Samba Team and as such is legal to be openly published.
2824 If you translate the schema to be used with Netscape DS, please
2825 submit the modified schema file as a patch to <A
2826 HREF="jerry@samba.org"
2827 TARGET="_top"
2828 >jerry@samba.org</A
2829 ></P
2830 ><P
2831 >Just as the smbpasswd file is mean to store information which supplements a
2832 user's <TT
2833 CLASS="FILENAME"
2834 >/etc/passwd</TT
2835 > entry, so is the sambaAccount object
2836 meant to supplement the UNIX user account information.  A sambaAccount is a
2837 <CODE
2838 CLASS="CONSTANT"
2839 >STRUCTURAL</CODE
2840 > objectclass so it can be stored individually
2841 in the directory.  However, there are several fields (e.g. uid) which overlap
2842 with the posixAccount objectclass outlined in RFC2307.  This is by design.</P
2843 ><P
2844 >In order to store all user account information (UNIX and Samba) in the directory,
2845 it is necessary to use the sambaAccount and posixAccount objectclasses in
2846 combination.  However, smbd will still obtain the user's UNIX account
2847 information via the standard C library calls (e.g. getpwnam(), et. al.).
2848 This means that the Samba server must also have the LDAP NSS library installed
2849 and functioning correctly.  This division of information makes it possible to
2850 store all Samba account information in LDAP, but still maintain UNIX account
2851 information in NIS while the network is transitioning to a full LDAP infrastructure.</P
2852 ></DIV
2853 ><DIV
2854 CLASS="SECT2"
2855 ><HR><H3
2856 CLASS="SECT2"
2857 ><A
2858 NAME="AEN396"
2859 >3.6.5. Configuring Samba with LDAP</A
2860 ></H3
2861 ><DIV
2862 CLASS="SECT3"
2863 ><H4
2864 CLASS="SECT3"
2865 ><A
2866 NAME="AEN398"
2867 >3.6.5.1. OpenLDAP configuration</A
2868 ></H4
2869 ><P
2870 >To include support for the sambaAccount object in an OpenLDAP directory
2871 server, first copy the samba.schema file to slapd's configuration directory.</P
2872 ><P
2873 ><SAMP
2874 CLASS="PROMPT"
2875 >root# </SAMP
2876 ><B
2877 CLASS="COMMAND"
2878 >cp samba.schema /etc/openldap/schema/</B
2879 ></P
2880 ><P
2881 >Next, include the <TT
2882 CLASS="FILENAME"
2883 >samba.schema</TT
2884 > file in <TT
2885 CLASS="FILENAME"
2886 >slapd.conf</TT
2887 >.
2888 The sambaAccount object contains two attributes which depend upon other schema
2889 files.  The 'uid' attribute is defined in <TT
2890 CLASS="FILENAME"
2891 >cosine.schema</TT
2892 > and
2893 the 'displayName' attribute is defined in the <TT
2894 CLASS="FILENAME"
2895 >inetorgperson.schema</TT
2896 >
2897 file.  Both of these must be included before the <TT
2898 CLASS="FILENAME"
2899 >samba.schema</TT
2900 > file.</P
2901 ><P
2902 ><PRE
2903 CLASS="PROGRAMLISTING"
2904 >## /etc/openldap/slapd.conf
2905
2906 ## schema files (core.schema is required by default)
2907 include            /etc/openldap/schema/core.schema
2908
2909 ## needed for sambaAccount
2910 include            /etc/openldap/schema/cosine.schema
2911 include            /etc/openldap/schema/inetorgperson.schema
2912 include            /etc/openldap/schema/samba.schema
2913
2914 ## uncomment this line if you want to support the RFC2307 (NIS) schema
2915 ## include         /etc/openldap/schema/nis.schema
2916
2917 ....</PRE
2918 ></P
2919 ><P
2920 >It is recommended that you maintain some indices on some of the most usefull attributes,
2921 like in the following example, to speed up searches made on sambaAccount objectclasses
2922 (and possibly posixAccount and posixGroup as well).</P
2923 ><P
2924 ><PRE
2925 CLASS="PROGRAMLISTING"
2926 ># Indices to maintain
2927 ## required by OpenLDAP 2.0
2928 index objectclass   eq
2929
2930 ## support pb_getsampwnam()
2931 index uid           pres,eq
2932 ## support pdb_getsambapwrid()
2933 index rid           eq
2934
2935 ## uncomment these if you are storing posixAccount and
2936 ## posixGroup entries in the directory as well
2937 ##index uidNumber     eq
2938 ##index gidNumber     eq
2939 ##index cn            eq
2940 ##index memberUid     eq</PRE
2941 ></P
2942 ></DIV
2943 ><DIV
2944 CLASS="SECT3"
2945 ><HR><H4
2946 CLASS="SECT3"
2947 ><A
2948 NAME="AEN415"
2949 >3.6.5.2. Configuring Samba</A
2950 ></H4
2951 ><P
2952 >The following parameters are available in smb.conf only with <VAR
2953 CLASS="PARAMETER"
2954 >--with-ldapsam</VAR
2955 >
2956 was included with compiling Samba.</P
2957 ><P
2958 ></P
2959 ><UL
2960 ><LI
2961 ><P
2962 ><A
2963 HREF="smb.conf.5.html#LDAPSSL"
2964 TARGET="_top"
2965 >ldap ssl</A
2966 ></P
2967 ></LI
2968 ><LI
2969 ><P
2970 ><A
2971 HREF="smb.conf.5.html#LDAPSERVER"
2972 TARGET="_top"
2973 >ldap server</A
2974 ></P
2975 ></LI
2976 ><LI
2977 ><P
2978 ><A
2979 HREF="smb.conf.5.html#LDAPADMINDN"
2980 TARGET="_top"
2981 >ldap admin dn</A
2982 ></P
2983 ></LI
2984 ><LI
2985 ><P
2986 ><A
2987 HREF="smb.conf.5.html#LDAPSUFFIX"
2988 TARGET="_top"
2989 >ldap suffix</A
2990 ></P
2991 ></LI
2992 ><LI
2993 ><P
2994 ><A
2995 HREF="smb.conf.5.html#LDAPFILTER"
2996 TARGET="_top"
2997 >ldap filter</A
2998 ></P
2999 ></LI
3000 ><LI
3001 ><P
3002 ><A
3003 HREF="smb.conf.5.html#LDAPPORT"
3004 TARGET="_top"
3005 >ldap port</A
3006 ></P
3007 ></LI
3008 ></UL
3009 ><P
3010 >These are described in the <A
3011 HREF="smb.conf.5.html"
3012 TARGET="_top"
3013 >smb.conf(5)</A
3014 > man
3015 page and so will not be repeated here.  However, a sample smb.conf file for
3016 use with an LDAP directory could appear as</P
3017 ><P
3018 ><PRE
3019 CLASS="PROGRAMLISTING"
3020 >## /usr/local/samba/lib/smb.conf
3021 [global]
3022      security = user
3023      encrypt passwords = yes
3024
3025      netbios name = TASHTEGO
3026      workgroup = NARNIA
3027
3028      # ldap related parameters
3029
3030      # define the DN to use when binding to the directory servers
3031      # The password for this DN is not stored in smb.conf.  Rather it
3032      # must be set by using 'smbpasswd -w <VAR
3033 CLASS="REPLACEABLE"
3034 >secretpw</VAR
3035 >' to store the
3036      # passphrase in the secrets.tdb file.  If the "ldap admin dn" values
3037      # changes, this password will need to be reset.
3038      ldap admin dn = "cn=Samba Manager,ou=people,dc=samba,dc=org"
3039
3040      #  specify the LDAP server's hostname (defaults to locahost)
3041      ldap server = ahab.samba.org
3042
3043      # Define the SSL option when connecting to the directory
3044      # ('off', 'start tls', or 'on' (default))
3045      ldap ssl = start tls
3046
3047      # define the port to use in the LDAP session (defaults to 636 when
3048      # "ldap ssl = on")
3049      ldap port = 389
3050
3051      # specify the base DN to use when searching the directory
3052      ldap suffix = "ou=people,dc=samba,dc=org"
3053
3054      # generally the default ldap search filter is ok
3055      # ldap filter = "(&#38;(uid=%u)(objectclass=sambaAccount))"</PRE
3056 ></P
3057 ></DIV
3058 ></DIV
3059 ><DIV
3060 CLASS="SECT2"
3061 ><HR><H3
3062 CLASS="SECT2"
3063 ><A
3064 NAME="AEN443"
3065 >3.6.6. Accounts and Groups management</A
3066 ></H3
3067 ><P
3068 >As users accounts are managed thru the sambaAccount objectclass, you should
3069 modify you existing administration tools to deal with sambaAccount attributes.</P
3070 ><P
3071 >Machines accounts are managed with the sambaAccount objectclass, just
3072 like users accounts. However, it's up to you to stored thoses accounts
3073 in a different tree of you LDAP namespace: you should use
3074 "ou=Groups,dc=plainjoe,dc=org" to store groups and
3075 "ou=People,dc=plainjoe,dc=org" to store users. Just configure your
3076 NSS and PAM accordingly (usually, in the /etc/ldap.conf configuration
3077 file).</P
3078 ><P
3079 >In Samba release 3.0, the group management system is based on posix
3080 groups. This means that Samba make usage of the posixGroup objectclass.
3081 For now, there is no NT-like group system management (global and local
3082 groups).</P
3083 ></DIV
3084 ><DIV
3085 CLASS="SECT2"
3086 ><HR><H3
3087 CLASS="SECT2"
3088 ><A
3089 NAME="AEN448"
3090 >3.6.7. Security and sambaAccount</A
3091 ></H3
3092 ><P
3093 >There are two important points to remember when discussing the security
3094 of sambaAccount entries in the directory.</P
3095 ><P
3096 ></P
3097 ><UL
3098 ><LI
3099 ><P
3100 ><SPAN
3101 CLASS="emphasis"
3102 ><I
3103 CLASS="EMPHASIS"
3104 >Never</I
3105 ></SPAN
3106 > retrieve the lmPassword or
3107         ntPassword attribute values over an unencrypted LDAP session.</P
3108 ></LI
3109 ><LI
3110 ><P
3111 ><SPAN
3112 CLASS="emphasis"
3113 ><I
3114 CLASS="EMPHASIS"
3115 >Never</I
3116 ></SPAN
3117 > allow non-admin users to
3118         view the lmPassword or ntPassword attribute values.</P
3119 ></LI
3120 ></UL
3121 ><P
3122 >These password hashes are clear text equivalents and can be used to impersonate
3123 the user without deriving the original clear text strings.  For more information
3124 on the details of LM/NT password hashes, refer to the <A
3125 HREF="ENCRYPTION.html"
3126 TARGET="_top"
3127 >ENCRYPTION chapter</A
3128 > of the Samba-HOWTO-Collection.</P
3129 ><P
3130 >To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults
3131 to require an encrypted session (<B
3132 CLASS="COMMAND"
3133 >ldap ssl = on</B
3134 >) using
3135 the default port of 636
3136 when contacting the directory server.  When using an OpenLDAP 2.0 server, it
3137 is possible to use the use the StartTLS LDAP extended  operation in the place of
3138 LDAPS.  In either case, you are strongly discouraged to disable this security
3139 (<B
3140 CLASS="COMMAND"
3141 >ldap ssl = off</B
3142 >).</P
3143 ><P
3144 >Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS
3145 extended operation.  However, the OpenLDAP library still provides support for
3146 the older method of securing communication between clients and servers.</P
3147 ><P
3148 >The second security precaution is to prevent non-administrative users from
3149 harvesting password hashes from the directory.  This can be done using the
3150 following ACL in <TT
3151 CLASS="FILENAME"
3152 >slapd.conf</TT
3153 >:</P
3154 ><P
3155 ><PRE
3156 CLASS="PROGRAMLISTING"
3157 >## allow the "ldap admin dn" access, but deny everyone else
3158 access to attrs=lmPassword,ntPassword
3159      by dn="cn=Samba Admin,ou=people,dc=plainjoe,dc=org" write
3160      by * none</PRE
3161 ></P
3162 ></DIV
3163 ><DIV
3164 CLASS="SECT2"
3165 ><HR><H3
3166 CLASS="SECT2"
3167 ><A
3168 NAME="AEN468"
3169 >3.6.8. LDAP specials attributes for sambaAccounts</A
3170 ></H3
3171 ><P
3172 >The sambaAccount objectclass is composed of the following attributes:</P
3173 ><P
3174 ></P
3175 ><UL
3176 ><LI
3177 ><P
3178 ><CODE
3179 CLASS="CONSTANT"
3180 >lmPassword</CODE
3181 >: the LANMAN password 16-byte hash stored as a character
3182         representation of a hexidecimal string.</P
3183 ></LI
3184 ><LI
3185 ><P
3186 ><CODE
3187 CLASS="CONSTANT"
3188 >ntPassword</CODE
3189 >: the NT password hash 16-byte stored as a character
3190         representation of a hexidecimal string.</P
3191 ></LI
3192 ><LI
3193 ><P
3194 ><CODE
3195 CLASS="CONSTANT"
3196 >pwdLastSet</CODE
3197 >: The integer time in seconds since 1970 when the
3198         <CODE
3199 CLASS="CONSTANT"
3200 >lmPassword</CODE
3201 > and <CODE
3202 CLASS="CONSTANT"
3203 >ntPassword</CODE
3204 > attributes were last set.
3205         </P
3206 ></LI
3207 ><LI
3208 ><P
3209 ><CODE
3210 CLASS="CONSTANT"
3211 >acctFlags</CODE
3212 >: string of 11 characters surrounded by square brackets []
3213         representing account flags such as U (user), W(workstation), X(no password expiration), and
3214         D(disabled).</P
3215 ></LI
3216 ><LI
3217 ><P
3218 ><CODE
3219 CLASS="CONSTANT"
3220 >logonTime</CODE
3221 >: Integer value currently unused</P
3222 ></LI
3223 ><LI
3224 ><P
3225 ><CODE
3226 CLASS="CONSTANT"
3227 >logoffTime</CODE
3228 >: Integer value currently unused</P
3229 ></LI
3230 ><LI
3231 ><P
3232 ><CODE
3233 CLASS="CONSTANT"
3234 >kickoffTime</CODE
3235 >: Integer value currently unused</P
3236 ></LI
3237 ><LI
3238 ><P
3239 ><CODE
3240 CLASS="CONSTANT"
3241 >pwdCanChange</CODE
3242 >: Integer value currently unused</P
3243 ></LI
3244 ><LI
3245 ><P
3246 ><CODE
3247 CLASS="CONSTANT"
3248 >pwdMustChange</CODE
3249 >: Integer value currently unused</P
3250 ></LI
3251 ><LI
3252 ><P
3253 ><CODE
3254 CLASS="CONSTANT"
3255 >homeDrive</CODE
3256 >: specifies the drive letter to which to map the
3257         UNC path specified by homeDirectory. The drive letter must be specified in the form "X:"
3258         where X is the letter of the drive to map. Refer to the "logon drive" parameter in the
3259         smb.conf(5) man page for more information.</P
3260 ></LI
3261 ><LI
3262 ><P
3263 ><CODE
3264 CLASS="CONSTANT"
3265 >scriptPath</CODE
3266 >: The scriptPath property specifies the path of
3267         the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path
3268         is relative to the netlogon share.  Refer to the "logon script" parameter in the
3269         smb.conf(5) man page for more information.</P
3270 ></LI
3271 ><LI
3272 ><P
3273 ><CODE
3274 CLASS="CONSTANT"
3275 >profilePath</CODE
3276 >: specifies a path to the user's profile.
3277         This value can be a null string, a local absolute path, or a UNC path.  Refer to the
3278         "logon path" parameter in the smb.conf(5) man page for more information.</P
3279 ></LI
3280 ><LI
3281 ><P
3282 ><CODE
3283 CLASS="CONSTANT"
3284 >smbHome</CODE
3285 >: The homeDirectory property specifies the path of
3286         the home directory for the user. The string can be null. If homeDrive is set and specifies
3287         a drive letter, homeDirectory should be a UNC path. The path must be a network
3288         UNC path of the form \\server\share\directory. This value can be a null string.
3289         Refer to the "logon home" parameter in the smb.conf(5) man page for more information.
3290         </P
3291 ></LI
3292 ><LI
3293 ><P
3294 ><CODE
3295 CLASS="CONSTANT"
3296 >userWorkstation</CODE
3297 >: character string value currently unused.
3298         </P
3299 ></LI
3300 ><LI
3301 ><P
3302 ><CODE
3303 CLASS="CONSTANT"
3304 >rid</CODE
3305 >: the integer representation of the user's relative identifier
3306         (RID).</P
3307 ></LI
3308 ><LI
3309 ><P
3310 ><CODE
3311 CLASS="CONSTANT"
3312 >primaryGroupID</CODE
3313 >: the relative identifier (RID) of the primary group
3314         of the user.</P
3315 ></LI
3316 ></UL
3317 ><P
3318 >The majority of these parameters are only used when Samba is acting as a PDC of
3319 a domain (refer to the <A
3320 HREF="Samba-PDC-HOWTO.html"
3321 TARGET="_top"
3322 >Samba-PDC-HOWTO</A
3323 > for details on
3324 how to configure Samba as a Primary Domain Controller). The following four attributes
3325 are only stored with the sambaAccount entry if the values are non-default values:</P
3326 ><P
3327 ></P
3328 ><UL
3329 ><LI
3330 ><P
3331 >smbHome</P
3332 ></LI
3333 ><LI
3334 ><P
3335 >scriptPath</P
3336 ></LI
3337 ><LI
3338 ><P
3339 >logonPath</P
3340 ></LI
3341 ><LI
3342 ><P
3343 >homeDrive</P
3344 ></LI
3345 ></UL
3346 ><P
3347 >These attributes are only stored with the sambaAccount entry if
3348 the values are non-default values.  For example, assume TASHTEGO has now been
3349 configured as a PDC and that <B
3350 CLASS="COMMAND"
3351 >logon home = \\%L\%u</B
3352 > was defined in
3353 its <TT
3354 CLASS="FILENAME"
3355 >smb.conf</TT
3356 > file. When a user named "becky" logons to the domain,
3357 the <VAR
3358 CLASS="PARAMETER"
3359 >logon home</VAR
3360 > string is expanded to \\TASHTEGO\becky.
3361 If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org",
3362 this value is used.  However, if this attribute does not exist, then the value
3363 of the <VAR
3364 CLASS="PARAMETER"
3365 >logon home</VAR
3366 > parameter is used in its place.  Samba
3367 will only write the attribute value to the directory entry is the value is
3368 something other than the default (e.g. \\MOBY\becky).</P
3369 ></DIV
3370 ><DIV
3371 CLASS="SECT2"
3372 ><HR><H3
3373 CLASS="SECT2"
3374 ><A
3375 NAME="AEN538"
3376 >3.6.9. Example LDIF Entries for a sambaAccount</A
3377 ></H3
3378 ><P
3379 >The following is a working LDIF with the inclusion of the posixAccount objectclass:</P
3380 ><P
3381 ><PRE
3382 CLASS="PROGRAMLISTING"
3383 >dn: uid=guest2, ou=people,dc=plainjoe,dc=org
3384 ntPassword: 878D8014606CDA29677A44EFA1353FC7
3385 pwdMustChange: 2147483647
3386 primaryGroupID: 1201
3387 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
3388 pwdLastSet: 1010179124
3389 logonTime: 0
3390 objectClass: sambaAccount
3391 uid: guest2
3392 kickoffTime: 2147483647
3393 acctFlags: [UX         ]
3394 logoffTime: 2147483647
3395 rid: 19006
3396 pwdCanChange: 0</PRE
3397 ></P
3398 ><P
3399 >The following is an LDIF entry for using both the sambaAccount and
3400 posixAccount objectclasses:</P
3401 ><P
3402 ><PRE
3403 CLASS="PROGRAMLISTING"
3404 >dn: uid=gcarter, ou=people,dc=plainjoe,dc=org
3405 logonTime: 0
3406 displayName: Gerald Carter
3407 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
3408 primaryGroupID: 1201
3409 objectClass: posixAccount
3410 objectClass: sambaAccount
3411 acctFlags: [UX         ]
3412 userPassword: {crypt}BpM2ej8Rkzogo
3413 uid: gcarter
3414 uidNumber: 9000
3415 cn: Gerald Carter
3416 loginShell: /bin/bash
3417 logoffTime: 2147483647
3418 gidNumber: 100
3419 kickoffTime: 2147483647
3420 pwdLastSet: 1010179230
3421 rid: 19000
3422 homeDirectory: /home/tashtego/gcarter
3423 pwdCanChange: 0
3424 pwdMustChange: 2147483647
3425 ntPassword: 878D8014606CDA29677A44EFA1353FC7</PRE
3426 ></P
3427 ></DIV
3428 ></DIV
3429 ><DIV
3430 CLASS="SECT1"
3431 ><HR><H2
3432 CLASS="SECT1"
3433 ><A
3434 NAME="AEN546"
3435 >3.7. MySQL</A
3436 ></H2
3437 ><DIV
3438 CLASS="SECT2"
3439 ><H3
3440 CLASS="SECT2"
3441 ><A
3442 NAME="AEN548"
3443 >3.7.1. Creating the database</A
3444 ></H3
3445 ><P
3446 >You either can set up your own table and specify the field names to pdb_mysql (see below
3447 for the column names) or use the default table. The file <TT
3448 CLASS="FILENAME"
3449 >examples/pdb/mysql/mysql.dump</TT
3450
3451 contains the correct queries to create the required tables. Use the command :
3452
3453 <B
3454 CLASS="COMMAND"
3455 >mysql -u<VAR
3456 CLASS="REPLACEABLE"
3457 >username</VAR
3458 > -h<VAR
3459 CLASS="REPLACEABLE"
3460 >hostname</VAR
3461 > -p<VAR
3462 CLASS="REPLACEABLE"
3463 >password</VAR
3464 > <VAR
3465 CLASS="REPLACEABLE"
3466 >databasename</VAR
3467 > &#60; <TT
3468 CLASS="FILENAME"
3469 >/path/to/samba/examples/pdb/mysql/mysql.dump</TT
3470 ></B
3471 >&#13;</P
3472 ></DIV
3473 ><DIV
3474 CLASS="SECT2"
3475 ><HR><H3
3476 CLASS="SECT2"
3477 ><A
3478 NAME="AEN558"
3479 >3.7.2. Configuring</A
3480 ></H3
3481 ><P
3482 >This plugin lacks some good documentation, but here is some short info:</P
3483 ><P
3484 >Add a the following to the <B
3485 CLASS="COMMAND"
3486 >passdb backend</B
3487 > variable in your <TT
3488 CLASS="FILENAME"
3489 >smb.conf</TT
3490 >:
3491 <PRE
3492 CLASS="PROGRAMLISTING"
3493 >passdb backend = [other-plugins] mysql:identifier [other-plugins]</PRE
3494 ></P
3495 ><P
3496 >The identifier can be any string you like, as long as it doesn't collide with 
3497 the identifiers of other plugins or other instances of pdb_mysql. If you 
3498 specify multiple pdb_mysql.so entries in 'passdb backend', you also need to 
3499 use different identifiers!</P
3500 ><P
3501 >Additional options can be given thru the smb.conf file in the [global] section.</P
3502 ><P
3503 ><PRE
3504 CLASS="PROGRAMLISTING"
3505 >identifier:mysql host                     - host name, defaults to 'localhost'
3506 identifier:mysql password
3507 identifier:mysql user                     - defaults to 'samba'
3508 identifier:mysql database                 - defaults to 'samba'
3509 identifier:mysql port                     - defaults to 3306
3510 identifier:table                          - Name of the table containing users</PRE
3511 ></P
3512 ><DIV
3513 CLASS="WARNING"
3514 ><P
3515 ></P
3516 ><TABLE
3517 CLASS="WARNING"
3518 WIDTH="100%"
3519 BORDER="0"
3520 ><TR
3521 ><TD
3522 WIDTH="25"
3523 ALIGN="CENTER"
3524 VALIGN="TOP"
3525 ><IMG
3526 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
3527 HSPACE="5"
3528 ALT="Warning"></TD
3529 ><TD
3530 ALIGN="LEFT"
3531 VALIGN="TOP"
3532 ><P
3533 >Since the password for the mysql user is stored in the 
3534 smb.conf file, you should make the the smb.conf file 
3535 readable only to the user that runs samba. This is considered a security 
3536 bug and will be fixed soon.</P
3537 ></TD
3538 ></TR
3539 ></TABLE
3540 ></DIV
3541 ><P
3542 >Names of the columns in this table(I've added column types those columns should have first):</P
3543 ><P
3544 ><PRE
3545 CLASS="PROGRAMLISTING"
3546 >identifier:logon time column             - int(9)
3547 identifier:logoff time column            - int(9)
3548 identifier:kickoff time column           - int(9)
3549 identifier:pass last set time column     - int(9)
3550 identifier:pass can change time column   - int(9)
3551 identifier:pass must change time column  - int(9)
3552 identifier:username column               - varchar(255) - unix username
3553 identifier:domain column                 - varchar(255) - NT domain user is part of
3554 identifier:nt username column            - varchar(255) - NT username
3555 identifier:fullname column            - varchar(255) - Full name of user
3556 identifier:home dir column               - varchar(255) - Unix homedir path
3557 identifier:dir drive column              - varchar(2) - Directory drive path (eg: 'H:')
3558 identifier:logon script column           - varchar(255) - Batch file to run on client side when logging on
3559 identifier:profile path column           - varchar(255) - Path of profile
3560 identifier:acct desc column              - varchar(255) - Some ASCII NT user data
3561 identifier:workstations column           - varchar(255) - Workstations user can logon to (or NULL for all)
3562 identifier:unknown string column         - varchar(255) - unknown string
3563 identifier:munged dial column            - varchar(255) - ?
3564 identifier:uid column                    - int(9) - Unix user ID (uid)
3565 identifier:gid column                    - int(9) - Unix user group (gid)
3566 identifier:user sid column               - varchar(255) - NT user SID
3567 identifier:group sid column              - varchar(255) - NT group ID
3568 identifier:lanman pass column            - varchar(255) - encrypted lanman password
3569 identifier:nt pass column                - varchar(255) - encrypted nt passwd
3570 identifier:plain pass column             - varchar(255) - plaintext password
3571 identifier:acct control column           - int(9) - nt user data
3572 identifier:unknown 3 column              - int(9) - unknown
3573 identifier:logon divs column             - int(9) - ?
3574 identifier:hours len column              - int(9) - ?
3575 identifier:unknown 5 column              - int(9) - unknown
3576 identifier:unknown 6 column              - int(9) - unknown</PRE
3577 ></P
3578 ><P
3579 >Eventually, you can put a colon (:) after the name of each column, which 
3580 should specify the column to update when updating the table. You can also
3581 specify nothing behind the colon - then the data from the field will not be 
3582 updated. </P
3583 ></DIV
3584 ><DIV
3585 CLASS="SECT2"
3586 ><HR><H3
3587 CLASS="SECT2"
3588 ><A
3589 NAME="AEN575"
3590 >3.7.3. Using plaintext passwords or encrypted password</A
3591 ></H3
3592 ><P
3593 >I strongly discourage the use of plaintext passwords, however, you can use them:</P
3594 ><P
3595 >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:plain pass column' to the name of the column containing the plaintext passwords. </P
3596 ><P
3597 >If you use encrypted passwords, set the 'identifier:plain pass column' to 'NULL' (without the quotes). This is the default.</P
3598 ></DIV
3599 ><DIV
3600 CLASS="SECT2"
3601 ><HR><H3
3602 CLASS="SECT2"
3603 ><A
3604 NAME="AEN580"
3605 >3.7.4. Getting non-column data from the table</A
3606 ></H3
3607 ><P
3608 >It is possible to have not all data in the database and making some 'constant'.</P
3609 ><P
3610 >For example, you can set 'identifier:fullname column' to : 
3611 <B
3612 CLASS="COMMAND"
3613 >CONCAT(First_name,' ',Sur_name)</B
3614 ></P
3615 ><P
3616 >Or, set 'identifier:workstations column' to :
3617 <B
3618 CLASS="COMMAND"
3619 >NULL</B
3620 ></P
3621 ><P
3622 >See the MySQL documentation for more language constructs.</P
3623 ></DIV
3624 ></DIV
3625 ><DIV
3626 CLASS="SECT1"
3627 ><HR><H2
3628 CLASS="SECT1"
3629 ><A
3630 NAME="AEN588"
3631 >3.8. XML</A
3632 ></H2
3633 ><P
3634 >This module requires libxml2 to be installed.</P
3635 ><P
3636 >The usage of pdb_xml is pretty straightforward. To export data, use:
3637
3638 <B
3639 CLASS="COMMAND"
3640 >pdbedit -e xml:filename</B
3641 >
3642
3643 (where filename is the name of the file to put the data in)</P
3644 ><P
3645 >To import data, use:
3646 <B
3647 CLASS="COMMAND"
3648 >pdbedit -i xml:filename -e current-pdb</B
3649 >
3650
3651 Where filename is the name to read the data from and current-pdb to put it in.</P
3652 ></DIV
3653 ></DIV
3654 ></DIV
3655 ><DIV
3656 CLASS="PART"
3657 ><A
3658 NAME="TYPE"
3659 ></A
3660 ><DIV
3661 CLASS="TITLEPAGE"
3662 ><H1
3663 CLASS="TITLE"
3664 >II. Type of installation</H1
3665 ><DIV
3666 CLASS="PARTINTRO"
3667 ><A
3668 NAME="AEN597"
3669 ></A
3670 ><H1
3671 >Introduction</H1
3672 ><P
3673 >Samba can operate in various SMB networks. This part contains information on configuring samba 
3674 for various environments.</P
3675 ></DIV
3676 ><DIV
3677 CLASS="TOC"
3678 ><DL
3679 ><DT
3680 ><B
3681 >Table of Contents</B
3682 ></DT
3683 ><DT
3684 >4. <A
3685 HREF="#SERVERTYPE"
3686 >Nomenclature of Server Types</A
3687 ></DT
3688 ><DD
3689 ><DL
3690 ><DT
3691 >4.1. <A
3692 HREF="#AEN626"
3693 >Stand Alone Server</A
3694 ></DT
3695 ><DT
3696 >4.2. <A
3697 HREF="#AEN633"
3698 >Domain Member Server</A
3699 ></DT
3700 ><DT
3701 >4.3. <A
3702 HREF="#AEN639"
3703 >Domain Controller</A
3704 ></DT
3705 ><DD
3706 ><DL
3707 ><DT
3708 >4.3.1. <A
3709 HREF="#AEN642"
3710 >Domain Controller Types</A
3711 ></DT
3712 ></DL
3713 ></DD
3714 ></DL
3715 ></DD
3716 ><DT
3717 >5. <A
3718 HREF="#SECURITYLEVELS"
3719 >Samba as Stand-Alone Server</A
3720 ></DT
3721 ><DD
3722 ><DL
3723 ><DT
3724 >5.1. <A
3725 HREF="#AEN668"
3726 >User and Share security level</A
3727 ></DT
3728 ><DD
3729 ><DL
3730 ><DT
3731 >5.1.1. <A
3732 HREF="#AEN671"
3733 >User Level Security</A
3734 ></DT
3735 ><DT
3736 >5.1.2. <A
3737 HREF="#AEN681"
3738 >Share Level Security</A
3739 ></DT
3740 ><DT
3741 >5.1.3. <A
3742 HREF="#AEN685"
3743 >Server Level Security</A
3744 ></DT
3745 ><DT
3746 >5.1.4. <A
3747 HREF="#AEN724"
3748 >Domain Level Security</A
3749 ></DT
3750 ><DT
3751 >5.1.5. <A
3752 HREF="#AEN745"
3753 >ADS Level Security</A
3754 ></DT
3755 ></DL
3756 ></DD
3757 ></DL
3758 ></DD
3759 ><DT
3760 >6. <A
3761 HREF="#SAMBA-PDC"
3762 >Samba as an NT4 or Win2k Primary Domain Controller</A
3763 ></DT
3764 ><DD
3765 ><DL
3766 ><DT
3767 >6.1. <A
3768 HREF="#AEN772"
3769 >Prerequisite Reading</A
3770 ></DT
3771 ><DT
3772 >6.2. <A
3773 HREF="#AEN777"
3774 >Background</A
3775 ></DT
3776 ><DT
3777 >6.3. <A
3778 HREF="#AEN817"
3779 >Configuring the Samba Domain Controller</A
3780 ></DT
3781 ><DT
3782 >6.4. <A
3783 HREF="#AEN859"
3784 >Creating Machine Trust Accounts and Joining Clients to the Domain</A
3785 ></DT
3786 ><DD
3787 ><DL
3788 ><DT
3789 >6.4.1. <A
3790 HREF="#AEN902"
3791 >Manual Creation of Machine Trust Accounts</A
3792 ></DT
3793 ><DT
3794 >6.4.2. <A
3795 HREF="#AEN943"
3796 >"On-the-Fly" Creation of Machine Trust Accounts</A
3797 ></DT
3798 ><DT
3799 >6.4.3. <A
3800 HREF="#AEN952"
3801 >Joining the Client to the Domain</A
3802 ></DT
3803 ></DL
3804 ></DD
3805 ><DT
3806 >6.5. <A
3807 HREF="#AEN967"
3808 >Common Problems and Errors</A
3809 ></DT
3810 ><DT
3811 >6.6. <A
3812 HREF="#AEN1013"
3813 >What other help can I get?</A
3814 ></DT
3815 ><DT
3816 >6.7. <A
3817 HREF="#AEN1127"
3818 >Domain Control for Windows 9x/ME</A
3819 ></DT
3820 ><DD
3821 ><DL
3822 ><DT
3823 >6.7.1. <A
3824 HREF="#AEN1150"
3825 >Configuration Instructions:    Network Logons</A
3826 ></DT
3827 ></DL
3828 ></DD
3829 ></DL
3830 ></DD
3831 ><DT
3832 >7. <A
3833 HREF="#SAMBA-BDC"
3834 >Samba Backup Domain Controller to Samba Domain Control</A
3835 ></DT
3836 ><DD
3837 ><DL
3838 ><DT
3839 >7.1. <A
3840 HREF="#AEN1180"
3841 >Prerequisite Reading</A
3842 ></DT
3843 ><DT
3844 >7.2. <A
3845 HREF="#AEN1184"
3846 >Background</A
3847 ></DT
3848 ><DT
3849 >7.3. <A
3850 HREF="#AEN1192"
3851 >What qualifies a Domain Controller on the network?</A
3852 ></DT
3853 ><DD
3854 ><DL
3855 ><DT
3856 >7.3.1. <A
3857 HREF="#AEN1195"
3858 >How does a Workstation find its domain controller?</A
3859 ></DT
3860 ><DT
3861 >7.3.2. <A
3862 HREF="#AEN1198"
3863 >When is the PDC needed?</A
3864 ></DT
3865 ></DL
3866 ></DD
3867 ><DT
3868 >7.4. <A
3869 HREF="#AEN1201"
3870 >Can Samba be a Backup Domain Controller to an NT PDC?</A
3871 ></DT
3872 ><DT
3873 >7.5. <A
3874 HREF="#AEN1206"
3875 >How do I set up a Samba BDC?</A
3876 ></DT
3877 ><DD
3878 ><DL
3879 ><DT
3880 >7.5.1. <A
3881 HREF="#AEN1223"
3882 >How do I replicate the smbpasswd file?</A
3883 ></DT
3884 ><DT
3885 >7.5.2. <A
3886 HREF="#AEN1227"
3887 >Can I do this all with LDAP?</A
3888 ></DT
3889 ></DL
3890 ></DD
3891 ></DL
3892 ></DD
3893 ><DT
3894 >8. <A
3895 HREF="#ADS"
3896 >Samba as a ADS domain member</A
3897 ></DT
3898 ><DD
3899 ><DL
3900 ><DT
3901 >8.1. <A
3902 HREF="#AEN1238"
3903 >Setup your <TT
3904 CLASS="FILENAME"
3905 >smb.conf</TT
3906 ></A
3907 ></DT
3908 ><DT
3909 >8.2. <A
3910 HREF="#AEN1249"
3911 >Setup your <TT
3912 CLASS="FILENAME"
3913 >/etc/krb5.conf</TT
3914 ></A
3915 ></DT
3916 ><DT
3917 >8.3. <A
3918 HREF="#AEN1260"
3919 >Create the computer account</A
3920 ></DT
3921 ><DD
3922 ><DL
3923 ><DT
3924 >8.3.1. <A
3925 HREF="#AEN1264"
3926 >Possible errors</A
3927 ></DT
3928 ></DL
3929 ></DD
3930 ><DT
3931 >8.4. <A
3932 HREF="#AEN1272"
3933 >Test your server setup</A
3934 ></DT
3935 ><DT
3936 >8.5. <A
3937 HREF="#AEN1277"
3938 >Testing with smbclient</A
3939 ></DT
3940 ><DT
3941 >8.6. <A
3942 HREF="#AEN1280"
3943 >Notes</A
3944 ></DT
3945 ></DL
3946 ></DD
3947 ><DT
3948 >9. <A
3949 HREF="#DOMAIN-SECURITY"
3950 >Samba as a NT4 or Win2k domain member</A
3951 ></DT
3952 ><DD
3953 ><DL
3954 ><DT
3955 >9.1. <A
3956 HREF="#AEN1302"
3957 >Joining an NT Domain with Samba 3.0</A
3958 ></DT
3959 ><DT
3960 >9.2. <A
3961 HREF="#AEN1356"
3962 >Why is this better than security = server?</A
3963 ></DT
3964 ></DL
3965 ></DD
3966 ></DL
3967 ></DIV
3968 ></DIV
3969 ><DIV
3970 CLASS="CHAPTER"
3971 ><HR><H1
3972 ><A
3973 NAME="SERVERTYPE"
3974 ></A
3975 >Chapter 4. Nomenclature of Server Types</H1
3976 ><P
3977 >Adminstrators of Microsoft networks often refer to there being three
3978 different type of servers:</P
3979 ><P
3980 ></P
3981 ><UL
3982 ><LI
3983 ><P
3984 >Stand Alone Server</P
3985 ></LI
3986 ><LI
3987 ><P
3988 >Domain Member Server</P
3989 ></LI
3990 ><LI
3991 ><P
3992 >Domain Controller</P
3993 ><P
3994 ></P
3995 ><UL
3996 ><LI
3997 ><P
3998 >Primary Domain Controller</P
3999 ></LI
4000 ><LI
4001 ><P
4002 >Backup Domain Controller</P
4003 ></LI
4004 ><LI
4005 ><P
4006 >ADS Domain Controller</P
4007 ></LI
4008 ></UL
4009 ></LI
4010 ></UL
4011 ><P
4012 >A network administrator who is familiar with these terms and who
4013 wishes to migrate to or use Samba will want to know what these terms mean
4014 within a Samba context.</P
4015 ><DIV
4016 CLASS="SECT1"
4017 ><HR><H2
4018 CLASS="SECT1"
4019 ><A
4020 NAME="AEN626"
4021 >4.1. Stand Alone Server</A
4022 ></H2
4023 ><P
4024 >The term <SPAN
4025 CLASS="emphasis"
4026 ><I
4027 CLASS="EMPHASIS"
4028 >stand alone server</I
4029 ></SPAN
4030 > means that the server
4031 will provide local authentication and access control for all resources
4032 that are available from it. In general this means that there will be a
4033 local user database. In more technical terms, it means that resources
4034 on the machine will either be made available in either SHARE mode or in
4035 USER mode. SHARE mode and USER mode security are documented under
4036 discussions regarding "security mode". The smb.conf configuration parameters
4037 that control security mode are: "security = user" and "security = share".</P
4038 ><P
4039 >No special action is needed other than to create user accounts. Stand-alone
4040 servers do NOT provide network logon services, meaning that machines that
4041 use this server do NOT perform a domain logon but instead make use only of
4042 the MS Windows logon which is local to the MS Windows workstation/server.</P
4043 ><P
4044 >Samba tends to blur the distinction a little in respect of what is
4045 a stand alone server. This is because the authentication database may be
4046 local or on a remote server, even if from the samba protocol perspective
4047 the samba server is NOT a member of a domain security context.</P
4048 ><P
4049 >Through the use of PAM (Pluggable Authentication Modules) and nsswitch
4050 (the name service switcher) the source of authentication may reside on 
4051 another server. We would be inclined to call this the authentication server.
4052 This means that the samba server may use the local Unix/Linux system
4053 password database (/etc/passwd or /etc/shadow), may use a local smbpasswd
4054 file (/etc/samba/smbpasswd or /usr/local/samba/lib/private/smbpasswd), or
4055 may use an LDAP back end, or even via PAM and Winbind another CIFS/SMB
4056 server for authentication.</P
4057 ></DIV
4058 ><DIV
4059 CLASS="SECT1"
4060 ><HR><H2
4061 CLASS="SECT1"
4062 ><A
4063 NAME="AEN633"
4064 >4.2. Domain Member Server</A
4065 ></H2
4066 ><P
4067 >This mode of server operation involves the samba machine being made a member
4068 of a domain security context. This means by definition that all user authentication
4069 will be done from a centrally defined authentication regime. The authentication
4070 regime may come from an NT3/4 style (old domain technology) server, or it may be
4071 provided from an Active Directory server (ADS) running on MS Windows 2000 or later.
4072 &#62;/para&#62;&#13;</P
4073 ><P
4074 ><SPAN
4075 CLASS="emphasis"
4076 ><I
4077 CLASS="EMPHASIS"
4078 >Of course it should be clear that the authentication back end itself could be from any
4079 distributed directory architecture server that is supported by Samba. This can be
4080 LDAP (from OpenLDAP), or Sun's iPlanet, of NetWare Directory Server, etc.</I
4081 ></SPAN
4082 ></P
4083 ><P
4084 >Please refer to the section on Howto configure Samba as a Primary Domain Controller
4085 and for more information regarding how to create a domain machine account for a
4086 domain member server as well as for information regading how to enable the samba
4087 domain member machine to join the domain and to be fully trusted by it.</P
4088 ></DIV
4089 ><DIV
4090 CLASS="SECT1"
4091 ><HR><H2
4092 CLASS="SECT1"
4093 ><A
4094 NAME="AEN639"
4095 >4.3. Domain Controller</A
4096 ></H2
4097 ><P
4098 >Over the years public perceptions of what Domain Control really is has taken on an
4099 almost mystical nature. Before we branch into a brief overview of what Domain Control
4100 is the following types of controller are known:</P
4101 ><DIV
4102 CLASS="SECT2"
4103 ><HR><H3
4104 CLASS="SECT2"
4105 ><A
4106 NAME="AEN642"
4107 >4.3.1. Domain Controller Types</A
4108 ></H3
4109 ><P
4110 ></P
4111 ><TABLE
4112 BORDER="0"
4113 ><TBODY
4114 ><TR
4115 ><TD
4116 >Primary Domain Controller</TD
4117 ></TR
4118 ><TR
4119 ><TD
4120 >Backup Domain Controller</TD
4121 ></TR
4122 ><TR
4123 ><TD
4124 >ADS Domain Controller</TD
4125 ></TR
4126 ></TBODY
4127 ></TABLE
4128 ><P
4129 ></P
4130 ><P
4131 >The <SPAN
4132 CLASS="emphasis"
4133 ><I
4134 CLASS="EMPHASIS"
4135 >Primary Domain Controller</I
4136 ></SPAN
4137 > or PDC plays an important role in the MS 
4138 Windows NT3 and NT4 Domain Control architecture, but not in the manner that so many
4139 expect. The PDC seeds the Domain Control database (a part of the Windows registry) and
4140 it plays a key part in synchronisation of the domain authentication database. </P
4141 ><P
4142 >New to Samba-3.0.0 is the ability to use a back-end file that holds the same type of data as
4143 the NT4 style SAM (Security Account Manager) database (one of the registry files).
4144 The samba-3.0.0 SAM can be specified via the smb.conf file parameter "passwd backend" and
4145 valid options include <SPAN
4146 CLASS="emphasis"
4147 ><I
4148 CLASS="EMPHASIS"
4149 > smbpasswd tdbsam ldapsam nisplussam plugin unixsam</I
4150 ></SPAN
4151 >.
4152 The smbpasswd, tdbsam and ldapsam options can have a "_nua" suffix to indicate that No Unix
4153 Accounts need to be created. In other words, the Samba SAM will be independant of Unix/Linux
4154 system accounts, provided a uid range is defined from which SAM accounts can be created.</P
4155 ><P
4156 >The <SPAN
4157 CLASS="emphasis"
4158 ><I
4159 CLASS="EMPHASIS"
4160 >Backup Domain Controller</I
4161 ></SPAN
4162 > or BDC plays a key role in servicing network
4163 authentication requests. The BDC is biased to answer logon requests so that on a network segment
4164 that has a BDC and a PDC the BDC will be most likely to service network logon requests. The PDC will
4165 answer network logon requests when the BDC is too busy (high load). A BDC can be promoted to
4166 a PDC. If the PDC is on line at the time that the BDC is promoted to PDC the previous PDC is
4167 automatically demoted to a BDC.</P
4168 ><P
4169 >At this time Samba is NOT capable of acting as an <SPAN
4170 CLASS="emphasis"
4171 ><I
4172 CLASS="EMPHASIS"
4173 >ADS Domain Controller</I
4174 ></SPAN
4175 >.&#13;</P
4176 ></DIV
4177 ></DIV
4178 ></DIV
4179 ><DIV
4180 CLASS="CHAPTER"
4181 ><HR><H1
4182 ><A
4183 NAME="SECURITYLEVELS"
4184 ></A
4185 >Chapter 5. Samba as Stand-Alone Server</H1
4186 ><P
4187 >In this section the function and purpose of Samba's <SPAN
4188 CLASS="emphasis"
4189 ><I
4190 CLASS="EMPHASIS"
4191 >security</I
4192 ></SPAN
4193 >
4194 modes are described.</P
4195 ><DIV
4196 CLASS="SECT1"
4197 ><HR><H2
4198 CLASS="SECT1"
4199 ><A
4200 NAME="AEN668"
4201 >5.1. User and Share security level</A
4202 ></H2
4203 ><P
4204 >A SMB server tells the client at startup what "security level" it is
4205 running. There are two options "share level" and "user level". Which
4206 of these two the client receives affects the way the client then tries
4207 to authenticate itself. It does not directly affect (to any great
4208 extent) the way the Samba server does security. I know this is
4209 strange, but it fits in with the client/server approach of SMB. In SMB
4210 everything is initiated and controlled by the client, and the server
4211 can only tell the client what is available and whether an action is
4212 allowed. </P
4213 ><DIV
4214 CLASS="SECT2"
4215 ><HR><H3
4216 CLASS="SECT2"
4217 ><A
4218 NAME="AEN671"
4219 >5.1.1. User Level Security</A
4220 ></H3
4221 ><P
4222 >I'll describe user level security first, as its simpler. In user level
4223 security the client will send a "session setup" command directly after
4224 the protocol negotiation. This contains a username and password. The
4225 server can either accept or reject that username/password
4226 combination. Note that at this stage the server has no idea what
4227 share the client will eventually try to connect to, so it can't base
4228 the "accept/reject" on anything other than:</P
4229 ><P
4230 ></P
4231 ><OL
4232 TYPE="1"
4233 ><LI
4234 ><P
4235 >the username/password</P
4236 ></LI
4237 ><LI
4238 ><P
4239 >the machine that the client is coming from</P
4240 ></LI
4241 ></OL
4242 ><P
4243 >If the server accepts the username/password then the client expects to
4244 be able to mount any share (using a "tree connection") without
4245 specifying a password. It expects that all access rights will be as
4246 the username/password specified in the "session setup". </P
4247 ><P
4248 >It is also possible for a client to send multiple "session setup"
4249 requests. When the server responds it gives the client a "uid" to use
4250 as an authentication tag for that username/password. The client can
4251 maintain multiple authentication contexts in this way (WinDD is an
4252 example of an application that does this)</P
4253 ></DIV
4254 ><DIV
4255 CLASS="SECT2"
4256 ><HR><H3
4257 CLASS="SECT2"
4258 ><A
4259 NAME="AEN681"
4260 >5.1.2. Share Level Security</A
4261 ></H3
4262 ><P
4263 >Ok, now for share level security. In share level security the client
4264 authenticates itself separately for each share. It will send a
4265 password along with each "tree connection" (share mount). It does not
4266 explicitly send a username with this operation. The client is
4267 expecting a password to be associated with each share, independent of
4268 the user. This means that samba has to work out what username the
4269 client probably wants to use. It is never explicitly sent the
4270 username. Some commercial SMB servers such as NT actually associate
4271 passwords directly with shares in share level security, but samba
4272 always uses the unix authentication scheme where it is a
4273 username/password that is authenticated, not a "share/password".</P
4274 ><P
4275 >Many clients send a "session setup" even if the server is in share
4276 level security. They normally send a valid username but no
4277 password. Samba records this username in a list of "possible
4278 usernames". When the client then does a "tree connection" it also adds
4279 to this list the name of the share they try to connect to (useful for
4280 home directories) and any users listed in the "user =" smb.conf
4281 line. The password is then checked in turn against these "possible
4282 usernames". If a match is found then the client is authenticated as
4283 that user.</P
4284 ></DIV
4285 ><DIV
4286 CLASS="SECT2"
4287 ><HR><H3
4288 CLASS="SECT2"
4289 ><A
4290 NAME="AEN685"
4291 >5.1.3. Server Level Security</A
4292 ></H3
4293 ><P
4294 >Finally "server level" security. In server level security the samba
4295 server reports to the client that it is in user level security. The
4296 client then does a "session setup" as described earlier. The samba
4297 server takes the username/password that the client sends and attempts
4298 to login to the "password server" by sending exactly the same
4299 username/password that it got from the client. If that server is in
4300 user level security and accepts the password then samba accepts the
4301 clients connection. This allows the samba server to use another SMB
4302 server as the "password server". </P
4303 ><P
4304 >You should also note that at the very start of all this, where the
4305 server tells the client what security level it is in, it also tells
4306 the client if it supports encryption. If it does then it supplies the
4307 client with a random "cryptkey". The client will then send all
4308 passwords in encrypted form. You have to compile samba with encryption
4309 enabled to support this feature, and you have to maintain a separate
4310 smbpasswd file with SMB style encrypted passwords. It is
4311 cryptographically impossible to translate from unix style encryption
4312 to SMB style encryption, although there are some fairly simple management
4313 schemes by which the two could be kept in sync.</P
4314 ><P
4315 >"security = server" means that Samba reports to clients that
4316 it is running in "user mode" but actually passes off all authentication
4317 requests to another "user mode" server. This requires an additional
4318 parameter "password server =" that points to the real authentication server.
4319 That real authentication server can be another Samba server or can be a
4320 Windows NT server, the later natively capable of encrypted password support.</P
4321 ><DIV
4322 CLASS="SECT3"
4323 ><HR><H4
4324 CLASS="SECT3"
4325 ><A
4326 NAME="AEN690"
4327 >5.1.3.1. Configuring Samba for Seemless Windows Network Integration</A
4328 ></H4
4329 ><P
4330 >MS Windows clients may use encrypted passwords as part of a challenege/response
4331 authentication model (a.k.a. NTLMv1) or alone, or clear text strings for simple
4332 password based authentication. It should be realized that with the SMB protocol
4333 the password is passed over the network either in plain text or encrypted, but
4334 not both in the same authentication requests.</P
4335 ><P
4336 >When encrypted passwords are used a password that has been entered by the user
4337 is encrypted in two ways:</P
4338 ><P
4339 ></P
4340 ><UL
4341 ><LI
4342 ><P
4343 >An MD4 hash of the UNICODE of the password
4344         string.  This is known as the NT hash.
4345         </P
4346 ></LI
4347 ><LI
4348 ><P
4349 >The password is converted to upper case,
4350         and then padded or trucated to 14 bytes.  This string is 
4351         then appended with 5 bytes of NULL characters and split to
4352         form two 56 bit DES keys to encrypt a "magic" 8 byte value.
4353         The resulting 16 bytes for the LanMan hash.
4354         </P
4355 ></LI
4356 ></UL
4357 ><P
4358 >MS Windows 95 pre-service pack 1, MS Windows NT versions 3.x and version 4.0
4359 pre-service pack 3 will use either mode of password authentication. All
4360 versions of MS Windows that follow these versions no longer support plain
4361 text passwords by default.</P
4362 ><P
4363 >MS Windows clients have a habit of dropping network mappings that have been idle
4364 for 10 minutes or longer. When the user attempts to use the mapped drive
4365 connection that has been dropped, the client re-establishes the connection using
4366 a cached copy of the password.</P
4367 ><P
4368 >When Microsoft changed the default password mode, support was dropped for caching
4369 of the plain text password. This means that when the registry parameter is changed
4370 to re-enable use of plain text passwords it appears to work, but when a dropped
4371 service connection mapping attempts to revalidate it will fail if the remote
4372 authentication server does not support encrypted passwords.  This means that it
4373 is definitely not a good idea to re-enable plain text password support in such clients.</P
4374 ><P
4375 >The following parameters can be used to work around the issue of Windows 9x client
4376 upper casing usernames and password before transmitting them to the SMB server
4377 when using clear text authentication.</P
4378 ><P
4379 ><PRE
4380 CLASS="PROGRAMLISTING"
4381 >       <A
4382 HREF="smb.conf.5.html#PASSWORDLEVEL"
4383 TARGET="_top"
4384 >passsword level</A
4385 > = <VAR
4386 CLASS="REPLACEABLE"
4387 >integer</VAR
4388 >
4389         <A
4390 HREF="smb.conf.5.html#USERNAMELEVEL"
4391 TARGET="_top"
4392 >username level</A
4393 > = <VAR
4394 CLASS="REPLACEABLE"
4395 >integer</VAR
4396 ></PRE
4397 ></P
4398 ><P
4399 >By default Samba will lower case the username before attempting to lookup the user
4400 in the database of local system accounts.  Because UNIX usernames conventionally
4401 only contain lower case character, the <VAR
4402 CLASS="PARAMETER"
4403 >username level</VAR
4404 > parameter
4405 is rarely needed.</P
4406 ><P
4407 >However, passwords on UNIX systems often make use of mixed case characters. 
4408 This means that in order for a user on a Windows 9x client to connect to a Samba
4409 server using clear text authentication, the <VAR
4410 CLASS="PARAMETER"
4411 >password level</VAR
4412 >
4413 must be set to the maximum number of upper case letter which <SPAN
4414 CLASS="emphasis"
4415 ><I
4416 CLASS="EMPHASIS"
4417 >could</I
4418 ></SPAN
4419 >
4420 appear is a password.  Note that is the server OS uses the traditional DES version
4421 of crypt(), then a <VAR
4422 CLASS="PARAMETER"
4423 >password level</VAR
4424 > of 8 will result in case
4425 insensitive passwords as seen from Windows users.  This will also result in longer
4426 login times as Samba hash to compute the permutations of the password string and 
4427 try them one by one until a match is located (or all combinations fail).</P
4428 ><P
4429 >The best option to adopt is to enable support for encrypted passwords 
4430 where ever Samba is used. There are three configuration possibilities 
4431 for support of encrypted passwords:</P
4432 ></DIV
4433 ><DIV
4434 CLASS="SECT3"
4435 ><HR><H4
4436 CLASS="SECT3"
4437 ><A
4438 NAME="AEN716"
4439 >5.1.3.2. Use MS Windows NT as an authentication server</A
4440 ></H4
4441 ><P
4442 >This method involves the additions of the following parameters in the smb.conf file:</P
4443 ><P
4444 ><PRE
4445 CLASS="PROGRAMLISTING"
4446 >       encrypt passwords = Yes
4447         security = server
4448         password server = "NetBIOS_name_of_PDC"</PRE
4449 ></P
4450 ><P
4451 >There are two ways of identifying whether or not a username and 
4452 password pair was valid or not. One uses the reply information provided 
4453 as part of the authentication messaging process, the other uses 
4454 just and error code.</P
4455 ><P
4456 >The down-side of this mode of configuration is the fact that 
4457 for security reasons Samba will send the password server a bogus 
4458 username and a bogus password and if the remote server fails to 
4459 reject the username and password pair then an alternative mode 
4460 of identification of validation is used. Where a site uses password 
4461 lock out after a certain number of failed authentication attempts 
4462 this will result in user lockouts.</P
4463 ><P
4464 >Use of this mode of authentication does require there to be 
4465 a standard Unix account for the user, this account can be blocked 
4466 to prevent logons by other than MS Windows clients.</P
4467 ></DIV
4468 ></DIV
4469 ><DIV
4470 CLASS="SECT2"
4471 ><HR><H3
4472 CLASS="SECT2"
4473 ><A
4474 NAME="AEN724"
4475 >5.1.4. Domain Level Security</A
4476 ></H3
4477 ><P
4478 >When samba is operating in <SPAN
4479 CLASS="emphasis"
4480 ><I
4481 CLASS="EMPHASIS"
4482 >security = domain</I
4483 ></SPAN
4484 > mode this means that
4485 the Samba server has a domain security trust account (a machine account) and will cause
4486 all authentication requests to be passed through to the domain controllers.</P
4487 ><DIV
4488 CLASS="SECT3"
4489 ><HR><H4
4490 CLASS="SECT3"
4491 ><A
4492 NAME="AEN728"
4493 >5.1.4.1. Samba as a member of an MS Windows NT security domain</A
4494 ></H4
4495 ><P
4496 >This method involves additon of the following paramters in the smb.conf file:</P
4497 ><P
4498 ><PRE
4499 CLASS="PROGRAMLISTING"
4500 >       encrypt passwords = Yes
4501         security = domain
4502         workgroup = "name of NT domain"
4503         password server = *</PRE
4504 ></P
4505 ><P
4506 >The use of the "*" argument to "password server" will cause samba to locate the
4507 domain controller in a way analogous to the way this is done within MS Windows NT.
4508 This is the default behaviour.</P
4509 ><P
4510 >In order for this method to work the Samba server needs to join the 
4511 MS Windows NT security domain. This is done as follows:</P
4512 ><P
4513 ></P
4514 ><UL
4515 ><LI
4516 ><P
4517 >On the MS Windows NT domain controller using 
4518         the Server Manager add a machine account for the Samba server.
4519         </P
4520 ></LI
4521 ><LI
4522 ><P
4523 >Next, on the Linux system execute: 
4524         <B
4525 CLASS="COMMAND"
4526 >smbpasswd -r PDC_NAME -j DOMAIN_NAME</B
4527 >
4528         </P
4529 ></LI
4530 ></UL
4531 ><P
4532 >Use of this mode of authentication does require there to be a standard Unix account
4533 for the user in order to assign a uid once the account has been authenticated by
4534 the remote Windows DC.  This account can be blocked to prevent logons by other than
4535 MS Windows clients by things such as setting an invalid shell in the
4536 <TT
4537 CLASS="FILENAME"
4538 >/etc/passwd</TT
4539 > entry. </P
4540 ><P
4541 >An alternative to assigning UIDs to Windows users on a Samba member server is
4542 presented in the <A
4543 HREF="winbind.html"
4544 TARGET="_top"
4545 >Winbind Overview</A
4546 > chapter
4547 in this HOWTO collection.</P
4548 ></DIV
4549 ></DIV
4550 ><DIV
4551 CLASS="SECT2"
4552 ><HR><H3
4553 CLASS="SECT2"
4554 ><A
4555 NAME="AEN745"
4556 >5.1.5. ADS Level Security</A
4557 ></H3
4558 ><P
4559 >For information about the configuration option please refer to the entire section entitled
4560 <SPAN
4561 CLASS="emphasis"
4562 ><I
4563 CLASS="EMPHASIS"
4564 >Samba as an ADS Domain Member.</I
4565 ></SPAN
4566 ></P
4567 ></DIV
4568 ></DIV
4569 ></DIV
4570 ><DIV
4571 CLASS="CHAPTER"
4572 ><HR><H1
4573 ><A
4574 NAME="SAMBA-PDC"
4575 ></A
4576 >Chapter 6. Samba as an NT4 or Win2k Primary Domain Controller</H1
4577 ><DIV
4578 CLASS="SECT1"
4579 ><H2
4580 CLASS="SECT1"
4581 ><A
4582 NAME="AEN772"
4583 >6.1. Prerequisite Reading</A
4584 ></H2
4585 ><P
4586 >Before you continue reading in this chapter, please make sure 
4587 that you are comfortable with configuring basic files services
4588 in smb.conf and how to enable and administer password 
4589 encryption in Samba.  Theses two topics are covered in the
4590 <A
4591 HREF="smb.conf.5.html"
4592 TARGET="_top"
4593 ><TT
4594 CLASS="FILENAME"
4595 >smb.conf(5)</TT
4596 ></A
4597
4598 manpage.</P
4599 ></DIV
4600 ><DIV
4601 CLASS="SECT1"
4602 ><HR><H2
4603 CLASS="SECT1"
4604 ><A
4605 NAME="AEN777"
4606 >6.2. Background</A
4607 ></H2
4608 ><P
4609 >This article outlines the steps necessary for configuring Samba as a PDC.
4610 It is necessary to have a working Samba server prior to implementing the
4611 PDC functionality.</P
4612 ><P
4613 ></P
4614 ><UL
4615 ><LI
4616 ><P
4617 >       Domain logons for Windows NT 4.0 / 200x / XP Professional clients.
4618         </P
4619 ></LI
4620 ><LI
4621 ><P
4622 >       Placing Windows 9x / Me clients in user level security
4623         </P
4624 ></LI
4625 ><LI
4626 ><P
4627 >       Retrieving a list of users and groups from a Samba PDC to
4628         Windows 9x / Me / NT / 200x / XP Professional clients
4629         </P
4630 ></LI
4631 ><LI
4632 ><P
4633 >       Roaming Profiles
4634         </P
4635 ></LI
4636 ><LI
4637 ><P
4638 >       Network/System Policies
4639         </P
4640 ></LI
4641 ></UL
4642 ><DIV
4643 CLASS="NOTE"
4644 ><P
4645 ></P
4646 ><TABLE
4647 CLASS="NOTE"
4648 WIDTH="100%"
4649 BORDER="0"
4650 ><TR
4651 ><TD
4652 WIDTH="25"
4653 ALIGN="CENTER"
4654 VALIGN="TOP"
4655 ><IMG
4656 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
4657 HSPACE="5"
4658 ALT="Note"></TD
4659 ><TD
4660 ALIGN="LEFT"
4661 VALIGN="TOP"
4662 ><P
4663 >Roaming Profiles and System/Network policies are advanced network administration topics
4664 that are covered separately in this document.</P
4665 ></TD
4666 ></TR
4667 ></TABLE
4668 ></DIV
4669 ><P
4670 >The following functionalities are new to the Samba 3.0 release:</P
4671 ><P
4672 ></P
4673 ><UL
4674 ><LI
4675 ><P
4676 >       Windows NT 4 domain trusts
4677         </P
4678 ></LI
4679 ><LI
4680 ><P
4681 >       Adding users via the User Manager for Domains
4682         </P
4683 ></LI
4684 ></UL
4685 ><P
4686 >The following functionalities are NOT provided by Samba 3.0:</P
4687 ><P
4688 ></P
4689 ><UL
4690 ><LI
4691 ><P
4692 >       SAM replication with Windows NT 4.0 Domain Controllers
4693         (i.e. a Samba PDC and a Windows NT BDC or vice versa) 
4694         </P
4695 ></LI
4696 ><LI
4697 ><P
4698 >       Acting as a Windows 2000 Domain Controller (i.e. Kerberos and 
4699         Active Directory)
4700         </P
4701 ></LI
4702 ></UL
4703 ><P
4704 >Please note that Windows 9x / Me / XP Home clients are not true members of a domain
4705 for reasons outlined in this article.  Therefore the protocol for
4706 support Windows 9x-style domain logons is completely different
4707 from NT4 / Win2k type domain logons and has been officially supported for some 
4708 time.</P
4709 ><P
4710 ><SPAN
4711 CLASS="emphasis"
4712 ><I
4713 CLASS="EMPHASIS"
4714 >MS Windows XP Home edition is NOT able to join a domain and does not permit
4715 the use of domain logons.</I
4716 ></SPAN
4717 ></P
4718 ><P
4719 >Implementing a Samba PDC can basically be divided into 3 broad
4720 steps.</P
4721 ><P
4722 ></P
4723 ><OL
4724 TYPE="1"
4725 ><LI
4726 ><P
4727 >       Configuring the Samba PDC
4728         </P
4729 ></LI
4730 ><LI
4731 ><P
4732 >       Creating machine trust accounts and joining clients to the domain
4733         </P
4734 ></LI
4735 ><LI
4736 ><P
4737 >       Adding and managing domain user accounts
4738         </P
4739 ></LI
4740 ></OL
4741 ><P
4742 >There are other minor details such as user profiles, system
4743 policies, etc...  However, these are not necessarily specific
4744 to a Samba PDC as much as they are related to Windows NT networking
4745 concepts.</P
4746 ></DIV
4747 ><DIV
4748 CLASS="SECT1"
4749 ><HR><H2
4750 CLASS="SECT1"
4751 ><A
4752 NAME="AEN817"
4753 >6.3. Configuring the Samba Domain Controller</A
4754 ></H2
4755 ><P
4756 >The first step in creating a working Samba PDC is to 
4757 understand the parameters necessary in smb.conf. Here we
4758 attempt to explain the parameters that are covered in
4759 <A
4760 HREF="smb.conf.5.html"
4761 TARGET="_top"
4762 > the smb.conf
4763 man page</A
4764 >.</P
4765 ><P
4766 >Here is an example <TT
4767 CLASS="FILENAME"
4768 >smb.conf</TT
4769 > for acting as a PDC:</P
4770 ><P
4771 ><PRE
4772 CLASS="PROGRAMLISTING"
4773 >[global]
4774     ; Basic server settings
4775     <A
4776 HREF="smb.conf.5.html#NETBIOSNAME"
4777 TARGET="_top"
4778 >netbios name</A
4779 > = <VAR
4780 CLASS="REPLACEABLE"
4781 >POGO</VAR
4782 >
4783     <A
4784 HREF="smb.conf.5.html#WORKGROUP"
4785 TARGET="_top"
4786 >workgroup</A
4787 > = <VAR
4788 CLASS="REPLACEABLE"
4789 >NARNIA</VAR
4790 >
4791
4792     ; we should act as the domain and local master browser
4793     <A
4794 HREF="smb.conf.5.html#OSLEVEL"
4795 TARGET="_top"
4796 >os level</A
4797 > = 64
4798     <A
4799 HREF="smb.conf.5.html#PERFERREDMASTER"
4800 TARGET="_top"
4801 >preferred master</A
4802 > = yes
4803     <A
4804 HREF="smb.conf.5.html#DOMAINMASTER"
4805 TARGET="_top"
4806 >domain master</A
4807 > = yes
4808     <A
4809 HREF="smb.conf.5.html#LOCALMASTER"
4810 TARGET="_top"
4811 >local master</A
4812 > = yes
4813     
4814     ; security settings (must user security = user)
4815     <A
4816 HREF="smb.conf.5.html#SECURITYEQUALSUSER"
4817 TARGET="_top"
4818 >security</A
4819 > = user
4820     
4821     ; encrypted passwords are a requirement for a PDC
4822     <A
4823 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
4824 TARGET="_top"
4825 >encrypt passwords</A
4826 > = yes
4827     
4828     ; support domain logons
4829     <A
4830 HREF="smb.conf.5.html#DOMAINLOGONS"
4831 TARGET="_top"
4832 >domain logons</A
4833 > = yes
4834     
4835     ; where to store user profiles?
4836     <A
4837 HREF="smb.conf.5.html#LOGONPATH"
4838 TARGET="_top"
4839 >logon path</A
4840 > = \\%N\profiles\%u
4841     
4842     ; where is a user's home directory and where should it be mounted at?
4843     <A
4844 HREF="smb.conf.5.html#LOGONDRIVE"
4845 TARGET="_top"
4846 >logon drive</A
4847 > = H:
4848     <A
4849 HREF="smb.conf.5.html#LOGONHOME"
4850 TARGET="_top"
4851 >logon home</A
4852 > = \\homeserver\%u
4853     
4854     ; specify a generic logon script for all users
4855     ; this is a relative **DOS** path to the [netlogon] share
4856     <A
4857 HREF="smb.conf.5.html#LOGONSCRIPT"
4858 TARGET="_top"
4859 >logon script</A
4860 > = logon.cmd
4861
4862 ; necessary share for domain controller
4863 [netlogon]
4864     <A
4865 HREF="smb.conf.5.html#PATH"
4866 TARGET="_top"
4867 >path</A
4868 > = /usr/local/samba/lib/netlogon
4869     <A
4870 HREF="smb.conf.5.html#READONLY"
4871 TARGET="_top"
4872 >read only</A
4873 > = yes
4874     <A
4875 HREF="smb.conf.5.html#WRITELIST"
4876 TARGET="_top"
4877 >write list</A
4878 > = <VAR
4879 CLASS="REPLACEABLE"
4880 >ntadmin</VAR
4881 >
4882     
4883 ; share for storing user profiles
4884 [profiles]
4885     <A
4886 HREF="smb.conf.5.html#PATH"
4887 TARGET="_top"
4888 >path</A
4889 > = /export/smb/ntprofile
4890     <A
4891 HREF="smb.conf.5.html#READONLY"
4892 TARGET="_top"
4893 >read only</A
4894 > = no
4895     <A
4896 HREF="smb.conf.5.html#CREATEMASK"
4897 TARGET="_top"
4898 >create mask</A
4899 > = 0600
4900     <A
4901 HREF="smb.conf.5.html#DIRECTORYMASK"
4902 TARGET="_top"
4903 >directory mask</A
4904 > = 0700</PRE
4905 ></P
4906 ><P
4907 >There are a couple of points to emphasize in the above configuration.</P
4908 ><P
4909 ></P
4910 ><UL
4911 ><LI
4912 ><P
4913 >       Encrypted passwords must be enabled.  For more details on how 
4914         to do this, refer to <A
4915 HREF="ENCRYPTION.html"
4916 TARGET="_top"
4917 >ENCRYPTION.html</A
4918 >.
4919         </P
4920 ></LI
4921 ><LI
4922 ><P
4923 >       The server must support domain logons and a
4924         <TT
4925 CLASS="FILENAME"
4926 >[netlogon]</TT
4927 > share
4928         </P
4929 ></LI
4930 ><LI
4931 ><P
4932 >       The server must be the domain master browser in order for Windows 
4933         client to locate the server as a DC.  Please refer to the various 
4934         Network Browsing documentation included with this distribution for 
4935         details.
4936         </P
4937 ></LI
4938 ></UL
4939 ><P
4940 >Samba 3.0 offers a complete implementation of group mapping
4941 between Windows NT groups and Unix groups (this is really quite
4942 complicated to explain in a short space).</P
4943 ></DIV
4944 ><DIV
4945 CLASS="SECT1"
4946 ><HR><H2
4947 CLASS="SECT1"
4948 ><A
4949 NAME="AEN859"
4950 >6.4. Creating Machine Trust Accounts and Joining Clients to the Domain</A
4951 ></H2
4952 ><P
4953 >A machine trust account is a Samba account that is used to
4954 authenticate a client machine (rather than a user) to the Samba
4955 server.  In Windows terminology, this is known as a "Computer
4956 Account."</P
4957 ><P
4958 >The password of a machine trust account acts as the shared secret for
4959 secure communication with the Domain Controller.  This is a security
4960 feature to prevent an unauthorized machine with the same NetBIOS name
4961 from joining the domain and gaining access to domain user/group
4962 accounts.  Windows NT, 200x, XP Professional clients use machine trust
4963 accounts, but Windows 9x / Me / XP Home clients do not.  Hence, a
4964 Windows 9x / Me / XP Home  client is never a true member of a domain
4965 because it does not possess a machine trust account, and thus has no
4966 shared secret with the domain controller.</P
4967 ><P
4968 >A Windows PDC stores each machine trust account in the Windows
4969 Registry. A Samba-3 PDC also has to stoe machine trust account information
4970 in a suitable back-end data store. With Samba-3 there can be multiple back-ends
4971 for this including:</P
4972 ><P
4973 ></P
4974 ><UL
4975 ><LI
4976 ><P
4977 >       <SPAN
4978 CLASS="emphasis"
4979 ><I
4980 CLASS="EMPHASIS"
4981 >smbpaswd</I
4982 ></SPAN
4983 > - the plain ascii file stored used by
4984         earlier versions of Samba. This file configuration option requires
4985         a Unix/Linux system account for EVERY entry (ie: both for user and for
4986         machine accounts). This file will be located in the <SPAN
4987 CLASS="emphasis"
4988 ><I
4989 CLASS="EMPHASIS"
4990 >private</I
4991 ></SPAN
4992 >
4993         directory (default is /usr/local/samba/lib/private or on linux /etc/samba).
4994         </P
4995 ></LI
4996 ><LI
4997 ><P
4998 >       <SPAN
4999 CLASS="emphasis"
5000 ><I
5001 CLASS="EMPHASIS"
5002 >smbpasswd_nua</I
5003 ></SPAN
5004 > - This file is independant of the
5005         system wide user accounts. The use of this back-end option requires
5006         specification of the "non unix account range" option also. It is called
5007         smbpasswd and will be located in the <TT
5008 CLASS="FILENAME"
5009 >private</TT
5010 > directory.
5011         </P
5012 ></LI
5013 ><LI
5014 ><P
5015 >       <SPAN
5016 CLASS="emphasis"
5017 ><I
5018 CLASS="EMPHASIS"
5019 >tdbsam</I
5020 ></SPAN
5021 > - a binary database backend that will be
5022         stored in the <SPAN
5023 CLASS="emphasis"
5024 ><I
5025 CLASS="EMPHASIS"
5026 >private</I
5027 ></SPAN
5028 > directory in a file called
5029         <SPAN
5030 CLASS="emphasis"
5031 ><I
5032 CLASS="EMPHASIS"
5033 >passwd.tdb</I
5034 ></SPAN
5035 >. The key benefit of this binary format
5036         file is that it can store binary objects that can not be accomodated
5037         in the traditional plain text smbpasswd file.
5038         </P
5039 ></LI
5040 ><LI
5041 ><P
5042 >       <SPAN
5043 CLASS="emphasis"
5044 ><I
5045 CLASS="EMPHASIS"
5046 >tdbsam_nua</I
5047 ></SPAN
5048 > like the smbpasswd_nua option above, this
5049         file allows the creation of arbitrary user and machine accounts without
5050         requiring that account to be added to the system (/etc/passwd) file. It
5051         too requires the specification of the "non unix account range" option
5052         in the [globals] section of the smb.conf file.
5053         </P
5054 ></LI
5055 ><LI
5056 ><P
5057 >       <SPAN
5058 CLASS="emphasis"
5059 ><I
5060 CLASS="EMPHASIS"
5061 >ldapsam</I
5062 ></SPAN
5063 > - An LDAP based back-end. Permits the
5064         LDAP server to be specified. eg: ldap://localhost or ldap://frodo.murphy.com
5065         </P
5066 ></LI
5067 ><LI
5068 ><P
5069 >       <SPAN
5070 CLASS="emphasis"
5071 ><I
5072 CLASS="EMPHASIS"
5073 >ldapsam_nua</I
5074 ></SPAN
5075 > - LDAP based back-end with no unix
5076         account requirement, like smbpasswd_nua and tdbsam_nua above.
5077         </P
5078 ></LI
5079 ></UL
5080 ><P
5081 >A Samba PDC, however, stores each machine trust account in two parts,
5082 as follows:
5083
5084 <P
5085 ></P
5086 ><UL
5087 ><LI
5088 ><P
5089 >A Samba account, stored in the same location as user
5090     LanMan and NT password hashes (currently
5091     <TT
5092 CLASS="FILENAME"
5093 >smbpasswd</TT
5094 >). The Samba account 
5095     possesses and uses only the NT password hash.</P
5096 ></LI
5097 ><LI
5098 ><P
5099 >A corresponding Unix account, typically stored in
5100     <TT
5101 CLASS="FILENAME"
5102 >/etc/passwd</TT
5103 >. (Future releases will alleviate the need to
5104     create <TT
5105 CLASS="FILENAME"
5106 >/etc/passwd</TT
5107 > entries.) </P
5108 ></LI
5109 ></UL
5110 ></P
5111 ><P
5112 >There are two ways to create machine trust accounts:</P
5113 ><P
5114 ></P
5115 ><UL
5116 ><LI
5117 ><P
5118 > Manual creation. Both the Samba and corresponding
5119         Unix account are created by hand.</P
5120 ></LI
5121 ><LI
5122 ><P
5123 > "On-the-fly" creation. The Samba machine trust
5124         account is automatically created by Samba at the time the client
5125         is joined to the domain. (For security, this is the
5126         recommended method.) The corresponding Unix account may be
5127         created automatically or manually. </P
5128 ></LI
5129 ></UL
5130 ><DIV
5131 CLASS="SECT2"
5132 ><HR><H3
5133 CLASS="SECT2"
5134 ><A
5135 NAME="AEN902"
5136 >6.4.1. Manual Creation of Machine Trust Accounts</A
5137 ></H3
5138 ><P
5139 >The first step in manually creating a machine trust account is to
5140 manually create the corresponding Unix account in
5141 <TT
5142 CLASS="FILENAME"
5143 >/etc/passwd</TT
5144 >.  This can be done using
5145 <B
5146 CLASS="COMMAND"
5147 >vipw</B
5148 > or other 'add user' command that is normally
5149 used to create new Unix accounts.  The following is an example for a
5150 Linux based Samba server:</P
5151 ><P
5152 >  <SAMP
5153 CLASS="PROMPT"
5154 >root# </SAMP
5155 ><B
5156 CLASS="COMMAND"
5157 >/usr/sbin/useradd -g 100 -d /dev/null -c <VAR
5158 CLASS="REPLACEABLE"
5159 >"machine 
5160 nickname"</VAR
5161 > -s /bin/false <VAR
5162 CLASS="REPLACEABLE"
5163 >machine_name</VAR
5164 >$ </B
5165 ></P
5166 ><P
5167 ><SAMP
5168 CLASS="PROMPT"
5169 >root# </SAMP
5170 ><B
5171 CLASS="COMMAND"
5172 >passwd -l <VAR
5173 CLASS="REPLACEABLE"
5174 >machine_name</VAR
5175 >$</B
5176 ></P
5177 ><P
5178 >On *BSD systems, this can be done using the 'chpass' utility:</P
5179 ><P
5180 ><SAMP
5181 CLASS="PROMPT"
5182 >root# </SAMP
5183 ><B
5184 CLASS="COMMAND"
5185 >chpass -a "<VAR
5186 CLASS="REPLACEABLE"
5187 >machine_name</VAR
5188 >$:*:101:100::0:0:Workstation <VAR
5189 CLASS="REPLACEABLE"
5190 >machine_name</VAR
5191 >:/dev/null:/sbin/nologin"</B
5192 ></P
5193 ><P
5194 >The <TT
5195 CLASS="FILENAME"
5196 >/etc/passwd</TT
5197 > entry will list the machine name 
5198 with a "$" appended, won't have a password, will have a null shell and no 
5199 home directory. For example a machine named 'doppy' would have an 
5200 <TT
5201 CLASS="FILENAME"
5202 >/etc/passwd</TT
5203 > entry like this:</P
5204 ><P
5205 ><PRE
5206 CLASS="PROGRAMLISTING"
5207 >doppy$:x:505:501:<VAR
5208 CLASS="REPLACEABLE"
5209 >machine_nickname</VAR
5210 >:/dev/null:/bin/false</PRE
5211 ></P
5212 ><P
5213 >Above, <VAR
5214 CLASS="REPLACEABLE"
5215 >machine_nickname</VAR
5216 > can be any
5217 descriptive name for the client, i.e., BasementComputer.
5218 <VAR
5219 CLASS="REPLACEABLE"
5220 >machine_name</VAR
5221 > absolutely must be the NetBIOS
5222 name of the client to be joined to the domain.  The "$" must be
5223 appended to the NetBIOS name of the client or Samba will not recognize
5224 this as a machine trust account.</P
5225 ><P
5226 >Now that the corresponding Unix account has been created, the next step is to create 
5227 the Samba account for the client containing the well-known initial 
5228 machine trust account password.  This can be done using the <A
5229 HREF="smbpasswd.8.html"
5230 TARGET="_top"
5231 ><B
5232 CLASS="COMMAND"
5233 >smbpasswd(8)</B
5234 ></A
5235 > command 
5236 as shown here:</P
5237 ><P
5238 ><SAMP
5239 CLASS="PROMPT"
5240 >root# </SAMP
5241 ><B
5242 CLASS="COMMAND"
5243 >smbpasswd -a -m <VAR
5244 CLASS="REPLACEABLE"
5245 >machine_name</VAR
5246 ></B
5247 ></P
5248 ><P
5249 >where <VAR
5250 CLASS="REPLACEABLE"
5251 >machine_name</VAR
5252 > is the machine's NetBIOS
5253 name.  The RID of the new machine account is generated from the UID of 
5254 the corresponding Unix account.</P
5255 ><DIV
5256 CLASS="WARNING"
5257 ><P
5258 ></P
5259 ><TABLE
5260 CLASS="WARNING"
5261 WIDTH="100%"
5262 BORDER="0"
5263 ><TR
5264 ><TD
5265 WIDTH="25"
5266 ALIGN="CENTER"
5267 VALIGN="TOP"
5268 ><IMG
5269 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
5270 HSPACE="5"
5271 ALT="Warning"></TD
5272 ><TH
5273 ALIGN="LEFT"
5274 VALIGN="CENTER"
5275 ><B
5276 >Join the client to the domain immediately</B
5277 ></TH
5278 ></TR
5279 ><TR
5280 ><TD
5281 >&nbsp;</TD
5282 ><TD
5283 ALIGN="LEFT"
5284 VALIGN="TOP"
5285 ><P
5286 >       Manually creating a machine trust account using this method is the 
5287         equivalent of creating a machine trust account on a Windows NT PDC using 
5288         the "Server Manager".  From the time at which the account is created
5289         to the time which the client joins the domain and changes the password,
5290         your domain is vulnerable to an intruder joining your domain using a
5291         a machine with the same NetBIOS name.  A PDC inherently trusts
5292         members of the domain and will serve out a large degree of user 
5293         information to such clients.  You have been warned!
5294         </P
5295 ></TD
5296 ></TR
5297 ></TABLE
5298 ></DIV
5299 ></DIV
5300 ><DIV
5301 CLASS="SECT2"
5302 ><HR><H3
5303 CLASS="SECT2"
5304 ><A
5305 NAME="AEN943"
5306 >6.4.2. "On-the-Fly" Creation of Machine Trust Accounts</A
5307 ></H3
5308 ><P
5309 >The second (and recommended) way of creating machine trust accounts is
5310 simply to allow the Samba server to create them as needed when the client
5311 is joined to the domain. </P
5312 ><P
5313 >Since each Samba machine trust account requires a corresponding
5314 Unix account, a method for automatically creating the
5315 Unix account is usually supplied; this requires configuration of the
5316 <A
5317 HREF="smb.conf.5.html#ADDUSERSCRIPT"
5318 TARGET="_top"
5319 >add user script</A
5320
5321 option in <TT
5322 CLASS="FILENAME"
5323 >smb.conf</TT
5324 >.  This
5325 method is not required, however; corresponding Unix accounts may also
5326 be created manually.</P
5327 ><P
5328 >Below is an example for a RedHat 6.2 Linux system.</P
5329 ><P
5330 ><PRE
5331 CLASS="PROGRAMLISTING"
5332 >[global]
5333    # &#60;...remainder of parameters...&#62;
5334    add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u </PRE
5335 ></P
5336 ></DIV
5337 ><DIV
5338 CLASS="SECT2"
5339 ><HR><H3
5340 CLASS="SECT2"
5341 ><A
5342 NAME="AEN952"
5343 >6.4.3. Joining the Client to the Domain</A
5344 ></H3
5345 ><P
5346 >The procedure for joining a client to the domain varies with the
5347 version of Windows.</P
5348 ><P
5349 ></P
5350 ><UL
5351 ><LI
5352 ><P
5353 ><SPAN
5354 CLASS="emphasis"
5355 ><I
5356 CLASS="EMPHASIS"
5357 >Windows 2000</I
5358 ></SPAN
5359 ></P
5360 ><P
5361 > When the user elects to join the client to a domain, Windows prompts for
5362         an account and password that is privileged to join the domain.  A
5363         Samba administrative account (i.e., a Samba account that has root
5364         privileges on the Samba server) must be entered here; the
5365         operation will fail if an ordinary user account is given. 
5366         The password for this account should be
5367         set to a different password than the associated
5368         <TT
5369 CLASS="FILENAME"
5370 >/etc/passwd</TT
5371 > entry, for security
5372         reasons. </P
5373 ><P
5374 >The session key of the Samba administrative account acts as an
5375         encryption key for setting the password of the machine trust
5376         account. The machine trust account will be created on-the-fly, or
5377         updated if it already exists.</P
5378 ></LI
5379 ><LI
5380 ><P
5381 ><SPAN
5382 CLASS="emphasis"
5383 ><I
5384 CLASS="EMPHASIS"
5385 >Windows NT</I
5386 ></SPAN
5387 ></P
5388 ><P
5389 > If the machine trust account was created manually, on the
5390         Identification Changes menu enter the domain name, but do not
5391         check the box "Create a Computer Account in the Domain."  In this case,
5392         the existing machine trust account is used to join the machine to
5393         the domain.</P
5394 ><P
5395 > If the machine trust account is to be created
5396         on-the-fly, on the Identification Changes menu enter the domain
5397         name, and check the box "Create a Computer Account in the Domain."  In
5398         this case, joining the domain proceeds as above for Windows 2000
5399         (i.e., you must supply a Samba administrative account when
5400         prompted).</P
5401 ></LI
5402 ></UL
5403 ></DIV
5404 ></DIV
5405 ><DIV
5406 CLASS="SECT1"
5407 ><HR><H2
5408 CLASS="SECT1"
5409 ><A
5410 NAME="AEN967"
5411 >6.5. Common Problems and Errors</A
5412 ></H2
5413 ><P
5414 ></P
5415 ><P
5416 ></P
5417 ><UL
5418 ><LI
5419 ><P
5420 >       <SPAN
5421 CLASS="emphasis"
5422 ><I
5423 CLASS="EMPHASIS"
5424 >I cannot include a '$' in a machine name.</I
5425 ></SPAN
5426 >
5427         </P
5428 ><P
5429 >       A 'machine name' in (typically) <TT
5430 CLASS="FILENAME"
5431 >/etc/passwd</TT
5432 >       
5433         of the machine name with a '$' appended. FreeBSD (and other BSD 
5434         systems?) won't create a user with a '$' in their name.
5435         </P
5436 ><P
5437 >       The problem is only in the program used to make the entry, once 
5438         made, it works perfectly. So create a user without the '$' and 
5439         use <B
5440 CLASS="COMMAND"
5441 >vipw</B
5442 > to edit the entry, adding the '$'. Or create 
5443         the whole entry with vipw if you like, make sure you use a 
5444         unique User ID !
5445         </P
5446 ></LI
5447 ><LI
5448 ><P
5449 >       <SPAN
5450 CLASS="emphasis"
5451 ><I
5452 CLASS="EMPHASIS"
5453 >I get told "You already have a connection to the Domain...." 
5454         or "Cannot join domain, the credentials supplied conflict with an 
5455         existing set.." when creating a machine trust account.</I
5456 ></SPAN
5457 >
5458         </P
5459 ><P
5460 >       This happens if you try to create a machine trust account from the 
5461         machine itself and already have a connection (e.g. mapped drive) 
5462         to a share (or IPC$) on the Samba PDC.  The following command
5463         will remove all network drive connections:
5464         </P
5465 ><P
5466 >       <SAMP
5467 CLASS="PROMPT"
5468 >C:\WINNT\&#62;</SAMP
5469 > <B
5470 CLASS="COMMAND"
5471 >net use * /d</B
5472 >
5473         </P
5474 ><P
5475 >       Further, if the machine is a already a 'member of a workgroup' that 
5476         is the same name as the domain you are joining (bad idea) you will 
5477         get this message.  Change the workgroup name to something else, it 
5478         does not matter what, reboot, and try again.
5479         </P
5480 ></LI
5481 ><LI
5482 ><P
5483 >       <SPAN
5484 CLASS="emphasis"
5485 ><I
5486 CLASS="EMPHASIS"
5487 >The system can not log you on (C000019B)....</I
5488 ></SPAN
5489 >
5490         </P
5491 ><P
5492 >I joined the domain successfully but after upgrading 
5493         to a newer version of the Samba code I get the message, "The system 
5494         can not log you on (C000019B), Please try again or consult your 
5495         system administrator" when attempting to logon.
5496         </P
5497 ><P
5498 >       This occurs when the domain SID stored in the secrets.tdb database
5499         is changed. The most common cause of a change in domain SID is when
5500         the domain name and/or the server name (netbios name) is changed.
5501         The only way to correct the problem is to restore the original domain 
5502         SID or remove the domain client from the domain and rejoin. The domain
5503         SID may be reset using either the smbpasswd or rpcclient utilities.
5504         </P
5505 ></LI
5506 ><LI
5507 ><P
5508 >       <SPAN
5509 CLASS="emphasis"
5510 ><I
5511 CLASS="EMPHASIS"
5512 >The machine trust account for this computer either does not 
5513         exist or is not accessible.</I
5514 ></SPAN
5515 >
5516         </P
5517 ><P
5518 >       When I try to join the domain I get the message "The machine account 
5519         for this computer either does not exist or is not accessible". What's 
5520         wrong?
5521         </P
5522 ><P
5523 >       This problem is caused by the PDC not having a suitable machine trust account. 
5524         If you are using the <VAR
5525 CLASS="PARAMETER"
5526 >add user script</VAR
5527 > method to create 
5528         accounts then this would indicate that it has not worked. Ensure the domain 
5529         admin user system is working.
5530         </P
5531 ><P
5532 >       Alternatively if you are creating account entries manually then they 
5533         have not been created correctly. Make sure that you have the entry 
5534         correct for the machine trust account in smbpasswd file on the Samba PDC. 
5535         If you added the account using an editor rather than using the smbpasswd 
5536         utility, make sure that the account name is the machine NetBIOS name 
5537         with a '$' appended to it ( i.e. computer_name$ ). There must be an entry 
5538         in both /etc/passwd and the smbpasswd file. Some people have reported 
5539         that inconsistent subnet masks between the Samba server and the NT 
5540         client have caused this problem.   Make sure that these are consistent 
5541         for both client and server.
5542         </P
5543 ></LI
5544 ><LI
5545 ><P
5546 >       <SPAN
5547 CLASS="emphasis"
5548 ><I
5549 CLASS="EMPHASIS"
5550 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
5551         I get a message about my account being disabled.</I
5552 ></SPAN
5553 >
5554         </P
5555 ><P
5556 >       This problem is caused by a PAM related bug in Samba 2.2.0.  This bug is 
5557         fixed in 2.2.1.  Other symptoms could be unaccessible shares on 
5558         NT/W2K member servers in the domain or the following error in your smbd.log:
5559         passdb/pampass.c:pam_account(268) PAM: UNKNOWN ERROR for User: %user%
5560         </P
5561 ><P
5562 >       At first be ensure to enable the useraccounts with <B
5563 CLASS="COMMAND"
5564 >smbpasswd -e 
5565         %user%</B
5566 >, this is normally done, when you create an account.
5567         </P
5568 ><P
5569 >       In order to work around this problem in 2.2.0, configure the 
5570         <VAR
5571 CLASS="PARAMETER"
5572 >account</VAR
5573 > control flag in 
5574         <TT
5575 CLASS="FILENAME"
5576 >/etc/pam.d/samba</TT
5577 > file as follows:
5578         </P
5579 ><P
5580 ><PRE
5581 CLASS="PROGRAMLISTING"
5582 >       account required        pam_permit.so
5583         </PRE
5584 ></P
5585 ><P
5586 >       If you want to remain backward compatibility to samba 2.0.x use
5587         <TT
5588 CLASS="FILENAME"
5589 >pam_permit.so</TT
5590 >, it's also possible to use 
5591         <TT
5592 CLASS="FILENAME"
5593 >pam_pwdb.so</TT
5594 >. There are some bugs if you try to 
5595         use <TT
5596 CLASS="FILENAME"
5597 >pam_unix.so</TT
5598 >, if you need this, be ensure to use
5599         the most recent version of this file.
5600         </P
5601 ></LI
5602 ></UL
5603 ></DIV
5604 ><DIV
5605 CLASS="SECT1"
5606 ><HR><H2
5607 CLASS="SECT1"
5608 ><A
5609 NAME="AEN1013"
5610 >6.6. What other help can I get?</A
5611 ></H2
5612 ><P
5613 >There are many sources of information available in the form 
5614 of mailing lists, RFC's and documentation.  The docs that come 
5615 with the samba distribution contain very good explanations of 
5616 general SMB topics such as browsing.</P
5617 ><P
5618 ></P
5619 ><UL
5620 ><LI
5621 ><P
5622 >       <SPAN
5623 CLASS="emphasis"
5624 ><I
5625 CLASS="EMPHASIS"
5626 >What are some diagnostics tools I can use to debug the domain logon 
5627         process and where can I find them?</I
5628 ></SPAN
5629 >
5630         </P
5631 ><P
5632 >       One of the best diagnostic tools for debugging problems is Samba itself.  
5633         You can use the -d option for both smbd and nmbd to specify what 
5634         'debug level' at which to run.  See the man pages on smbd, nmbd  and 
5635         smb.conf for more information on debugging options.  The debug 
5636         level can range from 1 (the default) to 10 (100 for debugging passwords).
5637         </P
5638 ><P
5639 >       Another helpful method of debugging is to compile samba using the 
5640         <B
5641 CLASS="COMMAND"
5642 >gcc -g </B
5643 > flag.   This will include debug 
5644         information in the binaries and allow you to attach gdb to the 
5645         running smbd / nmbd process.  In order to attach gdb to an smbd 
5646         process for an NT workstation, first get the workstation to make the 
5647         connection. Pressing ctrl-alt-delete and going down to the domain box 
5648         is sufficient (at least, on the first time you join the domain) to 
5649         generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation 
5650         maintains an open connection, and therefore there will be an smbd 
5651         process running (assuming that you haven't set a really short smbd 
5652         idle timeout)  So, in between pressing ctrl alt delete, and actually 
5653         typing in your password, you can gdb attach and continue.
5654         </P
5655 ><P
5656 >       Some useful samba commands worth investigating:
5657         </P
5658 ><P
5659 ></P
5660 ><UL
5661 ><LI
5662 ><P
5663 >testparam | more</P
5664 ></LI
5665 ><LI
5666 ><P
5667 >smbclient -L //{netbios name of server}</P
5668 ></LI
5669 ></UL
5670 ><P
5671 >       An SMB enabled version of tcpdump is available from 
5672         <A
5673 HREF="http://www.tcpdump.org/"
5674 TARGET="_top"
5675 >http://www.tcpdup.org/</A
5676 >.
5677         Ethereal, another good packet sniffer for Unix and Win32
5678         hosts, can be downloaded from <A
5679 HREF="http://www.ethereal.com/"
5680 TARGET="_top"
5681 >http://www.ethereal.com</A
5682 >.
5683         </P
5684 ><P
5685 >       For tracing things on the Microsoft Windows NT, Network Monitor 
5686         (aka. netmon) is available on the Microsoft Developer Network CD's, 
5687         the Windows NT Server install CD and the SMS CD's.  The version of 
5688         netmon that ships with SMS allows for dumping packets between any two 
5689         computers (i.e. placing the network interface in promiscuous mode).  
5690         The version on the NT Server install CD will only allow monitoring 
5691         of network traffic directed to the local NT box and broadcasts on the 
5692         local subnet.  Be aware that Ethereal can read and write netmon 
5693         formatted files.
5694         </P
5695 ></LI
5696 ><LI
5697 ><P
5698 >       <SPAN
5699 CLASS="emphasis"
5700 ><I
5701 CLASS="EMPHASIS"
5702 >How do I install 'Network Monitor' on an NT Workstation 
5703         or a Windows 9x box?</I
5704 ></SPAN
5705 >
5706         </P
5707 ><P
5708 >       Installing netmon on an NT workstation requires a couple 
5709         of steps.  The following are for installing Netmon V4.00.349, which comes 
5710         with Microsoft Windows NT Server 4.0, on Microsoft Windows NT 
5711         Workstation 4.0.  The process should be similar for other version of 
5712         Windows NT / Netmon.  You will need both the Microsoft Windows 
5713         NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
5714         </P
5715 ><P
5716 >       Initially you will need to install 'Network Monitor Tools and Agent' 
5717         on the NT Server.  To do this 
5718         </P
5719 ><P
5720 ></P
5721 ><UL
5722 ><LI
5723 ><P
5724 >Goto Start - Settings - Control Panel - 
5725                 Network - Services - Add </P
5726 ></LI
5727 ><LI
5728 ><P
5729 >Select the 'Network Monitor Tools and Agent' and 
5730                 click on 'OK'.</P
5731 ></LI
5732 ><LI
5733 ><P
5734 >Click 'OK' on the Network Control Panel.
5735                 </P
5736 ></LI
5737 ><LI
5738 ><P
5739 >Insert the Windows NT Server 4.0 install CD 
5740                 when prompted.</P
5741 ></LI
5742 ></UL
5743 ><P
5744 >       At this point the Netmon files should exist in 
5745         <TT
5746 CLASS="FILENAME"
5747 >%SYSTEMROOT%\System32\netmon\*.*</TT
5748 >.    
5749         Two subdirectories exist as well, <TT
5750 CLASS="FILENAME"
5751 >parsers\</TT
5752
5753         which contains the necessary DLL's for parsing the netmon packet 
5754         dump, and <TT
5755 CLASS="FILENAME"
5756 >captures\</TT
5757 >.
5758         </P
5759 ><P
5760 >       In order to install the Netmon tools on an NT Workstation, you will 
5761         first need to install the 'Network  Monitor Agent' from the Workstation 
5762         install CD.
5763         </P
5764 ><P
5765 ></P
5766 ><UL
5767 ><LI
5768 ><P
5769 >Goto Start - Settings - Control Panel - 
5770                 Network - Services - Add</P
5771 ></LI
5772 ><LI
5773 ><P
5774 >Select the 'Network Monitor Agent' and click 
5775                 on 'OK'.</P
5776 ></LI
5777 ><LI
5778 ><P
5779 >Click 'OK' on the Network Control Panel.
5780                 </P
5781 ></LI
5782 ><LI
5783 ><P
5784 >Insert the Windows NT Workstation 4.0 install 
5785                 CD when prompted.</P
5786 ></LI
5787 ></UL
5788 ><P
5789 >       Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.* 
5790         to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set 
5791         permissions as  you deem appropriate for your site. You will need 
5792         administrative rights on the NT box to run netmon.
5793         </P
5794 ><P
5795 >       To install Netmon on a Windows 9x box install the network monitor agent 
5796         from the Windows 9x CD (\admin\nettools\netmon).  There is a readme 
5797         file located with the netmon driver files on the CD if you need 
5798         information on how to do this.  Copy the files from a working 
5799         Netmon installation.
5800         </P
5801 ></LI
5802 ><LI
5803 ><P
5804 >       The following is a list if helpful URLs and other links:
5805         </P
5806 ><P
5807 ></P
5808 ><UL
5809 ><LI
5810 ><P
5811 >Home of Samba site <A
5812 HREF="http://samba.org"
5813 TARGET="_top"
5814 >        http://samba.org</A
5815 >. We have a mirror near you !</P
5816 ></LI
5817 ><LI
5818 ><P
5819 > The <SPAN
5820 CLASS="emphasis"
5821 ><I
5822 CLASS="EMPHASIS"
5823 >Development</I
5824 ></SPAN
5825 > document 
5826         on the Samba mirrors might mention your problem. If so,
5827         it might mean that the developers are working on it.</P
5828 ></LI
5829 ><LI
5830 ><P
5831 >See how Scott Merrill simulates a BDC behavior at 
5832         <A
5833 HREF="http://www.skippy.net/linux/smb-howto.html"
5834 TARGET="_top"
5835 >        http://www.skippy.net/linux/smb-howto.html</A
5836 >. </P
5837 ></LI
5838 ><LI
5839 ><P
5840 >Although 2.0.7 has almost had its day as a PDC, David Bannon will
5841         keep the 2.0.7 PDC pages at <A
5842 HREF="http://bioserve.latrobe.edu.au/samba"
5843 TARGET="_top"
5844 >        http://bioserve.latrobe.edu.au/samba</A
5845 > going for a while yet.</P
5846 ></LI
5847 ><LI
5848 ><P
5849 >Misc links to CIFS information 
5850         <A
5851 HREF="http://samba.org/cifs/"
5852 TARGET="_top"
5853 >http://samba.org/cifs/</A
5854 ></P
5855 ></LI
5856 ><LI
5857 ><P
5858 >NT Domains for Unix <A
5859 HREF="http://mailhost.cb1.com/~lkcl/ntdom/"
5860 TARGET="_top"
5861 >        http://mailhost.cb1.com/~lkcl/ntdom/</A
5862 ></P
5863 ></LI
5864 ><LI
5865 ><P
5866 >FTP site for older SMB specs: 
5867         <A
5868 HREF="ftp://ftp.microsoft.com/developr/drg/CIFS/"
5869 TARGET="_top"
5870 >        ftp://ftp.microsoft.com/developr/drg/CIFS/</A
5871 ></P
5872 ></LI
5873 ></UL
5874 ></LI
5875 ></UL
5876 ><P
5877 ></P
5878 ><UL
5879 ><LI
5880 ><P
5881 >       <SPAN
5882 CLASS="emphasis"
5883 ><I
5884 CLASS="EMPHASIS"
5885 >How do I get help from the mailing lists?</I
5886 ></SPAN
5887 >
5888         </P
5889 ><P
5890 >       There are a number of Samba related mailing lists. Go to <A
5891 HREF="http://samba.org"
5892 TARGET="_top"
5893 >http://samba.org</A
5894 >, click on your nearest mirror
5895         and then click on <B
5896 CLASS="COMMAND"
5897 >Support</B
5898 > and then click on <B
5899 CLASS="COMMAND"
5900 >       Samba related mailing lists</B
5901 >.
5902         </P
5903 ><P
5904 >       For questions relating to Samba TNG go to
5905         <A
5906 HREF="http://www.samba-tng.org/"
5907 TARGET="_top"
5908 >http://www.samba-tng.org/</A
5909
5910         It has been requested that you don't post questions about Samba-TNG to the
5911         main stream Samba lists.</P
5912 ><P
5913 >       If you post a message to one of the lists please observe the following guide lines :
5914         </P
5915 ><P
5916 ></P
5917 ><UL
5918 ><LI
5919 ><P
5920 > Always remember that the developers are volunteers, they are 
5921                 not paid and they never guarantee to produce a particular feature at 
5922                 a particular time. Any time lines are 'best guess' and nothing more.
5923                 </P
5924 ></LI
5925 ><LI
5926 ><P
5927 > Always mention what version of samba you are using and what 
5928                 operating system its running under. You should probably list the
5929         relevant sections of your smb.conf file, at least the options 
5930         in [global] that affect PDC support.</P
5931 ></LI
5932 ><LI
5933 ><P
5934 >In addition to the version, if you obtained Samba via
5935         CVS mention the date when you last checked it out.</P
5936 ></LI
5937 ><LI
5938 ><P
5939 > Try and make your question clear and brief, lots of long, 
5940                 convoluted questions get deleted before they are completely read ! 
5941                 Don't post html encoded messages (if you can select colour or font 
5942                 size its html).</P
5943 ></LI
5944 ><LI
5945 ><P
5946 > If you run one of those nifty 'I'm on holidays' things when 
5947                 you are away, make sure its configured  to not answer mailing lists.
5948                 </P
5949 ></LI
5950 ><LI
5951 ><P
5952 > Don't cross post. Work out which is the best list to post to 
5953                 and see what happens, i.e. don't post to both samba-ntdom and samba-technical.
5954         Many people active on the lists subscribe to more 
5955                 than one list and get annoyed to see the same message two or more times. 
5956                 Often someone will see a message and thinking it would be better dealt 
5957                 with on another, will forward it on for you.</P
5958 ></LI
5959 ><LI
5960 ><P
5961 >You might include <SPAN
5962 CLASS="emphasis"
5963 ><I
5964 CLASS="EMPHASIS"
5965 >partial</I
5966 ></SPAN
5967 >
5968         log files written at a debug level set to as much as 20.  
5969         Please don't send the entire log but enough to give the context of the 
5970         error messages.</P
5971 ></LI
5972 ><LI
5973 ><P
5974 >(Possibly) If you have a complete netmon trace ( from the opening of 
5975         the pipe to the error ) you can send the *.CAP file as well.</P
5976 ></LI
5977 ><LI
5978 ><P
5979 >Please think carefully before attaching a document to an email.
5980         Consider pasting the relevant parts into the body of the message. The samba
5981         mailing lists go to a huge number of people, do they all need a copy of your 
5982         smb.conf in their attach directory?</P
5983 ></LI
5984 ></UL
5985 ></LI
5986 ><LI
5987 ><P
5988 >       <SPAN
5989 CLASS="emphasis"
5990 ><I
5991 CLASS="EMPHASIS"
5992 >How do I get off the mailing lists?</I
5993 ></SPAN
5994 >
5995         </P
5996 ><P
5997 >To have your name removed from a samba mailing list, go to the
5998         same place you went to to get on it. Go to <A
5999 HREF="http://lists.samba.org/"
6000 TARGET="_top"
6001 >http://lists.samba.org</A
6002 >, 
6003         click on your nearest mirror and then click on <B
6004 CLASS="COMMAND"
6005 >Support</B
6006 > and 
6007         then click on <B
6008 CLASS="COMMAND"
6009 > Samba related mailing lists</B
6010 >. Or perhaps see 
6011         <A
6012 HREF="http://lists.samba.org/mailman/roster/samba-ntdom"
6013 TARGET="_top"
6014 >here</A
6015 >
6016         </P
6017 ><P
6018 >       Please don't post messages to the list asking to be removed, you will just
6019         be referred to the above address (unless that process failed in some way...)
6020         </P
6021 ></LI
6022 ></UL
6023 ></DIV
6024 ><DIV
6025 CLASS="SECT1"
6026 ><HR><H2
6027 CLASS="SECT1"
6028 ><A
6029 NAME="AEN1127"
6030 >6.7. Domain Control for Windows 9x/ME</A
6031 ></H2
6032 ><P
6033 >A domain and a workgroup are exactly the same thing in terms of network
6034 browsing.  The difference is that a distributable authentication
6035 database is associated with a domain, for secure login access to a
6036 network.  Also, different access rights can be granted to users if they
6037 successfully authenticate against a domain logon server. Samba-3 does this
6038 now in the same way that MS Windows NT/2K.</P
6039 ><P
6040 >The SMB client logging on to a domain has an expectation that every other
6041 server in the domain should accept the same authentication information.
6042 Network browsing functionality of domains and workgroups is identical and
6043 is explained in this documentation under the browsing discussions.
6044 It should be noted, that browsing is totally orthogonal to logon support.</P
6045 ><P
6046 >Issues related to the single-logon network model are discussed in this
6047 section.  Samba supports domain logons, network logon scripts, and user
6048 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
6049 which are the focus of this section.</P
6050 ><P
6051 >When an SMB client in a domain wishes to logon it broadcast requests for a
6052 logon server.  The first one to reply gets the job, and validates its
6053 password using whatever mechanism the Samba administrator has installed.
6054 It is possible (but very stupid) to create a domain where the user
6055 database is not shared between servers, i.e. they are effectively workgroup
6056 servers advertising themselves as participating in a domain.  This
6057 demonstrates how authentication is quite different from but closely
6058 involved with domains.</P
6059 ><P
6060 >Using these features you can make your clients verify their logon via
6061 the Samba server; make clients run a batch file when they logon to
6062 the network and download their preferences, desktop and start menu.</P
6063 ><P
6064 >Before launching into the configuration instructions, it is 
6065 worthwhile lookingat how a Windows 9x/ME client performs a logon:</P
6066 ><P
6067 ></P
6068 ><OL
6069 TYPE="1"
6070 ><LI
6071 ><P
6072 >       The client broadcasts (to the IP broadcast address of the subnet it is in)
6073         a NetLogon request. This is sent to the NetBIOS name DOMAIN&#60;1c&#62; at the
6074         NetBIOS layer.  The client chooses the first response it receives, which
6075         contains the NetBIOS name of the logon server to use in the format of 
6076         \\SERVER.
6077         </P
6078 ></LI
6079 ><LI
6080 ><P
6081 >       The client then connects to that server, logs on (does an SMBsessetupX) and
6082         then connects to the IPC$ share (using an SMBtconX).
6083         </P
6084 ></LI
6085 ><LI
6086 ><P
6087 >       The client then does a NetWkstaUserLogon request, which retrieves the name
6088         of the user's logon script. 
6089         </P
6090 ></LI
6091 ><LI
6092 ><P
6093 >       The client then connects to the NetLogon share and searches for this    
6094         and if it is found and can be read, is retrieved and executed by the client.
6095         After this, the client disconnects from the NetLogon share.
6096         </P
6097 ></LI
6098 ><LI
6099 ><P
6100 >       The client then sends a NetUserGetInfo request to the server, to retrieve
6101         the user's home share, which is used to search for profiles. Since the
6102         response to the NetUserGetInfo request does not contain much more       
6103         the user's home share, profiles for Win9X clients MUST reside in the user
6104         home directory.
6105         </P
6106 ></LI
6107 ><LI
6108 ><P
6109 >       The client then connects to the user's home share and searches for the 
6110         user's profile. As it turns out, you can specify the user's home share as
6111         a sharename and path. For example, \\server\fred\.profile.
6112         If the profiles are found, they are implemented.
6113         </P
6114 ></LI
6115 ><LI
6116 ><P
6117 >       The client then disconnects from the user's home share, and reconnects to
6118         the NetLogon share and looks for CONFIG.POL, the policies file. If this is
6119         found, it is read and implemented.
6120         </P
6121 ></LI
6122 ></OL
6123 ><DIV
6124 CLASS="SECT2"
6125 ><HR><H3
6126 CLASS="SECT2"
6127 ><A
6128 NAME="AEN1150"
6129 >6.7.1. Configuration Instructions:     Network Logons</A
6130 ></H3
6131 ><P
6132 >The main difference between a PDC and a Windows 9x logon 
6133 server configuration is that</P
6134 ><P
6135 ></P
6136 ><UL
6137 ><LI
6138 ><P
6139 >Password encryption is not required for a Windows 9x logon server.</P
6140 ></LI
6141 ><LI
6142 ><P
6143 >Windows 9x/ME clients do not possess machine trust accounts.</P
6144 ></LI
6145 ></UL
6146 ><P
6147 >Therefore, a Samba PDC will also act as a Windows 9x logon 
6148 server.</P
6149 ><DIV
6150 CLASS="WARNING"
6151 ><P
6152 ></P
6153 ><TABLE
6154 CLASS="WARNING"
6155 WIDTH="100%"
6156 BORDER="0"
6157 ><TR
6158 ><TD
6159 WIDTH="25"
6160 ALIGN="CENTER"
6161 VALIGN="TOP"
6162 ><IMG
6163 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
6164 HSPACE="5"
6165 ALT="Warning"></TD
6166 ><TH
6167 ALIGN="LEFT"
6168 VALIGN="CENTER"
6169 ><B
6170 >security mode and master browsers</B
6171 ></TH
6172 ></TR
6173 ><TR
6174 ><TD
6175 >&nbsp;</TD
6176 ><TD
6177 ALIGN="LEFT"
6178 VALIGN="TOP"
6179 ><P
6180 >There are a few comments to make in order to tie up some 
6181 loose ends.  There has been much debate over the issue of whether
6182 or not it is ok to configure Samba as a Domain Controller in security
6183 modes other than <CODE
6184 CLASS="CONSTANT"
6185 >USER</CODE
6186 >.  The only security mode 
6187 which  will not work due to technical reasons is <CODE
6188 CLASS="CONSTANT"
6189 >SHARE</CODE
6190 >
6191 mode security.  <CODE
6192 CLASS="CONSTANT"
6193 >DOMAIN</CODE
6194 > and <CODE
6195 CLASS="CONSTANT"
6196 >SERVER</CODE
6197 >
6198 mode security is really just a variation on SMB user level security.</P
6199 ><P
6200 >Actually, this issue is also closely tied to the debate on whether 
6201 or not Samba must be the domain master browser for its workgroup
6202 when operating as a DC.  While it may technically be possible
6203 to configure a server as such (after all, browsing and domain logons
6204 are two distinctly different functions), it is not a good idea to
6205 so.  You should remember that the DC must register the DOMAIN#1b NetBIOS 
6206 name.  This is the name used by Windows clients to locate the DC.
6207 Windows clients do not distinguish between the DC and the DMB.
6208 For this reason, it is very wise to configure the Samba DC as the DMB.</P
6209 ><P
6210 >Now back to the issue of configuring a Samba DC to use a mode other
6211 than "security = user".  If a Samba host is configured to use 
6212 another SMB server or DC in order to validate user connection 
6213 requests, then it is a fact that some other machine on the network 
6214 (the "password server") knows more about user than the Samba host.
6215 99% of the time, this other host is a domain controller.  Now 
6216 in order to operate in domain mode security, the "workgroup" parameter
6217 must be set to the name of the Windows NT domain (which already 
6218 has a domain controller, right?)</P
6219 ><P
6220 >Therefore configuring a Samba box as a DC for a domain that 
6221 already by definition has a PDC is asking for trouble.
6222 Therefore, you should always configure the Samba DC to be the DMB
6223 for its domain.</P
6224 ></TD
6225 ></TR
6226 ></TABLE
6227 ></DIV
6228 ></DIV
6229 ></DIV
6230 ></DIV
6231 ><DIV
6232 CLASS="CHAPTER"
6233 ><HR><H1
6234 ><A
6235 NAME="SAMBA-BDC"
6236 ></A
6237 >Chapter 7. Samba Backup Domain Controller to Samba Domain Control</H1
6238 ><DIV
6239 CLASS="SECT1"
6240 ><H2
6241 CLASS="SECT1"
6242 ><A
6243 NAME="AEN1180"
6244 >7.1. Prerequisite Reading</A
6245 ></H2
6246 ><P
6247 >Before you continue reading in this chapter, please make sure
6248 that you are comfortable with configuring a Samba PDC
6249 as described in the <A
6250 HREF="Samba-PDC-HOWTO.html"
6251 TARGET="_top"
6252 >Samba-PDC-HOWTO</A
6253 >.</P
6254 ></DIV
6255 ><DIV
6256 CLASS="SECT1"
6257 ><HR><H2
6258 CLASS="SECT1"
6259 ><A
6260 NAME="AEN1184"
6261 >7.2. Background</A
6262 ></H2
6263 ><P
6264 >What is a Domain Controller? It is a machine that is able to answer
6265 logon requests from workstations in a Windows NT Domain. Whenever a
6266 user logs into a Windows NT Workstation, the workstation connects to a
6267 Domain Controller and asks him whether the username and password the
6268 user typed in is correct.  The Domain Controller replies with a lot of
6269 information about the user, for example the place where the users
6270 profile is stored, the users full name of the user. All this
6271 information is stored in the NT user database, the so-called SAM.</P
6272 ><P
6273 >There are two kinds of Domain Controller in a NT 4 compatible Domain:
6274 A Primary Domain Controller (PDC) and one or more Backup Domain
6275 Controllers (BDC). The PDC contains the master copy of the
6276 SAM. Whenever the SAM has to change, for example when a user changes
6277 his password, this change has to be done on the PDC. A Backup Domain
6278 Controller is a machine that maintains a read-only copy of the
6279 SAM. This way it is able to reply to logon requests and authenticate
6280 users in case the PDC is not available. During this time no changes to
6281 the SAM are possible. Whenever changes to the SAM are done on the PDC,
6282 all BDC receive the changes from the PDC.</P
6283 ><P
6284 >Since version 2.2 Samba officially supports domain logons for all
6285 current Windows Clients, including Windows 2000 and XP. This text
6286 assumes the domain to be named SAMBA. To be able to act as a PDC, some
6287 parameters in the [global]-section of the smb.conf have to be set:</P
6288 ><P
6289 ><PRE
6290 CLASS="PROGRAMLISTING"
6291 >workgroup = SAMBA
6292 domain master = yes
6293 domain logons = yes</PRE
6294 ></P
6295 ><P
6296 >Several other things like a [homes] and a [netlogon] share also may be
6297 set along with settings for the profile path, the users home drive and
6298 others. This will not be covered in this document.</P
6299 ></DIV
6300 ><DIV
6301 CLASS="SECT1"
6302 ><HR><H2
6303 CLASS="SECT1"
6304 ><A
6305 NAME="AEN1192"
6306 >7.3. What qualifies a Domain Controller on the network?</A
6307 ></H2
6308 ><P
6309 >Every machine that is a Domain Controller for the domain SAMBA has to
6310 register the NetBIOS group name SAMBA#1c with the WINS server and/or
6311 by broadcast on the local network. The PDC also registers the unique
6312 NetBIOS name SAMBA#1b with the WINS server. The name type #1b is
6313 normally reserved for the domain master browser, a role that has
6314 nothing to do with anything related to authentication, but the
6315 Microsoft Domain implementation requires the domain master browser to
6316 be on the same machine as the PDC.</P
6317 ><DIV
6318 CLASS="SECT2"
6319 ><HR><H3
6320 CLASS="SECT2"
6321 ><A
6322 NAME="AEN1195"
6323 >7.3.1. How does a Workstation find its domain controller?</A
6324 ></H3
6325 ><P
6326 >A NT workstation in the domain SAMBA that wants a local user to be
6327 authenticated has to find the domain controller for SAMBA. It does
6328 this by doing a NetBIOS name query for the group name SAMBA#1c. It
6329 assumes that each of the machines it gets back from the queries is a
6330 domain controller and can answer logon requests. To not open security
6331 holes both the workstation and the selected (TODO: How is the DC
6332 chosen) domain controller authenticate each other. After that the
6333 workstation sends the user's credentials (his name and password) to
6334 the domain controller, asking for approval.</P
6335 ></DIV
6336 ><DIV
6337 CLASS="SECT2"
6338 ><HR><H3
6339 CLASS="SECT2"
6340 ><A
6341 NAME="AEN1198"
6342 >7.3.2. When is the PDC needed?</A
6343 ></H3
6344 ><P
6345 >Whenever a user wants to change his password, this has to be done on
6346 the PDC. To find the PDC, the workstation does a NetBIOS name query
6347 for SAMBA#1b, assuming this machine maintains the master copy of the
6348 SAM. The workstation contacts the PDC, both mutually authenticate and
6349 the password change is done.</P
6350 ></DIV
6351 ></DIV
6352 ><DIV
6353 CLASS="SECT1"
6354 ><HR><H2
6355 CLASS="SECT1"
6356 ><A
6357 NAME="AEN1201"
6358 >7.4. Can Samba be a Backup Domain Controller to an NT PDC?</A
6359 ></H2
6360 ><P
6361 >With version 2.2, no. The native NT SAM replication protocols have
6362 not yet been fully implemented. The Samba Team is working on
6363 understanding and implementing the protocols, but this work has not
6364 been finished for version 2.2.</P
6365 ><P
6366 >With version 3.0, the work on both the replication protocols and a
6367 suitable storage mechanism has progressed, and some form of NT4 BDC
6368 support is expected soon.</P
6369 ><P
6370 >Can I get the benefits of a BDC with Samba?  Yes. The main reason for
6371 implementing a BDC is availability. If the PDC is a Samba machine,
6372 a second Samba machine can be set up to
6373 service logon requests whenever the PDC is down.</P
6374 ></DIV
6375 ><DIV
6376 CLASS="SECT1"
6377 ><HR><H2
6378 CLASS="SECT1"
6379 ><A
6380 NAME="AEN1206"
6381 >7.5. How do I set up a Samba BDC?</A
6382 ></H2
6383 ><P
6384 >Several things have to be done:</P
6385 ><P
6386 ></P
6387 ><UL
6388 ><LI
6389 ><P
6390 >The domain SID has to be the same on the PDC and the BDC. This used to
6391 be stored in the file private/MACHINE.SID. This file is not created
6392 anymore since Samba 2.2.5 or even earlier. Nowadays the domain SID is
6393 stored in the file private/secrets.tdb. Simply copying the secrets.tdb
6394 from the PDC to the BDC does not work, as the BDC would
6395 generate a new SID for itself and override the domain SID with this
6396 new BDC SID.</P
6397 ><P
6398 >To retrieve the domain SID from the PDC or an existing BDC and store it in the
6399 secrets.tdb, execute 'net rpc getsid' on the BDC.</P
6400 ></LI
6401 ><LI
6402 ><P
6403 >The Unix user database has to be synchronized from the PDC to the
6404 BDC. This means that both the /etc/passwd and /etc/group have to be
6405 replicated from the PDC to the BDC. This can be done manually
6406 whenever changes are made, or the PDC is set up as a NIS master
6407 server and the BDC as a NIS slave server. To set up the BDC as a
6408 mere NIS client would not be enough, as the BDC would not be able to
6409 access its user database in case of a PDC failure.</P
6410 ></LI
6411 ><LI
6412 ><P
6413 >The Samba password database in the file private/smbpasswd has to be
6414 replicated from the PDC to the BDC. This is a bit tricky, see the
6415 next section.</P
6416 ></LI
6417 ><LI
6418 ><P
6419 >Any netlogon share has to be replicated from the PDC to the
6420 BDC. This can be done manually whenever login scripts are changed,
6421 or it can be done automatically together with the smbpasswd
6422 synchronization.</P
6423 ></LI
6424 ></UL
6425 ><P
6426 >Finally, the BDC has to be found by the workstations. This can be done
6427 by setting</P
6428 ><P
6429 ><PRE
6430 CLASS="PROGRAMLISTING"
6431 >workgroup = samba
6432 domain master = no
6433 domain logons = yes</PRE
6434 ></P
6435 ><P
6436 >in the [global]-section of the smb.conf of the BDC. This makes the BDC
6437 only register the name SAMBA#1c with the WINS server. This is no
6438 problem as the name SAMBA#1c is a NetBIOS group name that is meant to
6439 be registered by more than one machine. The parameter 'domain master =
6440 no' forces the BDC not to register SAMBA#1b which as a unique NetBIOS
6441 name is reserved for the Primary Domain Controller.</P
6442 ><DIV
6443 CLASS="SECT2"
6444 ><HR><H3
6445 CLASS="SECT2"
6446 ><A
6447 NAME="AEN1223"
6448 >7.5.1. How do I replicate the smbpasswd file?</A
6449 ></H3
6450 ><P
6451 >Replication of the smbpasswd file is sensitive. It has to be done
6452 whenever changes to the SAM are made. Every user's password change is
6453 done in the smbpasswd file and has to be replicated to the BDC. So
6454 replicating the smbpasswd file very often is necessary.</P
6455 ><P
6456 >As the smbpasswd file contains plain text password equivalents, it
6457 must not be sent unencrypted over the wire. The best way to set up
6458 smbpasswd replication from the PDC to the BDC is to use the utility
6459 rsync. rsync can use ssh as a transport. ssh itself can be set up to
6460 accept *only* rsync transfer without requiring the user to type a
6461 password.</P
6462 ></DIV
6463 ><DIV
6464 CLASS="SECT2"
6465 ><HR><H3
6466 CLASS="SECT2"
6467 ><A
6468 NAME="AEN1227"
6469 >7.5.2. Can I do this all with LDAP?</A
6470 ></H3
6471 ><P
6472 >The simple answer is YES.  Samba's pdb_ldap code supports
6473 binding to a replica LDAP server, and will also follow referrals and
6474 rebind to the master if it ever needs to make a modification to the
6475 database.  (Normally BDCs are read only, so this will not occur
6476 often).</P
6477 ></DIV
6478 ></DIV
6479 ></DIV
6480 ><DIV
6481 CLASS="CHAPTER"
6482 ><HR><H1
6483 ><A
6484 NAME="ADS"
6485 ></A
6486 >Chapter 8. Samba as a ADS domain member</H1
6487 ><P
6488 >This is a rough guide to setting up Samba 3.0 with kerberos authentication against a
6489 Windows2000 KDC. </P
6490 ><DIV
6491 CLASS="SECT1"
6492 ><HR><H2
6493 CLASS="SECT1"
6494 ><A
6495 NAME="AEN1238"
6496 >8.1. Setup your <TT
6497 CLASS="FILENAME"
6498 >smb.conf</TT
6499 ></A
6500 ></H2
6501 ><P
6502 >You must use at least the following 3 options in smb.conf:</P
6503 ><P
6504 ><PRE
6505 CLASS="PROGRAMLISTING"
6506 >  realm = YOUR.KERBEROS.REALM
6507   security = ADS
6508   encrypt passwords = yes</PRE
6509 ></P
6510 ><P
6511 >In case samba can't figure out your ads server using your realm name, use the 
6512 <B
6513 CLASS="COMMAND"
6514 >ads server</B
6515 > option in <TT
6516 CLASS="FILENAME"
6517 >smb.conf</TT
6518 >:
6519 <PRE
6520 CLASS="PROGRAMLISTING"
6521 >  ads server = your.kerberos.server</PRE
6522 ></P
6523 ><P
6524 >You do *not* need a smbpasswd file, and older clients will
6525   be authenticated as if "security = domain", although it won't do any harm
6526   and allows you to have local users not in the domain.
6527   I expect that the above required options will change soon when we get better
6528   active directory integration.</P
6529 ></DIV
6530 ><DIV
6531 CLASS="SECT1"
6532 ><HR><H2
6533 CLASS="SECT1"
6534 ><A
6535 NAME="AEN1249"
6536 >8.2. Setup your <TT
6537 CLASS="FILENAME"
6538 >/etc/krb5.conf</TT
6539 ></A
6540 ></H2
6541 ><P
6542 >The minimal configuration for krb5.conf is:</P
6543 ><P
6544 ><PRE
6545 CLASS="PROGRAMLISTING"
6546 >[realms]
6547     YOUR.KERBEROS.REALM = {
6548         kdc = your.kerberos.server
6549     }</PRE
6550 ></P
6551 ><P
6552 >Test your config by doing a "kinit USERNAME@REALM" and making sure that
6553   your password is accepted by the Win2000 KDC. </P
6554 ><P
6555 >NOTE: The realm must be uppercase. </P
6556 ><P
6557 >You also must ensure that you can do a reverse DNS lookup on the IP
6558 address of your KDC. Also, the name that this reverse lookup maps to
6559 must either be the netbios name of the KDC (ie. the hostname with no
6560 domain attached) or it can alternatively be the netbios name
6561 followed by the realm. </P
6562 ><P
6563 >The easiest way to ensure you get this right is to add a /etc/hosts
6564 entry mapping the IP address of your KDC to its netbios name. If you
6565 don't get this right then you will get a "local error" when you try
6566 to join the realm.</P
6567 ><P
6568 >If all you want is kerberos support in smbclient then you can skip
6569 straight to step 5 now. Step 3 is only needed if you want kerberos
6570 support for smbd and winbindd.</P
6571 ></DIV
6572 ><DIV
6573 CLASS="SECT1"
6574 ><HR><H2
6575 CLASS="SECT1"
6576 ><A
6577 NAME="AEN1260"
6578 >8.3. Create the computer account</A
6579 ></H2
6580 ><P
6581 >As a user that has write permission on the Samba private directory
6582 (usually root) run:
6583 <B
6584 CLASS="COMMAND"
6585 >net ads join</B
6586 ></P
6587 ><DIV
6588 CLASS="SECT2"
6589 ><HR><H3
6590 CLASS="SECT2"
6591 ><A
6592 NAME="AEN1264"
6593 >8.3.1. Possible errors</A
6594 ></H3
6595 ><P
6596 ><P
6597 ></P
6598 ><DIV
6599 CLASS="VARIABLELIST"
6600 ><DL
6601 ><DT
6602 >"ADS support not compiled in"</DT
6603 ><DD
6604 ><P
6605 >Samba must be reconfigured (remove config.cache) and recompiled (make clean all install) after the kerberos libs and headers are installed.</P
6606 ></DD
6607 ></DL
6608 ></DIV
6609 ></P
6610 ></DIV
6611 ></DIV
6612 ><DIV
6613 CLASS="SECT1"
6614 ><HR><H2
6615 CLASS="SECT1"
6616 ><A
6617 NAME="AEN1272"
6618 >8.4. Test your server setup</A
6619 ></H2
6620 ><P
6621 >On a Windows 2000 client try <B
6622 CLASS="COMMAND"
6623 >net use * \\server\share</B
6624 >. You should
6625 be logged in with kerberos without needing to know a password. If
6626 this fails then run <B
6627 CLASS="COMMAND"
6628 >klist tickets</B
6629 >. Did you get a ticket for the
6630 server? Does it have an encoding type of DES-CBC-MD5 ? </P
6631 ></DIV
6632 ><DIV
6633 CLASS="SECT1"
6634 ><HR><H2
6635 CLASS="SECT1"
6636 ><A
6637 NAME="AEN1277"
6638 >8.5. Testing with smbclient</A
6639 ></H2
6640 ><P
6641 >On your Samba server try to login to a Win2000 server or your Samba
6642 server using smbclient and kerberos. Use smbclient as usual, but
6643 specify the -k option to choose kerberos authentication.</P
6644 ></DIV
6645 ><DIV
6646 CLASS="SECT1"
6647 ><HR><H2
6648 CLASS="SECT1"
6649 ><A
6650 NAME="AEN1280"
6651 >8.6. Notes</A
6652 ></H2
6653 ><P
6654 >You must change administrator password at least once after DC 
6655 install, to create the right encoding types</P
6656 ><P
6657 >w2k doesn't seem to create the _kerberos._udp and _ldap._tcp in
6658    their defaults DNS setup. Maybe fixed in service packs?</P
6659 ></DIV
6660 ></DIV
6661 ><DIV
6662 CLASS="CHAPTER"
6663 ><HR><H1
6664 ><A
6665 NAME="DOMAIN-SECURITY"
6666 ></A
6667 >Chapter 9. Samba as a NT4 or Win2k domain member</H1
6668 ><DIV
6669 CLASS="SECT1"
6670 ><H2
6671 CLASS="SECT1"
6672 ><A
6673 NAME="AEN1302"
6674 >9.1. Joining an NT Domain with Samba 3.0</A
6675 ></H2
6676 ><P
6677 >Assume you have a Samba 3.0 server with a NetBIOS name of 
6678         <CODE
6679 CLASS="CONSTANT"
6680 >SERV1</CODE
6681 > and are joining an or Win2k NT domain called
6682         <CODE
6683 CLASS="CONSTANT"
6684 >DOM</CODE
6685 >, which has a PDC with a NetBIOS name
6686         of <CODE
6687 CLASS="CONSTANT"
6688 >DOMPDC</CODE
6689 > and two backup domain controllers 
6690         with NetBIOS names <CODE
6691 CLASS="CONSTANT"
6692 >DOMBDC1</CODE
6693 > and <CODE
6694 CLASS="CONSTANT"
6695 >DOMBDC2
6696         </CODE
6697 >.</P
6698 ><P
6699 >Firstly, you must edit your <A
6700 HREF="smb.conf.5.html"
6701 TARGET="_top"
6702 ><TT
6703 CLASS="FILENAME"
6704 >smb.conf(5)</TT
6705 >
6706         </A
6707 > file to tell Samba it should now use domain security.</P
6708 ><P
6709 >Change (or add) your <A
6710 HREF="smb.conf.5.html#SECURITY"
6711 TARGET="_top"
6712 >       <VAR
6713 CLASS="PARAMETER"
6714 >security =</VAR
6715 ></A
6716 > line in the [global] section 
6717         of your smb.conf to read:</P
6718 ><P
6719 ><B
6720 CLASS="COMMAND"
6721 >security = domain</B
6722 ></P
6723 ><P
6724 >Next change the <A
6725 HREF="smb.conf.5.html#WORKGROUP"
6726 TARGET="_top"
6727 ><VAR
6728 CLASS="PARAMETER"
6729 >       workgroup =</VAR
6730 ></A
6731 > line in the [global] section to read: </P
6732 ><P
6733 ><B
6734 CLASS="COMMAND"
6735 >workgroup = DOM</B
6736 ></P
6737 ><P
6738 >as this is the name of the domain we are joining. </P
6739 ><P
6740 >You must also have the parameter <A
6741 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
6742 TARGET="_top"
6743 >       <VAR
6744 CLASS="PARAMETER"
6745 >encrypt passwords</VAR
6746 ></A
6747 > set to <CODE
6748 CLASS="CONSTANT"
6749 >yes
6750         </CODE
6751 > in order for your users to authenticate to the NT PDC.</P
6752 ><P
6753 >Finally, add (or modify) a <A
6754 HREF="smb.conf.5.html#PASSWORDSERVER"
6755 TARGET="_top"
6756 >       <VAR
6757 CLASS="PARAMETER"
6758 >password server =</VAR
6759 ></A
6760 > line in the [global]
6761         section to read: </P
6762 ><P
6763 ><B
6764 CLASS="COMMAND"
6765 >password server = DOMPDC DOMBDC1 DOMBDC2</B
6766 ></P
6767 ><P
6768 >These are the primary and backup domain controllers Samba 
6769         will attempt to contact in order to authenticate users. Samba will 
6770         try to contact each of these servers in order, so you may want to 
6771         rearrange this list in order to spread out the authentication load 
6772         among domain controllers.</P
6773 ><P
6774 >Alternatively, if you want smbd to automatically determine 
6775         the list of Domain controllers to use for authentication, you may 
6776         set this line to be :</P
6777 ><P
6778 ><B
6779 CLASS="COMMAND"
6780 >password server = *</B
6781 ></P
6782 ><P
6783 >This method, allows Samba to use exactly the same
6784         mechanism that NT does. This 
6785         method either broadcasts or uses a WINS database in order to
6786         find domain controllers to authenticate against.</P
6787 ><P
6788 >In order to actually join the domain, you must run this
6789         command:</P
6790 ><P
6791 ><SAMP
6792 CLASS="PROMPT"
6793 >root# </SAMP
6794 ><KBD
6795 CLASS="USERINPUT"
6796 >net rpc join -S DOMPDC
6797         -U<VAR
6798 CLASS="REPLACEABLE"
6799 >Administrator%password</VAR
6800 ></KBD
6801 ></P
6802 ><P
6803 >as we are joining the domain DOM and the PDC for that domain 
6804         (the only machine that has write access to the domain SAM database) 
6805         is DOMPDC. The <VAR
6806 CLASS="REPLACEABLE"
6807 >Administrator%password</VAR
6808 > is 
6809         the login name and password for an account which has the necessary 
6810         privilege to add machines to the domain.  If this is successful 
6811         you will see the message:</P
6812 ><P
6813 ><SAMP
6814 CLASS="COMPUTEROUTPUT"
6815 >Joined domain DOM.</SAMP
6816 >
6817         or <SAMP
6818 CLASS="COMPUTEROUTPUT"
6819 >Joined 'SERV1' to realm 'MYREALM'</SAMP
6820 >
6821         </P
6822 ><P
6823 >in your terminal window. See the <A
6824 HREF="net.8.html"
6825 TARGET="_top"
6826 >       net(8)</A
6827 > man page for more details.</P
6828 ><P
6829 >This process joins the server to thedomain
6830         without having to create the machine trust account on the PDC
6831         beforehand.</P
6832 ><P
6833 >This command goes through the machine account password 
6834         change protocol, then writes the new (random) machine account 
6835         password for this Samba server into a file in the same directory 
6836         in which an smbpasswd file would be stored - normally :</P
6837 ><P
6838 ><TT
6839 CLASS="FILENAME"
6840 >/usr/local/samba/private/secrets.tdb</TT
6841 ></P
6842 ><P
6843 >This file is created and owned by root and is not 
6844         readable by any other user. It is the key to the domain-level 
6845         security for your system, and should be treated as carefully 
6846         as a shadow password file.</P
6847 ><P
6848 >Finally, restart your Samba daemons and get ready for 
6849         clients to begin using domain security!</P
6850 ></DIV
6851 ><DIV
6852 CLASS="SECT1"
6853 ><HR><H2
6854 CLASS="SECT1"
6855 ><A
6856 NAME="AEN1356"
6857 >9.2. Why is this better than security = server?</A
6858 ></H2
6859 ><P
6860 >Currently, domain security in Samba doesn't free you from 
6861         having to create local Unix users to represent the users attaching 
6862         to your server. This means that if domain user <CODE
6863 CLASS="CONSTANT"
6864 >DOM\fred
6865         </CODE
6866 > attaches to your domain security Samba server, there needs 
6867         to be a local Unix user fred to represent that user in the Unix 
6868         filesystem. This is very similar to the older Samba security mode 
6869         <A
6870 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
6871 TARGET="_top"
6872 >security = server</A
6873 >, 
6874         where Samba would pass through the authentication request to a Windows 
6875         NT server in the same way as a Windows 95 or Windows 98 server would.
6876         </P
6877 ><P
6878 >Please refer to the <A
6879 HREF="winbind.html"
6880 TARGET="_top"
6881 >Winbind 
6882         paper</A
6883 > for information on a system to automatically
6884         assign UNIX uids and gids to Windows NT Domain users and groups.
6885         This code is available in development branches only at the moment,
6886         but will be moved to release branches soon.</P
6887 ><P
6888 >The advantage to domain-level security is that the 
6889         authentication in domain-level security is passed down the authenticated 
6890         RPC channel in exactly the same way that an NT server would do it. This 
6891         means Samba servers now participate in domain trust relationships in 
6892         exactly the same way NT servers do (i.e., you can add Samba servers into 
6893         a resource domain and have the authentication passed on from a resource
6894         domain PDC to an account domain PDC.</P
6895 ><P
6896 >In addition, with <B
6897 CLASS="COMMAND"
6898 >security = server</B
6899 > every Samba 
6900         daemon on a server has to keep a connection open to the 
6901         authenticating server for as long as that daemon lasts. This can drain 
6902         the connection resources on a Microsoft NT server and cause it to run 
6903         out of available connections. With <B
6904 CLASS="COMMAND"
6905 >security = domain</B
6906 >, 
6907         however, the Samba daemons connect to the PDC/BDC only for as long 
6908         as is necessary to authenticate the user, and then drop the connection, 
6909         thus conserving PDC connection resources.</P
6910 ><P
6911 >And finally, acting in the same manner as an NT server 
6912         authenticating to a PDC means that as part of the authentication 
6913         reply, the Samba server gets the user identification information such 
6914         as the user SID, the list of NT groups the user belongs to, etc. </P
6915 ><DIV
6916 CLASS="NOTE"
6917 ><P
6918 ></P
6919 ><TABLE
6920 CLASS="NOTE"
6921 WIDTH="100%"
6922 BORDER="0"
6923 ><TR
6924 ><TD
6925 WIDTH="25"
6926 ALIGN="CENTER"
6927 VALIGN="TOP"
6928 ><IMG
6929 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
6930 HSPACE="5"
6931 ALT="Note"></TD
6932 ><TD
6933 ALIGN="LEFT"
6934 VALIGN="TOP"
6935 ><P
6936 > Much of the text of this document 
6937         was first published in the Web magazine <A
6938 HREF="http://www.linuxworld.com"
6939 TARGET="_top"
6940 >       
6941         LinuxWorld</A
6942 > as the article <A
6943 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
6944 TARGET="_top"
6945 >Doing 
6946         the NIS/NT Samba</A
6947 >.</P
6948 ></TD
6949 ></TR
6950 ></TABLE
6951 ></DIV
6952 ></DIV
6953 ></DIV
6954 ></DIV
6955 ><DIV
6956 CLASS="PART"
6957 ><A
6958 NAME="OPTIONAL"
6959 ></A
6960 ><DIV
6961 CLASS="TITLEPAGE"
6962 ><H1
6963 CLASS="TITLE"
6964 >III. Advanced Configuration</H1
6965 ><DIV
6966 CLASS="PARTINTRO"
6967 ><A
6968 NAME="AEN1374"
6969 ></A
6970 ><H1
6971 >Introduction</H1
6972 ><P
6973 >Samba has several features that you might want or might not want to use. The chapters in this 
6974 part each cover one specific feature.</P
6975 ></DIV
6976 ><DIV
6977 CLASS="TOC"
6978 ><DL
6979 ><DT
6980 ><B
6981 >Table of Contents</B
6982 ></DT
6983 ><DT
6984 >10. <A
6985 HREF="#ADVANCEDNETWORKMANAGEMENT"
6986 >Advanced Network Manangement Information</A
6987 ></DT
6988 ><DD
6989 ><DL
6990 ><DT
6991 >10.1. <A
6992 HREF="#AEN1388"
6993 >Remote Server Administration</A
6994 ></DT
6995 ></DL
6996 ></DD
6997 ><DT
6998 >11. <A
6999 HREF="#UNIX-PERMISSIONS"
7000 >UNIX Permission Bits and Windows NT Access Control Lists</A
7001 ></DT
7002 ><DD
7003 ><DL
7004 ><DT
7005 >11.1. <A
7006 HREF="#AEN1416"
7007 >Viewing and changing UNIX permissions using the NT 
7008         security dialogs</A
7009 ></DT
7010 ><DT
7011 >11.2. <A
7012 HREF="#AEN1420"
7013 >How to view file security on a Samba share</A
7014 ></DT
7015 ><DT
7016 >11.3. <A
7017 HREF="#AEN1431"
7018 >Viewing file ownership</A
7019 ></DT
7020 ><DT
7021 >11.4. <A
7022 HREF="#AEN1451"
7023 >Viewing file or directory permissions</A
7024 ></DT
7025 ><DD
7026 ><DL
7027 ><DT
7028 >11.4.1. <A
7029 HREF="#AEN1466"
7030 >File Permissions</A
7031 ></DT
7032 ><DT
7033 >11.4.2. <A
7034 HREF="#AEN1480"
7035 >Directory Permissions</A
7036 ></DT
7037 ></DL
7038 ></DD
7039 ><DT
7040 >11.5. <A
7041 HREF="#AEN1487"
7042 >Modifying file or directory permissions</A
7043 ></DT
7044 ><DT
7045 >11.6. <A
7046 HREF="#AEN1509"
7047 >Interaction with the standard Samba create mask 
7048         parameters</A
7049 ></DT
7050 ><DT
7051 >11.7. <A
7052 HREF="#AEN1563"
7053 >Interaction with the standard Samba file attribute 
7054         mapping</A
7055 ></DT
7056 ></DL
7057 ></DD
7058 ><DT
7059 >12. <A
7060 HREF="#GROUPMAPPING"
7061 >Group mapping HOWTO</A
7062 ></DT
7063 ><DT
7064 >13. <A
7065 HREF="#PAM"
7066 >Configuring PAM for distributed but centrally 
7067 managed authentication</A
7068 ></DT
7069 ><DD
7070 ><DL
7071 ><DT
7072 >13.1. <A
7073 HREF="#AEN1619"
7074 >Samba and PAM</A
7075 ></DT
7076 ><DT
7077 >13.2. <A
7078 HREF="#AEN1668"
7079 >Distributed Authentication</A
7080 ></DT
7081 ><DT
7082 >13.3. <A
7083 HREF="#AEN1673"
7084 >PAM Configuration in smb.conf</A
7085 ></DT
7086 ></DL
7087 ></DD
7088 ><DT
7089 >14. <A
7090 HREF="#PRINTING"
7091 >Printing Support</A
7092 ></DT
7093 ><DD
7094 ><DL
7095 ><DT
7096 >14.1. <A
7097 HREF="#AEN1699"
7098 >Introduction</A
7099 ></DT
7100 ><DT
7101 >14.2. <A
7102 HREF="#AEN1721"
7103 >Configuration</A
7104 ></DT
7105 ><DD
7106 ><DL
7107 ><DT
7108 >14.2.1. <A
7109 HREF="#AEN1729"
7110 >Creating [print$]</A
7111 ></DT
7112 ><DT
7113 >14.2.2. <A
7114 HREF="#AEN1764"
7115 >Setting Drivers for Existing Printers</A
7116 ></DT
7117 ><DT
7118 >14.2.3. <A
7119 HREF="#AEN1780"
7120 >Support a large number of printers</A
7121 ></DT
7122 ><DT
7123 >14.2.4. <A
7124 HREF="#AEN1791"
7125 >Adding New Printers via the Windows NT APW</A
7126 ></DT
7127 ><DT
7128 >14.2.5. <A
7129 HREF="#AEN1821"
7130 >Samba and Printer Ports</A
7131 ></DT
7132 ></DL
7133 ></DD
7134 ><DT
7135 >14.3. <A
7136 HREF="#AEN1829"
7137 >The Imprints Toolset</A
7138 ></DT
7139 ><DD
7140 ><DL
7141 ><DT
7142 >14.3.1. <A
7143 HREF="#AEN1833"
7144 >What is Imprints?</A
7145 ></DT
7146 ><DT
7147 >14.3.2. <A
7148 HREF="#AEN1843"
7149 >Creating Printer Driver Packages</A
7150 ></DT
7151 ><DT
7152 >14.3.3. <A
7153 HREF="#AEN1846"
7154 >The Imprints server</A
7155 ></DT
7156 ><DT
7157 >14.3.4. <A
7158 HREF="#AEN1850"
7159 >The Installation Client</A
7160 ></DT
7161 ></DL
7162 ></DD
7163 ><DT
7164 >14.4. <A
7165 HREF="#AEN1872"
7166 >Diagnosis</A
7167 ></DT
7168 ><DD
7169 ><DL
7170 ><DT
7171 >14.4.1. <A
7172 HREF="#AEN1874"
7173 >Introduction</A
7174 ></DT
7175 ><DT
7176 >14.4.2. <A
7177 HREF="#AEN1890"
7178 >Debugging printer problems</A
7179 ></DT
7180 ><DT
7181 >14.4.3. <A
7182 HREF="#AEN1899"
7183 >What printers do I have?</A
7184 ></DT
7185 ><DT
7186 >14.4.4. <A
7187 HREF="#AEN1907"
7188 >Setting up printcap and print servers</A
7189 ></DT
7190 ><DT
7191 >14.4.5. <A
7192 HREF="#AEN1935"
7193 >Job sent, no output</A
7194 ></DT
7195 ><DT
7196 >14.4.6. <A
7197 HREF="#AEN1946"
7198 >Job sent, strange output</A
7199 ></DT
7200 ><DT
7201 >14.4.7. <A
7202 HREF="#AEN1958"
7203 >Raw PostScript printed</A
7204 ></DT
7205 ><DT
7206 >14.4.8. <A
7207 HREF="#AEN1961"
7208 >Advanced Printing</A
7209 ></DT
7210 ><DT
7211 >14.4.9. <A
7212 HREF="#AEN1964"
7213 >Real debugging</A
7214 ></DT
7215 ></DL
7216 ></DD
7217 ></DL
7218 ></DD
7219 ><DT
7220 >15. <A
7221 HREF="#CUPS-PRINTING"
7222 >CUPS Printing Support</A
7223 ></DT
7224 ><DD
7225 ><DL
7226 ><DT
7227 >15.1. <A
7228 HREF="#AEN1984"
7229 >Introduction</A
7230 ></DT
7231 ><DT
7232 >15.2. <A
7233 HREF="#AEN1989"
7234 >CUPS - RAW Print Through  Mode</A
7235 ></DT
7236 ><DT
7237 >15.3. <A
7238 HREF="#AEN2044"
7239 >The CUPS Filter Chains</A
7240 ></DT
7241 ><DT
7242 >15.4. <A
7243 HREF="#AEN2083"
7244 >CUPS Print Drivers and Devices</A
7245 ></DT
7246 ><DD
7247 ><DL
7248 ><DT
7249 >15.4.1. <A
7250 HREF="#AEN2090"
7251 >Further printing steps</A
7252 ></DT
7253 ></DL
7254 ></DD
7255 ><DT
7256 >15.5. <A
7257 HREF="#AEN2160"
7258 >Limiting the number of pages users can print</A
7259 ></DT
7260 ><DT
7261 >15.6. <A
7262 HREF="#AEN2249"
7263 >Advanced Postscript Printing from MS Windows</A
7264 ></DT
7265 ><DT
7266 >15.7. <A
7267 HREF="#AEN2264"
7268 >Auto-Deletion of CUPS spool files</A
7269 ></DT
7270 ></DL
7271 ></DD
7272 ><DT
7273 >16. <A
7274 HREF="#WINBIND"
7275 >Unified Logons between Windows NT and UNIX using Winbind</A
7276 ></DT
7277 ><DD
7278 ><DL
7279 ><DT
7280 >16.1. <A
7281 HREF="#AEN2326"
7282 >Abstract</A
7283 ></DT
7284 ><DT
7285 >16.2. <A
7286 HREF="#AEN2330"
7287 >Introduction</A
7288 ></DT
7289 ><DT
7290 >16.3. <A
7291 HREF="#AEN2343"
7292 >What Winbind Provides</A
7293 ></DT
7294 ><DD
7295 ><DL
7296 ><DT
7297 >16.3.1. <A
7298 HREF="#AEN2350"
7299 >Target Uses</A
7300 ></DT
7301 ></DL
7302 ></DD
7303 ><DT
7304 >16.4. <A
7305 HREF="#AEN2354"
7306 >How Winbind Works</A
7307 ></DT
7308 ><DD
7309 ><DL
7310 ><DT
7311 >16.4.1. <A
7312 HREF="#AEN2359"
7313 >Microsoft Remote Procedure Calls</A
7314 ></DT
7315 ><DT
7316 >16.4.2. <A
7317 HREF="#AEN2363"
7318 >Microsoft Active Directory Services</A
7319 ></DT
7320 ><DT
7321 >16.4.3. <A
7322 HREF="#AEN2366"
7323 >Name Service Switch</A
7324 ></DT
7325 ><DT
7326 >16.4.4. <A
7327 HREF="#AEN2382"
7328 >Pluggable Authentication Modules</A
7329 ></DT
7330 ><DT
7331 >16.4.5. <A
7332 HREF="#AEN2390"
7333 >User and Group ID Allocation</A
7334 ></DT
7335 ><DT
7336 >16.4.6. <A
7337 HREF="#AEN2394"
7338 >Result Caching</A
7339 ></DT
7340 ></DL
7341 ></DD
7342 ><DT
7343 >16.5. <A
7344 HREF="#AEN2397"
7345 >Installation and Configuration</A
7346 ></DT
7347 ><DD
7348 ><DL
7349 ><DT
7350 >16.5.1. <A
7351 HREF="#AEN2402"
7352 >Introduction</A
7353 ></DT
7354 ><DT
7355 >16.5.2. <A
7356 HREF="#AEN2415"
7357 >Requirements</A
7358 ></DT
7359 ><DT
7360 >16.5.3. <A
7361 HREF="#AEN2429"
7362 >Testing Things Out</A
7363 ></DT
7364 ></DL
7365 ></DD
7366 ><DT
7367 >16.6. <A
7368 HREF="#AEN2654"
7369 >Limitations</A
7370 ></DT
7371 ><DT
7372 >16.7. <A
7373 HREF="#AEN2664"
7374 >Conclusion</A
7375 ></DT
7376 ></DL
7377 ></DD
7378 ><DT
7379 >17. <A
7380 HREF="#POLICYMGMT"
7381 >Policy Management - Hows and Whys</A
7382 ></DT
7383 ><DD
7384 ><DL
7385 ><DT
7386 >17.1. <A
7387 HREF="#AEN2678"
7388 >System Policies</A
7389 ></DT
7390 ><DD
7391 ><DL
7392 ><DT
7393 >17.1.1. <A
7394 HREF="#AEN2692"
7395 >Creating and Managing Windows 9x/Me Policies</A
7396 ></DT
7397 ><DT
7398 >17.1.2. <A
7399 HREF="#AEN2704"
7400 >Creating and Managing Windows NT4 Style Policy Files</A
7401 ></DT
7402 ><DT
7403 >17.1.3. <A
7404 HREF="#AEN2722"
7405 >Creating and Managing MS Windows 200x Policies</A
7406 ></DT
7407 ></DL
7408 ></DD
7409 ></DL
7410 ></DD
7411 ><DT
7412 >18. <A
7413 HREF="#PROFILEMGMT"
7414 >Profile Management</A
7415 ></DT
7416 ><DD
7417 ><DL
7418 ><DT
7419 >18.1. <A
7420 HREF="#AEN2761"
7421 >Roaming Profiles</A
7422 ></DT
7423 ><DD
7424 ><DL
7425 ><DT
7426 >18.1.1. <A
7427 HREF="#AEN2769"
7428 >Windows NT Configuration</A
7429 ></DT
7430 ><DT
7431 >18.1.2. <A
7432 HREF="#AEN2778"
7433 >Windows 9X Configuration</A
7434 ></DT
7435 ><DT
7436 >18.1.3. <A
7437 HREF="#AEN2786"
7438 >Win9X and WinNT Configuration</A
7439 ></DT
7440 ><DT
7441 >18.1.4. <A
7442 HREF="#AEN2793"
7443 >Windows 9X Profile Setup</A
7444 ></DT
7445 ><DT
7446 >18.1.5. <A
7447 HREF="#AEN2829"
7448 >Windows NT Workstation 4.0</A
7449 ></DT
7450 ><DT
7451 >18.1.6. <A
7452 HREF="#AEN2837"
7453 >Windows NT/200x Server</A
7454 ></DT
7455 ><DT
7456 >18.1.7. <A
7457 HREF="#AEN2840"
7458 >Sharing Profiles between W9x/Me and NT4/200x/XP workstations</A
7459 ></DT
7460 ><DT
7461 >18.1.8. <A
7462 HREF="#AEN2847"
7463 >Windows NT 4</A
7464 ></DT
7465 ><DT
7466 >18.1.9. <A
7467 HREF="#AEN2885"
7468 >Windows 2000/XP</A
7469 ></DT
7470 ></DL
7471 ></DD
7472 ></DL
7473 ></DD
7474 ><DT
7475 >19. <A
7476 HREF="#INTEGRATE-MS-NETWORKS"
7477 >Integrating MS Windows networks with Samba</A
7478 ></DT
7479 ><DD
7480 ><DL
7481 ><DT
7482 >19.1. <A
7483 HREF="#AEN2975"
7484 >Name Resolution in a pure Unix/Linux world</A
7485 ></DT
7486 ><DD
7487 ><DL
7488 ><DT
7489 >19.1.1. <A
7490 HREF="#AEN2991"
7491 ><TT
7492 CLASS="FILENAME"
7493 >/etc/hosts</TT
7494 ></A
7495 ></DT
7496 ><DT
7497 >19.1.2. <A
7498 HREF="#AEN3007"
7499 ><TT
7500 CLASS="FILENAME"
7501 >/etc/resolv.conf</TT
7502 ></A
7503 ></DT
7504 ><DT
7505 >19.1.3. <A
7506 HREF="#AEN3018"
7507 ><TT
7508 CLASS="FILENAME"
7509 >/etc/host.conf</TT
7510 ></A
7511 ></DT
7512 ><DT
7513 >19.1.4. <A
7514 HREF="#AEN3026"
7515 ><TT
7516 CLASS="FILENAME"
7517 >/etc/nsswitch.conf</TT
7518 ></A
7519 ></DT
7520 ></DL
7521 ></DD
7522 ><DT
7523 >19.2. <A
7524 HREF="#AEN3038"
7525 >Name resolution as used within MS Windows networking</A
7526 ></DT
7527 ><DD
7528 ><DL
7529 ><DT
7530 >19.2.1. <A
7531 HREF="#AEN3050"
7532 >The NetBIOS Name Cache</A
7533 ></DT
7534 ><DT
7535 >19.2.2. <A
7536 HREF="#AEN3055"
7537 >The LMHOSTS file</A
7538 ></DT
7539 ><DT
7540 >19.2.3. <A
7541 HREF="#AEN3063"
7542 >HOSTS file</A
7543 ></DT
7544 ><DT
7545 >19.2.4. <A
7546 HREF="#AEN3068"
7547 >DNS Lookup</A
7548 ></DT
7549 ><DT
7550 >19.2.5. <A
7551 HREF="#AEN3071"
7552 >WINS Lookup</A
7553 ></DT
7554 ></DL
7555 ></DD
7556 ></DL
7557 ></DD
7558 ><DT
7559 >20. <A
7560 HREF="#IMPROVED-BROWSING"
7561 >Improved browsing in samba</A
7562 ></DT
7563 ><DD
7564 ><DL
7565 ><DT
7566 >20.1. <A
7567 HREF="#AEN3090"
7568 >Overview of browsing</A
7569 ></DT
7570 ><DT
7571 >20.2. <A
7572 HREF="#AEN3095"
7573 >Browsing support in samba</A
7574 ></DT
7575 ><DT
7576 >20.3. <A
7577 HREF="#AEN3103"
7578 >Problem resolution</A
7579 ></DT
7580 ><DT
7581 >20.4. <A
7582 HREF="#AEN3112"
7583 >Browsing across subnets</A
7584 ></DT
7585 ><DD
7586 ><DL
7587 ><DT
7588 >20.4.1. <A
7589 HREF="#AEN3117"
7590 >How does cross subnet browsing work ?</A
7591 ></DT
7592 ></DL
7593 ></DD
7594 ><DT
7595 >20.5. <A
7596 HREF="#AEN3152"
7597 >Setting up a WINS server</A
7598 ></DT
7599 ><DT
7600 >20.6. <A
7601 HREF="#AEN3171"
7602 >Setting up Browsing in a WORKGROUP</A
7603 ></DT
7604 ><DT
7605 >20.7. <A
7606 HREF="#AEN3189"
7607 >Setting up Browsing in a DOMAIN</A
7608 ></DT
7609 ><DT
7610 >20.8. <A
7611 HREF="#AEN3199"
7612 >Forcing samba to be the master</A
7613 ></DT
7614 ><DT
7615 >20.9. <A
7616 HREF="#AEN3208"
7617 >Making samba the domain master</A
7618 ></DT
7619 ><DT
7620 >20.10. <A
7621 HREF="#AEN3226"
7622 >Note about broadcast addresses</A
7623 ></DT
7624 ><DT
7625 >20.11. <A
7626 HREF="#AEN3229"
7627 >Multiple interfaces</A
7628 ></DT
7629 ></DL
7630 ></DD
7631 ><DT
7632 >21. <A
7633 HREF="#MSDFS"
7634 >Hosting a Microsoft Distributed File System tree on Samba</A
7635 ></DT
7636 ><DD
7637 ><DL
7638 ><DT
7639 >21.1. <A
7640 HREF="#AEN3243"
7641 >Instructions</A
7642 ></DT
7643 ><DD
7644 ><DL
7645 ><DT
7646 >21.1.1. <A
7647 HREF="#AEN3278"
7648 >Notes</A
7649 ></DT
7650 ></DL
7651 ></DD
7652 ></DL
7653 ></DD
7654 ><DT
7655 >22. <A
7656 HREF="#VFS"
7657 >Stackable VFS modules</A
7658 ></DT
7659 ><DD
7660 ><DL
7661 ><DT
7662 >22.1. <A
7663 HREF="#AEN3302"
7664 >Introduction and configuration</A
7665 ></DT
7666 ><DT
7667 >22.2. <A
7668 HREF="#AEN3311"
7669 >Included modules</A
7670 ></DT
7671 ><DD
7672 ><DL
7673 ><DT
7674 >22.2.1. <A
7675 HREF="#AEN3313"
7676 >audit</A
7677 ></DT
7678 ><DT
7679 >22.2.2. <A
7680 HREF="#AEN3321"
7681 >recycle</A
7682 ></DT
7683 ><DT
7684 >22.2.3. <A
7685 HREF="#AEN3358"
7686 >netatalk</A
7687 ></DT
7688 ></DL
7689 ></DD
7690 ><DT
7691 >22.3. <A
7692 HREF="#AEN3365"
7693 >VFS modules available elsewhere</A
7694 ></DT
7695 ><DD
7696 ><DL
7697 ><DT
7698 >22.3.1. <A
7699 HREF="#AEN3369"
7700 >DatabaseFS</A
7701 ></DT
7702 ><DT
7703 >22.3.2. <A
7704 HREF="#AEN3377"
7705 >vscan</A
7706 ></DT
7707 ></DL
7708 ></DD
7709 ></DL
7710 ></DD
7711 ><DT
7712 >23. <A
7713 HREF="#SECURING-SAMBA"
7714 >Securing Samba</A
7715 ></DT
7716 ><DD
7717 ><DL
7718 ><DT
7719 >23.1. <A
7720 HREF="#AEN3391"
7721 >Introduction</A
7722 ></DT
7723 ><DT
7724 >23.2. <A
7725 HREF="#AEN3394"
7726 >Using host based protection</A
7727 ></DT
7728 ><DT
7729 >23.3. <A
7730 HREF="#AEN3401"
7731 >Using interface protection</A
7732 ></DT
7733 ><DT
7734 >23.4. <A
7735 HREF="#AEN3410"
7736 >Using a firewall</A
7737 ></DT
7738 ><DT
7739 >23.5. <A
7740 HREF="#AEN3417"
7741 >Using a IPC$ share deny</A
7742 ></DT
7743 ><DT
7744 >23.6. <A
7745 HREF="#AEN3426"
7746 >Upgrading Samba</A
7747 ></DT
7748 ></DL
7749 ></DD
7750 ><DT
7751 >24. <A
7752 HREF="#UNICODE"
7753 >Unicode/Charsets</A
7754 ></DT
7755 ><DD
7756 ><DL
7757 ><DT
7758 >24.1. <A
7759 HREF="#AEN3440"
7760 >What are charsets and unicode?</A
7761 ></DT
7762 ><DT
7763 >24.2. <A
7764 HREF="#AEN3449"
7765 >Samba and charsets</A
7766 ></DT
7767 ></DL
7768 ></DD
7769 ></DL
7770 ></DIV
7771 ></DIV
7772 ><DIV
7773 CLASS="CHAPTER"
7774 ><HR><H1
7775 ><A
7776 NAME="ADVANCEDNETWORKMANAGEMENT"
7777 ></A
7778 >Chapter 10. Advanced Network Manangement Information</H1
7779 ><DIV
7780 CLASS="SECT1"
7781 ><H2
7782 CLASS="SECT1"
7783 ><A
7784 NAME="AEN1388"
7785 >10.1. Remote Server Administration</A
7786 ></H2
7787 ><P
7788 ><SPAN
7789 CLASS="emphasis"
7790 ><I
7791 CLASS="EMPHASIS"
7792 >How do I get 'User Manager' and 'Server Manager'</I
7793 ></SPAN
7794 ></P
7795 ><P
7796 >Since I don't need to buy an NT Server CD now, how do I get the 'User Manager for Domains',
7797 the 'Server Manager'?</P
7798 ><P
7799 >Microsoft distributes a version of these tools called nexus for installation on Windows 95
7800 systems.  The tools set includes:</P
7801 ><P
7802 ></P
7803 ><UL
7804 ><LI
7805 ><P
7806 >Server Manager</P
7807 ></LI
7808 ><LI
7809 ><P
7810 >User Manager for Domains</P
7811 ></LI
7812 ><LI
7813 ><P
7814 >Event Viewer</P
7815 ></LI
7816 ></UL
7817 ><P
7818 >Click here to download the archived file <A
7819 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE"
7820 TARGET="_top"
7821 >ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</A
7822 ></P
7823 ><P
7824 >The Windows NT 4.0 version of the 'User Manager for 
7825 Domains' and 'Server Manager' are available from Microsoft via ftp 
7826 from <A
7827 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE"
7828 TARGET="_top"
7829 >ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</A
7830 ></P
7831 ></DIV
7832 ></DIV
7833 ><DIV
7834 CLASS="CHAPTER"
7835 ><HR><H1
7836 ><A
7837 NAME="UNIX-PERMISSIONS"
7838 ></A
7839 >Chapter 11. UNIX Permission Bits and Windows NT Access Control Lists</H1
7840 ><DIV
7841 CLASS="SECT1"
7842 ><H2
7843 CLASS="SECT1"
7844 ><A
7845 NAME="AEN1416"
7846 >11.1. Viewing and changing UNIX permissions using the NT 
7847         security dialogs</A
7848 ></H2
7849 ><P
7850 >Windows NT clients can use their native security settings 
7851         dialog box to view and modify the underlying UNIX permissions.</P
7852 ><P
7853 >Note that this ability is careful not to compromise 
7854         the security of the UNIX host Samba is running on, and 
7855         still obeys all the file permission rules that a Samba 
7856         administrator can set.</P
7857 ></DIV
7858 ><DIV
7859 CLASS="SECT1"
7860 ><HR><H2
7861 CLASS="SECT1"
7862 ><A
7863 NAME="AEN1420"
7864 >11.2. How to view file security on a Samba share</A
7865 ></H2
7866 ><P
7867 >From an NT4/2000/XP client, single-click with the right 
7868         mouse button on any file or directory in a Samba mounted 
7869         drive letter or UNC path. When the menu pops-up, click 
7870         on the <SPAN
7871 CLASS="emphasis"
7872 ><I
7873 CLASS="EMPHASIS"
7874 >Properties</I
7875 ></SPAN
7876 > entry at the bottom of 
7877         the menu. This brings up the file properties dialog
7878         box. Click on the tab <SPAN
7879 CLASS="emphasis"
7880 ><I
7881 CLASS="EMPHASIS"
7882 >Security</I
7883 ></SPAN
7884 > and you 
7885         will see three buttons, <SPAN
7886 CLASS="emphasis"
7887 ><I
7888 CLASS="EMPHASIS"
7889 >Permissions</I
7890 ></SPAN
7891 >,      
7892         <SPAN
7893 CLASS="emphasis"
7894 ><I
7895 CLASS="EMPHASIS"
7896 >Auditing</I
7897 ></SPAN
7898 >, and <SPAN
7899 CLASS="emphasis"
7900 ><I
7901 CLASS="EMPHASIS"
7902 >Ownership</I
7903 ></SPAN
7904 >. 
7905         The <SPAN
7906 CLASS="emphasis"
7907 ><I
7908 CLASS="EMPHASIS"
7909 >Auditing</I
7910 ></SPAN
7911 > button will cause either 
7912         an error message <SPAN
7913 CLASS="ERRORNAME"
7914 >A requested privilege is not held 
7915         by the client</SPAN
7916 > to appear if the user is not the 
7917         NT Administrator, or a dialog which is intended to allow an 
7918         Administrator to add auditing requirements to a file if the 
7919         user is logged on as the NT Administrator. This dialog is 
7920         non-functional with a Samba share at this time, as the only 
7921         useful button, the <B
7922 CLASS="COMMAND"
7923 >Add</B
7924 > button will not currently 
7925         allow a list of users to be seen.</P
7926 ></DIV
7927 ><DIV
7928 CLASS="SECT1"
7929 ><HR><H2
7930 CLASS="SECT1"
7931 ><A
7932 NAME="AEN1431"
7933 >11.3. Viewing file ownership</A
7934 ></H2
7935 ><P
7936 >Clicking on the <B
7937 CLASS="COMMAND"
7938 >"Ownership"</B
7939 > button 
7940         brings up a dialog box telling you who owns the given file. The 
7941         owner name will be of the form :</P
7942 ><P
7943 ><B
7944 CLASS="COMMAND"
7945 >"SERVER\user (Long name)"</B
7946 ></P
7947 ><P
7948 >Where <VAR
7949 CLASS="REPLACEABLE"
7950 >SERVER</VAR
7951 > is the NetBIOS name of 
7952         the Samba server, <VAR
7953 CLASS="REPLACEABLE"
7954 >user</VAR
7955 > is the user name of 
7956         the UNIX user who owns the file, and <VAR
7957 CLASS="REPLACEABLE"
7958 >(Long name)</VAR
7959 >
7960         is the descriptive string identifying the user (normally found in the
7961         GECOS field of the UNIX password database). Click on the <B
7962 CLASS="COMMAND"
7963 >Close
7964         </B
7965 > button to remove this dialog.</P
7966 ><P
7967 >If the parameter <VAR
7968 CLASS="PARAMETER"
7969 >nt acl support</VAR
7970 >
7971         is set to <CODE
7972 CLASS="CONSTANT"
7973 >false</CODE
7974 > then the file owner will 
7975         be shown as the NT user <B
7976 CLASS="COMMAND"
7977 >"Everyone"</B
7978 >.</P
7979 ><P
7980 >The <B
7981 CLASS="COMMAND"
7982 >Take Ownership</B
7983 > button will not allow 
7984         you to change the ownership of this file to yourself (clicking on 
7985         it will display a dialog box complaining that the user you are 
7986         currently logged onto the NT client cannot be found). The reason 
7987         for this is that changing the ownership of a file is a privileged 
7988         operation in UNIX, available only to the <SPAN
7989 CLASS="emphasis"
7990 ><I
7991 CLASS="EMPHASIS"
7992 >root</I
7993 ></SPAN
7994
7995         user. As clicking on this button causes NT to attempt to change 
7996         the ownership of a file to the current user logged into the NT 
7997         client this will not work with Samba at this time.</P
7998 ><P
7999 >There is an NT chown command that will work with Samba 
8000         and allow a user with Administrator privilege connected 
8001         to a Samba server as root to change the ownership of 
8002         files on both a local NTFS filesystem or remote mounted NTFS 
8003         or Samba drive. This is available as part of the <SPAN
8004 CLASS="emphasis"
8005 ><I
8006 CLASS="EMPHASIS"
8007 >Seclib
8008         </I
8009 ></SPAN
8010 > NT security library written by Jeremy Allison of 
8011         the Samba Team, available from the main Samba ftp site.</P
8012 ></DIV
8013 ><DIV
8014 CLASS="SECT1"
8015 ><HR><H2
8016 CLASS="SECT1"
8017 ><A
8018 NAME="AEN1451"
8019 >11.4. Viewing file or directory permissions</A
8020 ></H2
8021 ><P
8022 >The third button is the <B
8023 CLASS="COMMAND"
8024 >"Permissions"</B
8025
8026         button. Clicking on this brings up a dialog box that shows both 
8027         the permissions and the UNIX owner of the file or directory. 
8028         The owner is displayed in the form :</P
8029 ><P
8030 ><B
8031 CLASS="COMMAND"
8032 >"SERVER\user (Long name)"</B
8033 ></P
8034 ><P
8035 >Where <VAR
8036 CLASS="REPLACEABLE"
8037 >SERVER</VAR
8038 > is the NetBIOS name of 
8039         the Samba server, <VAR
8040 CLASS="REPLACEABLE"
8041 >user</VAR
8042 > is the user name of 
8043         the UNIX user who owns the file, and <VAR
8044 CLASS="REPLACEABLE"
8045 >(Long name)</VAR
8046 >
8047         is the descriptive string identifying the user (normally found in the
8048         GECOS field of the UNIX password database).</P
8049 ><P
8050 >If the parameter <VAR
8051 CLASS="PARAMETER"
8052 >nt acl support</VAR
8053 >
8054         is set to <CODE
8055 CLASS="CONSTANT"
8056 >false</CODE
8057 > then the file owner will 
8058         be shown as the NT user <B
8059 CLASS="COMMAND"
8060 >"Everyone"</B
8061 > and the 
8062         permissions will be shown as NT "Full Control".</P
8063 ><P
8064 >The permissions field is displayed differently for files 
8065         and directories, so I'll describe the way file permissions 
8066         are displayed first.</P
8067 ><DIV
8068 CLASS="SECT2"
8069 ><HR><H3
8070 CLASS="SECT2"
8071 ><A
8072 NAME="AEN1466"
8073 >11.4.1. File Permissions</A
8074 ></H3
8075 ><P
8076 >The standard UNIX user/group/world triple and 
8077                 the corresponding "read", "write", "execute" permissions 
8078                 triples are mapped by Samba into a three element NT ACL 
8079                 with the 'r', 'w', and 'x' bits mapped into the corresponding 
8080                 NT permissions. The UNIX world permissions are mapped into 
8081                 the global NT group <B
8082 CLASS="COMMAND"
8083 >Everyone</B
8084 >, followed 
8085                 by the list of permissions allowed for UNIX world. The UNIX 
8086                 owner and group permissions are displayed as an NT 
8087                 <B
8088 CLASS="COMMAND"
8089 >user</B
8090 > icon and an NT <B
8091 CLASS="COMMAND"
8092 >local 
8093                 group</B
8094 > icon respectively followed by the list 
8095                 of permissions allowed for the UNIX user and group.</P
8096 ><P
8097 >As many UNIX permission sets don't map into common 
8098                 NT names such as <B
8099 CLASS="COMMAND"
8100 >"read"</B
8101 >, <B
8102 CLASS="COMMAND"
8103 >               "change"</B
8104 > or <B
8105 CLASS="COMMAND"
8106 >"full control"</B
8107 > then 
8108                 usually the permissions will be prefixed by the words <B
8109 CLASS="COMMAND"
8110 >               "Special Access"</B
8111 > in the NT display list.</P
8112 ><P
8113 >But what happens if the file has no permissions allowed 
8114                 for a particular UNIX user group or world component ? In order 
8115                 to  allow "no permissions" to be seen and modified then Samba 
8116                 overloads the NT <B
8117 CLASS="COMMAND"
8118 >"Take Ownership"</B
8119 > ACL attribute 
8120                 (which has no meaning in UNIX) and reports a component with 
8121                 no permissions as having the NT <B
8122 CLASS="COMMAND"
8123 >"O"</B
8124 > bit set. 
8125                 This was chosen of course to make it look like a zero, meaning 
8126                 zero permissions. More details on the decision behind this will 
8127                 be given below.</P
8128 ></DIV
8129 ><DIV
8130 CLASS="SECT2"
8131 ><HR><H3
8132 CLASS="SECT2"
8133 ><A
8134 NAME="AEN1480"
8135 >11.4.2. Directory Permissions</A
8136 ></H3
8137 ><P
8138 >Directories on an NT NTFS file system have two 
8139                 different sets of permissions. The first set of permissions 
8140                 is the ACL set on the directory itself, this is usually displayed 
8141                 in the first set of parentheses in the normal <B
8142 CLASS="COMMAND"
8143 >"RW"</B
8144
8145                 NT style. This first set of permissions is created by Samba in 
8146                 exactly the same way as normal file permissions are, described 
8147                 above, and is displayed in the same way.</P
8148 ><P
8149 >The second set of directory permissions has no real meaning 
8150                 in the UNIX permissions world and represents the <B
8151 CLASS="COMMAND"
8152 >               "inherited"</B
8153 > permissions that any file created within 
8154                 this directory would inherit.</P
8155 ><P
8156 >Samba synthesises these inherited permissions for NT by 
8157                 returning as an NT ACL the UNIX permission mode that a new file 
8158                 created by Samba on this share would receive.</P
8159 ></DIV
8160 ></DIV
8161 ><DIV
8162 CLASS="SECT1"
8163 ><HR><H2
8164 CLASS="SECT1"
8165 ><A
8166 NAME="AEN1487"
8167 >11.5. Modifying file or directory permissions</A
8168 ></H2
8169 ><P
8170 >Modifying file and directory permissions is as simple 
8171         as changing the displayed permissions in the dialog box, and 
8172         clicking the <B
8173 CLASS="COMMAND"
8174 >OK</B
8175 > button. However, there are 
8176         limitations that a user needs to be aware of, and also interactions 
8177         with the standard Samba permission masks and mapping of DOS 
8178         attributes that need to also be taken into account.</P
8179 ><P
8180 >If the parameter <VAR
8181 CLASS="PARAMETER"
8182 >nt acl support</VAR
8183 >
8184         is set to <CODE
8185 CLASS="CONSTANT"
8186 >false</CODE
8187 > then any attempt to set 
8188         security permissions will fail with an <B
8189 CLASS="COMMAND"
8190 >"Access Denied"
8191         </B
8192 > message.</P
8193 ><P
8194 >The first thing to note is that the <B
8195 CLASS="COMMAND"
8196 >"Add"</B
8197
8198         button will not return a list of users in Samba (it will give 
8199         an error message of <B
8200 CLASS="COMMAND"
8201 >"The remote procedure call failed 
8202         and did not execute"</B
8203 >). This means that you can only 
8204         manipulate the current user/group/world permissions listed in 
8205         the dialog box. This actually works quite well as these are the 
8206         only permissions that UNIX actually has.</P
8207 ><P
8208 >If a permission triple (either user, group, or world) 
8209         is removed from the list of permissions in the NT dialog box, 
8210         then when the <B
8211 CLASS="COMMAND"
8212 >"OK"</B
8213 > button is pressed it will 
8214         be applied as "no permissions" on the UNIX side. If you then 
8215         view the permissions again the "no permissions" entry will appear 
8216         as the NT <B
8217 CLASS="COMMAND"
8218 >"O"</B
8219 > flag, as described above. This 
8220         allows you to add permissions back to a file or directory once 
8221         you have removed them from a triple component.</P
8222 ><P
8223 >As UNIX supports only the "r", "w" and "x" bits of 
8224         an NT ACL then if other NT security attributes such as "Delete 
8225         access" are selected then they will be ignored when applied on 
8226         the Samba server.</P
8227 ><P
8228 >When setting permissions on a directory the second 
8229         set of permissions (in the second set of parentheses) is 
8230         by default applied to all files within that directory. If this 
8231         is not what you want you must uncheck the <B
8232 CLASS="COMMAND"
8233 >"Replace 
8234         permissions on existing files"</B
8235 > checkbox in the NT 
8236         dialog before clicking <B
8237 CLASS="COMMAND"
8238 >"OK"</B
8239 >.</P
8240 ><P
8241 >If you wish to remove all permissions from a 
8242         user/group/world  component then you may either highlight the 
8243         component and click the <B
8244 CLASS="COMMAND"
8245 >"Remove"</B
8246 > button, 
8247         or set the component to only have the special <B
8248 CLASS="COMMAND"
8249 >"Take
8250         Ownership"</B
8251 > permission (displayed as <B
8252 CLASS="COMMAND"
8253 >"O"
8254         </B
8255 >) highlighted.</P
8256 ></DIV
8257 ><DIV
8258 CLASS="SECT1"
8259 ><HR><H2
8260 CLASS="SECT1"
8261 ><A
8262 NAME="AEN1509"
8263 >11.6. Interaction with the standard Samba create mask 
8264         parameters</A
8265 ></H2
8266 ><P
8267 >There are four parameters 
8268         to control interaction with the standard Samba create mask parameters.
8269         These are :</P
8270 ><P
8271 ><VAR
8272 CLASS="PARAMETER"
8273 >security mask</VAR
8274 ></P
8275 ><P
8276 ><VAR
8277 CLASS="PARAMETER"
8278 >force security mode</VAR
8279 ></P
8280 ><P
8281 ><VAR
8282 CLASS="PARAMETER"
8283 >directory security mask</VAR
8284 ></P
8285 ><P
8286 ><VAR
8287 CLASS="PARAMETER"
8288 >force directory security mode</VAR
8289 ></P
8290 ><P
8291 >Once a user clicks <B
8292 CLASS="COMMAND"
8293 >"OK"</B
8294 > to apply the 
8295         permissions Samba maps the given permissions into a user/group/world 
8296         r/w/x triple set, and then will check the changed permissions for a 
8297         file against the bits set in the <A
8298 HREF="smb.conf.5.html#SECURITYMASK"
8299 TARGET="_top"
8300
8301         <VAR
8302 CLASS="PARAMETER"
8303 >security mask</VAR
8304 ></A
8305 > parameter. Any bits that 
8306         were changed that are not set to '1' in this parameter are left alone 
8307         in the file permissions.</P
8308 ><P
8309 >Essentially, zero bits in the <VAR
8310 CLASS="PARAMETER"
8311 >security mask</VAR
8312 >
8313         mask may be treated as a set of bits the user is <SPAN
8314 CLASS="emphasis"
8315 ><I
8316 CLASS="EMPHASIS"
8317 >not</I
8318 ></SPAN
8319
8320         allowed to change, and one bits are those the user is allowed to change.
8321         </P
8322 ><P
8323 >If not set explicitly this parameter is set to the same value as 
8324         the <A
8325 HREF="smb.conf.5.html#CREATEMASK"
8326 TARGET="_top"
8327 ><VAR
8328 CLASS="PARAMETER"
8329 >create mask
8330         </VAR
8331 ></A
8332 > parameter. To allow a user to modify all the
8333         user/group/world permissions on a file, set this parameter 
8334         to 0777.</P
8335 ><P
8336 >Next Samba checks the changed permissions for a file against 
8337         the bits set in the <A
8338 HREF="smb.conf.5.html#FORCESECURITYMODE"
8339 TARGET="_top"
8340 >       <VAR
8341 CLASS="PARAMETER"
8342 >force security mode</VAR
8343 ></A
8344 > parameter. Any bits 
8345         that were changed that correspond to bits set to '1' in this parameter 
8346         are forced to be set.</P
8347 ><P
8348 >Essentially, bits set in the <VAR
8349 CLASS="PARAMETER"
8350 >force security mode
8351         </VAR
8352 > parameter may be treated as a set of bits that, when 
8353         modifying security on a file, the user has always set to be 'on'.</P
8354 ><P
8355 >If not set explicitly this parameter is set to the same value 
8356         as the <A
8357 HREF="smb.conf.5.html#FORCECREATEMODE"
8358 TARGET="_top"
8359 ><VAR
8360 CLASS="PARAMETER"
8361 >force 
8362         create mode</VAR
8363 ></A
8364 > parameter.
8365         To allow a user to modify all the user/group/world permissions on a file
8366         with no restrictions set this parameter to 000.</P
8367 ><P
8368 >The <VAR
8369 CLASS="PARAMETER"
8370 >security mask</VAR
8371 > and <VAR
8372 CLASS="PARAMETER"
8373 >force 
8374         security mode</VAR
8375 > parameters are applied to the change 
8376         request in that order.</P
8377 ><P
8378 >For a directory Samba will perform the same operations as 
8379         described above for a file except using the parameter <VAR
8380 CLASS="PARAMETER"
8381 >       directory security mask</VAR
8382 > instead of <VAR
8383 CLASS="PARAMETER"
8384 >security 
8385         mask</VAR
8386 >, and <VAR
8387 CLASS="PARAMETER"
8388 >force directory security mode
8389         </VAR
8390 > parameter instead of <VAR
8391 CLASS="PARAMETER"
8392 >force security mode
8393         </VAR
8394 >.</P
8395 ><P
8396 >The <VAR
8397 CLASS="PARAMETER"
8398 >directory security mask</VAR
8399 > parameter 
8400         by default is set to the same value as the <VAR
8401 CLASS="PARAMETER"
8402 >directory mask
8403         </VAR
8404 > parameter and the <VAR
8405 CLASS="PARAMETER"
8406 >force directory security 
8407         mode</VAR
8408 > parameter by default is set to the same value as 
8409         the <VAR
8410 CLASS="PARAMETER"
8411 >force directory mode</VAR
8412 > parameter. </P
8413 ><P
8414 >In this way Samba enforces the permission restrictions that 
8415         an administrator can set on a Samba share, whilst still allowing users 
8416         to modify the permission bits within that restriction.</P
8417 ><P
8418 >If you want to set up a share that allows users full control
8419         in modifying the permission bits on their files and directories and
8420         doesn't force any particular bits to be set 'on', then set the following
8421         parameters in the <A
8422 HREF="smb.conf.5.html"
8423 TARGET="_top"
8424 ><TT
8425 CLASS="FILENAME"
8426 >smb.conf(5)
8427         </TT
8428 ></A
8429 > file in that share specific section :</P
8430 ><P
8431 ><VAR
8432 CLASS="PARAMETER"
8433 >security mask = 0777</VAR
8434 ></P
8435 ><P
8436 ><VAR
8437 CLASS="PARAMETER"
8438 >force security mode = 0</VAR
8439 ></P
8440 ><P
8441 ><VAR
8442 CLASS="PARAMETER"
8443 >directory security mask = 0777</VAR
8444 ></P
8445 ><P
8446 ><VAR
8447 CLASS="PARAMETER"
8448 >force directory security mode = 0</VAR
8449 ></P
8450 ></DIV
8451 ><DIV
8452 CLASS="SECT1"
8453 ><HR><H2
8454 CLASS="SECT1"
8455 ><A
8456 NAME="AEN1563"
8457 >11.7. Interaction with the standard Samba file attribute 
8458         mapping</A
8459 ></H2
8460 ><P
8461 >Samba maps some of the DOS attribute bits (such as "read 
8462         only") into the UNIX permissions of a file. This means there can 
8463         be a conflict between the permission bits set via the security 
8464         dialog and the permission bits set by the file attribute mapping.
8465         </P
8466 ><P
8467 >One way this can show up is if a file has no UNIX read access
8468         for the owner it will show up as "read only" in the standard 
8469         file attributes tabbed dialog. Unfortunately this dialog is
8470         the same one that contains the security info in another tab.</P
8471 ><P
8472 >What this can mean is that if the owner changes the permissions
8473         to allow themselves read access using the security dialog, clicks
8474         <B
8475 CLASS="COMMAND"
8476 >"OK"</B
8477 > to get back to the standard attributes tab 
8478         dialog, and then clicks <B
8479 CLASS="COMMAND"
8480 >"OK"</B
8481 > on that dialog, then 
8482         NT will set the file permissions back to read-only (as that is what 
8483         the attributes still say in the dialog). This means that after setting 
8484         permissions and clicking <B
8485 CLASS="COMMAND"
8486 >"OK"</B
8487 > to get back to the 
8488         attributes dialog you should always hit <B
8489 CLASS="COMMAND"
8490 >"Cancel"</B
8491
8492         rather than <B
8493 CLASS="COMMAND"
8494 >"OK"</B
8495 > to ensure that your changes 
8496         are not overridden.</P
8497 ></DIV
8498 ></DIV
8499 ><DIV
8500 CLASS="CHAPTER"
8501 ><HR><H1
8502 ><A
8503 NAME="GROUPMAPPING"
8504 ></A
8505 >Chapter 12. Group mapping HOWTO</H1
8506 ><P
8507
8508 Starting with Samba 3.0 alpha 2, a new group mapping function is available. The
8509 current method (likely to change) to manage the groups is a new command called
8510 <B
8511 CLASS="COMMAND"
8512 >smbgroupedit</B
8513 >.</P
8514 ><P
8515 >The first immediate reason to use the group mapping on a PDC, is that
8516 the <B
8517 CLASS="COMMAND"
8518 >domain admin group</B
8519 > of <TT
8520 CLASS="FILENAME"
8521 >smb.conf</TT
8522 > is 
8523 now gone. This parameter was used to give the listed users local admin rights 
8524 on their workstations. It was some magic stuff that simply worked but didn't
8525 scale very well for complex setups.</P
8526 ><P
8527 >Let me explain how it works on NT/W2K, to have this magic fade away.
8528 When installing NT/W2K on a computer, the installer program creates some users
8529 and groups. Notably the 'Administrators' group, and gives to that group some
8530 privileges like the ability to change the date and time or to kill any process
8531 (or close too) running on the local machine. The 'Administrator' user is a
8532 member of the 'Administrators' group, and thus 'inherit' the 'Administrators'
8533 group privileges. If a 'joe' user is created and become a member of the
8534 'Administrator' group, 'joe' has exactly the same rights as 'Administrator'.</P
8535 ><P
8536 >When a NT/W2K machine is joined to a domain, during that phase, the "Domain
8537 Administrators' group of the PDC is added to the 'Administrators' group of the
8538 workstation. Every members of the 'Domain Administrators' group 'inherit' the
8539 rights of the 'Administrators' group when logging on the workstation.</P
8540 ><P
8541 >You are now wondering how to make some of your samba PDC users members of the
8542 'Domain Administrators' ? That's really easy.</P
8543 ><P
8544 ></P
8545 ><OL
8546 TYPE="1"
8547 ><LI
8548 ><P
8549 >create a unix group (usually in <TT
8550 CLASS="FILENAME"
8551 >/etc/group</TT
8552 >), let's call it domadm</P
8553 ></LI
8554 ><LI
8555 ><P
8556 >add to this group the users that must be Administrators. For example if you want joe,john and mary, your entry in <TT
8557 CLASS="FILENAME"
8558 >/etc/group</TT
8559 > will look like:</P
8560 ><P
8561 ><PRE
8562 CLASS="PROGRAMLISTING"
8563 >domadm:x:502:joe,john,mary</PRE
8564 ></P
8565 ></LI
8566 ><LI
8567 ><P
8568 >Map this domadm group to the <B
8569 CLASS="COMMAND"
8570 >domain admins</B
8571 > group by running the command:</P
8572 ><P
8573 ><B
8574 CLASS="COMMAND"
8575 >smbgroupedit -c "Domain Admins" -u domadm</B
8576 ></P
8577 ></LI
8578 ></OL
8579 ><P
8580 >You're set, joe, john and mary are domain administrators !</P
8581 ><P
8582 >Like the Domain Admins group, you can map any arbitrary Unix group to any NT
8583 group. You can also make any Unix group a domain group. For example, on a domain
8584 member machine (an NT/W2K or a samba server running winbind), you would like to
8585 give access to a certain directory to some users who are member of a group on
8586 your samba PDC. Flag that group as a domain group by running:</P
8587 ><P
8588 ><B
8589 CLASS="COMMAND"
8590 >smbgroupedit -a unixgroup -td</B
8591 ></P
8592 ><P
8593 >You can list the various groups in the mapping database like this</P
8594 ><P
8595 ><B
8596 CLASS="COMMAND"
8597 >smbgroupedit -v</B
8598 ></P
8599 ></DIV
8600 ><DIV
8601 CLASS="CHAPTER"
8602 ><HR><H1
8603 ><A
8604 NAME="PAM"
8605 ></A
8606 >Chapter 13. Configuring PAM for distributed but centrally 
8607 managed authentication</H1
8608 ><DIV
8609 CLASS="SECT1"
8610 ><H2
8611 CLASS="SECT1"
8612 ><A
8613 NAME="AEN1619"
8614 >13.1. Samba and PAM</A
8615 ></H2
8616 ><P
8617 >A number of Unix systems (eg: Sun Solaris), as well as the 
8618 xxxxBSD family and Linux, now utilize the Pluggable Authentication 
8619 Modules (PAM) facility to provide all authentication, 
8620 authorization and resource control services. Prior to the 
8621 introduction of PAM, a decision to use an alternative to 
8622 the system password database (<TT
8623 CLASS="FILENAME"
8624 >/etc/passwd</TT
8625 >) 
8626 would require the provision of alternatives for all programs that provide 
8627 security services. Such a choice would involve provision of 
8628 alternatives to such programs as: <B
8629 CLASS="COMMAND"
8630 >login</B
8631 >, 
8632 <B
8633 CLASS="COMMAND"
8634 >passwd</B
8635 >, <B
8636 CLASS="COMMAND"
8637 >chown</B
8638 >, etc.</P
8639 ><P
8640 >PAM provides a mechanism that disconnects these security programs 
8641 from the underlying authentication/authorization infrastructure.
8642 PAM is configured either through one file <TT
8643 CLASS="FILENAME"
8644 >/etc/pam.conf</TT
8645 > (Solaris), 
8646 or by editing individual files that are located in <TT
8647 CLASS="FILENAME"
8648 >/etc/pam.d</TT
8649 >.</P
8650 ><DIV
8651 CLASS="NOTE"
8652 ><P
8653 ></P
8654 ><TABLE
8655 CLASS="NOTE"
8656 WIDTH="100%"
8657 BORDER="0"
8658 ><TR
8659 ><TD
8660 WIDTH="25"
8661 ALIGN="CENTER"
8662 VALIGN="TOP"
8663 ><IMG
8664 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
8665 HSPACE="5"
8666 ALT="Note"></TD
8667 ><TD
8668 ALIGN="LEFT"
8669 VALIGN="TOP"
8670 ><P
8671 >       If the PAM authentication module (loadable link library file) is located in the
8672         default location then it is not necessary to specify the path. In the case of
8673         Linux, the default location is <TT
8674 CLASS="FILENAME"
8675 >/lib/security</TT
8676 >. If the module
8677         is located other than default then the path may be specified as:
8678         
8679         <PRE
8680 CLASS="PROGRAMLISTING"
8681 >       eg: "auth       required      /other_path/pam_strange_module.so"
8682         </PRE
8683 >
8684         </P
8685 ></TD
8686 ></TR
8687 ></TABLE
8688 ></DIV
8689 ><P
8690 >The following is an example <TT
8691 CLASS="FILENAME"
8692 >/etc/pam.d/login</TT
8693 > configuration file. 
8694 This example had all options been uncommented is probably not usable 
8695 as it stacks many conditions before allowing successful completion 
8696 of the login process. Essentially all conditions can be disabled 
8697 by commenting them out except the calls to <TT
8698 CLASS="FILENAME"
8699 >pam_pwdb.so</TT
8700 >.</P
8701 ><P
8702 ><PRE
8703 CLASS="PROGRAMLISTING"
8704 >       #%PAM-1.0
8705         # The PAM configuration file for the `login' service
8706         #
8707         auth            required        pam_securetty.so
8708         auth            required        pam_nologin.so
8709         # auth          required        pam_dialup.so
8710         # auth          optional        pam_mail.so
8711         auth            required        pam_pwdb.so shadow md5
8712         # account       requisite       pam_time.so
8713         account         required        pam_pwdb.so
8714         session         required        pam_pwdb.so
8715         # session       optional        pam_lastlog.so
8716         # password      required        pam_cracklib.so retry=3
8717         password        required        pam_pwdb.so shadow md5</PRE
8718 ></P
8719 ><P
8720 >PAM allows use of replacable modules. Those available on a 
8721 sample system include:</P
8722 ><P
8723 ><PRE
8724 CLASS="PROGRAMLISTING"
8725 >       $ /bin/ls /lib/security
8726         pam_access.so    pam_ftp.so          pam_limits.so     
8727         pam_ncp_auth.so  pam_rhosts_auth.so  pam_stress.so     
8728         pam_cracklib.so  pam_group.so        pam_listfile.so   
8729         pam_nologin.so   pam_rootok.so       pam_tally.so      
8730         pam_deny.so      pam_issue.so        pam_mail.so       
8731         pam_permit.so    pam_securetty.so    pam_time.so       
8732         pam_dialup.so    pam_lastlog.so      pam_mkhomedir.so  
8733         pam_pwdb.so      pam_shells.so       pam_unix.so       
8734         pam_env.so       pam_ldap.so         pam_motd.so       
8735         pam_radius.so    pam_smbpass.so      pam_unix_acct.so  
8736         pam_wheel.so     pam_unix_auth.so    pam_unix_passwd.so
8737         pam_userdb.so    pam_warn.so         pam_unix_session.so</PRE
8738 ></P
8739 ><P
8740 >The following example for the login program replaces the use of 
8741 the <TT
8742 CLASS="FILENAME"
8743 >pam_pwdb.so</TT
8744 > module which uses the system 
8745 password database (<TT
8746 CLASS="FILENAME"
8747 >/etc/passwd</TT
8748 >,
8749 <TT
8750 CLASS="FILENAME"
8751 >/etc/shadow</TT
8752 >, <TT
8753 CLASS="FILENAME"
8754 >/etc/group</TT
8755 >) with 
8756 the module <TT
8757 CLASS="FILENAME"
8758 >pam_smbpass.so</TT
8759 > which uses the Samba 
8760 database which contains the Microsoft MD4 encrypted password 
8761 hashes. This database is stored in either 
8762 <TT
8763 CLASS="FILENAME"
8764 >/usr/local/samba/private/smbpasswd</TT
8765 >, 
8766 <TT
8767 CLASS="FILENAME"
8768 >/etc/samba/smbpasswd</TT
8769 >, or in 
8770 <TT
8771 CLASS="FILENAME"
8772 >/etc/samba.d/smbpasswd</TT
8773 >, depending on the 
8774 Samba implementation for your Unix/Linux system. The 
8775 <TT
8776 CLASS="FILENAME"
8777 >pam_smbpass.so</TT
8778 > module is provided by 
8779 Samba version 2.2.1 or later. It can be compiled by specifying the 
8780 <B
8781 CLASS="COMMAND"
8782 >--with-pam_smbpass</B
8783 > options when running Samba's
8784 <TT
8785 CLASS="FILENAME"
8786 >configure</TT
8787 > script.  For more information
8788 on the <TT
8789 CLASS="FILENAME"
8790 >pam_smbpass</TT
8791 > module, see the documentation
8792 in the <TT
8793 CLASS="FILENAME"
8794 >source/pam_smbpass</TT
8795 > directory of the Samba 
8796 source distribution.</P
8797 ><P
8798 ><PRE
8799 CLASS="PROGRAMLISTING"
8800 >       #%PAM-1.0
8801         # The PAM configuration file for the `login' service
8802         #
8803         auth            required        pam_smbpass.so nodelay
8804         account         required        pam_smbpass.so nodelay
8805         session         required        pam_smbpass.so nodelay
8806         password        required        pam_smbpass.so nodelay</PRE
8807 ></P
8808 ><P
8809 >The following is the PAM configuration file for a particular 
8810 Linux system. The default condition uses <TT
8811 CLASS="FILENAME"
8812 >pam_pwdb.so</TT
8813 >.</P
8814 ><P
8815 ><PRE
8816 CLASS="PROGRAMLISTING"
8817 >       #%PAM-1.0
8818         # The PAM configuration file for the `samba' service
8819         #
8820         auth       required     /lib/security/pam_pwdb.so nullok nodelay shadow audit
8821         account    required     /lib/security/pam_pwdb.so audit nodelay
8822         session    required     /lib/security/pam_pwdb.so nodelay
8823         password   required     /lib/security/pam_pwdb.so shadow md5</PRE
8824 ></P
8825 ><P
8826 >In the following example the decision has been made to use the 
8827 smbpasswd database even for basic samba authentication. Such a 
8828 decision could also be made for the passwd program and would 
8829 thus allow the smbpasswd passwords to be changed using the passwd 
8830 program.</P
8831 ><P
8832 ><PRE
8833 CLASS="PROGRAMLISTING"
8834 >       #%PAM-1.0
8835         # The PAM configuration file for the `samba' service
8836         #
8837         auth       required     /lib/security/pam_smbpass.so nodelay
8838         account    required     /lib/security/pam_pwdb.so audit nodelay
8839         session    required     /lib/security/pam_pwdb.so nodelay
8840         password   required     /lib/security/pam_smbpass.so nodelay smbconf=/etc/samba.d/smb.conf</PRE
8841 ></P
8842 ><DIV
8843 CLASS="NOTE"
8844 ><P
8845 ></P
8846 ><TABLE
8847 CLASS="NOTE"
8848 WIDTH="100%"
8849 BORDER="0"
8850 ><TR
8851 ><TD
8852 WIDTH="25"
8853 ALIGN="CENTER"
8854 VALIGN="TOP"
8855 ><IMG
8856 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
8857 HSPACE="5"
8858 ALT="Note"></TD
8859 ><TD
8860 ALIGN="LEFT"
8861 VALIGN="TOP"
8862 ><P
8863 >PAM allows stacking of authentication mechanisms. It is 
8864 also possible to pass information obtained within one PAM module through 
8865 to the next module in the PAM stack. Please refer to the documentation for 
8866 your particular system implementation for details regarding the specific 
8867 capabilities of PAM in this environment. Some Linux implmentations also 
8868 provide the <TT
8869 CLASS="FILENAME"
8870 >pam_stack.so</TT
8871 > module that allows all 
8872 authentication to be configured in a single central file. The 
8873 <TT
8874 CLASS="FILENAME"
8875 >pam_stack.so</TT
8876 > method has some very devoted followers 
8877 on the basis that it allows for easier administration. As with all issues in 
8878 life though, every decision makes trade-offs, so you may want examine the 
8879 PAM documentation for further helpful information.</P
8880 ></TD
8881 ></TR
8882 ></TABLE
8883 ></DIV
8884 ></DIV
8885 ><DIV
8886 CLASS="SECT1"
8887 ><HR><H2
8888 CLASS="SECT1"
8889 ><A
8890 NAME="AEN1668"
8891 >13.2. Distributed Authentication</A
8892 ></H2
8893 ><P
8894 >The astute administrator will realize from this that the 
8895 combination of <TT
8896 CLASS="FILENAME"
8897 >pam_smbpass.so</TT
8898 >, 
8899 <B
8900 CLASS="COMMAND"
8901 >winbindd</B
8902 >, and a distributed 
8903 passdb backend, such as ldap, will allow the establishment of a
8904 centrally managed, distributed 
8905 user/password database that can also be used by all 
8906 PAM (eg: Linux) aware programs and applications. This arrangement 
8907 can have particularly potent advantages compared with the 
8908 use of Microsoft Active Directory Service (ADS) in so far as 
8909 reduction of wide area network authentication traffic.</P
8910 ></DIV
8911 ><DIV
8912 CLASS="SECT1"
8913 ><HR><H2
8914 CLASS="SECT1"
8915 ><A
8916 NAME="AEN1673"
8917 >13.3. PAM Configuration in smb.conf</A
8918 ></H2
8919 ><P
8920 >There is an option in smb.conf called <A
8921 HREF="smb.conf.5.html#OBEYPAMRESTRICTIONS"
8922 TARGET="_top"
8923 >obey pam restrictions</A
8924 >. 
8925 The following is from the on-line help for this option in SWAT;</P
8926 ><P
8927 >When Samba is configured to enable PAM support (i.e. 
8928 <CODE
8929 CLASS="CONSTANT"
8930 >--with-pam</CODE
8931 >), this parameter will 
8932 control whether or not Samba should obey PAM's account 
8933 and session management directives. The default behavior 
8934 is to use PAM for clear text authentication only and to 
8935 ignore any account or session management. Note that Samba always 
8936 ignores PAM for authentication in the case of 
8937 <A
8938 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
8939 TARGET="_top"
8940 >encrypt passwords = yes</A
8941 >. 
8942 The reason is that PAM modules cannot support the challenge/response 
8943 authentication mechanism needed in the presence of SMB 
8944 password encryption. </P
8945 ><P
8946 >Default: <B
8947 CLASS="COMMAND"
8948 >obey pam restrictions = no</B
8949 ></P
8950 ></DIV
8951 ></DIV
8952 ><DIV
8953 CLASS="CHAPTER"
8954 ><HR><H1
8955 ><A
8956 NAME="PRINTING"
8957 ></A
8958 >Chapter 14. Printing Support</H1
8959 ><DIV
8960 CLASS="SECT1"
8961 ><H2
8962 CLASS="SECT1"
8963 ><A
8964 NAME="AEN1699"
8965 >14.1. Introduction</A
8966 ></H2
8967 ><P
8968 >Beginning with the 2.2.0 release, Samba supports 
8969 the native Windows NT printing mechanisms implemented via 
8970 MS-RPC (i.e. the SPOOLSS named pipe).  Previous versions of 
8971 Samba only supported LanMan printing calls.</P
8972 ><P
8973 >The additional functionality provided by the new 
8974 SPOOLSS support includes:</P
8975 ><P
8976 ></P
8977 ><UL
8978 ><LI
8979 ><P
8980 >Support for downloading printer driver 
8981         files to Windows 95/98/NT/2000 clients upon demand.
8982         </P
8983 ></LI
8984 ><LI
8985 ><P
8986 >Uploading of printer drivers via the 
8987         Windows NT Add Printer Wizard (APW) or the 
8988         Imprints tool set (refer to <A
8989 HREF="http://imprints.sourceforge.net"
8990 TARGET="_top"
8991 >http://imprints.sourceforge.net</A
8992 >). 
8993         </P
8994 ></LI
8995 ><LI
8996 ><P
8997 >Support for the native MS-RPC printing 
8998         calls such as StartDocPrinter, EnumJobs(), etc...  (See 
8999         the MSDN documentation at <A
9000 HREF="http://msdn.microsoft.com/"
9001 TARGET="_top"
9002 >http://msdn.microsoft.com/</A
9003
9004         for more information on the Win32 printing API)
9005         </P
9006 ></LI
9007 ><LI
9008 ><P
9009 >Support for NT Access Control Lists (ACL) 
9010         on printer objects</P
9011 ></LI
9012 ><LI
9013 ><P
9014 >Improved support for printer queue manipulation 
9015         through the use of an internal databases for spooled job 
9016         information</P
9017 ></LI
9018 ></UL
9019 ><P
9020 >There has been some initial confusion about what all this means
9021 and whether or not it is a requirement for printer drivers to be 
9022 installed on a Samba host in order to support printing from Windows 
9023 clients. As a side note, Samba does not use these drivers in any way to process 
9024 spooled files.  They are utilized entirely by the clients.</P
9025 ><P
9026 >The following MS KB article, may be of some help if you are dealing with
9027 Windows 2000 clients:  <SPAN
9028 CLASS="emphasis"
9029 ><I
9030 CLASS="EMPHASIS"
9031 >How to Add Printers with No User 
9032 Interaction in Windows 2000</I
9033 ></SPAN
9034 ></P
9035 ><P
9036 ><A
9037 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
9038 TARGET="_top"
9039 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
9040 ></P
9041 ></DIV
9042 ><DIV
9043 CLASS="SECT1"
9044 ><HR><H2
9045 CLASS="SECT1"
9046 ><A
9047 NAME="AEN1721"
9048 >14.2. Configuration</A
9049 ></H2
9050 ><DIV
9051 CLASS="WARNING"
9052 ><P
9053 ></P
9054 ><TABLE
9055 CLASS="WARNING"
9056 WIDTH="100%"
9057 BORDER="0"
9058 ><TR
9059 ><TD
9060 WIDTH="25"
9061 ALIGN="CENTER"
9062 VALIGN="TOP"
9063 ><IMG
9064 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
9065 HSPACE="5"
9066 ALT="Warning"></TD
9067 ><TH
9068 ALIGN="LEFT"
9069 VALIGN="CENTER"
9070 ><B
9071 >[print$] vs. [printer$]</B
9072 ></TH
9073 ></TR
9074 ><TR
9075 ><TD
9076 >&nbsp;</TD
9077 ><TD
9078 ALIGN="LEFT"
9079 VALIGN="TOP"
9080 ><P
9081 >Previous versions of Samba recommended using a share named [printer$].  
9082 This name was taken from the printer$ service created by Windows 9x 
9083 clients when a printer was shared.  Windows 9x printer servers always have 
9084 a printer$ service which provides read-only access via no 
9085 password in order to support printer driver downloads.</P
9086 ><P
9087 >However, the initial implementation allowed for a 
9088 parameter named <VAR
9089 CLASS="PARAMETER"
9090 >printer driver location</VAR
9091
9092 to be used on a per share basis to specify the location of 
9093 the driver files associated with that printer.  Another 
9094 parameter named <VAR
9095 CLASS="PARAMETER"
9096 >printer driver</VAR
9097 > provided 
9098 a means of defining the printer driver name to be sent to 
9099 the client.</P
9100 ></TD
9101 ></TR
9102 ></TABLE
9103 ></DIV
9104 ><DIV
9105 CLASS="SECT2"
9106 ><HR><H3
9107 CLASS="SECT2"
9108 ><A
9109 NAME="AEN1729"
9110 >14.2.1. Creating [print$]</A
9111 ></H3
9112 ><P
9113 >In order to support the uploading of printer driver 
9114 files, you must first configure a file share named [print$].  
9115 The name of this share is hard coded in Samba's internals so 
9116 the name is very important (print$ is the service used by 
9117 Windows NT print servers to provide support for printer driver 
9118 download).</P
9119 ><P
9120 >You should modify the server's smb.conf file to add the global
9121 parameters and to create the 
9122 following file share (of course, some of the parameter values,
9123 such as 'path' are arbitrary and should be replaced with
9124 appropriate values for your site):</P
9125 ><P
9126 ><PRE
9127 CLASS="PROGRAMLISTING"
9128 >[global]
9129     ; members of the ntadmin group should be able
9130     ; to add drivers and set printer properties
9131     ; root is implicitly a 'printer admin'
9132     printer admin = @ntadmin
9133
9134 [print$]
9135     path = /usr/local/samba/printers
9136     guest ok = yes
9137     browseable = yes
9138     read only = yes
9139     ; since this share is configured as read only, then we need
9140     ; a 'write list'.  Check the file system permissions to make
9141     ; sure this account can copy files to the share.  If this
9142     ; is setup to a non-root account, then it should also exist
9143     ; as a 'printer admin'
9144     write list = @ntadmin,root</PRE
9145 ></P
9146 ><P
9147 >The <A
9148 HREF="smb.conf.5.html#WRITELIST"
9149 TARGET="_top"
9150 ><VAR
9151 CLASS="PARAMETER"
9152 >write list</VAR
9153 ></A
9154 > is used to allow administrative 
9155 level user accounts to have write access in order to update files 
9156 on the share.  See the <A
9157 HREF="smb.conf.5.html"
9158 TARGET="_top"
9159 >smb.conf(5) 
9160 man page</A
9161 > for more information on configuring file shares.</P
9162 ><P
9163 >The requirement for <A
9164 HREF="smb.conf.5.html#GUESTOK"
9165 TARGET="_top"
9166 ><B
9167 CLASS="COMMAND"
9168 >guest 
9169 ok = yes</B
9170 ></A
9171 > depends upon how your
9172 site is configured.  If users will be guaranteed to have 
9173 an account on the Samba host, then this is a non-issue.</P
9174 ><DIV
9175 CLASS="NOTE"
9176 ><P
9177 ></P
9178 ><TABLE
9179 CLASS="NOTE"
9180 WIDTH="100%"
9181 BORDER="0"
9182 ><TR
9183 ><TD
9184 WIDTH="25"
9185 ALIGN="CENTER"
9186 VALIGN="TOP"
9187 ><IMG
9188 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
9189 HSPACE="5"
9190 ALT="Note"></TD
9191 ><TH
9192 ALIGN="LEFT"
9193 VALIGN="CENTER"
9194 ><B
9195 >Author's Note</B
9196 ></TH
9197 ></TR
9198 ><TR
9199 ><TD
9200 >&nbsp;</TD
9201 ><TD
9202 ALIGN="LEFT"
9203 VALIGN="TOP"
9204 ><P
9205 >The non-issue is that if all your Windows NT users are guaranteed to be 
9206 authenticated by the Samba server (such as a domain member server and the NT 
9207 user has already been validated by the Domain Controller in 
9208 order to logon to the Windows NT console), then guest access 
9209 is not necessary.  Of course, in a workgroup environment where 
9210 you just want to be able to print without worrying about 
9211 silly accounts and security, then configure the share for 
9212 guest access.  You'll probably want to add <A
9213 HREF="smb.conf.5.html#MAPTOGUEST"
9214 TARGET="_top"
9215 ><B
9216 CLASS="COMMAND"
9217 >map to guest = Bad User</B
9218 ></A
9219 > in the [global] section as well.  Make sure 
9220 you understand what this parameter does before using it 
9221 though. --jerry</P
9222 ></TD
9223 ></TR
9224 ></TABLE
9225 ></DIV
9226 ><P
9227 >In order for a Windows NT print server to support 
9228 the downloading of driver files by multiple client architectures,
9229 it must create subdirectories within the [print$] service
9230 which correspond to each of the supported client architectures.
9231 Samba follows this model as well.</P
9232 ><P
9233 >Next create the directory tree below the [print$] share 
9234 for each architecture you wish to support.</P
9235 ><P
9236 ><PRE
9237 CLASS="PROGRAMLISTING"
9238 >[print$]-----
9239         |-W32X86           ; "Windows NT x86"
9240         |-WIN40            ; "Windows 95/98"
9241         |-W32ALPHA         ; "Windows NT Alpha_AXP"
9242         |-W32MIPS          ; "Windows NT R4000"
9243         |-W32PPC           ; "Windows NT PowerPC"</PRE
9244 ></P
9245 ><DIV
9246 CLASS="WARNING"
9247 ><P
9248 ></P
9249 ><TABLE
9250 CLASS="WARNING"
9251 WIDTH="100%"
9252 BORDER="0"
9253 ><TR
9254 ><TD
9255 WIDTH="25"
9256 ALIGN="CENTER"
9257 VALIGN="TOP"
9258 ><IMG
9259 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
9260 HSPACE="5"
9261 ALT="Warning"></TD
9262 ><TH
9263 ALIGN="LEFT"
9264 VALIGN="CENTER"
9265 ><B
9266 >ATTENTION!  REQUIRED PERMISSIONS</B
9267 ></TH
9268 ></TR
9269 ><TR
9270 ><TD
9271 >&nbsp;</TD
9272 ><TD
9273 ALIGN="LEFT"
9274 VALIGN="TOP"
9275 ><P
9276 >In order to currently add a new driver to you Samba host, 
9277 one of two conditions must hold true:</P
9278 ><P
9279 ></P
9280 ><UL
9281 ><LI
9282 ><P
9283 >The account used to connect to the Samba host 
9284         must have a uid of 0 (i.e. a root account)</P
9285 ></LI
9286 ><LI
9287 ><P
9288 >The account used to connect to the Samba host
9289         must be a member of the <A
9290 HREF="smb.conf.5.html#PRINTERADMIN"
9291 TARGET="_top"
9292 ><VAR
9293 CLASS="PARAMETER"
9294 >printer 
9295         admin</VAR
9296 ></A
9297 > list.</P
9298 ></LI
9299 ></UL
9300 ><P
9301 >Of course, the connected account must still possess access
9302 to add files to the subdirectories beneath [print$]. Remember
9303 that all file shares are set to 'read only' by default.</P
9304 ></TD
9305 ></TR
9306 ></TABLE
9307 ></DIV
9308 ><P
9309 >Once you have created the required [print$] service and 
9310 associated subdirectories, simply log onto the Samba server using 
9311 a root (or <VAR
9312 CLASS="PARAMETER"
9313 >printer admin</VAR
9314 >) account
9315 from a Windows NT 4.0/2k client.  Open "Network Neighbourhood" or
9316 "My Network Places" and browse for the Samba host.  Once you have located
9317 the server, navigate to the "Printers..." folder.
9318 You should see an initial listing of printers
9319 that matches the printer shares defined on your Samba host.</P
9320 ></DIV
9321 ><DIV
9322 CLASS="SECT2"
9323 ><HR><H3
9324 CLASS="SECT2"
9325 ><A
9326 NAME="AEN1764"
9327 >14.2.2. Setting Drivers for Existing Printers</A
9328 ></H3
9329 ><P
9330 >The initial listing of printers in the Samba host's 
9331 Printers folder will have no real printer driver assigned 
9332 to them. This defaults to a NULL string to allow the use
9333 of the local Add Printer Wizard on NT/2000 clients.
9334 Attempting to view the printer properties for a printer
9335 which has this default driver assigned will result in 
9336 the error message:</P
9337 ><P
9338 ><SPAN
9339 CLASS="emphasis"
9340 ><I
9341 CLASS="EMPHASIS"
9342 >Device settings cannot be displayed.  The driver 
9343 for the specified printer is not installed, only spooler 
9344 properties will be displayed.  Do you want to install the 
9345 driver now?</I
9346 ></SPAN
9347 ></P
9348 ><P
9349 >Click "No" in the error dialog and you will be presented with
9350 the printer properties window.  The way to assign a driver to a 
9351 printer is to either</P
9352 ><P
9353 ></P
9354 ><UL
9355 ><LI
9356 ><P
9357 >Use the "New Driver..." button to install 
9358         a new printer driver, or</P
9359 ></LI
9360 ><LI
9361 ><P
9362 >Select a driver from the popup list of 
9363         installed drivers.  Initially this list will be empty.</P
9364 ></LI
9365 ></UL
9366 ><P
9367 >If you wish to install printer drivers for client 
9368 operating systems other than "Windows NT x86", you will need 
9369 to use the "Sharing" tab of the printer properties dialog.</P
9370 ><P
9371 >Assuming you have connected with a root account, you 
9372 will also be able modify other printer properties such as 
9373 ACLs and device settings using this dialog box.</P
9374 ><P
9375 >A few closing comments for this section, it is possible 
9376 on a Windows NT print server to have printers
9377 listed in the Printers folder which are not shared.  Samba does
9378 not make this distinction.  By definition, the only printers of
9379 which Samba is aware are those which are specified as shares in
9380 <TT
9381 CLASS="FILENAME"
9382 >smb.conf</TT
9383 >.</P
9384 ><P
9385 >Another interesting side note is that Windows NT clients do
9386 not use the SMB printer share, but rather can print directly 
9387 to any printer on another Windows NT host using MS-RPC.  This
9388 of course assumes that the printing client has the necessary
9389 privileges on the remote host serving the printer.  The default
9390 permissions assigned by Windows NT to a printer gives the "Print"
9391 permissions to the "Everyone" well-known group.</P
9392 ></DIV
9393 ><DIV
9394 CLASS="SECT2"
9395 ><HR><H3
9396 CLASS="SECT2"
9397 ><A
9398 NAME="AEN1780"
9399 >14.2.3. Support a large number of printers</A
9400 ></H3
9401 ><P
9402 >One issue that has arisen during the development
9403 phase of Samba 2.2 is the need to support driver downloads for
9404 100's of printers.  Using the Windows NT APW is somewhat 
9405 awkward to say the list.  If more than one printer are using the 
9406 same driver, the <A
9407 HREF="rpcclient.1.html"
9408 TARGET="_top"
9409 ><B
9410 CLASS="COMMAND"
9411 >rpcclient's
9412 setdriver command</B
9413 ></A
9414 > can be used to set the driver
9415 associated with an installed driver.  The following is example
9416 of how this could be accomplished:</P
9417 ><P
9418 ><PRE
9419 CLASS="PROGRAMLISTING"
9420
9421 <SAMP
9422 CLASS="PROMPT"
9423 >$ </SAMP
9424 >rpcclient pogo -U root%secret -c "enumdrivers"
9425 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
9426  
9427 [Windows NT x86]
9428 Printer Driver Info 1:
9429      Driver Name: [HP LaserJet 4000 Series PS]
9430  
9431 Printer Driver Info 1:
9432      Driver Name: [HP LaserJet 2100 Series PS]
9433  
9434 Printer Driver Info 1:
9435      Driver Name: [HP LaserJet 4Si/4SiMX PS]
9436                                   
9437 <SAMP
9438 CLASS="PROMPT"
9439 >$ </SAMP
9440 >rpcclient pogo -U root%secret -c "enumprinters"
9441 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
9442      flags:[0x800000]
9443      name:[\\POGO\hp-print]
9444      description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
9445      comment:[]
9446                                   
9447 <SAMP
9448 CLASS="PROMPT"
9449 >$ </SAMP
9450 >rpcclient pogo -U root%secret \
9451 <SAMP
9452 CLASS="PROMPT"
9453 >&#62; </SAMP
9454 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
9455 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
9456 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
9457 ></P
9458 ></DIV
9459 ><DIV
9460 CLASS="SECT2"
9461 ><HR><H3
9462 CLASS="SECT2"
9463 ><A
9464 NAME="AEN1791"
9465 >14.2.4. Adding New Printers via the Windows NT APW</A
9466 ></H3
9467 ><P
9468 >By default, Samba offers all printer shares defined in <TT
9469 CLASS="FILENAME"
9470 >smb.conf</TT
9471 >
9472 in the "Printers..." folder.  Also existing in this folder is the Windows NT 
9473 Add Printer Wizard icon.  The APW will be show only if</P
9474 ><P
9475 ></P
9476 ><UL
9477 ><LI
9478 ><P
9479 >The connected user is able to successfully
9480         execute an OpenPrinterEx(\\server) with administrative
9481         privileges (i.e. root or <VAR
9482 CLASS="PARAMETER"
9483 >printer admin</VAR
9484 >).
9485         </P
9486 ></LI
9487 ><LI
9488 ><P
9489 ><A
9490 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
9491 TARGET="_top"
9492 ><VAR
9493 CLASS="PARAMETER"
9494 >show 
9495         add printer wizard = yes</VAR
9496 ></A
9497 > (the default).
9498         </P
9499 ></LI
9500 ></UL
9501 ><P
9502 >In order to be able to use the APW to successfully add a printer to a Samba 
9503 server, the <A
9504 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
9505 TARGET="_top"
9506 ><VAR
9507 CLASS="PARAMETER"
9508 >add 
9509 printer command</VAR
9510 ></A
9511 > must have a defined value.  The program
9512 hook must successfully add the printer to the system (i.e. 
9513 <TT
9514 CLASS="FILENAME"
9515 >/etc/printcap</TT
9516 > or appropriate files) and 
9517 <TT
9518 CLASS="FILENAME"
9519 >smb.conf</TT
9520 > if necessary.</P
9521 ><P
9522 >When using the APW from a client, if the named printer share does 
9523 not exist, <B
9524 CLASS="COMMAND"
9525 >smbd</B
9526 > will execute the <VAR
9527 CLASS="PARAMETER"
9528 >add printer 
9529 command</VAR
9530 > and reparse to the <TT
9531 CLASS="FILENAME"
9532 >smb.conf</TT
9533 >
9534 to attempt to locate the new printer share.  If the share is still not defined,
9535 an error of "Access Denied" is returned to the client.  Note that the 
9536 <VAR
9537 CLASS="PARAMETER"
9538 >add printer program</VAR
9539 > is executed under the context
9540 of the connected user, not necessarily a root account.</P
9541 ><P
9542 >There is a complementary <A
9543 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
9544 TARGET="_top"
9545 ><VAR
9546 CLASS="PARAMETER"
9547 >delete
9548 printer command</VAR
9549 ></A
9550 > for removing entries from the "Printers..."
9551 folder.</P
9552 ><P
9553 >The following is an example <A
9554 HREF="smb.conf.5.html#ADDPRINTERCOMMAN"
9555 TARGET="_top"
9556 ><VAR
9557 CLASS="PARAMETER"
9558 >add printer command</VAR
9559 ></A
9560 > script. It adds the appropriate entries to <TT
9561 CLASS="FILENAME"
9562 >/etc/printcap.local</TT
9563 > (change that to what you need) and returns a line of 'Done' which is needed for the whole process to work.</P
9564 ><PRE
9565 CLASS="PROGRAMLISTING"
9566 >#!/bin/sh
9567
9568 # Script to insert a new printer entry into printcap.local
9569 #
9570 # $1, printer name, used as the descriptive name
9571 # $2, share name, used as the printer name for Linux
9572 # $3, port name
9573 # $4, driver name
9574 # $5, location, used for the device file of the printer
9575 # $6, win9x location
9576
9577 #
9578 # Make sure we use the location that RedHat uses for local printer defs
9579 PRINTCAP=/etc/printcap.local
9580 DATE=`date +%Y%m%d-%H%M%S`
9581 LP=lp
9582 RESTART="service lpd restart"
9583
9584 # Keep a copy
9585 cp $PRINTCAP $PRINTCAP.$DATE
9586 # Add the printer to $PRINTCAP
9587 echo ""                                                 &#62;&#62; $PRINTCAP
9588 echo "$2|$1:\\"                                         &#62;&#62; $PRINTCAP
9589 echo "  :sd=/var/spool/lpd/$2:\\"                       &#62;&#62; $PRINTCAP
9590 echo "  :mx=0:ml=0:sh:\\"                               &#62;&#62; $PRINTCAP
9591 echo "  :lp=/usr/local/samba/var/print/$5.prn:"         &#62;&#62; $PRINTCAP
9592
9593 touch "/usr/local/samba/var/print/$5.prn" &#62;&#62; /tmp/printadd.$$ 2&#62;&#38;1
9594 chown $LP "/usr/local/samba/var/print/$5.prn" &#62;&#62; /tmp/printadd.$$ 2&#62;&#38;1
9595
9596 mkdir /var/spool/lpd/$2
9597 chmod 700 /var/spool/lpd/$2
9598 chown $LP /var/spool/lpd/$2
9599 #echo $1 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
9600 #echo $2 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
9601 #echo $3 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
9602 #echo $4 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
9603 #echo $5 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
9604 #echo $6 &#62;&#62; "/usr/local/samba/var/print/$5.prn"
9605 $RESTART &#62;&#62; "/usr/local/samba/var/print/$5.prn"
9606 # Not sure if this is needed
9607 touch /usr/local/samba/lib/smb.conf
9608 #
9609 # You need to return a value, but I am not sure what it means.
9610 #
9611 echo "Done"
9612 exit 0</PRE
9613 ></DIV
9614 ><DIV
9615 CLASS="SECT2"
9616 ><HR><H3
9617 CLASS="SECT2"
9618 ><A
9619 NAME="AEN1821"
9620 >14.2.5. Samba and Printer Ports</A
9621 ></H3
9622 ><P
9623 >Windows NT/2000 print servers associate a port with each printer.  These normally
9624 take the form of LPT1:, COM1:, FILE:, etc...  Samba must also support the
9625 concept of ports associated with a printer.  By default, only one printer port,
9626 named "Samba Printer Port", exists on a system.  Samba does not really a port in
9627 order to print, rather it is a requirement of Windows clients.  </P
9628 ><P
9629 >Note that Samba does not support the concept of "Printer Pooling" internally 
9630 either.  This is when a logical printer is assigned to multiple ports as 
9631 a form of load balancing or fail over.</P
9632 ><P
9633 >If you require that multiple ports be defined for some reason,
9634 <TT
9635 CLASS="FILENAME"
9636 >smb.conf</TT
9637 > possesses a <A
9638 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
9639 TARGET="_top"
9640 ><VAR
9641 CLASS="PARAMETER"
9642 >enumports 
9643 command</VAR
9644 ></A
9645 > which can be used to define an external program 
9646 that generates a listing of ports on a system.</P
9647 ></DIV
9648 ></DIV
9649 ><DIV
9650 CLASS="SECT1"
9651 ><HR><H2
9652 CLASS="SECT1"
9653 ><A
9654 NAME="AEN1829"
9655 >14.3. The Imprints Toolset</A
9656 ></H2
9657 ><P
9658 >The Imprints tool set provides a UNIX equivalent of the 
9659         Windows NT Add Printer Wizard.  For complete information, please 
9660         refer to the Imprints web site at <A
9661 HREF="http://imprints.sourceforge.net/"
9662 TARGET="_top"
9663 >       http://imprints.sourceforge.net/</A
9664 > as well as the documentation 
9665         included with the imprints source distribution.  This section will 
9666         only provide a brief introduction to the features of Imprints.</P
9667 ><DIV
9668 CLASS="SECT2"
9669 ><HR><H3
9670 CLASS="SECT2"
9671 ><A
9672 NAME="AEN1833"
9673 >14.3.1. What is Imprints?</A
9674 ></H3
9675 ><P
9676 >Imprints is a collection of tools for supporting the goals 
9677                 of</P
9678 ><P
9679 ></P
9680 ><UL
9681 ><LI
9682 ><P
9683 >Providing a central repository information 
9684                         regarding Windows NT and 95/98 printer driver packages</P
9685 ></LI
9686 ><LI
9687 ><P
9688 >Providing the tools necessary for creating 
9689                         the Imprints printer driver packages.</P
9690 ></LI
9691 ><LI
9692 ><P
9693 >Providing an installation client which 
9694                         will obtain and install printer drivers on remote Samba 
9695                         and Windows NT 4 print servers.</P
9696 ></LI
9697 ></UL
9698 ></DIV
9699 ><DIV
9700 CLASS="SECT2"
9701 ><HR><H3
9702 CLASS="SECT2"
9703 ><A
9704 NAME="AEN1843"
9705 >14.3.2. Creating Printer Driver Packages</A
9706 ></H3
9707 ><P
9708 >The process of creating printer driver packages is beyond
9709                 the scope of this document (refer to Imprints.txt also included
9710                 with the Samba distribution for more information).  In short,
9711                 an Imprints driver package is a gzipped tarball containing the
9712                 driver files, related INF files, and a control file needed by the
9713                 installation client.</P
9714 ></DIV
9715 ><DIV
9716 CLASS="SECT2"
9717 ><HR><H3
9718 CLASS="SECT2"
9719 ><A
9720 NAME="AEN1846"
9721 >14.3.3. The Imprints server</A
9722 ></H3
9723 ><P
9724 >The Imprints server is really a database server that 
9725                 may be queried via standard HTTP mechanisms.  Each printer 
9726                 entry in the database has an associated URL for the actual
9727                 downloading of the package.  Each package is digitally signed
9728                 via GnuPG which can be used to verify that package downloaded
9729                 is actually the one referred in the Imprints database.  It is 
9730                 <SPAN
9731 CLASS="emphasis"
9732 ><I
9733 CLASS="EMPHASIS"
9734 >not</I
9735 ></SPAN
9736 > recommended that this security check 
9737                 be disabled.</P
9738 ></DIV
9739 ><DIV
9740 CLASS="SECT2"
9741 ><HR><H3
9742 CLASS="SECT2"
9743 ><A
9744 NAME="AEN1850"
9745 >14.3.4. The Installation Client</A
9746 ></H3
9747 ><P
9748 >More information regarding the Imprints installation client 
9749                 is available in the <TT
9750 CLASS="FILENAME"
9751 >Imprints-Client-HOWTO.ps</TT
9752
9753                 file included with the imprints source package.</P
9754 ><P
9755 >The Imprints installation client comes in two forms.</P
9756 ><P
9757 ></P
9758 ><UL
9759 ><LI
9760 ><P
9761 >a set of command line Perl scripts</P
9762 ></LI
9763 ><LI
9764 ><P
9765 >a GTK+ based graphical interface to 
9766                         the command line perl scripts</P
9767 ></LI
9768 ></UL
9769 ><P
9770 >The installation client (in both forms) provides a means
9771                 of querying the Imprints database server for a matching
9772                 list of known printer model names as well as a means to 
9773                 download and install the drivers on remote Samba and Windows
9774                 NT print servers.</P
9775 ><P
9776 >The basic installation process is in four steps and 
9777                 perl code is wrapped around <B
9778 CLASS="COMMAND"
9779 >smbclient</B
9780
9781                 and <B
9782 CLASS="COMMAND"
9783 >rpcclient</B
9784 >.</P
9785 ><P
9786 ><PRE
9787 CLASS="PROGRAMLISTING"
9788 >       
9789 foreach (supported architecture for a given driver)
9790 {
9791      1.  rpcclient: Get the appropriate upload directory 
9792          on the remote server
9793      2.  smbclient: Upload the driver files
9794      3.  rpcclient: Issues an AddPrinterDriver() MS-RPC
9795 }
9796         
9797 4.  rpcclient: Issue an AddPrinterEx() MS-RPC to actually
9798     create the printer</PRE
9799 ></P
9800 ><P
9801 >One of the problems encountered when implementing 
9802                 the Imprints tool set was the name space issues between 
9803                 various supported client architectures.  For example, Windows 
9804                 NT includes a driver named "Apple LaserWriter II NTX v51.8" 
9805                 and Windows 95 calls its version of this driver "Apple 
9806                 LaserWriter II NTX"</P
9807 ><P
9808 >The problem is how to know what client drivers have 
9809                 been uploaded for a printer.  As astute reader will remember 
9810                 that the Windows NT Printer Properties dialog only includes 
9811                 space for one printer driver name.  A quick look in the 
9812                 Windows NT 4.0 system registry at</P
9813 ><P
9814 ><TT
9815 CLASS="FILENAME"
9816 >HKLM\System\CurrentControlSet\Control\Print\Environment
9817                 </TT
9818 ></P
9819 ><P
9820 >will reveal that Windows NT always uses the NT driver 
9821                 name.  This is ok as Windows NT always requires that at least 
9822                 the Windows NT version of the printer driver is present.  
9823                 However, Samba does not have the requirement internally.  
9824                 Therefore, how can you use the NT driver name if is has not 
9825                 already been installed?</P
9826 ><P
9827 >The way of sidestepping this limitation is to require 
9828                 that all Imprints printer driver packages include both the Intel 
9829                 Windows NT and 95/98 printer drivers and that NT driver is 
9830                 installed first.</P
9831 ></DIV
9832 ></DIV
9833 ><DIV
9834 CLASS="SECT1"
9835 ><HR><H2
9836 CLASS="SECT1"
9837 ><A
9838 NAME="AEN1872"
9839 >14.4. Diagnosis</A
9840 ></H2
9841 ><DIV
9842 CLASS="SECT2"
9843 ><H3
9844 CLASS="SECT2"
9845 ><A
9846 NAME="AEN1874"
9847 >14.4.1. Introduction</A
9848 ></H3
9849 ><P
9850 >This is a short description of how to debug printing problems with
9851 Samba. This describes how to debug problems with printing from a SMB
9852 client to a Samba server, not the other way around. For the reverse
9853 see the examples/printing directory.</P
9854 ><P
9855 >Ok, so you want to print to a Samba server from your PC. The first
9856 thing you need to understand is that Samba does not actually do any
9857 printing itself, it just acts as a middleman between your PC client
9858 and your Unix printing subsystem. Samba receives the file from the PC
9859 then passes the file to a external "print command". What print command
9860 you use is up to you.</P
9861 ><P
9862 >The whole things is controlled using options in smb.conf. The most
9863 relevant options (which you should look up in the smb.conf man page)
9864 are:</P
9865 ><P
9866 ><PRE
9867 CLASS="PROGRAMLISTING"
9868 >      [global]
9869         print command     - send a file to a spooler
9870         lpq command       - get spool queue status
9871         lprm command      - remove a job
9872       [printers]
9873         path = /var/spool/lpd/samba</PRE
9874 ></P
9875 ><P
9876 >The following are nice to know about:</P
9877 ><P
9878 ><PRE
9879 CLASS="PROGRAMLISTING"
9880 >        queuepause command   - stop a printer or print queue
9881         queueresume command  - start a printer or print queue</PRE
9882 ></P
9883 ><P
9884 >Example:</P
9885 ><P
9886 ><PRE
9887 CLASS="PROGRAMLISTING"
9888 >        print command = /usr/bin/lpr -r -P%p %s
9889         lpq command   = /usr/bin/lpq    -P%p %s
9890         lprm command  = /usr/bin/lprm   -P%p %j
9891         queuepause command = /usr/sbin/lpc -P%p stop
9892         queuepause command = /usr/sbin/lpc -P%p start</PRE
9893 ></P
9894 ><P
9895 >Samba should set reasonable defaults for these depending on your
9896 system type, but it isn't clairvoyant. It is not uncommon that you
9897 have to tweak these for local conditions.  The commands should
9898 always have fully specified pathnames,  as the smdb may not have
9899 the correct PATH values.</P
9900 ><P
9901 >When you send a job to Samba to be printed,  it will make a temporary
9902 copy of it in the directory specified in the [printers] section.
9903 and it should be periodically cleaned out.  The lpr -r option
9904 requests that the temporary copy be removed after printing; If
9905 printing fails then you might find leftover files in this directory,
9906 and it should be periodically cleaned out.  Samba used the lpq
9907 command to determine the "job number" assigned to your print job
9908 by the spooler.</P
9909 ><P
9910 >The %&#62;letter&#60; are "macros" that get dynamically replaced with appropriate
9911 values when they are used. The %s gets replaced with the name of the spool
9912 file that Samba creates and the %p gets replaced with the name of the
9913 printer. The %j gets replaced with the "job number" which comes from
9914 the lpq output.</P
9915 ></DIV
9916 ><DIV
9917 CLASS="SECT2"
9918 ><HR><H3
9919 CLASS="SECT2"
9920 ><A
9921 NAME="AEN1890"
9922 >14.4.2. Debugging printer problems</A
9923 ></H3
9924 ><P
9925 >One way to debug printing problems is to start by replacing these
9926 command with shell scripts that record the arguments and the contents
9927 of the print file. A simple example of this kind of things might
9928 be:</P
9929 ><P
9930 ><PRE
9931 CLASS="PROGRAMLISTING"
9932 >       print command = /tmp/saveprint %p %s
9933
9934     #!/bin/saveprint
9935     # we make sure that we are the right user
9936     /usr/bin/id -p &#62;/tmp/tmp.print
9937     # we run the command and save the error messages
9938     # replace the command with the one appropriate for your system
9939     /usr/bin/lpr -r -P$1 $2 2&#62;&#62;&#38;/tmp/tmp.print</PRE
9940 ></P
9941 ><P
9942 >Then you print a file and try removing it.  You may find that the
9943 print queue needs to be stopped in order to see the queue status
9944 and remove the job:</P
9945 ><P
9946 ><PRE
9947 CLASS="PROGRAMLISTING"
9948 >&#13;h4: {42} % echo hi &#62;/tmp/hi
9949 h4: {43} % smbclient //localhost/lw4
9950 added interface ip=10.0.0.4 bcast=10.0.0.255 nmask=255.255.255.0
9951 Password: 
9952 Domain=[ASTART] OS=[Unix] Server=[Samba 2.0.7]
9953 smb: \&#62; print /tmp/hi
9954 putting file /tmp/hi as hi-17534 (0.0 kb/s) (average 0.0 kb/s)
9955 smb: \&#62; queue
9956 1049     3            hi-17534
9957 smb: \&#62; cancel 1049
9958 Error cancelling job 1049 : code 0
9959 smb: \&#62; cancel 1049
9960 Job 1049 cancelled
9961 smb: \&#62; queue
9962 smb: \&#62; exit</PRE
9963 ></P
9964 ><P
9965 >The 'code 0' indicates that the job was removed.  The comment
9966 by the  smbclient is a bit misleading on this.
9967 You can observe the command output and then and look at the
9968 /tmp/tmp.print file to see what the results are.  You can quickly
9969 find out if the problem is with your printing system.  Often people
9970 have problems with their /etc/printcap file or permissions on
9971 various print queues.</P
9972 ></DIV
9973 ><DIV
9974 CLASS="SECT2"
9975 ><HR><H3
9976 CLASS="SECT2"
9977 ><A
9978 NAME="AEN1899"
9979 >14.4.3. What printers do I have?</A
9980 ></H3
9981 ><P
9982 >You can use the 'testprns' program to check to see if the printer
9983 name you are using is recognized by Samba.  For example,  you can
9984 use:</P
9985 ><P
9986 ><PRE
9987 CLASS="PROGRAMLISTING"
9988 >    testprns printer /etc/printcap</PRE
9989 ></P
9990 ><P
9991 >Samba can get its printcap information from a file or from a program.
9992 You can try the following to see the format of the extracted
9993 information:</P
9994 ><P
9995 ><PRE
9996 CLASS="PROGRAMLISTING"
9997 >    testprns -a printer /etc/printcap
9998
9999     testprns -a printer '|/bin/cat printcap'</PRE
10000 ></P
10001 ></DIV
10002 ><DIV
10003 CLASS="SECT2"
10004 ><HR><H3
10005 CLASS="SECT2"
10006 ><A
10007 NAME="AEN1907"
10008 >14.4.4. Setting up printcap and print servers</A
10009 ></H3
10010 ><P
10011 >You may need to set up some printcaps for your Samba system to use.
10012 It is strongly recommended that you use the facilities provided by
10013 the print spooler to set up queues and printcap information.</P
10014 ><P
10015 >Samba requires either a printcap or program to deliver printcap
10016 information.  This printcap information has the format:</P
10017 ><P
10018 ><PRE
10019 CLASS="PROGRAMLISTING"
10020 >  name|alias1|alias2...:option=value:...</PRE
10021 ></P
10022 ><P
10023 >For almost all printing systems, the printer 'name' must be composed
10024 only of alphanumeric or underscore '_' characters.  Some systems also
10025 allow hyphens ('-') as well.  An alias is an alternative name for the
10026 printer,  and an alias with a space in it is used as a 'comment'
10027 about the printer.  The printcap format optionally uses a \ at the end of lines
10028 to extend the printcap to multiple lines.</P
10029 ><P
10030 >Here are some examples of printcap files:</P
10031 ><P
10032 ><P
10033 ></P
10034 ><OL
10035 TYPE="1"
10036 ><LI
10037 ><P
10038 >pr              just printer name</P
10039 ></LI
10040 ><LI
10041 ><P
10042 >pr|alias        printer name and alias</P
10043 ></LI
10044 ><LI
10045 ><P
10046 >pr|My Printer   printer name, alias used as comment</P
10047 ></LI
10048 ><LI
10049 ><P
10050 >pr:sh:\        Same as pr:sh:cm= testing
10051   :cm= \ 
10052   testing</P
10053 ></LI
10054 ><LI
10055 ><P
10056 >pr:sh           Same as pr:sh:cm= testing
10057   :cm= testing</P
10058 ></LI
10059 ></OL
10060 ></P
10061 ><P
10062 >Samba reads the printcap information when first started.  If you make
10063 changes in the printcap information, then you must do the following:</P
10064 ><P
10065 ></P
10066 ><OL
10067 TYPE="1"
10068 ><LI
10069 ><P
10070 >make sure that the print spooler is aware of these changes.
10071 The LPRng system uses the 'lpc reread' command to do this.</P
10072 ></LI
10073 ><LI
10074 ><P
10075 >make sure that the spool queues, etc., exist and have the
10076 correct permissions.  The LPRng system uses the 'checkpc -f'
10077 command to do this.</P
10078 ></LI
10079 ><LI
10080 ><P
10081 >You now should send a SIGHUP signal to the smbd server to have
10082 it reread the printcap information.</P
10083 ></LI
10084 ></OL
10085 ></DIV
10086 ><DIV
10087 CLASS="SECT2"
10088 ><HR><H3
10089 CLASS="SECT2"
10090 ><A
10091 NAME="AEN1935"
10092 >14.4.5. Job sent, no output</A
10093 ></H3
10094 ><P
10095 >This is the most frustrating part of printing.  You may have sent the
10096 job,  verified that the job was forwarded,  set up a wrapper around
10097 the command to send the file,  but there was no output from the printer.</P
10098 ><P
10099 >First,  check to make sure that the job REALLY is getting to the
10100 right print queue.  If you are using a BSD or LPRng print spooler,
10101 you can temporarily stop the printing of jobs.  Jobs can still be
10102 submitted, but they will not be printed.  Use:</P
10103 ><P
10104 ><PRE
10105 CLASS="PROGRAMLISTING"
10106 >  lpc -Pprinter stop</PRE
10107 ></P
10108 ><P
10109 >Now submit a print job and then use 'lpq -Pprinter' to see if the
10110 job is in the print queue.  If it is not in the print queue then
10111 you will have to find out why it is not being accepted for printing.</P
10112 ><P
10113 >Next, you may want to check to see what the format of the job really
10114 was.  With the assistance of the system administrator you can view
10115 the submitted jobs files.  You may be surprised to find that these
10116 are not in what you would expect to call a printable format.
10117 You can use the UNIX 'file' utitily to determine what the job
10118 format actually is:</P
10119 ><P
10120 ><PRE
10121 CLASS="PROGRAMLISTING"
10122 >    cd /var/spool/lpd/printer   # spool directory of print jobs
10123     ls                          # find job files
10124     file dfA001myhost</PRE
10125 ></P
10126 ><P
10127 >You should make sure that your printer supports this format OR that
10128 your system administrator has installed a 'print filter' that will
10129 convert the file to a format appropriate for your printer.</P
10130 ></DIV
10131 ><DIV
10132 CLASS="SECT2"
10133 ><HR><H3
10134 CLASS="SECT2"
10135 ><A
10136 NAME="AEN1946"
10137 >14.4.6. Job sent, strange output</A
10138 ></H3
10139 ><P
10140 >Once you have the job printing, you can then start worrying about
10141 making it print nicely.</P
10142 ><P
10143 >The most common problem is extra pages of output: banner pages
10144 OR blank pages at the end.</P
10145 ><P
10146 >If you are getting banner pages,  check and make sure that the
10147 printcap option or printer option is configured for no banners.
10148 If you have a printcap,  this is the :sh (suppress header or banner
10149 page) option.  You should have the following in your printer.</P
10150 ><P
10151 ><PRE
10152 CLASS="PROGRAMLISTING"
10153 >   printer: ... :sh</PRE
10154 ></P
10155 ><P
10156 >If you have this option and are still getting banner pages,  there
10157 is a strong chance that your printer is generating them for you
10158 automatically.  You should make sure that banner printing is disabled
10159 for the printer.  This usually requires using the printer setup software
10160 or procedures supplied by the printer manufacturer.</P
10161 ><P
10162 >If you get an extra page of output,  this could be due to problems
10163 with your job format,  or if you are generating PostScript jobs,
10164 incorrect setting on your printer driver on the MicroSoft client.
10165 For example, under Win95 there is a option:</P
10166 ><P
10167 ><PRE
10168 CLASS="PROGRAMLISTING"
10169 >  Printers|Printer Name|(Right Click)Properties|Postscript|Advanced|</PRE
10170 ></P
10171 ><P
10172 >that allows you to choose if a Ctrl-D is appended to all jobs.
10173 This is a very bad thing to do, as most spooling systems will
10174 automatically add a ^D to the end of the job if it is detected as
10175 PostScript.  The multiple ^D may cause an additional page of output.</P
10176 ></DIV
10177 ><DIV
10178 CLASS="SECT2"
10179 ><HR><H3
10180 CLASS="SECT2"
10181 ><A
10182 NAME="AEN1958"
10183 >14.4.7. Raw PostScript printed</A
10184 ></H3
10185 ><P
10186 >This is a problem that is usually caused by either the print spooling
10187 system putting information at the start of the print job that makes
10188 the printer think the job is a text file, or your printer simply
10189 does not support PostScript.  You may need to enable 'Automatic
10190 Format Detection' on your printer.</P
10191 ></DIV
10192 ><DIV
10193 CLASS="SECT2"
10194 ><HR><H3
10195 CLASS="SECT2"
10196 ><A
10197 NAME="AEN1961"
10198 >14.4.8. Advanced Printing</A
10199 ></H3
10200 ><P
10201 >Note that you can do some pretty magic things by using your
10202 imagination with the "print command" option and some shell scripts.
10203 Doing print accounting is easy by passing the %U option to a print
10204 command shell script. You could even make the print command detect
10205 the type of output and its size and send it to an appropriate
10206 printer.</P
10207 ></DIV
10208 ><DIV
10209 CLASS="SECT2"
10210 ><HR><H3
10211 CLASS="SECT2"
10212 ><A
10213 NAME="AEN1964"
10214 >14.4.9. Real debugging</A
10215 ></H3
10216 ><P
10217 >If the above debug tips don't help, then maybe you need to bring in
10218 the bug guns, system tracing. See Tracing.txt in this directory.</P
10219 ></DIV
10220 ></DIV
10221 ></DIV
10222 ><DIV
10223 CLASS="CHAPTER"
10224 ><HR><H1
10225 ><A
10226 NAME="CUPS-PRINTING"
10227 ></A
10228 >Chapter 15. CUPS Printing Support</H1
10229 ><DIV
10230 CLASS="SECT1"
10231 ><H2
10232 CLASS="SECT1"
10233 ><A
10234 NAME="AEN1984"
10235 >15.1. Introduction</A
10236 ></H2
10237 ><P
10238 >The Common Unix Print System (CUPS) has become very popular, but to many it is
10239 a very mystical tool. There is a great deal of uncertainty regarding CUPS and how
10240 it works. The result is seen in a large number of posting on the samba mailing lists
10241 expressing frustration when MS Windows printers appear not to work with a CUPS
10242 backr-end.
10243 /para&#62;&#13;</P
10244 ><P
10245 >This is a good time to point out how CUPS can be used and what it does. CUPS is more
10246 than just a print spooling system - it is a complete printer management system that
10247 complies with HTTP and IPP protocols. It can be managed remotely via a web browser
10248 and it can print using http and ipp protocols.</P
10249 ><P
10250 >CUPS allows to creation of RAW printers (ie: NO file format translation) as well as
10251 SMART printers (ie: CUPS does file format conversion as required for the printer). In
10252 many ways this gives CUPS similar capabilities to the MS Windows print monitoring
10253 system. Of course, if you are a CUPS advocate, you would agrue that CUPS is better!
10254 In any case, let us now move on to explore how one may configure CUPS for interfacing
10255 with MS Windows print clients via Samba.</P
10256 ></DIV
10257 ><DIV
10258 CLASS="SECT1"
10259 ><HR><H2
10260 CLASS="SECT1"
10261 ><A
10262 NAME="AEN1989"
10263 >15.2. CUPS - RAW Print Through  Mode</A
10264 ></H2
10265 ><P
10266 >When CUPS printers are configured for RAW print-through mode operation it is the
10267 responsibility of the Samba client to fully render the print job (file) in a format
10268 that is suitable for direct delivery to the printer. In this case CUPS will NOT
10269 do any print file format conversion work.</P
10270 ><P
10271 >The CUPS files that need to be correctly set for RAW mode printers to work are:
10272
10273 <P
10274 ></P
10275 ><UL
10276 ><LI
10277 ><P
10278 ><TT
10279 CLASS="FILENAME"
10280 >/etc/cups/mime.types</TT
10281 ></P
10282 ><P
10283 ></P
10284 ></LI
10285 ><LI
10286 ><P
10287 ><TT
10288 CLASS="FILENAME"
10289 >/etc/cups/mime.convs</TT
10290 ></P
10291 ><P
10292 ></P
10293 ></LI
10294 ></UL
10295 >
10296
10297 Both contain entries that must be uncommented to allow <SPAN
10298 CLASS="emphasis"
10299 ><I
10300 CLASS="EMPHASIS"
10301 >RAW</I
10302 ></SPAN
10303 > mode
10304 operation.</P
10305 ><P
10306 >Firstly, to enable CUPS based printing from Samba the following options must be
10307 enabled in your smb.conf file [globals] section:
10308
10309 <P
10310 ></P
10311 ><UL
10312 ><LI
10313 ><P
10314 >printing = CUPS</P
10315 ></LI
10316 ><LI
10317 ><P
10318 >printcap = CUPS</P
10319 ></LI
10320 ></UL
10321 >
10322
10323 When these parameters are specified the print directives in smb.conf (as well as in
10324 samba itself) will be ignored because samba will directly interface with CUPS through
10325 it's application program interface (API) - so long as Samba has been compiled with
10326 CUPS library (libcups) support. If samba has NOT been compiled with CUPS support then
10327 printing will use the System V AT&#38;T command set with the <SPAN
10328 CLASS="emphasis"
10329 ><I
10330 CLASS="EMPHASIS"
10331 >-oraw</I
10332 ></SPAN
10333
10334 option automatically passing through.</P
10335 ><P
10336 >Cupsomatic (an enhanced printing utility that is part of some CUPS implementations) 
10337 on the Samba/CUPS server does *not* add any features if a file is really
10338 printed "raw".  However, if you have loaded the driver for the Windows client from
10339 the CUPS server, using the "cupsaddsmb" utility, and if this driver is one using
10340 a "Foomatic" PPD, the PJL header in question is already added on the Windows client,
10341 at the time when the driver initially generated the PostScript data and CUPS in true
10342 "-oraw" manner doesn't remove this PJL header and passes the file "as is" to its
10343 printer communication backend.</P
10344 ><DIV
10345 CLASS="NOTE"
10346 ><P
10347 ></P
10348 ><TABLE
10349 CLASS="NOTE"
10350 WIDTH="100%"
10351 BORDER="0"
10352 ><TR
10353 ><TD
10354 WIDTH="25"
10355 ALIGN="CENTER"
10356 VALIGN="TOP"
10357 ><IMG
10358 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
10359 HSPACE="5"
10360 ALT="Note"></TD
10361 ><TD
10362 ALIGN="LEFT"
10363 VALIGN="TOP"
10364 ><P
10365 >NOTE: editing in the "mime.convs" and the "mime.types" file does not *enforce*
10366 "raw" printing, it only *allows* it.</P
10367 ></TD
10368 ></TR
10369 ></TABLE
10370 ></DIV
10371 ><P
10372 >Print files that arrive from MS Windows printing are "auto-typed" by CUPS. This aids
10373 the process of determining proper treatment while in the print queue system.
10374
10375 <P
10376 ></P
10377 ><UL
10378 ><LI
10379 ><P
10380 >       Files generated by PCL drivers and directed at PCK printers get auto-typed as
10381         <TT
10382 CLASS="FILENAME"
10383 >application/octet-stream</TT
10384 >. Unknown file format types also
10385         get auto-typed with this tag.
10386         </P
10387 ></LI
10388 ><LI
10389 ><P
10390 >       Files generated by a Postscript driver and directed at a Postscript printer
10391         are auto-typed depending on the auto-detected most suitable MIME type as:
10392
10393         <P
10394 ></P
10395 ><UL
10396 ><LI
10397 ><P
10398 >* application/postscript</P
10399 ></LI
10400 ><LI
10401 ><P
10402 >* application/vnd.cups-postscript</P
10403 ></LI
10404 ></UL
10405 >
10406         </P
10407 ></LI
10408 ></UL
10409 ></P
10410 ><P
10411 >"application/postscript" first goes thru the "pstops" filter (where the page counting
10412 and accounting takes place). The outcome will be of MIME type
10413 "application/vnd.cups-postscript". The pstopsfilter reads and uses information from
10414 the PPD and inserts user-provided options into the PostScript file. As a consequence,
10415 the filtered file could possibly have an unwanted PJL header.</P
10416 ><P
10417 >"application/postscript" will be all files with a ".ps", ".ai", ".eps" suffix or which
10418 have as their first character string one of "%!" or "&#60;04&#62;%".</P
10419 ><P
10420 >"application/vnd.cups-postscript" will files which contain the string
10421 "LANGUAGE=POSTSCRIPT" (or similar variations with different capitalization) in the
10422 first 512 bytes, and also contain the "PJL super escape code" in the first 128 bytes
10423 ("&#60;1B&#62;%-12345X"). Very likely, most PostScript files generated on Windows using a CUPS
10424 or other PPD, will have to be auto-typed as "vnd.cups-postscript".  A file produced
10425 with a "Generic PostScript driver" will just be tagged "application/postscript".</P
10426 ><P
10427 >Once the file is in "application/vnd.cups-postscript" format, either "pstoraster"
10428 or "cupsomatic" will take over (depending on the printer configuration, as
10429 determined by the PPD in use).</P
10430 ><DIV
10431 CLASS="NOTE"
10432 ><P
10433 ></P
10434 ><TABLE
10435 CLASS="NOTE"
10436 WIDTH="100%"
10437 BORDER="0"
10438 ><TR
10439 ><TD
10440 WIDTH="25"
10441 ALIGN="CENTER"
10442 VALIGN="TOP"
10443 ><IMG
10444 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
10445 HSPACE="5"
10446 ALT="Note"></TD
10447 ><TD
10448 ALIGN="LEFT"
10449 VALIGN="TOP"
10450 ><P
10451 >A printer queue with *no* PPD associated to it is a "raw" printer and all files
10452 will go directly there as received by the spooler. The exeptions are file types
10453 "application/octet-stream" which need "passthrough feature" enabled.
10454 "Raw" queues don't do any filtering at all, they hand the file directly to the
10455 CUPS backend. This backend is responsible for the sending of the data to the device
10456 (as in the "device URI" notation as lpd://, socket://, smb://, ipp://, http://,
10457 parallel:/, serial:/, usb:/ etc.)</P
10458 ></TD
10459 ></TR
10460 ></TABLE
10461 ></DIV
10462 ><DIV
10463 CLASS="NOTE"
10464 ><P
10465 ></P
10466 ><TABLE
10467 CLASS="NOTE"
10468 WIDTH="100%"
10469 BORDER="0"
10470 ><TR
10471 ><TD
10472 WIDTH="25"
10473 ALIGN="CENTER"
10474 VALIGN="TOP"
10475 ><IMG
10476 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
10477 HSPACE="5"
10478 ALT="Note"></TD
10479 ><TD
10480 ALIGN="LEFT"
10481 VALIGN="TOP"
10482 ><P
10483 >"cupsomatic"/Foomatic are *not* native CUPS drivers and they don't ship with CUPS.
10484 They are a Third Party add-on, developed at Linuxprinting.org.  As such, they are
10485 a brilliant hack to make all models (driven by Ghostscript drivers/filters in
10486 traditional spoolers) also work via CUPS, with the same (good or bad!) quality
10487 as in these other spoolers. "cupsomatic" is only a vehicle to execute a ghostscript
10488 commandline at that stage in the CUPS filtering chain, where "normally" the native
10489 CUPS "pstoraster" filter would kick in.  cupsomatic by-passes pstoraster, "kidnaps"
10490 the printfile from CUPS away and re-directs it to go through Ghostscipt. CUPS accepts this,
10491 because the associated CUPS-O-Matic-/Foomatic-PPD specifies:</P
10492 ><PRE
10493 CLASS="PROGRAMLISTING"
10494 >   *cupsFilter:  "application/vnd.cups-postscript 0 cupsomatic"</PRE
10495 ><P
10496 >This line persuades CUPS to hand the file to cupsomatic, once it has successfully
10497 converted it to the MIME type "application/vnd.cups-postscript". This conversion will not
10498 happen for Jobs arriving from Windows which are auto-typed "application/octet-stream",
10499 with the according changes in "/etc/cups/mime.types" in place.</P
10500 ></TD
10501 ></TR
10502 ></TABLE
10503 ></DIV
10504 ><P
10505 >CUPS is widely configurable and flexible, even regarding its filtering mechanism.
10506 Another workaround in some situations would be to have
10507 in "/etc/cups/mime.types" entries as follows:</P
10508 ><PRE
10509 CLASS="PROGRAMLISTING"
10510 >   application/postscript           application/vnd.cups-raw  0  -
10511    application/vnd.cups-postscript  application/vnd.cups-raw  0  -</PRE
10512 ><P
10513 >This would prevent all Postscript files from being filtered (rather, they will go
10514 thru the virtual "nullfilter" denoted with "-"). This could only be useful for
10515 PS printers. If you want to print PS code on non-PS printers an entry as follows
10516 could be useful:</P
10517 ><PRE
10518 CLASS="PROGRAMLISTING"
10519 >   */*           application/vnd.cups-raw  0  -</PRE
10520 ><P
10521 >and would effectively send *all* files to the backend without further processing.</P
10522 ><P
10523 >Lastly, you could have the following entry:</P
10524 ><PRE
10525 CLASS="PROGRAMLISTING"
10526 >   application/vnd.cups-postscript  application/vnd.cups-raw  0  my_PJL_stripping_filter</PRE
10527 ><P
10528 >You will need to write a "my_PJL_stripping_filter" (could be a shellscript) that
10529 parses the PostScript and removes the unwanted PJL. This would need to conform to
10530 CUPS filter design (mainly, receive and pass the parameters printername, job-id,
10531 username, jobtitle, copies, print options and possibly the filename). It would
10532 be installed as world executable into "/usr/lib/cups/filters/" and will be called
10533 by CUPS if it encounters a MIME type "application/vnd.cups-postscript".</P
10534 ><P
10535 >CUPS can handle "-o job-hold-until=indefinite". This keeps the job in the queue
10536 "on hold". It will only be printed upon manual release by the printer operator.
10537 This is a requirement in many "central reproduction departments", where a few
10538 operators manage the jobs of hundreds of users on some big machine, where no
10539 user is allowed to have direct access. (The operators often need to load the
10540 proper paper type before running the 10.000 page job requested by marketing
10541 for the mailing, etc.).</P
10542 ></DIV
10543 ><DIV
10544 CLASS="SECT1"
10545 ><HR><H2
10546 CLASS="SECT1"
10547 ><A
10548 NAME="AEN2044"
10549 >15.3. The CUPS Filter Chains</A
10550 ></H2
10551 ><P
10552 >The following diagrams reveal how CUPS handles print jobs.</P
10553 ><PRE
10554 CLASS="PROGRAMLISTING"
10555 >#########################################################################
10556 #
10557 # CUPS in and of itself has this (general) filter chain (CAPITAL
10558 # letters are FILE-FORMATS or MIME types, other are filters (this is
10559 # true for pre-1.1.15 of pre-4.3 versions of CUPS and ESP PrintPro):
10560 #
10561 # <VAR
10562 CLASS="REPLACEABLE"
10563 >SOMETHNG</VAR
10564 >-FILEFORMAT
10565 #      |
10566 #      |
10567 #      V
10568 #     <VAR
10569 CLASS="REPLACEABLE"
10570 >something</VAR
10571 >tops
10572 #      |
10573 #      |
10574 #      V
10575 # APPLICATION/POSTSCRIPT
10576 #      |
10577 #      |
10578 #      V
10579 #     pstops
10580 #      |
10581 #      |
10582 #      V
10583 # APPLICATION/VND.CUPS-POSTSCRIPT
10584 #      |
10585 #      |
10586 #      V
10587 #     pstoraster   # as shipped with CUPS, independent from any Ghostscipt
10588 #      |           # installation on the system
10589 #      |  (= "postscipt interpreter")
10590 #      |
10591 #      V
10592 # APPLICATION/VND.CUPS-RASTER
10593 #      |
10594 #      |
10595 #      V
10596 #     rasterto<VAR
10597 CLASS="REPLACEABLE"
10598 >something</VAR
10599 >  (f.e. Gimp-Print filters may be plugged in here)
10600 #      |   (= "raster driver")
10601 #      |
10602 #      V
10603 # SOMETHING-DEVICE-SPECIFIC
10604 #      |
10605 #      |
10606 #      V
10607 #     backend
10608 #
10609 #
10610 # ESP PrintPro has some enhanced "rasterto<VAR
10611 CLASS="REPLACEABLE"
10612 >something</VAR
10613 >" filters as compared to
10614 # CUPS, and also a somewhat improved "pstoraster" filter.
10615 #
10616 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
10617 #       CUPS and ESP PrintPro plug-in where rasterto<VAR
10618 CLASS="REPLACEABLE"
10619 >something</VAR
10620 > is noted.
10621 #
10622 #########################################################################</PRE
10623 ><PRE
10624 CLASS="PROGRAMLISTING"
10625 >#########################################################################
10626 #
10627 # This is how "cupsomatic" comes into play:
10628 # =========================================
10629 #
10630 # <VAR
10631 CLASS="REPLACEABLE"
10632 >SOMETHNG</VAR
10633 >-FILEFORMAT
10634 #      |
10635 #      |
10636 #      V
10637 #    <VAR
10638 CLASS="REPLACEABLE"
10639 >something</VAR
10640 >tops
10641 #      |
10642 #      |
10643 #      V
10644 # APPLICATION/POSTSCRIPT
10645 #      |
10646 #      |
10647 #      V
10648 #    pstops
10649 #      |
10650 #      |
10651 #      V
10652 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
10653 #      |                                          |
10654 #      |                                          V
10655 #      V                                         cupsomatic
10656 #    pstoraster                                  (constructs complicated
10657 #      |  (= "postscipt interpreter")            Ghostscript commandline
10658 #      |                                         to let the file be
10659 #      V                                         processed by a
10660 # APPLICATION/VND.CUPS-RASTER                    "-sDEVICE=<VAR
10661 CLASS="REPLACEABLE"
10662 >s.th.</VAR
10663 >"
10664 #      |                                         call...)
10665 #      |                                          |
10666 #      V                                          |
10667 #    rasterto<VAR
10668 CLASS="REPLACEABLE"
10669 >something</VAR
10670 >                          V
10671 #      |    (= "raster driver")     +-------------------------+
10672 #      |                            | Ghostscript at work.... |
10673 #      V                            |                         |
10674 # SOMETHING-DEVICE-SPECIFIC         *-------------------------+
10675 #      |                                          |
10676 #      |                                          |
10677 #      V                                          |
10678 #    backend &#62;------------------------------------+
10679 #      |
10680 #      |
10681 #      V
10682 #    THE PRINTER
10683 #
10684 #
10685 # Note, that cupsomatic "kidnaps" the printfile after the
10686 # "APPLICATION/VND.CUPS-POSTSCRPT" stage and deviates it through
10687 # the CUPS-external, systemwide Ghostscript installation, bypassing the
10688 # "pstoraster" filter (therefor also bypassing the CUPS-raster-drivers
10689 # "rasterto<VAR
10690 CLASS="REPLACEABLE"
10691 >something</VAR
10692 >", and hands the rasterized file directly to the CUPS
10693 # backend...
10694 #
10695 # cupsomatic is not made by the CUPS developers. It is an independent
10696 # contribution to printing development, made by people from
10697 # Linuxprinting.org. (see also http://www.cups.org/cups-help.html)
10698 #
10699 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
10700 #       CUPS and ESP PrintPro plug-in where rasterto<VAR
10701 CLASS="REPLACEABLE"
10702 >something</VAR
10703 > is noted.
10704 #
10705 #########################################################################</PRE
10706 ><PRE
10707 CLASS="PROGRAMLISTING"
10708 >#########################################################################
10709 #
10710 # And this is how it works for ESP PrintPro from 4.3:
10711 # ===================================================
10712 #
10713 # <VAR
10714 CLASS="REPLACEABLE"
10715 >SOMETHNG</VAR
10716 >-FILEFORMAT
10717 #      |
10718 #      |
10719 #      V
10720 #     <VAR
10721 CLASS="REPLACEABLE"
10722 >something</VAR
10723 >tops
10724 #      |
10725 #      |
10726 #      V
10727 # APPLICATION/POSTSCRIPT
10728 #      |
10729 #      |
10730 #      V
10731 #     pstops
10732 #      |
10733 #      |
10734 #      V
10735 # APPLICATION/VND.CUPS-POSTSCRIPT
10736 #      |
10737 #      |
10738 #      V
10739 #     gsrip
10740 #      |  (= "postscipt interpreter")
10741 #      |
10742 #      V
10743 # APPLICATION/VND.CUPS-RASTER
10744 #      |
10745 #      |
10746 #      V
10747 #     rasterto<VAR
10748 CLASS="REPLACEABLE"
10749 >something</VAR
10750 >  (f.e. Gimp-Print filters may be plugged in here)
10751 #      |   (= "raster driver")
10752 #      |
10753 #      V
10754 # SOMETHING-DEVICE-SPECIFIC
10755 #      |
10756 #      |
10757 #      V
10758 #     backend
10759 #
10760 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
10761 #       CUPS and ESP PrintPro plug-in where rasterto<VAR
10762 CLASS="REPLACEABLE"
10763 >something</VAR
10764 > is noted.
10765 #
10766 #########################################################################</PRE
10767 ><PRE
10768 CLASS="PROGRAMLISTING"
10769 >#########################################################################
10770 #
10771 # This is how "cupsomatic" would come into play with ESP PrintPro:
10772 # ================================================================
10773 #
10774 #
10775 # <VAR
10776 CLASS="REPLACEABLE"
10777 >SOMETHNG</VAR
10778 >-FILEFORMAT
10779 #      |
10780 #      |
10781 #      V
10782 #    <VAR
10783 CLASS="REPLACEABLE"
10784 >something</VAR
10785 >tops
10786 #      |
10787 #      |
10788 #      V
10789 # APPLICATION/POSTSCRIPT
10790 #      |
10791 #      |
10792 #      V
10793 #    pstops
10794 #      |
10795 #      |
10796 #      V
10797 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
10798 #      |                                          |
10799 #      |                                          V
10800 #      V                                         cupsomatic
10801 #    gsrip                                       (constructs complicated
10802 #      |  (= "postscipt interpreter")            Ghostscript commandline
10803 #      |                                         to let the file be
10804 #      V                                         processed by a
10805 # APPLICATION/VND.CUPS-RASTER                    "-sDEVICE=<VAR
10806 CLASS="REPLACEABLE"
10807 >s.th.</VAR
10808 >"
10809 #      |                                         call...)
10810 #      |                                          |
10811 #      V                                          |
10812 #    rasterto<VAR
10813 CLASS="REPLACEABLE"
10814 >something</VAR
10815 >                          V
10816 #      |   (= "raster driver")      +-------------------------+
10817 #      |                            | Ghostscript at work.... |
10818 #      V                            |                         |
10819 # SOMETHING-DEVICE-SPECIFIC         *-------------------------+
10820 #      |                                          |
10821 #      |                                          |
10822 #      V                                          |
10823 #    backend &#62;------------------------------------+
10824 #      |
10825 #      |
10826 #      V
10827 #    THE PRINTER
10828 #
10829 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
10830 #       CUPS and ESP PrintPro plug-in where rasterto<VAR
10831 CLASS="REPLACEABLE"
10832 >something</VAR
10833 > is noted.
10834 #
10835 #########################################################################</PRE
10836 ><PRE
10837 CLASS="PROGRAMLISTING"
10838 >#########################################################################
10839 #
10840 # And this is how it works for CUPS from 1.1.15:
10841 # ==============================================
10842 #
10843 # <VAR
10844 CLASS="REPLACEABLE"
10845 >SOMETHNG</VAR
10846 >-FILEFORMAT
10847 #      |
10848 #      |
10849 #      V
10850 #     <VAR
10851 CLASS="REPLACEABLE"
10852 >something</VAR
10853 >tops
10854 #      |
10855 #      |
10856 #      V
10857 # APPLICATION/POSTSCRIPT
10858 #      |
10859 #      |
10860 #      V
10861 #     pstops
10862 #      |
10863 #      |
10864 #      V
10865 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
10866 #                                     |
10867 #                  +------------------v------------------------------+
10868 #                  | Ghostscript                                     |
10869 #                  | at work...                                      |
10870 #                  | (with                                           |
10871 #                  | "-sDEVICE=cups")                                |
10872 #                  |                                                 |
10873 #                  |         (= "postscipt interpreter")             |
10874 #                  |                                                 |
10875 #                  +------------------v------------------------------+
10876 #                                     |
10877 #                                     |
10878 # APPLICATION/VND.CUPS-RASTER &#62;-------+
10879 #      |
10880 #      |
10881 #      V
10882 #     rasterto<VAR
10883 CLASS="REPLACEABLE"
10884 >something</VAR
10885 >
10886 #      |   (= "raster driver")
10887 #      |
10888 #      V
10889 # SOMETHING-DEVICE-SPECIFIC
10890 #      |
10891 #      |
10892 #      V
10893 #     backend
10894 #
10895 #
10896 # NOTE: since version 1.1.15 CUPS "outsourced" the pstoraster process to
10897 #       Ghostscript. GNU Ghostscript needs to be patched to handle the
10898 #       CUPS requirement; ESP Ghostscript has this builtin. In any case,
10899 #       "gs -h" needs to show up a "cups" device. pstoraster is now a
10900 #       calling an appropriate "gs -sDEVICE=cups..." commandline to do
10901 #       the job. It will output "application/vnd.cup-raster", which will
10902 #       be finally processed by a CUPS raster driver "rasterto<VAR
10903 CLASS="REPLACEABLE"
10904 >something</VAR
10905 >"
10906 #       Note the difference to "cupsomatic", which will *not* output
10907 #       CUPS-raster, but a final version of the printfile, ready to be
10908 #       sent to the printer. cupsomatic also doesn't use the "cups"
10909 #       devicemode in Ghostscript, but one of the classical devicemodes....
10910 #
10911 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
10912 #       CUPS and ESP PrintPro plug-in where rasterto<VAR
10913 CLASS="REPLACEABLE"
10914 >something</VAR
10915 > is noted.
10916 #
10917 #########################################################################</PRE
10918 ><PRE
10919 CLASS="PROGRAMLISTING"
10920 >#########################################################################
10921 #
10922 # And this is how it works for CUPS from 1.1.15, with cupsomatic included:
10923 # ========================================================================
10924 #
10925 # <VAR
10926 CLASS="REPLACEABLE"
10927 >SOMETHNG</VAR
10928 >-FILEFORMAT
10929 #      |
10930 #      |
10931 #      V
10932 #     <VAR
10933 CLASS="REPLACEABLE"
10934 >something</VAR
10935 >tops
10936 #      |
10937 #      |
10938 #      V
10939 # APPLICATION/POSTSCRIPT
10940 #      |
10941 #      |
10942 #      V
10943 #     pstops
10944 #      |
10945 #      |
10946 #      V
10947 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
10948 #                                     |
10949 #                  +------------------v------------------------------+
10950 #                  | Ghostscript        . Ghostscript at work....    |
10951 #                  | at work...         . (with "-sDEVICE=           |
10952 #                  | (with              .            <VAR
10953 CLASS="REPLACEABLE"
10954 >s.th.</VAR
10955 >"        |
10956 #                  | "-sDEVICE=cups")   .                            |
10957 #                  |                    .                            |
10958 #                  | (CUPS standard)    .      (cupsomatic)          |
10959 #                  |                    .                            |
10960 #                  |          (= "postscript interpreter")           |
10961 #                  |                    .                            |
10962 #                  +------------------v--------------v---------------+
10963 #                                     |              |
10964 #                                     |              |
10965 # APPLICATION/VND.CUPS-RASTER &#62;-------+              |
10966 #      |                                             |
10967 #      |                                             |
10968 #      V                                             |
10969 #     rasterto<VAR
10970 CLASS="REPLACEABLE"
10971 >something</VAR
10972 >                            |
10973 #      |   (= "raster driver")                       |
10974 #      |                                             |
10975 #      V                                             |
10976 # SOMETHING-DEVICE-SPECIFIC &#62;------------------------+
10977 #      |
10978 #      |
10979 #      V
10980 #     backend
10981 #
10982 #
10983 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
10984 #       CUPS and ESP PrintPro plug-in where rasterto<VAR
10985 CLASS="REPLACEABLE"
10986 >something</VAR
10987 > is noted.
10988 #
10989 ##########################################################################</PRE
10990 ></DIV
10991 ><DIV
10992 CLASS="SECT1"
10993 ><HR><H2
10994 CLASS="SECT1"
10995 ><A
10996 NAME="AEN2083"
10997 >15.4. CUPS Print Drivers and Devices</A
10998 ></H2
10999 ><P
11000 >CUPS ships with good support for HP LaserJet type printers. You can install
11001 the driver as follows:
11002
11003 <P
11004 ></P
11005 ><UL
11006 ><LI
11007 ><P
11008 >       lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -m laserjet.ppd
11009         </P
11010 ></LI
11011 ></UL
11012 >
11013
11014 (The "-m" switch will retrieve the "laserjet.ppd" from the standard repository
11015 for not-yet-installed-PPDs, which CUPS typically stores in 
11016 <TT
11017 CLASS="FILENAME"
11018 >/usr/share/cups/model</TT
11019 >. Alternatively, you may use
11020 "-P /absolute/filesystem/path/to/where/there/is/PPD/your.ppd").</P
11021 ><DIV
11022 CLASS="SECT2"
11023 ><HR><H3
11024 CLASS="SECT2"
11025 ><A
11026 NAME="AEN2090"
11027 >15.4.1. Further printing steps</A
11028 ></H3
11029 ><P
11030 >Always also consult the database on linuxprinting.org for all recommendations
11031 about which driver is best used for each printer:</P
11032 ><P
11033 ><A
11034 HREF="http://www.linuxprinting.org/printer_list.cgi"
11035 TARGET="_top"
11036 >http://www.linuxprinting.org/printer_list.cgi</A
11037 ></P
11038 ><P
11039 >There select your model and click on "Show". You'll arrive at a page listing
11040 all drivers working with your model. There will always be *one* 
11041 <SPAN
11042 CLASS="emphasis"
11043 ><I
11044 CLASS="EMPHASIS"
11045 >recommended</I
11046 ></SPAN
11047 > one. Try this one first. In your case
11048 ("HP LaserJet 4 Plus"), you'll arrive here:</P
11049 ><P
11050 ><A
11051 HREF="http://www.linuxprinting.org/show_printer.cgi?recnum=75104"
11052 TARGET="_top"
11053 >http://www.linuxprinting.org/show_printer.cgi?recnum=75104</A
11054 ></P
11055 ><P
11056 >The recommended driver is "ljet4". It has a link to the page for the ljet4
11057 driver too:</P
11058 ><P
11059 ><A
11060 HREF="http://www.linuxprinting.org/show_driver.cgi?driver=ljet4"
11061 TARGET="_top"
11062 >http://www.linuxprinting.org/show_driver.cgi?driver=ljet4</A
11063 >&#13;</P
11064 ><P
11065 >On the driver's page, you'll find important and detailed info about how to use
11066 that driver within the various available spoolers. You can generate a PPD for
11067 CUPS. The PPD contains all the info about how to use your model and the driver;
11068 this is, once installed, working transparently for the user -- you'll only
11069 need to choose resolution, paper size etc. from the web-based menu or from
11070 the print dialog GUI or from the commandline...</P
11071 ><P
11072 >On the driver's page, choose to use the "PPD-O-Matic" online PPD generator
11073 program. Select your model and click "Generate PPD file". When you safe the
11074 appearing ASCII text file, don't use "cut'n'past" (as it could possiblly corrupt
11075 line endings and tabs), but use "Save as..." in your browser's menu. Save it
11076 at "/some/path/on/your/filesystem/somewhere/my-name-for-my-printer.ppd"</P
11077 ><P
11078 >Then install the printer:</P
11079 ><P
11080 ><PRE
11081 CLASS="PROGRAMLISTING"
11082 >    "lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -P /some/path/on/your/filesystem/somewhere/my-name-for-my-printer.ppd"</PRE
11083 ></P
11084 ><P
11085 >Note, that for all the "Foomatic-PPDs" from Linuxprinting.org, you also need
11086 a special "CUPS filter" named "cupsomatic". Get the latest version of
11087 "cupsomatic" from:</P
11088 ><P
11089 ><A
11090 HREF="http://www.linuxprinting.org/cupsomatic"
11091 TARGET="_top"
11092 >http://www.linuxprinting.org/cupsomatic</A
11093 ></P
11094 ><P
11095 >This needs to be copied to <TT
11096 CLASS="FILENAME"
11097 >/usr/lib/cups/filter/cupsomatic</TT
11098 >
11099 and be made world executable. This filter is needed to read and act upon the
11100 specially encoded Foomatic comments, embedded in the printfile, which in turn
11101 are used to construct (transparently for you, the user) the complicated
11102 ghostscript command line needed for your printer/driver combo.</P
11103 ><P
11104 >You can have a look at all the options for the Ghostscript commandline supported
11105 by your printer and the ljet4 driver by going to the section "Execution details",
11106 selecting your model (Laserjet 4 Plus) and clicking on "Show execution details".
11107 This will bring up this web page:</P
11108 ><P
11109 ><A
11110 HREF="http://www.linuxprinting.org/execution.cgi?driver=ljet4&printer=75104&.submit=Show+execution+details"
11111 TARGET="_top"
11112 >http://www.linuxprinting.org/execution.cgi?driver=ljet4&#38;printer=75104&#38;.submit=Show+execution+details</A
11113 ></P
11114 ><P
11115 >The ingenious thing is that the database is kept current. If there
11116 is a bug fix and an improvement somewhere in the database, you will
11117 always get the most current and stable and feature-rich driver by following
11118 the steps described above.</P
11119 ><DIV
11120 CLASS="NOTE"
11121 ><P
11122 ></P
11123 ><TABLE
11124 CLASS="NOTE"
11125 WIDTH="100%"
11126 BORDER="0"
11127 ><TR
11128 ><TD
11129 WIDTH="25"
11130 ALIGN="CENTER"
11131 VALIGN="TOP"
11132 ><IMG
11133 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
11134 HSPACE="5"
11135 ALT="Note"></TD
11136 ><TD
11137 ALIGN="LEFT"
11138 VALIGN="TOP"
11139 ><P
11140 >Till Kamppeter from MandrakeSoft is doing an excellent job here that too few
11141 people are aware of. (So if you use it often, please send him a note showing
11142 your appreciation).</P
11143 ></TD
11144 ></TR
11145 ></TABLE
11146 ></DIV
11147 ><P
11148 >The latest and greatest improvement now is support for "custom page sizes"
11149 for all those printers which support it.</P
11150 ><P
11151 >"cupsomatic" is documented here:</P
11152 ><P
11153 ><A
11154 HREF="http://www.linuxprinting.org/cups-doc.html"
11155 TARGET="_top"
11156 >http://www.linuxprinting.org/cups-doc.html</A
11157 ></P
11158 ><P
11159 >More printing tutorial info may be found here:</P
11160 ><P
11161 ><A
11162 HREF="http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/"
11163 TARGET="_top"
11164 >http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/</A
11165 ></P
11166 ><P
11167 >Note, that *all* the Foomatic drivers listed on Linuxprinting.org (now
11168 approaching the "all-time high" number of 1.000 for the supported models)
11169 are using a special filtering chain involving Ghostscript, as described
11170 in this document.</P
11171 ><P
11172 >Summary - You need:</P
11173 ><P
11174 ><P
11175 ></P
11176 ><TABLE
11177 BORDER="0"
11178 ><TBODY
11179 ><TR
11180 ><TD
11181 >A "foomatic+<VAR
11182 CLASS="REPLACEABLE"
11183 >something</VAR
11184 >" PPD is not enough to print with CUPS (but it is *one* important component)</TD
11185 ></TR
11186 ><TR
11187 ><TD
11188 >The "cupsomatic" filter script (Perl) in <TT
11189 CLASS="FILENAME"
11190 >/usr/lib/cups/filters/</TT
11191 ></TD
11192 ></TR
11193 ><TR
11194 ><TD
11195 >Perl to make cupsomatic run</TD
11196 ></TR
11197 ><TR
11198 ><TD
11199 >Ghostscript (because it is called and controlled by the PPD/cupsomatic combo in a way to fit your printermodel/driver combo.</TD
11200 ></TR
11201 ><TR
11202 ><TD
11203 >Ghostscript *must*, depending on the driver/model, contain support for a certain "device" (as shown by "gs -h")</TD
11204 ></TR
11205 ></TBODY
11206 ></TABLE
11207 ><P
11208 ></P
11209 >&#13;</P
11210 ><P
11211 >In the case of the "hpijs" driver, you need a Ghostscript version, which
11212 has "ijs" amongst its supported devices in "gs -h". In the case of
11213 "hpijs+foomatic", a valid ghostscript commandline would be reading like this:</P
11214 ><P
11215 ><PRE
11216 CLASS="PROGRAMLISTING"
11217 >       gs -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ijs       \
11218              -sIjsServer=hpijs<VAR
11219 CLASS="REPLACEABLE"
11220 >PageSize</VAR
11221 > -dDuplex=<VAR
11222 CLASS="REPLACEABLE"
11223 >Duplex</VAR
11224 > <VAR
11225 CLASS="REPLACEABLE"
11226 >Model</VAR
11227 >        \
11228              -r<VAR
11229 CLASS="REPLACEABLE"
11230 >Resolution</VAR
11231 >,PS:MediaPosition=<VAR
11232 CLASS="REPLACEABLE"
11233 >InputSlot</VAR
11234 > -dIjsUseOutputFD \
11235              -sOutputFile=- -</PRE
11236 ></P
11237 ><DIV
11238 CLASS="NOTE"
11239 ><P
11240 ></P
11241 ><TABLE
11242 CLASS="NOTE"
11243 WIDTH="100%"
11244 BORDER="0"
11245 ><TR
11246 ><TD
11247 WIDTH="25"
11248 ALIGN="CENTER"
11249 VALIGN="TOP"
11250 ><IMG
11251 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
11252 HSPACE="5"
11253 ALT="Note"></TD
11254 ><TD
11255 ALIGN="LEFT"
11256 VALIGN="TOP"
11257 ><P
11258 >Note, that with CUPS and the "hpijs+foomatic" PPD (plus Perl and cupsomatic)
11259 you don't need to remember this. You can choose the available print options
11260 thru a GUI print command (like "glp" from ESP's commercially supported
11261 PrintPro software, or KDE's "kprinter", or GNOME's "gtklp" or the independent
11262 "xpp") or the CUPS web interface via human-readable drop-down selection
11263 menus.</P
11264 ></TD
11265 ></TR
11266 ></TABLE
11267 ></DIV
11268 ><P
11269 >If you use "ESP Ghostscript" (also under the GPL, provided by Easy Software
11270 Products, the makers of CUPS, downloadable from
11271 <A
11272 HREF="http://www.cups.org/software.html"
11273 TARGET="_top"
11274 >http://www.cups.org/software.html</A
11275 >,
11276 co-maintained by the developers of linuxprinting.org), you are guaranteed to
11277 have in use the most uptodate, bug-fixed, enhanced and stable version of a Free
11278 Ghostscript. It contains support for ~300 devices, whereas plain vanilla
11279 GNU Ghostscript 7.05 only has ~200.</P
11280 ><P
11281 >If you print only one CUPS test page, from the web interface and when you try to
11282 print a windows test page, it acts like the job was never sent:
11283
11284 <P
11285 ></P
11286 ><TABLE
11287 BORDER="0"
11288 ><TBODY
11289 ><TR
11290 ><TD
11291 >Can you print "standard" jobs from the CUPS machine?</TD
11292 ></TR
11293 ><TR
11294 ><TD
11295 >Are the jobs from Windows visible in the Web interface on CUPS (http://localhost:631/)?</TD
11296 ></TR
11297 ><TR
11298 ><TD
11299 ><SPAN
11300 CLASS="emphasis"
11301 ><I
11302 CLASS="EMPHASIS"
11303 >Most important:</I
11304 ></SPAN
11305 > What kind of printer driver are you using on the Windows clients?</TD
11306 ></TR
11307 ></TBODY
11308 ></TABLE
11309 ><P
11310 ></P
11311 >
11312
11313 You can try to get a more detailed debugging info by setting "LogLevel debug" in
11314 <TT
11315 CLASS="FILENAME"
11316 >/etc/cups/cupsd.conf</TT
11317 >, re-start cupsd and investigate <TT
11318 CLASS="FILENAME"
11319 >/var/log/cups/error_log</TT
11320 >
11321 for the whereabouts of your Windows-originating printjobs:</P
11322 ><P
11323 ></P
11324 ><TABLE
11325 BORDER="0"
11326 ><TBODY
11327 ><TR
11328 ><TD
11329 >what does the "auto-typing" line say? which is the "MIME type" CUPS thinks is arriving from the Windows clients?</TD
11330 ></TR
11331 ><TR
11332 ><TD
11333 >are there "filter" available for this MIME type?</TD
11334 ></TR
11335 ><TR
11336 ><TD
11337 >are there "filter rules" defined in "/etc/cups/mime.convs" for this MIME type?</TD
11338 ></TR
11339 ></TBODY
11340 ></TABLE
11341 ><P
11342 ></P
11343 ></DIV
11344 ></DIV
11345 ><DIV
11346 CLASS="SECT1"
11347 ><HR><H2
11348 CLASS="SECT1"
11349 ><A
11350 NAME="AEN2160"
11351 >15.5. Limiting the number of pages users can print</A
11352 ></H2
11353 ><P
11354 >The feature you want is dependent on the real print subsystem you're using.
11355 Samba's part is always to receive the job files from the clients (filtered
11356 *or* unfiltered) and hand it over to this printing subsystem.</P
11357 ><P
11358 >Of course one could "hack" things with one's own scripts.</P
11359 ><P
11360 >But there is CUPS (Common Unix Printing System). CUPS supports "quotas".
11361 Quotas can be based on sizes of jobs or on the number of pages or both,
11362 and are spanning any time period you want.</P
11363 ><P
11364 >This is an example command how root would set a print quota in CUPS,
11365 assuming an existing printer named "quotaprinter":</P
11366 ><PRE
11367 CLASS="PROGRAMLISTING"
11368 >  lpadmin -p quotaprinter -o job-quota-period=604800 -o job-k-limit=1024 -o job-page-limit=100</PRE
11369 ><P
11370 >This would limit every single user to print 100 pages or 1024 KB of
11371 data (whichever comes first) within the last 604.800 seconds ( = 1 week).</P
11372 ><P
11373 >For CUPS to count correctly, the printfile needs to pass the CUPS "pstops" filter,
11374 otherwise it uses a "dummy" count of "1". Some printfiles don't pass it
11375 (eg: image files) but then those are mostly 1 page jobs anyway. This also means,
11376 proprietary drivers for the target printer running on the client computers and
11377 CUPS/Samba then spooling these files as "raw" (i.e. leaving them untouched, not
11378 filtering them), will be counted as "1-pagers" too!</P
11379 ><P
11380 >You need to send PostScript from the clients (i.e. run a PostScript driver there)
11381 for having the chance to get accounting done. If the printer is a non-PostScript model,
11382 you need to let CUPS do the job to convert the file to a print-ready format for the
11383 target printer. This will be working for currently ~1.000 different printer models, see</P
11384 ><PRE
11385 CLASS="PROGRAMLISTING"
11386 >     http://www.linuxprinting.org/printer_list.cgi</PRE
11387 ><P
11388 >Before CUPS-1.1.16 your only option was to use the Adobe PostScript
11389 Driver on the Windows clients. The output of this driver was not always
11390 passed thru the "pstops" filter on the CUPS/Samba side, and therefor was
11391 not counted correctly (the reason is that it often --- depending on the
11392 "PPD" being used --- did write a "PJL"-header in front of the real
11393 PostScript which made CUPS to skip the pstops and go directy to
11394 the "pstoraster" stage).</P
11395 ><P
11396 >From CUPS-1.1.16 onward you can use the "CUPS PostScript Driver
11397 for Windows NT/2K/XP clients" (it is tagged in the download area of
11398 http://www.cups.org/ as the "cups-samba-1.1.16.tar.gz" package).
11399 It is *not* working for Win9x/ME clients. But it:</P
11400 ><P
11401 ></P
11402 ><TABLE
11403 BORDER="0"
11404 ><TBODY
11405 ><TR
11406 ><TD
11407 >&#62;it guarantees to not write an PJL-header</TD
11408 ></TR
11409 ><TR
11410 ><TD
11411 >it guarantees to still read and support all PJL-options named in the driver PPD with its own means</TD
11412 ></TR
11413 ><TR
11414 ><TD
11415 >it guarantees the file going thru the "pstops" filter on the CUPS/Samba server</TD
11416 ></TR
11417 ><TR
11418 ><TD
11419 >it guarantees to page-count correctly the printfile</TD
11420 ></TR
11421 ></TBODY
11422 ></TABLE
11423 ><P
11424 ></P
11425 ><P
11426 >You can read more about the setup of this combination in the
11427 manpage for "cupsaddsmb" (only present with CUPS installed, only
11428 current with CUPS 1.1.16).</P
11429 ><P
11430 >These are the items CUPS logs in the "page_log" for every single *page* of a job:</P
11431 ><P
11432 ><PRE
11433 CLASS="PROGRAMLISTING"
11434 >       * Printer name
11435         * User name
11436         * Job ID
11437         * Time of printing
11438         * the page number
11439         * the number of copies
11440         * a billing info string (optional)</PRE
11441 ></P
11442 ><P
11443 >Here is an extract of my CUPS server's page_log file to illustrate
11444 the format and included items:</P
11445 ><P
11446 ><PRE
11447 CLASS="PROGRAMLISTING"
11448 >       infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 1 2  #marketing
11449         infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 2 2  #marketing
11450         infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 3 2  #marketing
11451         infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 4 2  #marketing
11452         infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 5 2  #marketing
11453         infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 6 2  #marketing</PRE
11454 ></P
11455 ><P
11456 >This was Job ID "40", printed on "infotec_IS2027" by user "kurt", a 6-page job
11457 printed in 2 copies and billed to "#marketing"...</P
11458 ><P
11459 >What flaws or shortcomings are there?</P
11460 ><P
11461 ></P
11462 ><TABLE
11463 BORDER="0"
11464 ><TBODY
11465 ><TR
11466 ><TD
11467 >the ones named above</TD
11468 ></TR
11469 ><TR
11470 ><TD
11471 >       CUPS really counts the job pages being *processsed in software*
11472         (going thru the "RIP") rather than the physical sheets successfully
11473         leaving the printing device -- if there is a jam while printing
11474         the 5th sheet out of 1000 and the job is aborted by the printer,
11475         the "page count" will still show the figure of 1000 for that job
11476         </TD
11477 ></TR
11478 ><TR
11479 ><TD
11480 >       all quotas are the same for all users (no flexibility to give the
11481         boss a higher quota than the clerk) no support for groups
11482         </TD
11483 ></TR
11484 ><TR
11485 ><TD
11486 >       no means to read out the current balance or "used-up" number of current quota
11487         </TD
11488 ></TR
11489 ><TR
11490 ><TD
11491 >       a user having used up 99 sheets of 100 quota will still be able to send and print a 1.000 sheet job
11492         </TD
11493 ></TR
11494 ><TR
11495 ><TD
11496 >       a user being denied a job because of a filled-up quota doesn't get a meaningful
11497         error message from CUPS other than "client-error-not-possible".
11498         </TD
11499 ></TR
11500 ></TBODY
11501 ></TABLE
11502 ><P
11503 ></P
11504 ><P
11505 >But this is the best system out there currently. And there are
11506 huge improvements under development:</P
11507 ><P
11508 ></P
11509 ><TABLE
11510 BORDER="0"
11511 ><TBODY
11512 ><TR
11513 ><TD
11514 >page counting will go into the "backends" (these talk
11515         directly to the printer and will increase the count in sync with the
11516          actual printing process  -- a jam at the 5th sheet will lead to a stop in the counting)</TD
11517 ></TR
11518 ><TR
11519 ><TD
11520 >quotas will be handled more flexibly</TD
11521 ></TR
11522 ><TR
11523 ><TD
11524 >probably there will be support for users to inquire their "accounts" in advance</TD
11525 ></TR
11526 ><TR
11527 ><TD
11528 >probably there will be support for some other tools around this topic</TD
11529 ></TR
11530 ></TBODY
11531 ></TABLE
11532 ><P
11533 ></P
11534 ><P
11535 >Other than the current stage of the CUPS development, I don't
11536 know any other ready-to-use tool which you could consider.</P
11537 ><P
11538 >You can download the driver files from
11539 <A
11540 HREF="http://www.cups.org/software.html"
11541 TARGET="_top"
11542 >http://www.cups.org/software.html</A
11543 >.
11544 It is a separate package from the CUPS base software files, tagged as "CUPS 1.1.16
11545 Windows NT/2k/XP Printer Driver for SAMBA (tar.gz, 192k)". The filename to
11546 download is "cups-samba-1.1.16.tar.gz". Upon untar-/unzip-ping it will reveal
11547 the files:</P
11548 ><P
11549 ><PRE
11550 CLASS="PROGRAMLISTING"
11551 >   cups-samba.install
11552    cups-samba.license
11553    cups-samba.readme
11554    cups-samba.remove
11555    cups-samba.ss</PRE
11556 ></P
11557 ><P
11558 >These have been packaged with the ESP meta packager software "EPM". The
11559 *.install and *.remove files are simple shell script, which untars the
11560 *.ss (which is nothing else than a tar-archive) and puts its contents
11561 into <TT
11562 CLASS="FILENAME"
11563 >/usr/share/cups/drivers/</TT
11564 >. Its contents are 3 files:</P
11565 ><P
11566 ><PRE
11567 CLASS="PROGRAMLISTING"
11568 >   cupsdrvr.dll
11569    cupsui.dll
11570    cups.hlp</PRE
11571 ></P
11572 ><DIV
11573 CLASS="NOTE"
11574 ><P
11575 ></P
11576 ><TABLE
11577 CLASS="NOTE"
11578 WIDTH="100%"
11579 BORDER="0"
11580 ><TR
11581 ><TD
11582 WIDTH="25"
11583 ALIGN="CENTER"
11584 VALIGN="TOP"
11585 ><IMG
11586 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
11587 HSPACE="5"
11588 ALT="Note"></TD
11589 ><TD
11590 ALIGN="LEFT"
11591 VALIGN="TOP"
11592 ><P
11593 >ATTENTION: due to a bug one CUPS release puts the <TT
11594 CLASS="FILENAME"
11595 >cups.hlp</TT
11596 >
11597 into <TT
11598 CLASS="FILENAME"
11599 >/usr/share/drivers/</TT
11600 > instead of
11601 <TT
11602 CLASS="FILENAME"
11603 >/usr/share/cups/drivers/</TT
11604 >. To work around this, copy/move
11605 the file after running the "./cups-samba.install" script manually to the right place:</P
11606 ><P
11607 ><PRE
11608 CLASS="PROGRAMLISTING"
11609 >      cp /usr/share/drivers/cups.hlp /usr/share/cups/drivers/</PRE
11610 ></P
11611 ></TD
11612 ></TR
11613 ></TABLE
11614 ></DIV
11615 ><DIV
11616 CLASS="NOTE"
11617 ><P
11618 ></P
11619 ><TABLE
11620 CLASS="NOTE"
11621 WIDTH="100%"
11622 BORDER="0"
11623 ><TR
11624 ><TD
11625 WIDTH="25"
11626 ALIGN="CENTER"
11627 VALIGN="TOP"
11628 ><IMG
11629 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
11630 HSPACE="5"
11631 ALT="Note"></TD
11632 ><TD
11633 ALIGN="LEFT"
11634 VALIGN="TOP"
11635 ><P
11636 >This new CUPS PostScript driver is currently binary-only, but free
11637 no source code is provided (yet). The reason is this: it has
11638 been developed with the help of the Microsoft Driver Developer Kit (DDK)
11639 and compiled with Microsoft Visual Studio 6. It is not clear to the driver
11640 developers if they are allowed to distribute the whole of the source code
11641 as Free Software. However, they will likely release the "diff" in source
11642 code under the GPL, so anybody with a license of Visual Studio and a DDK
11643 will be able to compile for him/herself.</P
11644 ><P
11645 >Once you have run the install script (and possibly manually moved the
11646 "cups.hlp" file to "/usr/share/cups/drivers/"), the driver is ready to be
11647 put into Samba's [print$] share (which often maps to "/etc/samba/drivers/"
11648 and contains a subdir tree with WIN40 and W32X86 branches), by running
11649 "cupsaddsmb" (see also "man cupsaddsmb" for CUPS 1.1.16). [Don't forget to
11650 put root into the smbpasswd file by running "smbpasswd" should you run
11651 this whole procedure for the first time.] Once the driver files are in the
11652 [print$] share, they are ready to be downloaded and installed by the
11653 Win NT/2k/XP clients.</P
11654 ></TD
11655 ></TR
11656 ></TABLE
11657 ></DIV
11658 ><DIV
11659 CLASS="NOTE"
11660 ><P
11661 ></P
11662 ><TABLE
11663 CLASS="NOTE"
11664 WIDTH="100%"
11665 BORDER="0"
11666 ><TR
11667 ><TD
11668 WIDTH="25"
11669 ALIGN="CENTER"
11670 VALIGN="TOP"
11671 ><IMG
11672 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
11673 HSPACE="5"
11674 ALT="Note"></TD
11675 ><TD
11676 ALIGN="LEFT"
11677 VALIGN="TOP"
11678 ><P
11679 >NOTE 1: Win 9x/ME clients won't work with this driver. For these you'd
11680 still need to use the ADOBE*.* drivers as previously.</P
11681 ></TD
11682 ></TR
11683 ></TABLE
11684 ></DIV
11685 ><DIV
11686 CLASS="NOTE"
11687 ><P
11688 ></P
11689 ><TABLE
11690 CLASS="NOTE"
11691 WIDTH="100%"
11692 BORDER="0"
11693 ><TR
11694 ><TD
11695 WIDTH="25"
11696 ALIGN="CENTER"
11697 VALIGN="TOP"
11698 ><IMG
11699 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
11700 HSPACE="5"
11701 ALT="Note"></TD
11702 ><TD
11703 ALIGN="LEFT"
11704 VALIGN="TOP"
11705 ><P
11706 >NOTE 2: It is not harming if you've still the ADOBE*.* driver files from
11707 previous installations in the "/usr/share/cups/drivers/" directory.
11708 The new cupsaddsmb (from 1.1.16) will automatically use the
11709 "newest" installed driver (which here then is the CUPS drivers).</P
11710 ></TD
11711 ></TR
11712 ></TABLE
11713 ></DIV
11714 ><DIV
11715 CLASS="NOTE"
11716 ><P
11717 ></P
11718 ><TABLE
11719 CLASS="NOTE"
11720 WIDTH="100%"
11721 BORDER="0"
11722 ><TR
11723 ><TD
11724 WIDTH="25"
11725 ALIGN="CENTER"
11726 VALIGN="TOP"
11727 ><IMG
11728 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
11729 HSPACE="5"
11730 ALT="Note"></TD
11731 ><TD
11732 ALIGN="LEFT"
11733 VALIGN="TOP"
11734 ><P
11735 >NOTE 3: Should your Win clients have had the old ADOBE*.* files and the
11736 Adobe PostScript drivers installed, the download and installation
11737 of the new CUPS PostScript driver for Windows NT/2k/XP will fail
11738 at first.</P
11739 ><P
11740 >It is not enough to "delete" the printer (as the driver files
11741 will still be kept by the clients and re-used if you try to
11742 re-install the printer). To really get rid of the Adobe driver
11743 files on the clients, open the "Printers" folder (possibly via
11744 "Start --&#62; Settings --&#62; Control Panel --&#62; Printers"), right-click
11745 onto the folder background and select "Server Properties". A
11746 new dialog opens; select the "Drivers" tab; on the list select
11747 the driver you want to delete and click on the "Delete" button.
11748 (This will only work if there is no single printer left which
11749 uses that particular driver -- you need to "delete" all printers
11750 using this driver in the "Printers" folder first.)</P
11751 ></TD
11752 ></TR
11753 ></TABLE
11754 ></DIV
11755 ><DIV
11756 CLASS="NOTE"
11757 ><P
11758 ></P
11759 ><TABLE
11760 CLASS="NOTE"
11761 WIDTH="100%"
11762 BORDER="0"
11763 ><TR
11764 ><TD
11765 WIDTH="25"
11766 ALIGN="CENTER"
11767 VALIGN="TOP"
11768 ><IMG
11769 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
11770 HSPACE="5"
11771 ALT="Note"></TD
11772 ><TD
11773 ALIGN="LEFT"
11774 VALIGN="TOP"
11775 ><P
11776 >Once you have successfully downloaded the CUPS PostScript driver
11777 to a client, you can easily switch all printers to this one
11778 by proceeding as described elsewhere in the "Samba HOWTO
11779 Collection" to change a driver for an existing printer.</P
11780 ></TD
11781 ></TR
11782 ></TABLE
11783 ></DIV
11784 ><P
11785 >What are the benefits with the "CUPS PostScript driver for Windows NT/2k/XP"
11786 as compared to the Adobe drivers?</P
11787 ><P
11788 ><P
11789 ></P
11790 ><UL
11791 ><LI
11792 ><P
11793 >       no hassle with the Adobe EULA
11794         </P
11795 ></LI
11796 ><LI
11797 ><P
11798 >       no hassle with the question "where do I get the ADOBE*.* driver files from?"
11799         </P
11800 ></LI
11801 ><LI
11802 ><P
11803 >       the Adobe drivers (depending on the printer PPD associated with them)
11804         often put a PJL header in front of the core PostScript part of the print
11805         file (thus the file starts with "<VAR
11806 CLASS="REPLACEABLE"
11807 >1B</VAR
11808 >%-12345X" or "<VAR
11809 CLASS="REPLACEABLE"
11810 >escape</VAR
11811 >%-12345X"
11812         instead of "%!PS"). This leads to the CUPS daemon autotyping the
11813         arriving file as a print-ready file, not requiring a pass thru the
11814         "pstops" filter (to speak more technical, it is not regarded as the
11815         generic MIME type "application/postscript", but as the more special
11816         MIME type "application/cups.vnd-postscript"), which therefore also
11817         leads to the page accounting in "/var/log/cups/page_log" not receiving
11818         the exact mumber of pages; instead the dummy page number of "1" is
11819         logged in a standard setup)
11820         </P
11821 ></LI
11822 ><LI
11823 ><P
11824 >       the Adobe driver has more options to "mis-configure" the PostScript
11825         generated by it (like setting it inadvertedly to "Optimize for Speed",
11826         instead of "Optimize for Portability", which could lead to CUPS being
11827         unable to process it)
11828         </P
11829 ></LI
11830 ><LI
11831 ><P
11832 >       the CUPS PostScript driver output sent by Windows clients to the CUPS
11833         server will be guaranteed to be auto-typed as generic MIME type
11834         "application/postscript", thusly passing thru the CUPS "pstops" filter
11835         and logging the correct number of pages in the page_log for accounting
11836         and quota purposes
11837         </P
11838 ></LI
11839 ><LI
11840 ><P
11841 >       the CUPS PostScript driver supports the sending of additional print
11842         options by the Win NT/2k/XP clients, such as naming the CUPS standard
11843         banner pages (or the custom ones, should they be installed at the time
11844         of driver download), using the CUPS "page-label" option, setting a
11845         job-priority and setting the scheduled time of printing (with the option
11846         to support additional useful IPP job attributes in the future).
11847         </P
11848 ></LI
11849 ><LI
11850 ><P
11851 >       the CUPS PostScript driver supports the inclusion of the new
11852         "*cupsJobTicket" comments at the beginnig of the PostScript file (which
11853         could be used in the future for all sort of beneficial extensions on
11854         the CUPS side, but which will not disturb any other application as those
11855         will regard it as a comment and simply ignore it).
11856         </P
11857 ></LI
11858 ><LI
11859 ><P
11860 >       the CUPS PostScript driver will be the heart of the fully fledged CUPS
11861         IPP client for Windows NT/2k/XP to be released soon (probably alongside
11862         the first Beta release for CUPS 1.2).
11863         </P
11864 ></LI
11865 ></UL
11866 ></P
11867 ></DIV
11868 ><DIV
11869 CLASS="SECT1"
11870 ><HR><H2
11871 CLASS="SECT1"
11872 ><A
11873 NAME="AEN2249"
11874 >15.6. Advanced Postscript Printing from MS Windows</A
11875 ></H2
11876 ><P
11877 >Let the Windows Clients use a PostScript driver to deliver poistscript to
11878 the samba print server (just like any Linux or Unix Client would also use
11879 PostScript to send to the server)</P
11880 ><P
11881 >Make the Unix printing subsystem to which Samba sends the job convert the
11882 incoming PostScript files to the native print format of the target printers
11883 (would be PCL if you have an HP printer)</P
11884 ><P
11885 >Now if you are afraid that this would just mean using a *Generic* PostScript
11886 driver for the clients that has no Simplex/Duplex selection, and no paper tray
11887 choice, but you need them to be able to set up print jobs, with all the bells
11888 and whistles of your printers:-</P
11889 ><P
11890 ></P
11891 ><TABLE
11892 BORDER="0"
11893 ><TBODY
11894 ><TR
11895 ><TD
11896 >Not possible with traditional spooling systems</TD
11897 ></TR
11898 ><TR
11899 ><TD
11900 >       But perfectly supported by CUPS (which uses "PPD" files to
11901         describe how to control the print options for PostScript and
11902         non-PostScript devices alike...
11903         </TD
11904 ></TR
11905 ></TBODY
11906 ></TABLE
11907 ><P
11908 ></P
11909 ><P
11910 >CUPS PPDs are working perfectly on Windows clients who use Adobe PostScript
11911 drivers (or the new CUPS PostScript driver for Windows NT/2K/XP). Clients can use
11912 them to setup the job to their liking and CUPS will use the received job options
11913 to make the (PCL-, ESC/P- or PostScript-) printer behave as required.</P
11914 ><P
11915 >If you want to have the additional benefit of page count logging and accounting
11916 then the CUPS PostScript driver is the best choice (better than the Adobe one).</P
11917 ><P
11918 >If you want to make the drivers downloadable for the clients then "cupsaddsmb" is
11919 your friend. It will setup the [print$] share on the Samba host to be ready to serve
11920 the clients for a "point and print" driver installation.</P
11921 ><DIV
11922 CLASS="WARNING"
11923 ><P
11924 ></P
11925 ><TABLE
11926 CLASS="WARNING"
11927 WIDTH="100%"
11928 BORDER="0"
11929 ><TR
11930 ><TD
11931 WIDTH="25"
11932 ALIGN="CENTER"
11933 VALIGN="TOP"
11934 ><IMG
11935 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
11936 HSPACE="5"
11937 ALT="Warning"></TD
11938 ><TD
11939 ALIGN="LEFT"
11940 VALIGN="TOP"
11941 ><P
11942 >What strings are attached?</P
11943 ></TD
11944 ></TR
11945 ></TABLE
11946 ></DIV
11947 ><P
11948 >There are some. But, given the sheer CPU power you can buy nowadays,
11949 these can be overcome easily. The strings:</P
11950 ><P
11951 >Well, if the CUPS/Samba side will have to print to many printers serving many users,
11952 you probably will need to set up a second server (which can do automatic load balancing
11953 with the first one, plus a degree of fail-over mechanism). Converting the incoming
11954 PostScript jobs, "interpreting" them for non-PostScript printers, amounts to the work
11955 of a "RIP" (Raster Image Processor) done in software. This requires more CPU and RAM
11956 than for the mere "raw spooling" task your current setup is solving. It all depends
11957 on the avarage and peak printing load the server should be able to handle.</P
11958 ></DIV
11959 ><DIV
11960 CLASS="SECT1"
11961 ><HR><H2
11962 CLASS="SECT1"
11963 ><A
11964 NAME="AEN2264"
11965 >15.7. Auto-Deletion of CUPS spool files</A
11966 ></H2
11967 ><P
11968 >Samba print files pass thru two "spool" directories. One the incoming directory
11969 managed by Samba, (set eg: in the "path = /var/spool/samba" directive in the [printers]
11970 section of "smb.conf"). Second is the spool directory of your UNIX print subsystem.
11971 For CUPS it is normally "/var/spool/cups/", as set by the cupsd.conf directive
11972 "RequestRoot /var/spool/cups".</P
11973 ><P
11974 >I am not sure, which one of your directories keeps the files.  From what you say,
11975 it is most likely the Samba part.</P
11976 ><P
11977 >For the CUPS part, you may want to consult:</P
11978 ><PRE
11979 CLASS="PROGRAMLISTING"
11980 >   http://localhost:631/sam.html#PreserveJobFiles and
11981    http://localhost:631/sam.html#PreserveJobHistory and
11982    http://localhost:631/sam.html#MaxJobs</PRE
11983 ><P
11984 >There are the settings described for your CUPS daemon, which could lead to completed
11985 job files not being deleted.</P
11986 ><P
11987 >"PreserveJobHistory Yes" -- keeps some details of jobs in
11988 cupsd's mind (well it keeps the "c12345", "c12346" etc. files
11989 in the CUPS spool directory, which do a similar job as the
11990 old-fashioned BSD-LPD control files). This is set to "Yes"
11991 as a default.</P
11992 ><P
11993 >"PreserveJobFiles Yes" -- keeps the job files themselves in
11994 cupsd's mind (well it keeps the "d12345", "d12346" etc. files
11995 in the CUPS spool directory...). This is set to "No" as the
11996 CUPS default.</P
11997 ><P
11998 >"MaxJobs 500" -- this directive controls the maximum number
11999 of jobs that are kept in memory. Once the number of jobs
12000 reaches the limit, the oldest completed job is automatically
12001 purged from the system to make room for the new one. If all
12002 of the known jobs are still pending or active then the new
12003 job will be rejected. Setting the maximum to 0 disables this
12004 functionality. The default setting is 0.</P
12005 ><P
12006 >(There are also additional settings for "MaxJobsPerUser" and
12007 "MaxJobsPerPrinter"...)</P
12008 ><P
12009 >For everything to work as announced, you need to have three things:</P
12010 ><P
12011 ></P
12012 ><TABLE
12013 BORDER="0"
12014 ><TBODY
12015 ><TR
12016 ><TD
12017 >       a Samba-smbd which is compiled against "libcups" (Check on Linux by running "ldd `which smbd`")
12018         </TD
12019 ></TR
12020 ><TR
12021 ><TD
12022 >       a Samba-smb.conf setting of "printing = cups"
12023         </TD
12024 ></TR
12025 ><TR
12026 ><TD
12027 >       another Samba-smb.conf setting of "printcap = cups"
12028         </TD
12029 ></TR
12030 ></TBODY
12031 ></TABLE
12032 ><P
12033 ></P
12034 ><DIV
12035 CLASS="NOTE"
12036 ><P
12037 ></P
12038 ><TABLE
12039 CLASS="NOTE"
12040 WIDTH="100%"
12041 BORDER="0"
12042 ><TR
12043 ><TD
12044 WIDTH="25"
12045 ALIGN="CENTER"
12046 VALIGN="TOP"
12047 ><IMG
12048 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
12049 HSPACE="5"
12050 ALT="Note"></TD
12051 ><TD
12052 ALIGN="LEFT"
12053 VALIGN="TOP"
12054 ><P
12055 >Note, that in this case all other manually set printing-related
12056 commands (like "print command", "lpq command", "lprm command",
12057 "lppause command" or "lpresume command") are ignored and they
12058 should normally have no influence what-so-ever on your printing.</P
12059 ></TD
12060 ></TR
12061 ></TABLE
12062 ></DIV
12063 ><P
12064 >If you want to do things manually, replace the "printing = cups"
12065 by "printing = bsd". Then your manually set commands may work
12066 (haven't tested this), and a "print command = lp -d %P %s; rm %s"
12067 may do what you need.</P
12068 ><P
12069 >You forgot to mention the CUPS version you're using. If you did
12070 set things up as described in the man pages, then the Samba
12071 spool files should be deleted. Otherwise it may be a bug. On
12072 the CUPS side, you can control the behaviour as described
12073 above.</P
12074 ><P
12075 >If you have more problems, post the output of these commands:</P
12076 ><P
12077 ><PRE
12078 CLASS="PROGRAMLISTING"
12079 >   grep -v ^# /etc/cups/cupsd.conf | grep -v ^$
12080    grep -v ^# /etc/samba/smb.conf | grep -v ^$ | grep -v "^;"</PRE
12081 ></P
12082 ><P
12083 >(adapt paths as needed). These commands sanitize the files
12084 and cut out the empty lines and lines with comments, providing
12085 the "naked settings" in a compact way.</P
12086 ></DIV
12087 ></DIV
12088 ><DIV
12089 CLASS="CHAPTER"
12090 ><HR><H1
12091 ><A
12092 NAME="WINBIND"
12093 ></A
12094 >Chapter 16. Unified Logons between Windows NT and UNIX using Winbind</H1
12095 ><DIV
12096 CLASS="SECT1"
12097 ><H2
12098 CLASS="SECT1"
12099 ><A
12100 NAME="AEN2326"
12101 >16.1. Abstract</A
12102 ></H2
12103 ><P
12104 >Integration of UNIX and Microsoft Windows NT through 
12105         a unified logon has been considered a "holy grail" in heterogeneous 
12106         computing environments for a long time. We present 
12107         <SPAN
12108 CLASS="emphasis"
12109 ><I
12110 CLASS="EMPHASIS"
12111 >winbind</I
12112 ></SPAN
12113 >, a component of the Samba suite 
12114         of programs as a solution to the unified logon problem. Winbind 
12115         uses a UNIX implementation 
12116         of Microsoft RPC calls, Pluggable Authentication Modules, and the Name 
12117         Service Switch to allow Windows NT domain users to appear and operate 
12118         as UNIX users on a UNIX machine. This paper describes the winbind 
12119         system, explaining the functionality it provides, how it is configured, 
12120         and how it works internally.</P
12121 ></DIV
12122 ><DIV
12123 CLASS="SECT1"
12124 ><HR><H2
12125 CLASS="SECT1"
12126 ><A
12127 NAME="AEN2330"
12128 >16.2. Introduction</A
12129 ></H2
12130 ><P
12131 >It is well known that UNIX and Microsoft Windows NT have 
12132         different models for representing user and group information and 
12133         use different technologies for implementing them. This fact has 
12134         made it difficult to integrate the two systems in a satisfactory 
12135         manner.</P
12136 ><P
12137 >One common solution in use today has been to create 
12138         identically named user accounts on both the UNIX and Windows systems 
12139         and use the Samba suite of programs to provide file and print services 
12140         between the two. This solution is far from perfect however, as 
12141         adding and deleting users on both sets of machines becomes a chore 
12142         and two sets of passwords are required both of which
12143         can lead to synchronization problems between the UNIX and Windows 
12144         systems and confusion for users.</P
12145 ><P
12146 >We divide the unified logon problem for UNIX machines into 
12147         three smaller problems:</P
12148 ><P
12149 ></P
12150 ><UL
12151 ><LI
12152 ><P
12153 >Obtaining Windows NT user and group information
12154                 </P
12155 ></LI
12156 ><LI
12157 ><P
12158 >Authenticating Windows NT users
12159                 </P
12160 ></LI
12161 ><LI
12162 ><P
12163 >Password changing for Windows NT users
12164                 </P
12165 ></LI
12166 ></UL
12167 ><P
12168 >Ideally, a prospective solution to the unified logon problem 
12169         would satisfy all the above components without duplication of 
12170         information on the UNIX machines and without creating additional 
12171         tasks for the system administrator when maintaining users and 
12172         groups on either system. The winbind system provides a simple 
12173         and elegant solution to all three components of the unified logon 
12174         problem.</P
12175 ></DIV
12176 ><DIV
12177 CLASS="SECT1"
12178 ><HR><H2
12179 CLASS="SECT1"
12180 ><A
12181 NAME="AEN2343"
12182 >16.3. What Winbind Provides</A
12183 ></H2
12184 ><P
12185 >Winbind unifies UNIX and Windows NT account management by 
12186         allowing a UNIX box to become a full member of a NT domain. Once 
12187         this is done the UNIX box will see NT users and groups as if 
12188         they were native UNIX users and groups, allowing the NT domain 
12189         to be used in much the same manner that NIS+ is used within 
12190         UNIX-only environments.</P
12191 ><P
12192 >The end result is that whenever any 
12193         program on the UNIX machine asks the operating system to lookup 
12194         a user or group name, the query will be resolved by asking the 
12195         NT domain controller for the specified domain to do the lookup.
12196         Because Winbind hooks into the operating system at a low level 
12197         (via the NSS name resolution modules in the C library) this 
12198         redirection to the NT domain controller is completely 
12199         transparent.</P
12200 ><P
12201 >Users on the UNIX machine can then use NT user and group 
12202         names as they would use "native" UNIX names. They can chown files 
12203         so that they are owned by NT domain users or even login to the 
12204         UNIX machine and run a UNIX X-Window session as a domain user.</P
12205 ><P
12206 >The only obvious indication that Winbind is being used is 
12207         that user and group names take the form DOMAIN\user and 
12208         DOMAIN\group. This is necessary as it allows Winbind to determine 
12209         that redirection to a domain controller is wanted for a particular 
12210         lookup and which trusted domain is being referenced.</P
12211 ><P
12212 >Additionally, Winbind provides an authentication service 
12213         that hooks into the Pluggable Authentication Modules (PAM) system 
12214         to provide authentication via a NT domain to any PAM enabled 
12215         applications. This capability solves the problem of synchronizing 
12216         passwords between systems since all passwords are stored in a single 
12217         location (on the domain controller).</P
12218 ><DIV
12219 CLASS="SECT2"
12220 ><HR><H3
12221 CLASS="SECT2"
12222 ><A
12223 NAME="AEN2350"
12224 >16.3.1. Target Uses</A
12225 ></H3
12226 ><P
12227 >Winbind is targeted at organizations that have an 
12228                 existing NT based domain infrastructure into which they wish 
12229                 to put UNIX workstations or servers. Winbind will allow these 
12230                 organizations to deploy UNIX workstations without having to 
12231                 maintain a separate account infrastructure. This greatly 
12232                 simplifies the administrative overhead of deploying UNIX 
12233                 workstations into a NT based organization.</P
12234 ><P
12235 >Another interesting way in which we expect Winbind to 
12236                 be used is as a central part of UNIX based appliances. Appliances 
12237                 that provide file and print services to Microsoft based networks 
12238                 will be able to use Winbind to provide seamless integration of 
12239                 the appliance into the domain.</P
12240 ></DIV
12241 ></DIV
12242 ><DIV
12243 CLASS="SECT1"
12244 ><HR><H2
12245 CLASS="SECT1"
12246 ><A
12247 NAME="AEN2354"
12248 >16.4. How Winbind Works</A
12249 ></H2
12250 ><P
12251 >The winbind system is designed around a client/server 
12252         architecture. A long running <B
12253 CLASS="COMMAND"
12254 >winbindd</B
12255 > daemon 
12256         listens on a UNIX domain socket waiting for requests
12257         to arrive. These requests are generated by the NSS and PAM 
12258         clients and processed sequentially.</P
12259 ><P
12260 >The technologies used to implement winbind are described 
12261         in detail below.</P
12262 ><DIV
12263 CLASS="SECT2"
12264 ><HR><H3
12265 CLASS="SECT2"
12266 ><A
12267 NAME="AEN2359"
12268 >16.4.1. Microsoft Remote Procedure Calls</A
12269 ></H3
12270 ><P
12271 >Over the last few years, efforts have been underway 
12272                 by various Samba Team members to decode various aspects of 
12273                 the Microsoft Remote Procedure Call (MSRPC) system. This 
12274                 system is used for most network related operations between 
12275                 Windows NT machines including remote management, user authentication
12276                 and print spooling. Although initially this work was done 
12277                 to aid the implementation of Primary Domain Controller (PDC) 
12278                 functionality in Samba, it has also yielded a body of code which 
12279                 can be used for other purposes.</P
12280 ><P
12281 >Winbind uses various MSRPC calls to enumerate domain users 
12282                 and groups and to obtain detailed information about individual 
12283                 users or groups. Other MSRPC calls can be used to authenticate 
12284                 NT domain users and to change user passwords. By directly querying 
12285                 a Windows PDC for user and group information, winbind maps the 
12286                 NT account information onto UNIX user and group names.</P
12287 ></DIV
12288 ><DIV
12289 CLASS="SECT2"
12290 ><HR><H3
12291 CLASS="SECT2"
12292 ><A
12293 NAME="AEN2363"
12294 >16.4.2. Microsoft Active Directory Services</A
12295 ></H3
12296 ><P
12297 >                Since late 2001, Samba has gained the ability to
12298                 interact with Microsoft Windows 2000 using its 'Native
12299                 Mode' protocols, rather than the NT4 RPC services.
12300                 Using LDAP and Kerberos, a domain member running
12301                 winbind can enumerate users and groups in exactly the
12302                 same way as a Win2k client would, and in so doing
12303                 provide a much more efficient and
12304                 effective winbind implementation.  
12305                 </P
12306 ></DIV
12307 ><DIV
12308 CLASS="SECT2"
12309 ><HR><H3
12310 CLASS="SECT2"
12311 ><A
12312 NAME="AEN2366"
12313 >16.4.3. Name Service Switch</A
12314 ></H3
12315 ><P
12316 >The Name Service Switch, or NSS, is a feature that is 
12317                 present in many UNIX operating systems. It allows system 
12318                 information such as hostnames, mail aliases and user information 
12319                 to be resolved from different sources. For example, a standalone 
12320                 UNIX workstation may resolve system information from a series of 
12321                 flat files stored on the local filesystem. A networked workstation 
12322                 may first attempt to resolve system information from local files, 
12323                 and then consult a NIS database for user information or a DNS server 
12324                 for hostname information.</P
12325 ><P
12326 >The NSS application programming interface allows winbind 
12327                 to present itself as a source of system information when 
12328                 resolving UNIX usernames and groups.  Winbind uses this interface, 
12329                 and information obtained from a Windows NT server using MSRPC 
12330                 calls to provide a new source of account enumeration.  Using standard 
12331                 UNIX library calls, one can enumerate the users and groups on
12332                 a UNIX machine running winbind and see all users and groups in 
12333                 a NT domain plus any trusted domain as though they were local 
12334                 users and groups.</P
12335 ><P
12336 >The primary control file for NSS is 
12337                 <TT
12338 CLASS="FILENAME"
12339 >/etc/nsswitch.conf</TT
12340 >. 
12341                 When a UNIX application makes a request to do a lookup 
12342                 the C library looks in <TT
12343 CLASS="FILENAME"
12344 >/etc/nsswitch.conf</TT
12345
12346                 for a line which matches the service type being requested, for 
12347                 example the "passwd" service type is used when user or group names 
12348                 are looked up. This     config line species which implementations 
12349                 of that service should be tried and in what order. If the passwd 
12350                 config line is:</P
12351 ><P
12352 ><B
12353 CLASS="COMMAND"
12354 >passwd: files example</B
12355 ></P
12356 ><P
12357 >then the C library will first load a module called 
12358                 <TT
12359 CLASS="FILENAME"
12360 >/lib/libnss_files.so</TT
12361 > followed by
12362                 the module <TT
12363 CLASS="FILENAME"
12364 >/lib/libnss_example.so</TT
12365 >. The 
12366                 C library will dynamically load each of these modules in turn 
12367                 and call resolver functions within the modules to try to resolve 
12368                 the request. Once the request is resolved the C library returns the
12369                 result to the application.</P
12370 ><P
12371 >This NSS interface provides a very easy way for Winbind 
12372                 to hook into the operating system. All that needs to be done 
12373                 is to put <TT
12374 CLASS="FILENAME"
12375 >libnss_winbind.so</TT
12376 > in <TT
12377 CLASS="FILENAME"
12378 >/lib/</TT
12379
12380                 then add "winbind" into <TT
12381 CLASS="FILENAME"
12382 >/etc/nsswitch.conf</TT
12383 > at 
12384                 the appropriate place. The C library will then call Winbind to 
12385                 resolve user and group names.</P
12386 ></DIV
12387 ><DIV
12388 CLASS="SECT2"
12389 ><HR><H3
12390 CLASS="SECT2"
12391 ><A
12392 NAME="AEN2382"
12393 >16.4.4. Pluggable Authentication Modules</A
12394 ></H3
12395 ><P
12396 >Pluggable Authentication Modules, also known as PAM, 
12397                 is a system for abstracting authentication and authorization 
12398                 technologies. With a PAM module it is possible to specify different 
12399                 authentication methods for different system applications without 
12400                 having to recompile these applications. PAM is also useful
12401                 for implementing a particular policy for authorization. For example, 
12402                 a system administrator may only allow console logins from users 
12403                 stored in the local password file but only allow users resolved from 
12404                 a NIS database to log in over the network.</P
12405 ><P
12406 >Winbind uses the authentication management and password 
12407                 management PAM interface to integrate Windows NT users into a 
12408                 UNIX system. This allows Windows NT users to log in to a UNIX 
12409                 machine and be authenticated against a suitable Primary Domain 
12410                 Controller. These users can also change their passwords and have 
12411                 this change take effect directly on the Primary Domain Controller.
12412                 </P
12413 ><P
12414 >PAM is configured by providing control files in the directory 
12415                 <TT
12416 CLASS="FILENAME"
12417 >/etc/pam.d/</TT
12418 > for each of the services that 
12419                 require authentication. When an authentication request is made 
12420                 by an application the PAM code in the C library looks up this
12421                 control file to determine what modules to load to do the 
12422                 authentication check and in what order. This interface makes adding 
12423                 a new authentication service for Winbind very easy, all that needs 
12424                 to be done is that the <TT
12425 CLASS="FILENAME"
12426 >pam_winbind.so</TT
12427 > module 
12428                 is copied to <TT
12429 CLASS="FILENAME"
12430 >/lib/security/</TT
12431 > and the PAM 
12432                 control files for relevant services are updated to allow 
12433                 authentication via winbind. See the PAM documentation
12434                 for more details.</P
12435 ></DIV
12436 ><DIV
12437 CLASS="SECT2"
12438 ><HR><H3
12439 CLASS="SECT2"
12440 ><A
12441 NAME="AEN2390"
12442 >16.4.5. User and Group ID Allocation</A
12443 ></H3
12444 ><P
12445 >When a user or group is created under Windows NT 
12446                 is it allocated a numerical relative identifier (RID). This is 
12447                 slightly different to UNIX which has a range of numbers that are 
12448                 used to identify users, and the same range in which to identify 
12449                 groups. It is winbind's job to convert RIDs to UNIX id numbers and
12450                 vice versa.  When winbind is configured it is given part of the UNIX 
12451                 user id space and a part of the UNIX group id space in which to 
12452                 store Windows NT users and groups. If a Windows NT user is 
12453                 resolved for the first time, it is allocated the next UNIX id from 
12454                 the range. The same process applies for Windows NT groups. Over 
12455                 time, winbind will have mapped all Windows NT users and groups
12456                 to UNIX user ids and group ids.</P
12457 ><P
12458 >The results of this mapping are stored persistently in 
12459                 an ID mapping database held in a tdb database). This ensures that 
12460                 RIDs are mapped to UNIX IDs in a consistent way.</P
12461 ></DIV
12462 ><DIV
12463 CLASS="SECT2"
12464 ><HR><H3
12465 CLASS="SECT2"
12466 ><A
12467 NAME="AEN2394"
12468 >16.4.6. Result Caching</A
12469 ></H3
12470 ><P
12471 >An active system can generate a lot of user and group 
12472                 name lookups. To reduce the network cost of these lookups winbind 
12473                 uses a caching scheme based on the SAM sequence number supplied 
12474                 by NT domain controllers.  User or group information returned 
12475                 by a PDC is cached by winbind along with a sequence number also 
12476                 returned by the PDC. This sequence number is incremented by 
12477                 Windows NT whenever any user or group information is modified. If 
12478                 a cached entry has expired, the sequence number is requested from 
12479                 the PDC and compared against the sequence number of the cached entry. 
12480                 If the sequence numbers do not match, then the cached information 
12481                 is discarded and up to date information is requested directly 
12482                 from the PDC.</P
12483 ></DIV
12484 ></DIV
12485 ><DIV
12486 CLASS="SECT1"
12487 ><HR><H2
12488 CLASS="SECT1"
12489 ><A
12490 NAME="AEN2397"
12491 >16.5. Installation and Configuration</A
12492 ></H2
12493 ><P
12494 >Many thanks to John Trostel <A
12495 HREF="mailto:jtrostel@snapserver.com"
12496 TARGET="_top"
12497 >jtrostel@snapserver.com</A
12498 >
12499 for providing the HOWTO for this section.</P
12500 ><P
12501 >This HOWTO describes how to get winbind services up and running 
12502 to control access and authenticate users on your Linux box using 
12503 the winbind services which come with SAMBA 2.2.2.</P
12504 ><DIV
12505 CLASS="SECT2"
12506 ><HR><H3
12507 CLASS="SECT2"
12508 ><A
12509 NAME="AEN2402"
12510 >16.5.1. Introduction</A
12511 ></H3
12512 ><P
12513 >This HOWTO describes the procedures used to get winbind up and 
12514 running on my RedHat 7.1 system.  Winbind is capable of providing access 
12515 and authentication control for Windows Domain users through an NT 
12516 or Win2K PDC for 'regular' services, such as telnet a nd ftp, as
12517 well for SAMBA services.</P
12518 ><P
12519 >This HOWTO has been written from a 'RedHat-centric' perspective, so if 
12520 you are using another distribution, you may have to modify the instructions 
12521 somewhat to fit the way your distribution works.</P
12522 ><P
12523 ></P
12524 ><UL
12525 ><LI
12526 ><P
12527 >       <SPAN
12528 CLASS="emphasis"
12529 ><I
12530 CLASS="EMPHASIS"
12531 >Why should I to this?</I
12532 ></SPAN
12533 >
12534         </P
12535 ><P
12536 >This allows the SAMBA administrator to rely on the 
12537         authentication mechanisms on the NT/Win2K PDC for the authentication 
12538         of domain members.  NT/Win2K users no longer need to have separate 
12539         accounts on the SAMBA server.
12540         </P
12541 ></LI
12542 ><LI
12543 ><P
12544 >       <SPAN
12545 CLASS="emphasis"
12546 ><I
12547 CLASS="EMPHASIS"
12548 >Who should be reading this document?</I
12549 ></SPAN
12550 >
12551         </P
12552 ><P
12553 >       This HOWTO is designed for system administrators.  If you are 
12554         implementing SAMBA on a file server and wish to (fairly easily) 
12555         integrate existing NT/Win2K users from your PDC onto the
12556         SAMBA server, this HOWTO is for you.  That said, I am no NT or PAM 
12557         expert, so you may find a better or easier way to accomplish 
12558         these tasks.
12559         </P
12560 ></LI
12561 ></UL
12562 ></DIV
12563 ><DIV
12564 CLASS="SECT2"
12565 ><HR><H3
12566 CLASS="SECT2"
12567 ><A
12568 NAME="AEN2415"
12569 >16.5.2. Requirements</A
12570 ></H3
12571 ><P
12572 >If you have a samba configuration file that you are currently 
12573 using... <SPAN
12574 CLASS="emphasis"
12575 ><I
12576 CLASS="EMPHASIS"
12577 >BACK IT UP!</I
12578 ></SPAN
12579 >  If your system already uses PAM, 
12580 <SPAN
12581 CLASS="emphasis"
12582 ><I
12583 CLASS="EMPHASIS"
12584 >back up the <TT
12585 CLASS="FILENAME"
12586 >/etc/pam.d</TT
12587 > directory 
12588 contents!</I
12589 ></SPAN
12590 > If you haven't already made a boot disk, 
12591 <SPAN
12592 CLASS="emphasis"
12593 ><I
12594 CLASS="EMPHASIS"
12595 >MAKE ONE NOW!</I
12596 ></SPAN
12597 ></P
12598 ><P
12599 >Messing with the pam configuration files can make it nearly impossible 
12600 to log in to yourmachine. That's why you want to be able to boot back 
12601 into your machine in single user mode and restore your 
12602 <TT
12603 CLASS="FILENAME"
12604 >/etc/pam.d</TT
12605 > back to the original state they were in if 
12606 you get frustrated with the way things are going.  ;-)</P
12607 ><P
12608 >The latest version of SAMBA (version 3.0 as of this writing), now 
12609 includes a functioning winbindd daemon.  Please refer to the 
12610 <A
12611 HREF="http://samba.org/"
12612 TARGET="_top"
12613 >main SAMBA web page</A
12614 > or, 
12615 better yet, your closest SAMBA mirror site for instructions on 
12616 downloading the source code.</P
12617 ><P
12618 >To allow Domain users the ability to access SAMBA shares and 
12619 files, as well as potentially other services provided by your 
12620 SAMBA machine, PAM (pluggable authentication modules) must
12621 be setup properly on your machine.  In order to compile the 
12622 winbind modules, you should have at least the pam libraries resident 
12623 on your system.  For recent RedHat systems (7.1, for instance), that 
12624 means <TT
12625 CLASS="FILENAME"
12626 >pam-0.74-22</TT
12627 >.  For best results, it is helpful to also
12628 install the development packages in <TT
12629 CLASS="FILENAME"
12630 >pam-devel-0.74-22</TT
12631 >.</P
12632 ></DIV
12633 ><DIV
12634 CLASS="SECT2"
12635 ><HR><H3
12636 CLASS="SECT2"
12637 ><A
12638 NAME="AEN2429"
12639 >16.5.3. Testing Things Out</A
12640 ></H3
12641 ><P
12642 >Before starting, it is probably best to kill off all the SAMBA 
12643 related daemons running on your server.  Kill off all <B
12644 CLASS="COMMAND"
12645 >smbd</B
12646 >, 
12647 <B
12648 CLASS="COMMAND"
12649 >nmbd</B
12650 >, and <B
12651 CLASS="COMMAND"
12652 >winbindd</B
12653 > processes that may 
12654 be running.  To use PAM, you will want to make sure that you have the 
12655 standard PAM package (for RedHat) which supplies the <TT
12656 CLASS="FILENAME"
12657 >/etc/pam.d</TT
12658
12659 directory structure, including the pam modules are used by pam-aware 
12660 services, several pam libraries, and the <TT
12661 CLASS="FILENAME"
12662 >/usr/doc</TT
12663
12664 and <TT
12665 CLASS="FILENAME"
12666 >/usr/man</TT
12667 > entries for pam.  Winbind built better 
12668 in SAMBA if the pam-devel package was also installed.  This package includes 
12669 the header files needed to compile pam-aware applications. For instance, 
12670 my RedHat system has both <TT
12671 CLASS="FILENAME"
12672 >pam-0.74-22</TT
12673 > and
12674 <TT
12675 CLASS="FILENAME"
12676 >pam-devel-0.74-22</TT
12677 > RPMs installed.</P
12678 ><DIV
12679 CLASS="SECT3"
12680 ><HR><H4
12681 CLASS="SECT3"
12682 ><A
12683 NAME="AEN2440"
12684 >16.5.3.1. Configure and compile SAMBA</A
12685 ></H4
12686 ><P
12687 >The configuration and compilation of SAMBA is pretty straightforward.
12688 The first three steps may not be necessary depending upon
12689 whether or not you have previously built the Samba binaries.</P
12690 ><P
12691 ><PRE
12692 CLASS="PROGRAMLISTING"
12693 ><SAMP
12694 CLASS="PROMPT"
12695 >root#</SAMP
12696 > <B
12697 CLASS="COMMAND"
12698 >autoconf</B
12699 >
12700 <SAMP
12701 CLASS="PROMPT"
12702 >root#</SAMP
12703 > <B
12704 CLASS="COMMAND"
12705 >make clean</B
12706 >
12707 <SAMP
12708 CLASS="PROMPT"
12709 >root#</SAMP
12710 > <B
12711 CLASS="COMMAND"
12712 >rm config.cache</B
12713 >
12714 <SAMP
12715 CLASS="PROMPT"
12716 >root#</SAMP
12717 > <B
12718 CLASS="COMMAND"
12719 >./configure</B
12720 >
12721 <SAMP
12722 CLASS="PROMPT"
12723 >root#</SAMP
12724 > <B
12725 CLASS="COMMAND"
12726 >make</B
12727 >
12728 <SAMP
12729 CLASS="PROMPT"
12730 >root#</SAMP
12731 > <B
12732 CLASS="COMMAND"
12733 >make install</B
12734 ></PRE
12735 ></P
12736 ><P
12737 >This will, by default, install SAMBA in <TT
12738 CLASS="FILENAME"
12739 >/usr/local/samba</TT
12740 >.
12741 See the main SAMBA documentation if you want to install SAMBA somewhere else.
12742 It will also build the winbindd executable and libraries. </P
12743 ></DIV
12744 ><DIV
12745 CLASS="SECT3"
12746 ><HR><H4
12747 CLASS="SECT3"
12748 ><A
12749 NAME="AEN2459"
12750 >16.5.3.2. Configure <TT
12751 CLASS="FILENAME"
12752 >nsswitch.conf</TT
12753 > and the 
12754 winbind libraries</A
12755 ></H4
12756 ><P
12757 >The libraries needed to run the <B
12758 CLASS="COMMAND"
12759 >winbindd</B
12760 > daemon 
12761 through nsswitch need to be copied to their proper locations, so</P
12762 ><P
12763 ><SAMP
12764 CLASS="PROMPT"
12765 >root#</SAMP
12766 > <B
12767 CLASS="COMMAND"
12768 >cp ../samba/source/nsswitch/libnss_winbind.so /lib</B
12769 ></P
12770 ><P
12771 >I also found it necessary to make the following symbolic link:</P
12772 ><P
12773 ><SAMP
12774 CLASS="PROMPT"
12775 >root#</SAMP
12776 > <B
12777 CLASS="COMMAND"
12778 >ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2</B
12779 ></P
12780 ><P
12781 >And, in the case of Sun solaris:</P
12782 ><P
12783 ><SAMP
12784 CLASS="PROMPT"
12785 >root#</SAMP
12786 > <B
12787 CLASS="COMMAND"
12788 >ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1</B
12789 >
12790 <SAMP
12791 CLASS="PROMPT"
12792 >root#</SAMP
12793 > <B
12794 CLASS="COMMAND"
12795 >ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.1</B
12796 >
12797 <SAMP
12798 CLASS="PROMPT"
12799 >root#</SAMP
12800 > <B
12801 CLASS="COMMAND"
12802 >ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.2</B
12803 ></P
12804 ><P
12805 >Now, as root you need to edit <TT
12806 CLASS="FILENAME"
12807 >/etc/nsswitch.conf</TT
12808 > to 
12809 allow user and group entries to be visible from the <B
12810 CLASS="COMMAND"
12811 >winbindd</B
12812
12813 daemon.  My <TT
12814 CLASS="FILENAME"
12815 >/etc/nsswitch.conf</TT
12816 > file look like 
12817 this after editing:</P
12818 ><P
12819 ><PRE
12820 CLASS="PROGRAMLISTING"
12821 >       passwd:     files winbind
12822         shadow:     files 
12823         group:      files winbind</PRE
12824 ></P
12825 ><P
12826 >       
12827 The libraries needed by the winbind daemon will be automatically 
12828 entered into the <B
12829 CLASS="COMMAND"
12830 >ldconfig</B
12831 > cache the next time 
12832 your system reboots, but it 
12833 is faster (and you don't need to reboot) if you do it manually:</P
12834 ><P
12835 ><SAMP
12836 CLASS="PROMPT"
12837 >root#</SAMP
12838 > <B
12839 CLASS="COMMAND"
12840 >/sbin/ldconfig -v | grep winbind</B
12841 ></P
12842 ><P
12843 >This makes <TT
12844 CLASS="FILENAME"
12845 >libnss_winbind</TT
12846 > available to winbindd 
12847 and echos back a check to you.</P
12848 ></DIV
12849 ><DIV
12850 CLASS="SECT3"
12851 ><HR><H4
12852 CLASS="SECT3"
12853 ><A
12854 NAME="AEN2492"
12855 >16.5.3.3. Configure smb.conf</A
12856 ></H4
12857 ><P
12858 >Several parameters are needed in the smb.conf file to control 
12859 the behavior of <B
12860 CLASS="COMMAND"
12861 >winbindd</B
12862 >. Configure 
12863 <TT
12864 CLASS="FILENAME"
12865 >smb.conf</TT
12866 > These are described in more detail in 
12867 the <A
12868 HREF="winbindd.8.html"
12869 TARGET="_top"
12870 >winbindd(8)</A
12871 > man page.  My 
12872 <TT
12873 CLASS="FILENAME"
12874 >smb.conf</TT
12875 > file was modified to
12876 include the following entries in the [global] section:</P
12877 ><P
12878 ><PRE
12879 CLASS="PROGRAMLISTING"
12880 >[global]
12881      &#60;...&#62;
12882      # separate domain and username with '+', like DOMAIN+username
12883      <A
12884 HREF="winbindd.8.html#WINBINDSEPARATOR"
12885 TARGET="_top"
12886 >winbind separator</A
12887 > = +
12888      # use uids from 10000 to 20000 for domain users
12889      <A
12890 HREF="winbindd.8.html#WINBINDUID"
12891 TARGET="_top"
12892 >winbind uid</A
12893 > = 10000-20000
12894      # use gids from 10000 to 20000 for domain groups
12895      <A
12896 HREF="winbindd.8.html#WINBINDGID"
12897 TARGET="_top"
12898 >winbind gid</A
12899 > = 10000-20000
12900      # allow enumeration of winbind users and groups
12901      <A
12902 HREF="winbindd.8.html#WINBINDENUMUSERS"
12903 TARGET="_top"
12904 >winbind enum users</A
12905 > = yes
12906      <A
12907 HREF="winbindd.8.html#WINBINDENUMGROUP"
12908 TARGET="_top"
12909 >winbind enum groups</A
12910 > = yes
12911      # give winbind users a real shell (only needed if they have telnet access)
12912      <A
12913 HREF="winbindd.8.html#TEMPLATEHOMEDIR"
12914 TARGET="_top"
12915 >template homedir</A
12916 > = /home/winnt/%D/%U
12917      <A
12918 HREF="winbindd.8.html#TEMPLATESHELL"
12919 TARGET="_top"
12920 >template shell</A
12921 > = /bin/bash</PRE
12922 ></P
12923 ></DIV
12924 ><DIV
12925 CLASS="SECT3"
12926 ><HR><H4
12927 CLASS="SECT3"
12928 ><A
12929 NAME="AEN2508"
12930 >16.5.3.4. Join the SAMBA server to the PDC domain</A
12931 ></H4
12932 ><P
12933 >Enter the following command to make the SAMBA server join the 
12934 PDC domain, where <VAR
12935 CLASS="REPLACEABLE"
12936 >DOMAIN</VAR
12937 > is the name of 
12938 your Windows domain and <VAR
12939 CLASS="REPLACEABLE"
12940 >Administrator</VAR
12941 > is 
12942 a domain user who has administrative privileges in the domain.</P
12943 ><P
12944 ><SAMP
12945 CLASS="PROMPT"
12946 >root#</SAMP
12947 > <B
12948 CLASS="COMMAND"
12949 >/usr/local/samba/bin/net join -S PDC -U Administrator</B
12950 ></P
12951 ><P
12952 >The proper response to the command should be: "Joined the domain 
12953 <VAR
12954 CLASS="REPLACEABLE"
12955 >DOMAIN</VAR
12956 >" where <VAR
12957 CLASS="REPLACEABLE"
12958 >DOMAIN</VAR
12959
12960 is your DOMAIN name.</P
12961 ></DIV
12962 ><DIV
12963 CLASS="SECT3"
12964 ><HR><H4
12965 CLASS="SECT3"
12966 ><A
12967 NAME="AEN2519"
12968 >16.5.3.5. Start up the winbindd daemon and test it!</A
12969 ></H4
12970 ><P
12971 >Eventually, you will want to modify your smb startup script to 
12972 automatically invoke the winbindd daemon when the other parts of 
12973 SAMBA start, but it is possible to test out just the winbind
12974 portion first.  To start up winbind services, enter the following 
12975 command as root:</P
12976 ><P
12977 ><SAMP
12978 CLASS="PROMPT"
12979 >root#</SAMP
12980 > <B
12981 CLASS="COMMAND"
12982 >/usr/local/samba/bin/winbindd</B
12983 ></P
12984 ><P
12985 >Winbindd can now also run in 'dual daemon mode'. This will make it 
12986 run as 2 processes. The first will answer all requests from the cache,
12987 thus making responses to clients faster. The other will
12988 update the cache for the query that the first has just responded.
12989 Advantage of this is that responses stay accurate and are faster. 
12990 You can enable dual daemon mode by adding '-B' to the commandline:</P
12991 ><P
12992 ><SAMP
12993 CLASS="PROMPT"
12994 >root#</SAMP
12995 > <B
12996 CLASS="COMMAND"
12997 >/usr/local/samba/bin/winbindd -B</B
12998 ></P
12999 ><P
13000 >I'm always paranoid and like to make sure the daemon 
13001 is really running...</P
13002 ><P
13003 ><SAMP
13004 CLASS="PROMPT"
13005 >root#</SAMP
13006 > <B
13007 CLASS="COMMAND"
13008 >ps -ae | grep winbindd</B
13009 ></P
13010 ><P
13011 >This command should produce output like this, if the daemon is running</P
13012 ><P
13013 >3025 ?        00:00:00 winbindd</P
13014 ><P
13015 >Now... for the real test, try to get some information about the 
13016 users on your PDC</P
13017 ><P
13018 ><SAMP
13019 CLASS="PROMPT"
13020 >root#</SAMP
13021 > <B
13022 CLASS="COMMAND"
13023 >/usr/local/samba/bin/wbinfo -u</B
13024 ></P
13025 ><P
13026 >       
13027 This should echo back a list of users on your Windows users on 
13028 your PDC.  For example, I get the following response:</P
13029 ><P
13030 ><PRE
13031 CLASS="PROGRAMLISTING"
13032 >CEO+Administrator
13033 CEO+burdell
13034 CEO+Guest
13035 CEO+jt-ad
13036 CEO+krbtgt
13037 CEO+TsInternetUser</PRE
13038 ></P
13039 ><P
13040 >Obviously, I have named my domain 'CEO' and my <VAR
13041 CLASS="PARAMETER"
13042 >winbind
13043 separator</VAR
13044 > is '+'.</P
13045 ><P
13046 >You can do the same sort of thing to get group information from 
13047 the PDC:</P
13048 ><P
13049 ><PRE
13050 CLASS="PROGRAMLISTING"
13051 ><SAMP
13052 CLASS="PROMPT"
13053 >root#</SAMP
13054 > <B
13055 CLASS="COMMAND"
13056 >/usr/local/samba/bin/wbinfo -g</B
13057 >
13058 CEO+Domain Admins
13059 CEO+Domain Users
13060 CEO+Domain Guests
13061 CEO+Domain Computers
13062 CEO+Domain Controllers
13063 CEO+Cert Publishers
13064 CEO+Schema Admins
13065 CEO+Enterprise Admins
13066 CEO+Group Policy Creator Owners</PRE
13067 ></P
13068 ><P
13069 >The function 'getent' can now be used to get unified 
13070 lists of both local and PDC users and groups.
13071 Try the following command:</P
13072 ><P
13073 ><SAMP
13074 CLASS="PROMPT"
13075 >root#</SAMP
13076 > <B
13077 CLASS="COMMAND"
13078 >getent passwd</B
13079 ></P
13080 ><P
13081 >You should get a list that looks like your <TT
13082 CLASS="FILENAME"
13083 >/etc/passwd</TT
13084
13085 list followed by the domain users with their new uids, gids, home 
13086 directories and default shells.</P
13087 ><P
13088 >The same thing can be done for groups with the command</P
13089 ><P
13090 ><SAMP
13091 CLASS="PROMPT"
13092 >root#</SAMP
13093 > <B
13094 CLASS="COMMAND"
13095 >getent group</B
13096 ></P
13097 ></DIV
13098 ><DIV
13099 CLASS="SECT3"
13100 ><HR><H4
13101 CLASS="SECT3"
13102 ><A
13103 NAME="AEN2559"
13104 >16.5.3.6. Fix the init.d startup scripts</A
13105 ></H4
13106 ><DIV
13107 CLASS="SECT4"
13108 ><H5
13109 CLASS="SECT4"
13110 ><A
13111 NAME="AEN2561"
13112 >16.5.3.6.1. Linux</A
13113 ></H5
13114 ><P
13115 >The <B
13116 CLASS="COMMAND"
13117 >winbindd</B
13118 > daemon needs to start up after the 
13119 <B
13120 CLASS="COMMAND"
13121 >smbd</B
13122 > and <B
13123 CLASS="COMMAND"
13124 >nmbd</B
13125 > daemons are running.  
13126 To accomplish this task, you need to modify the startup scripts of your system. They are located at <TT
13127 CLASS="FILENAME"
13128 >/etc/init.d/smb</TT
13129 > in RedHat and 
13130 <TT
13131 CLASS="FILENAME"
13132 >/etc/init.d/samba</TT
13133 > in Debian.
13134 script to add commands to invoke this daemon in the proper sequence.  My 
13135 startup script starts up <B
13136 CLASS="COMMAND"
13137 >smbd</B
13138 >, 
13139 <B
13140 CLASS="COMMAND"
13141 >nmbd</B
13142 >, and <B
13143 CLASS="COMMAND"
13144 >winbindd</B
13145 > from the 
13146 <TT
13147 CLASS="FILENAME"
13148 >/usr/local/samba/bin</TT
13149 > directory directly.  The 'start' 
13150 function in the script looks like this:</P
13151 ><P
13152 ><PRE
13153 CLASS="PROGRAMLISTING"
13154 >start() {
13155         KIND="SMB"
13156         echo -n $"Starting $KIND services: "
13157         daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
13158         RETVAL=$?
13159         echo
13160         KIND="NMB"
13161         echo -n $"Starting $KIND services: "
13162         daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
13163         RETVAL2=$?
13164         echo
13165         KIND="Winbind"
13166         echo -n $"Starting $KIND services: "
13167         daemon /usr/local/samba/bin/winbindd
13168         RETVAL3=$?
13169         echo
13170         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; touch /var/lock/subsys/smb || \
13171            RETVAL=1
13172         return $RETVAL
13173 }</PRE
13174 ></P
13175 ><P
13176 >If you would like to run winbindd in dual daemon mode, replace 
13177 the line 
13178 <PRE
13179 CLASS="PROGRAMLISTING"
13180 >        daemon /usr/local/samba/bin/winbindd</PRE
13181 >
13182
13183 in the example above with:
13184
13185 <PRE
13186 CLASS="PROGRAMLISTING"
13187 >        daemon /usr/local/samba/bin/winbindd -B</PRE
13188 >.</P
13189 ><P
13190 >The 'stop' function has a corresponding entry to shut down the 
13191 services and looks like this:</P
13192 ><P
13193 ><PRE
13194 CLASS="PROGRAMLISTING"
13195 >stop() {
13196         KIND="SMB"
13197         echo -n $"Shutting down $KIND services: "
13198         killproc smbd
13199         RETVAL=$?
13200         echo
13201         KIND="NMB"
13202         echo -n $"Shutting down $KIND services: "
13203         killproc nmbd
13204         RETVAL2=$?
13205         echo
13206         KIND="Winbind"
13207         echo -n $"Shutting down $KIND services: "
13208         killproc winbindd
13209         RETVAL3=$?
13210         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; rm -f /var/lock/subsys/smb
13211         echo ""
13212         return $RETVAL
13213 }</PRE
13214 ></P
13215 ></DIV
13216 ><DIV
13217 CLASS="SECT4"
13218 ><HR><H5
13219 CLASS="SECT4"
13220 ><A
13221 NAME="AEN2581"
13222 >16.5.3.6.2. Solaris</A
13223 ></H5
13224 ><P
13225 >On solaris, you need to modify the 
13226 <TT
13227 CLASS="FILENAME"
13228 >/etc/init.d/samba.server</TT
13229 > startup script. It usually 
13230 only starts smbd and nmbd but should now start winbindd too. If you 
13231 have samba installed in <TT
13232 CLASS="FILENAME"
13233 >/usr/local/samba/bin</TT
13234 >, 
13235 the file could contains something like this:</P
13236 ><P
13237 ><PRE
13238 CLASS="PROGRAMLISTING"
13239 >##
13240 ## samba.server
13241 ##
13242
13243 if [ ! -d /usr/bin ]
13244 then                    # /usr not mounted
13245         exit
13246 fi
13247
13248 killproc() {            # kill the named process(es)
13249         pid=`/usr/bin/ps -e |
13250              /usr/bin/grep -w $1 |
13251              /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
13252         [ "$pid" != "" ] &#38;&#38; kill $pid
13253 }
13254  
13255 # Start/stop processes required for samba server
13256
13257 case "$1" in
13258
13259 'start')
13260 #
13261 # Edit these lines to suit your installation (paths, workgroup, host)
13262 #
13263 echo Starting SMBD
13264    /usr/local/samba/bin/smbd -D -s \
13265         /usr/local/samba/smb.conf
13266
13267 echo Starting NMBD
13268    /usr/local/samba/bin/nmbd -D -l \
13269         /usr/local/samba/var/log -s /usr/local/samba/smb.conf
13270
13271 echo Starting Winbind Daemon
13272    /usr/local/samba/bin/winbindd
13273    ;;
13274
13275 'stop')
13276    killproc nmbd
13277    killproc smbd
13278    killproc winbindd
13279    ;;
13280
13281 *)
13282    echo "Usage: /etc/init.d/samba.server { start | stop }"
13283    ;;
13284 esac</PRE
13285 ></P
13286 ><P
13287 >Again, if you would like to run samba in dual daemon mode, replace 
13288 <PRE
13289 CLASS="PROGRAMLISTING"
13290 >   /usr/local/samba/bin/winbindd</PRE
13291 >
13292
13293 in the script above with:
13294
13295 <PRE
13296 CLASS="PROGRAMLISTING"
13297 >   /usr/local/samba/bin/winbindd -B</PRE
13298 ></P
13299 ></DIV
13300 ><DIV
13301 CLASS="SECT4"
13302 ><HR><H5
13303 CLASS="SECT4"
13304 ><A
13305 NAME="AEN2591"
13306 >16.5.3.6.3. Restarting</A
13307 ></H5
13308 ><P
13309 >If you restart the <B
13310 CLASS="COMMAND"
13311 >smbd</B
13312 >, <B
13313 CLASS="COMMAND"
13314 >nmbd</B
13315 >, 
13316 and <B
13317 CLASS="COMMAND"
13318 >winbindd</B
13319 > daemons at this point, you
13320 should be able to connect to the samba server as a domain member just as
13321 if you were a local user.</P
13322 ></DIV
13323 ></DIV
13324 ><DIV
13325 CLASS="SECT3"
13326 ><HR><H4
13327 CLASS="SECT3"
13328 ><A
13329 NAME="AEN2597"
13330 >16.5.3.7. Configure Winbind and PAM</A
13331 ></H4
13332 ><P
13333 >If you have made it this far, you know that winbindd and samba are working
13334 together.  If you want to use winbind to provide authentication for other 
13335 services, keep reading.  The pam configuration files need to be altered in
13336 this step.  (Did you remember to make backups of your original 
13337 <TT
13338 CLASS="FILENAME"
13339 >/etc/pam.d</TT
13340 > files? If not, do it now.)</P
13341 ><P
13342 >You will need a pam module to use winbindd with these other services.  This 
13343 module will be compiled in the <TT
13344 CLASS="FILENAME"
13345 >../source/nsswitch</TT
13346 > directory
13347 by invoking the command</P
13348 ><P
13349 ><SAMP
13350 CLASS="PROMPT"
13351 >root#</SAMP
13352 > <B
13353 CLASS="COMMAND"
13354 >make nsswitch/pam_winbind.so</B
13355 ></P
13356 ><P
13357 >from the <TT
13358 CLASS="FILENAME"
13359 >../source</TT
13360 > directory.  The
13361 <TT
13362 CLASS="FILENAME"
13363 >pam_winbind.so</TT
13364 > file should be copied to the location of
13365 your other pam security modules.  On my RedHat system, this was the
13366 <TT
13367 CLASS="FILENAME"
13368 >/lib/security</TT
13369 > directory. On Solaris, the pam security 
13370 modules reside in <TT
13371 CLASS="FILENAME"
13372 >/usr/lib/security</TT
13373 >.</P
13374 ><P
13375 ><SAMP
13376 CLASS="PROMPT"
13377 >root#</SAMP
13378 > <B
13379 CLASS="COMMAND"
13380 >cp ../samba/source/nsswitch/pam_winbind.so /lib/security</B
13381 ></P
13382 ><DIV
13383 CLASS="SECT4"
13384 ><HR><H5
13385 CLASS="SECT4"
13386 ><A
13387 NAME="AEN2614"
13388 >16.5.3.7.1. Linux/FreeBSD-specific PAM configuration</A
13389 ></H5
13390 ><P
13391 >The <TT
13392 CLASS="FILENAME"
13393 >/etc/pam.d/samba</TT
13394 > file does not need to be changed. I 
13395 just left this fileas it was:</P
13396 ><P
13397 ><PRE
13398 CLASS="PROGRAMLISTING"
13399 >auth    required        /lib/security/pam_stack.so service=system-auth
13400 account required        /lib/security/pam_stack.so service=system-auth</PRE
13401 ></P
13402 ><P
13403 >The other services that I modified to allow the use of winbind 
13404 as an authentication service were the normal login on the console (or a terminal 
13405 session), telnet logins, and ftp service.  In order to enable these 
13406 services, you may first need to change the entries in 
13407 <TT
13408 CLASS="FILENAME"
13409 >/etc/xinetd.d</TT
13410 > (or <TT
13411 CLASS="FILENAME"
13412 >/etc/inetd.conf</TT
13413 >).  
13414 RedHat 7.1 uses the new xinetd.d structure, in this case you need 
13415 to change the lines in <TT
13416 CLASS="FILENAME"
13417 >/etc/xinetd.d/telnet</TT
13418
13419 and <TT
13420 CLASS="FILENAME"
13421 >/etc/xinetd.d/wu-ftp</TT
13422 > from </P
13423 ><P
13424 ><PRE
13425 CLASS="PROGRAMLISTING"
13426 >enable = no</PRE
13427 ></P
13428 ><P
13429 >to</P
13430 ><P
13431 ><PRE
13432 CLASS="PROGRAMLISTING"
13433 >enable = yes</PRE
13434 ></P
13435 ><P
13436 >       
13437 For ftp services to work properly, you will also need to either 
13438 have individual directories for the domain users already present on 
13439 the server, or change the home directory template to a general
13440 directory for all domain users.  These can be easily set using 
13441 the <TT
13442 CLASS="FILENAME"
13443 >smb.conf</TT
13444 > global entry 
13445 <B
13446 CLASS="COMMAND"
13447 >template homedir</B
13448 >.</P
13449 ><P
13450 >The <TT
13451 CLASS="FILENAME"
13452 >/etc/pam.d/ftp</TT
13453 > file can be changed 
13454 to allow winbind ftp access in a manner similar to the
13455 samba file.  My <TT
13456 CLASS="FILENAME"
13457 >/etc/pam.d/ftp</TT
13458 > file was 
13459 changed to look like this:</P
13460 ><P
13461 ><PRE
13462 CLASS="PROGRAMLISTING"
13463 >auth       required     /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
13464 auth       sufficient   /lib/security/pam_winbind.so
13465 auth       required     /lib/security/pam_stack.so service=system-auth
13466 auth       required     /lib/security/pam_shells.so
13467 account    sufficient   /lib/security/pam_winbind.so
13468 account    required     /lib/security/pam_stack.so service=system-auth
13469 session    required     /lib/security/pam_stack.so service=system-auth</PRE
13470 ></P
13471 ><P
13472 >The <TT
13473 CLASS="FILENAME"
13474 >/etc/pam.d/login</TT
13475 > file can be changed nearly the 
13476 same way.  It now looks like this:</P
13477 ><P
13478 ><PRE
13479 CLASS="PROGRAMLISTING"
13480 >auth       required     /lib/security/pam_securetty.so
13481 auth       sufficient   /lib/security/pam_winbind.so
13482 auth       sufficient   /lib/security/pam_unix.so use_first_pass
13483 auth       required     /lib/security/pam_stack.so service=system-auth
13484 auth       required     /lib/security/pam_nologin.so
13485 account    sufficient   /lib/security/pam_winbind.so
13486 account    required     /lib/security/pam_stack.so service=system-auth
13487 password   required     /lib/security/pam_stack.so service=system-auth
13488 session    required     /lib/security/pam_stack.so service=system-auth
13489 session    optional     /lib/security/pam_console.so</PRE
13490 ></P
13491 ><P
13492 >In this case, I added the <B
13493 CLASS="COMMAND"
13494 >auth sufficient /lib/security/pam_winbind.so</B
13495
13496 lines as before, but also added the <B
13497 CLASS="COMMAND"
13498 >required pam_securetty.so</B
13499
13500 above it, to disallow root logins over the network.  I also added a 
13501 <B
13502 CLASS="COMMAND"
13503 >sufficient /lib/security/pam_unix.so use_first_pass</B
13504 >
13505 line after the <B
13506 CLASS="COMMAND"
13507 >winbind.so</B
13508 > line to get rid of annoying 
13509 double prompts for passwords.</P
13510 ></DIV
13511 ><DIV
13512 CLASS="SECT4"
13513 ><HR><H5
13514 CLASS="SECT4"
13515 ><A
13516 NAME="AEN2647"
13517 >16.5.3.7.2. Solaris-specific configuration</A
13518 ></H5
13519 ><P
13520 >The /etc/pam.conf needs to be changed. I changed this file so that my Domain
13521 users can logon both locally as well as telnet.The following are the changes
13522 that I made.You can customize the pam.conf file as per your requirements,but
13523 be sure of those changes because in the worst case it will leave your system
13524 nearly impossible to boot.</P
13525 ><P
13526 ><PRE
13527 CLASS="PROGRAMLISTING"
13528 >#
13529 #ident  "@(#)pam.conf   1.14    99/09/16 SMI"
13530 #
13531 # Copyright (c) 1996-1999, Sun Microsystems, Inc.
13532 # All Rights Reserved.
13533 #
13534 # PAM configuration
13535 #
13536 # Authentication management
13537 #
13538 login   auth required   /usr/lib/security/pam_winbind.so
13539 login   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass 
13540 login   auth required   /usr/lib/security/$ISA/pam_dial_auth.so.1 try_first_pass 
13541 #
13542 rlogin  auth sufficient /usr/lib/security/pam_winbind.so
13543 rlogin  auth sufficient /usr/lib/security/$ISA/pam_rhosts_auth.so.1
13544 rlogin  auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
13545 #
13546 dtlogin auth sufficient /usr/lib/security/pam_winbind.so
13547 dtlogin auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
13548 #
13549 rsh     auth required   /usr/lib/security/$ISA/pam_rhosts_auth.so.1
13550 other   auth sufficient /usr/lib/security/pam_winbind.so
13551 other   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
13552 #
13553 # Account management
13554 #
13555 login   account sufficient      /usr/lib/security/pam_winbind.so
13556 login   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
13557 login   account required        /usr/lib/security/$ISA/pam_unix.so.1 
13558 #
13559 dtlogin account sufficient      /usr/lib/security/pam_winbind.so
13560 dtlogin account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
13561 dtlogin account required        /usr/lib/security/$ISA/pam_unix.so.1 
13562 #
13563 other   account sufficient      /usr/lib/security/pam_winbind.so
13564 other   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
13565 other   account required        /usr/lib/security/$ISA/pam_unix.so.1 
13566 #
13567 # Session management
13568 #
13569 other   session required        /usr/lib/security/$ISA/pam_unix.so.1 
13570 #
13571 # Password management
13572 #
13573 #other   password sufficient     /usr/lib/security/pam_winbind.so
13574 other   password required       /usr/lib/security/$ISA/pam_unix.so.1 
13575 dtsession auth required /usr/lib/security/$ISA/pam_unix.so.1
13576 #
13577 # Support for Kerberos V5 authentication (uncomment to use Kerberos)
13578 #
13579 #rlogin auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
13580 #login  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
13581 #dtlogin        auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
13582 #other  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
13583 #dtlogin        account optional /usr/lib/security/$ISA/pam_krb5.so.1
13584 #other  account optional /usr/lib/security/$ISA/pam_krb5.so.1
13585 #other  session optional /usr/lib/security/$ISA/pam_krb5.so.1
13586 #other  password optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass</PRE
13587 ></P
13588 ><P
13589 >I also added a try_first_pass line after the winbind.so line to get rid of
13590 annoying double prompts for passwords.</P
13591 ><P
13592 >Now restart your Samba and try connecting through your application that you
13593 configured in the pam.conf.</P
13594 ></DIV
13595 ></DIV
13596 ></DIV
13597 ></DIV
13598 ><DIV
13599 CLASS="SECT1"
13600 ><HR><H2
13601 CLASS="SECT1"
13602 ><A
13603 NAME="AEN2654"
13604 >16.6. Limitations</A
13605 ></H2
13606 ><P
13607 >Winbind has a number of limitations in its current 
13608         released version that we hope to overcome in future 
13609         releases:</P
13610 ><P
13611 ></P
13612 ><UL
13613 ><LI
13614 ><P
13615 >Winbind is currently only available for 
13616                 the Linux, Solaris and IRIX operating systems, although ports to other operating 
13617                 systems are certainly possible. For such ports to be feasible, 
13618                 we require the C library of the target operating system to 
13619                 support the Name Service Switch and Pluggable Authentication
13620                 Modules systems. This is becoming more common as NSS and 
13621                 PAM gain        support among UNIX vendors.</P
13622 ></LI
13623 ><LI
13624 ><P
13625 >The mappings of Windows NT RIDs to UNIX ids 
13626                 is not made algorithmically and depends on the order in which 
13627                 unmapped users or groups are seen by winbind. It may be difficult 
13628                 to recover the mappings of rid to UNIX id mapping if the file 
13629                 containing this information is corrupted or destroyed.</P
13630 ></LI
13631 ><LI
13632 ><P
13633 >Currently the winbind PAM module does not take 
13634                 into account possible workstation and logon time restrictions 
13635                 that may be been set for Windows NT users, this is
13636                 instead up to the PDC to enforce.</P
13637 ></LI
13638 ></UL
13639 ></DIV
13640 ><DIV
13641 CLASS="SECT1"
13642 ><HR><H2
13643 CLASS="SECT1"
13644 ><A
13645 NAME="AEN2664"
13646 >16.7. Conclusion</A
13647 ></H2
13648 ><P
13649 >The winbind system, through the use of the Name Service 
13650         Switch, Pluggable Authentication Modules, and appropriate 
13651         Microsoft RPC calls have allowed us to provide seamless 
13652         integration of Microsoft Windows NT domain users on a
13653         UNIX system. The result is a great reduction in the administrative 
13654         cost of running a mixed UNIX and NT network.</P
13655 ></DIV
13656 ></DIV
13657 ><DIV
13658 CLASS="CHAPTER"
13659 ><HR><H1
13660 ><A
13661 NAME="POLICYMGMT"
13662 ></A
13663 >Chapter 17. Policy Management - Hows and Whys</H1
13664 ><DIV
13665 CLASS="SECT1"
13666 ><H2
13667 CLASS="SECT1"
13668 ><A
13669 NAME="AEN2678"
13670 >17.1. System Policies</A
13671 ></H2
13672 ><P
13673 >Under MS Windows platforms, particularly those following the release of MS Windows
13674 NT4 and MS Windows 95) it is possible to create a type of file that would be placed
13675 in the NETLOGON share of a domain controller. As the client logs onto the network
13676 this file is read and the contents initiate changes to the registry of the client
13677 machine. This file allows changes to be made to those parts of the registry that
13678 affect users, groups of users, or machines.</P
13679 ><P
13680 >For MS Windows 9x/Me this file must be called <TT
13681 CLASS="FILENAME"
13682 >Config.POL</TT
13683 > and may
13684 be generated using a tool called <TT
13685 CLASS="FILENAME"
13686 >poledit.exe</TT
13687 >, better known as the
13688 Policy Editor. The policy editor was provided on the Windows 98 installation CD, but
13689 dissappeared again with the introduction of MS Windows Me (Millenium Edition). From
13690 comments from MS Windows network administrators it would appear that this tool became
13691 a part of the MS Windows Me Resource Kit.</P
13692 ><P
13693 >MS Windows NT4 Server products include the <SPAN
13694 CLASS="emphasis"
13695 ><I
13696 CLASS="EMPHASIS"
13697 >System Policy Editor</I
13698 ></SPAN
13699 >
13700 under the <TT
13701 CLASS="FILENAME"
13702 >Start-&#62;Programs-&#62;Administrative Tools</TT
13703 > menu item.
13704 For MS Windows NT4 and later clients this file must be called <TT
13705 CLASS="FILENAME"
13706 >NTConfig.POL</TT
13707 >.</P
13708 ><P
13709 >New with the introduction of MS Windows 2000 was the Microsoft Management Console
13710 or MMC.  This tool is the new wave in the ever changing landscape of Microsoft
13711 methods for management of network access and security. Every new Microsoft product
13712 or technology seems to obsolete the old rules and to introduce newer and more
13713 complex tools and methods. To Microsoft's credit though, the MMC does appear to
13714 be a step forward, but improved functionality comes at a great price.</P
13715 ><P
13716 >Before embarking on the configuration of network and system policies it is highly
13717 advisable to read the documentation available from Microsoft's web site from
13718 <A
13719 HREF="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp"
13720 TARGET="_top"
13721 >Implementing Profiles and Policies in Windows NT 4.0</A
13722 > available from Microsoft.
13723 There are a large number of documents in addition to this old one that should also
13724 be read and understood. Try searching on the Microsoft web site for "Group Policies".</P
13725 ><P
13726 >What follows is a very discussion with some helpful notes. The information provided
13727 here is incomplete - you are warned.</P
13728 ><DIV
13729 CLASS="SECT2"
13730 ><HR><H3
13731 CLASS="SECT2"
13732 ><A
13733 NAME="AEN2692"
13734 >17.1.1. Creating and Managing Windows 9x/Me Policies</A
13735 ></H3
13736 ><P
13737 >You need the Win98 Group Policy Editor to set Group Profiles up under Windows 9x/Me.
13738 It can be found on the Original full product Win98 installation CD under
13739 <TT
13740 CLASS="FILENAME"
13741 >tools/reskit/netadmin/poledit</TT
13742 >.  You install this using the
13743 Add/Remove Programs facility and then click on the 'Have Disk' tab.</P
13744 ><P
13745 >Use the Group Policy Editor to create a policy file that specifies the location of
13746 user profiles and/or the <TT
13747 CLASS="FILENAME"
13748 >My Documents</TT
13749 > etc.  stuff. You then
13750 save these settings in a file called <TT
13751 CLASS="FILENAME"
13752 >Config.POL</TT
13753 > that needs to
13754 be placed in the root of the [NETLOGON] share. If your Win98 is configured to log onto
13755 the Samba Domain, it will automatically read this file and update the Win9x/Me registry
13756 of the machine that is logging on.</P
13757 ><P
13758 >Further details are covered in the Win98 Resource Kit documentation.</P
13759 ><P
13760 >If you do not do it this way, then every so often Win9x/Me will check the
13761 integrity of the registry and will restore it's settings from the back-up
13762 copy of the registry it stores on each Win9x/Me machine. Hence, you will
13763 occasionally notice things changing back to the original settings.</P
13764 ><P
13765 >Install the group policy handler for Win9x to pick up group policies. Look on the
13766 Win98 CD in <TT
13767 CLASS="FILENAME"
13768 >\tools\reskit\netadmin\poledit</TT
13769 >.
13770 Install group policies on a Win9x client by double-clicking
13771 <TT
13772 CLASS="FILENAME"
13773 >grouppol.inf</TT
13774 >. Log off and on again a couple of times and see
13775 if Win98 picks up group policies.  Unfortunately this needs to be done on every
13776 Win9x/Me machine that uses group policies.</P
13777 ></DIV
13778 ><DIV
13779 CLASS="SECT2"
13780 ><HR><H3
13781 CLASS="SECT2"
13782 ><A
13783 NAME="AEN2704"
13784 >17.1.2. Creating and Managing Windows NT4 Style Policy Files</A
13785 ></H3
13786 ><P
13787 >To create or edit <TT
13788 CLASS="FILENAME"
13789 >ntconfig.pol</TT
13790 > you must use the NT Server
13791 Policy Editor, <B
13792 CLASS="COMMAND"
13793 >poledit.exe</B
13794 > which is included with NT4 Server
13795 but <SPAN
13796 CLASS="emphasis"
13797 ><I
13798 CLASS="EMPHASIS"
13799 >not NT Workstation</I
13800 ></SPAN
13801 >. There is a Policy Editor on a NT4
13802 Workstation but it is not suitable for creating <SPAN
13803 CLASS="emphasis"
13804 ><I
13805 CLASS="EMPHASIS"
13806 >Domain Policies</I
13807 ></SPAN
13808 >.
13809 Further, although the Windows 95 Policy Editor can be installed on an NT4
13810 Workstation/Server, it will not work with NT clients. However, the files from
13811 the NT Server will run happily enough on an NT4 Workstation.</P
13812 ><P
13813 >You need <TT
13814 CLASS="FILENAME"
13815 >poledit.exe, common.adm</TT
13816 > and <TT
13817 CLASS="FILENAME"
13818 >winnt.adm</TT
13819 >.
13820 It is convenient to put the two *.adm files in  the <TT
13821 CLASS="FILENAME"
13822 >c:\winnt\inf</TT
13823
13824 directory which is where the binary will look for them unless told otherwise. Note also that that
13825 directory is normally 'hidden'.</P
13826 ><P
13827 >The Windows NT policy editor is also included with the Service Pack 3 (and
13828 later) for Windows NT 4.0. Extract the files using <B
13829 CLASS="COMMAND"
13830 >servicepackname /x</B
13831 >,
13832 i.e. that's <B
13833 CLASS="COMMAND"
13834 >Nt4sp6ai.exe /x</B
13835 > for service pack 6a.  The policy editor,
13836 <B
13837 CLASS="COMMAND"
13838 >poledit.exe</B
13839 > and the associated template files (*.adm) should
13840 be extracted as well.  It is also possible to downloaded the policy template
13841 files for Office97 and get a copy of the policy editor.  Another possible
13842 location is with the Zero Administration Kit available for download from Microsoft.</P
13843 ><DIV
13844 CLASS="SECT3"
13845 ><HR><H4
13846 CLASS="SECT3"
13847 ><A
13848 NAME="AEN2719"
13849 >17.1.2.1. Registry Tattoos</A
13850 ></H4
13851 ><P
13852 >With NT4 style registry based policy changes, a large number of settings are not
13853 automatically reversed as the user logs off. Since the settings that were in the
13854 NTConfig.POL file were applied to the client machine registry and that apply to the
13855 hive key HKEY_LOCAL_MACHINE are permanent until explicitly reveresd. This is known
13856 as tattooing. It can have serious consequences down-stream and the administrator must
13857 be extreemly careful not to lock out the ability to manage the machine at a later date.</P
13858 ></DIV
13859 ></DIV
13860 ><DIV
13861 CLASS="SECT2"
13862 ><HR><H3
13863 CLASS="SECT2"
13864 ><A
13865 NAME="AEN2722"
13866 >17.1.3. Creating and Managing MS Windows 200x Policies</A
13867 ></H3
13868 ><P
13869 >Windows NT4 System policies allows setting of registry parameters specific to
13870 users, groups and computers (client workstations) that are members of the NT4
13871 style domain. Such policy file will work with MS Windows 2000 / XP clients also.</P
13872 ><P
13873 >New to MS Windows 2000 Microsoft introduced a new style of group policy that confers
13874 a superset of capabilities compared with NT4 style policies. Obviously, the tool used
13875 to create them is different, and the mechanism for implementing them is much changed.</P
13876 ><P
13877 >The older NT4 style registry based policies are known as <SPAN
13878 CLASS="emphasis"
13879 ><I
13880 CLASS="EMPHASIS"
13881 >Administrative Templates</I
13882 ></SPAN
13883 >
13884 in MS Windows 2000/XP Group Policy Objects (GPOs). The later includes ability to set various security
13885 configurations, enforce Internet Explorer browser settings, change and redirect aspects of the
13886 users' desktop (including: the location of <SPAN
13887 CLASS="emphasis"
13888 ><I
13889 CLASS="EMPHASIS"
13890 >My Documents</I
13891 ></SPAN
13892 > files (directory), as
13893 well as intrinsics of where menu items will appear in the Start menu). An additional new
13894 feature is the ability to make available particular software Windows applications to particular
13895 users and/or groups.</P
13896 ><P
13897 >Remember: NT4 policy files are named <TT
13898 CLASS="FILENAME"
13899 >NTConfig.POL</TT
13900 > and are stored in the root
13901 of the NETLOGON share on the domain controllers. A Windows NT4 user enters a username, a password
13902 and selects the domain name to which the logon will attempt to take place. During the logon
13903 process the client machine reads the NTConfig.POL file from the NETLOGON share on the authenticating
13904 server, modifies the local registry values according to the settings in this file.</P
13905 ><P
13906 >Windows 2K GPOs are very feature rich. They are NOT stored in the NETLOGON share, rather part of
13907 a Windows 200x policy file is stored in the Active Directory itself and the other part is stored
13908 in a shared (and replicated) volume called the SYSVOL folder. This folder is present on all Active
13909 Directory domain controllers. The part that is stored in the Active Directory itself is called the
13910 group policy container (GPC), and the part that is stored in the replicated share called SYSVOL is
13911 known as the group policy template (GPT).</P
13912 ><P
13913 >With NT4 clients the policy file is read and executed upon only aas each user log onto the network.
13914 MS Windows 200x policies are much more complex - GPOs are processed and applied at client machine
13915 startup (machine specific part) and when the user logs onto the network the user specific part
13916 is applied. In MS Windows 200x style policy management each machine and/or user may be subject
13917 to any number of concurently applicable (and applied) policy sets (GPOs). Active Directory allows
13918 the administrator to also set filters over the policy settings. No such equivalent capability
13919 exists with NT4 style policy files.</P
13920 ><DIV
13921 CLASS="SECT3"
13922 ><HR><H4
13923 CLASS="SECT3"
13924 ><A
13925 NAME="AEN2733"
13926 >17.1.3.1. Administration of Win2K Policies</A
13927 ></H4
13928 ><P
13929 >Instead of using the tool called "The System Policy Editor", commonly called Poledit (from the
13930 executable name poledit.exe), GPOs are created and managed using a Microsoft Management Console
13931 (MMC) snap-in as follows:</P
13932 ><P
13933 ></P
13934 ><UL
13935 ><LI
13936 ><P
13937 >       Go to the Windows 200x / XP menu <TT
13938 CLASS="FILENAME"
13939 >Start-&#62;Programs-&#62;Adminsitrative Tools</TT
13940 >
13941         and select the MMC snap-in called "Active Directory Users and Computers"
13942         </P
13943 ><P
13944 >       </P
13945 ></LI
13946 ><LI
13947 ><P
13948 >       Select the domain or organizational unit (OU) that you wish to manage, then right click
13949         to open the context menu for that object, select the properties item.
13950         </P
13951 ></LI
13952 ><LI
13953 ><P
13954 >       Now left click on the Group Policy tab, then left click on the New tab. Type a name
13955         for the new policy you will create.
13956         </P
13957 ></LI
13958 ><LI
13959 ><P
13960 >       Now left click on the Edit tab to commence the steps needed to create the GPO.
13961         </P
13962 ></LI
13963 ></UL
13964 ><P
13965 >All policy configuration options are controlled through the use of policy administrative
13966 templates. These files have a .adm extension, both in NT4 as well as in Windows 200x / XP.
13967 Beware however, since the .adm files are NOT interchangible across NT4 and Windows 200x.
13968 The later introduces many new features as well as extended definition capabilities. It is
13969 well beyond the scope of this documentation to explain how to program .adm files, for that
13970 the adminsitrator is referred to the Microsoft Windows Resource Kit for your particular
13971 version of MS Windows.</P
13972 ><DIV
13973 CLASS="NOTE"
13974 ><P
13975 ></P
13976 ><TABLE
13977 CLASS="NOTE"
13978 WIDTH="100%"
13979 BORDER="0"
13980 ><TR
13981 ><TD
13982 WIDTH="25"
13983 ALIGN="CENTER"
13984 VALIGN="TOP"
13985 ><IMG
13986 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
13987 HSPACE="5"
13988 ALT="Note"></TD
13989 ><TD
13990 ALIGN="LEFT"
13991 VALIGN="TOP"
13992 ><P
13993 >The MS Windows 2000 Resource Kit contains a tool called gpolmig.exe. This tool can be used
13994 to migrate an NT4 NTConfig.POL file into a Windows 200x style GPO. Be VERY careful how you
13995 use this powerful tool. Please refer to the resource kit manuals for specific usage information.</P
13996 ></TD
13997 ></TR
13998 ></TABLE
13999 ></DIV
14000 ></DIV
14001 ></DIV
14002 ></DIV
14003 ></DIV
14004 ><DIV
14005 CLASS="CHAPTER"
14006 ><HR><H1
14007 ><A
14008 NAME="PROFILEMGMT"
14009 ></A
14010 >Chapter 18. Profile Management</H1
14011 ><DIV
14012 CLASS="SECT1"
14013 ><H2
14014 CLASS="SECT1"
14015 ><A
14016 NAME="AEN2761"
14017 >18.1. Roaming Profiles</A
14018 ></H2
14019 ><DIV
14020 CLASS="WARNING"
14021 ><P
14022 ></P
14023 ><TABLE
14024 CLASS="WARNING"
14025 WIDTH="100%"
14026 BORDER="0"
14027 ><TR
14028 ><TD
14029 WIDTH="25"
14030 ALIGN="CENTER"
14031 VALIGN="TOP"
14032 ><IMG
14033 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
14034 HSPACE="5"
14035 ALT="Warning"></TD
14036 ><TD
14037 ALIGN="LEFT"
14038 VALIGN="TOP"
14039 ><P
14040 ><SPAN
14041 CLASS="emphasis"
14042 ><I
14043 CLASS="EMPHASIS"
14044 >NOTE!</I
14045 ></SPAN
14046 > Roaming profiles support is different for Win9X and WinNT.</P
14047 ></TD
14048 ></TR
14049 ></TABLE
14050 ></DIV
14051 ><P
14052 >Before discussing how to configure roaming profiles, it is useful to see how
14053 Win9X and WinNT clients implement these features.</P
14054 ><P
14055 >Win9X clients send a NetUserGetInfo request to the server to get the user's
14056 profiles location. However, the response does not have room for a separate
14057 profiles location field, only the user's home share. This means that Win9X
14058 profiles are restricted to being in the user's home directory.</P
14059 ><P
14060 >WinNT clients send a NetSAMLogon RPC request, which contains many fields,
14061 including a separate field for the location of the user's profiles.
14062 This means that support for profiles is different for Win9X and WinNT.</P
14063 ><DIV
14064 CLASS="SECT2"
14065 ><HR><H3
14066 CLASS="SECT2"
14067 ><A
14068 NAME="AEN2769"
14069 >18.1.1. Windows NT Configuration</A
14070 ></H3
14071 ><P
14072 >To support WinNT clients, in the [global] section of smb.conf set the
14073 following (for example):</P
14074 ><P
14075 ><PRE
14076 CLASS="PROGRAMLISTING"
14077 >logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath</PRE
14078 ></P
14079 ><P
14080 >The default for this option is \\%N\%U\profile, namely
14081 \\sambaserver\username\profile.  The \\N%\%U service is created
14082 automatically by the [homes] service.
14083 If you are using a samba server for the profiles, you _must_ make the
14084 share specified in the logon path browseable.</P
14085 ><DIV
14086 CLASS="NOTE"
14087 ><P
14088 ></P
14089 ><TABLE
14090 CLASS="NOTE"
14091 WIDTH="100%"
14092 BORDER="0"
14093 ><TR
14094 ><TD
14095 WIDTH="25"
14096 ALIGN="CENTER"
14097 VALIGN="TOP"
14098 ><IMG
14099 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
14100 HSPACE="5"
14101 ALT="Note"></TD
14102 ><TD
14103 ALIGN="LEFT"
14104 VALIGN="TOP"
14105 ><P
14106 >MS Windows NT/2K clients at times do not disconnect a connection to a server
14107 between logons. It is recommended to NOT use the <SPAN
14108 CLASS="emphasis"
14109 ><I
14110 CLASS="EMPHASIS"
14111 >homes</I
14112 ></SPAN
14113 >
14114 meta-service name as part of the profile share path.</P
14115 ></TD
14116 ></TR
14117 ></TABLE
14118 ></DIV
14119 ></DIV
14120 ><DIV
14121 CLASS="SECT2"
14122 ><HR><H3
14123 CLASS="SECT2"
14124 ><A
14125 NAME="AEN2778"
14126 >18.1.2. Windows 9X Configuration</A
14127 ></H3
14128 ><P
14129 >To support Win9X clients, you must use the "logon home" parameter. Samba has
14130 now been fixed so that "net use /home" now works as well, and it, too, relies
14131 on the "logon home" parameter.</P
14132 ><P
14133 >By using the logon home parameter, you are restricted to putting Win9X
14134 profiles in the user's home directory.   But wait! There is a trick you
14135 can use. If you set the following in the [global] section of your
14136 smb.conf file:</P
14137 ><P
14138 ><PRE
14139 CLASS="PROGRAMLISTING"
14140 >logon home = \\%L\%U\.profiles</PRE
14141 ></P
14142 ><P
14143 >then your Win9X clients will dutifully put their clients in a subdirectory
14144 of your home directory called .profiles (thus making them hidden).</P
14145 ><P
14146 >Not only that, but 'net use/home' will also work, because of a feature in
14147 Win9X. It removes any directory stuff off the end of the home directory area
14148 and only uses the server and share portion. That is, it looks like you
14149 specified \\%L\%U for "logon home".</P
14150 ></DIV
14151 ><DIV
14152 CLASS="SECT2"
14153 ><HR><H3
14154 CLASS="SECT2"
14155 ><A
14156 NAME="AEN2786"
14157 >18.1.3. Win9X and WinNT Configuration</A
14158 ></H3
14159 ><P
14160 >You can support profiles for both Win9X and WinNT clients by setting both the
14161 "logon home" and "logon path" parameters. For example:</P
14162 ><P
14163 ><PRE
14164 CLASS="PROGRAMLISTING"
14165 >logon home = \\%L\%U\.profiles
14166 logon path = \\%L\profiles\%U</PRE
14167 ></P
14168 ><DIV
14169 CLASS="NOTE"
14170 ><P
14171 ></P
14172 ><TABLE
14173 CLASS="NOTE"
14174 WIDTH="100%"
14175 BORDER="0"
14176 ><TR
14177 ><TD
14178 WIDTH="25"
14179 ALIGN="CENTER"
14180 VALIGN="TOP"
14181 ><IMG
14182 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
14183 HSPACE="5"
14184 ALT="Note"></TD
14185 ><TD
14186 ALIGN="LEFT"
14187 VALIGN="TOP"
14188 ><P
14189 >I have not checked what 'net use /home' does on NT when "logon home" is
14190 set as above.</P
14191 ></TD
14192 ></TR
14193 ></TABLE
14194 ></DIV
14195 ></DIV
14196 ><DIV
14197 CLASS="SECT2"
14198 ><HR><H3
14199 CLASS="SECT2"
14200 ><A
14201 NAME="AEN2793"
14202 >18.1.4. Windows 9X Profile Setup</A
14203 ></H3
14204 ><P
14205 >When a user first logs in on Windows 9X, the file user.DAT is created,
14206 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".
14207 These directories and their contents will be merged with the local
14208 versions stored in c:\windows\profiles\username on subsequent logins,
14209 taking the most recent from each.  You will need to use the [global]
14210 options "preserve case = yes", "short preserve case = yes" and
14211 "case sensitive = no" in order to maintain capital letters in shortcuts
14212 in any of the profile folders.</P
14213 ><P
14214 >The user.DAT file contains all the user's preferences.  If you wish to
14215 enforce a set of preferences, rename their user.DAT file to user.MAN,
14216 and deny them write access to this file.</P
14217 ><P
14218 ></P
14219 ><OL
14220 TYPE="1"
14221 ><LI
14222 ><P
14223 >        On the Windows 95 machine, go to Control Panel | Passwords and
14224         select the User Profiles tab.  Select the required level of
14225         roaming preferences.  Press OK, but do _not_ allow the computer
14226         to reboot.
14227         </P
14228 ></LI
14229 ><LI
14230 ><P
14231 >        On the Windows 95 machine, go to Control Panel | Network |
14232         Client for Microsoft Networks | Preferences.  Select 'Log on to
14233         NT Domain'.  Then, ensure that the Primary Logon is 'Client for
14234         Microsoft Networks'.  Press OK, and this time allow the computer
14235         to reboot.
14236         </P
14237 ></LI
14238 ></OL
14239 ><P
14240 >Under Windows 95, Profiles are downloaded from the Primary Logon.
14241 If you have the Primary Logon as 'Client for Novell Networks', then
14242 the profiles and logon script will be downloaded from your Novell
14243 Server.  If you have the Primary Logon as 'Windows Logon', then the
14244 profiles will be loaded from the local machine - a bit against the
14245 concept of roaming profiles, if you ask me.</P
14246 ><P
14247 >You will now find that the Microsoft Networks Login box contains
14248 [user, password, domain] instead of just [user, password].  Type in
14249 the samba server's domain name (or any other domain known to exist,
14250 but bear in mind that the user will be authenticated against this
14251 domain and profiles downloaded from it, if that domain logon server
14252 supports it), user name and user's password.</P
14253 ><P
14254 >Once the user has been successfully validated, the Windows 95 machine
14255 will inform you that 'The user has not logged on before' and asks you
14256 if you wish to save the user's preferences?  Select 'yes'.</P
14257 ><P
14258 >Once the Windows 95 client comes up with the desktop, you should be able
14259 to examine the contents of the directory specified in the "logon path"
14260 on the samba server and verify that the "Desktop", "Start Menu",
14261 "Programs" and "Nethood" folders have been created.</P
14262 ><P
14263 >These folders will be cached locally on the client, and updated when
14264 the user logs off (if you haven't made them read-only by then :-).
14265 You will find that if the user creates further folders or short-cuts,
14266 that the client will merge the profile contents downloaded with the
14267 contents of the profile directory already on the local client, taking
14268 the newest folders and short-cuts from each set.</P
14269 ><P
14270 >If you have made the folders / files read-only on the samba server,
14271 then you will get errors from the w95 machine on logon and logout, as
14272 it attempts to merge the local and the remote profile.  Basically, if
14273 you have any errors reported by the w95 machine, check the Unix file
14274 permissions and ownership rights on the profile directory contents,
14275 on the samba server.</P
14276 ><P
14277 >If you have problems creating user profiles, you can reset the user's
14278 local desktop cache, as shown below.  When this user then next logs in,
14279 they will be told that they are logging in "for the first time".</P
14280 ><P
14281 ></P
14282 ><OL
14283 TYPE="1"
14284 ><LI
14285 ><P
14286 >        instead of logging in under the [user, password, domain] dialog,
14287         press escape.
14288         </P
14289 ></LI
14290 ><LI
14291 ><P
14292 >        run the regedit.exe program, and look in:
14293         </P
14294 ><P
14295 >        HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
14296         </P
14297 ><P
14298 >        you will find an entry, for each user, of ProfilePath.  Note the
14299         contents of this key (likely to be c:\windows\profiles\username),
14300         then delete the key ProfilePath for the required user.
14301         </P
14302 ><P
14303 >        [Exit the registry editor].
14304         </P
14305 ></LI
14306 ><LI
14307 ><P
14308 >        <SPAN
14309 CLASS="emphasis"
14310 ><I
14311 CLASS="EMPHASIS"
14312 >WARNING</I
14313 ></SPAN
14314 > - before deleting the contents of the
14315         directory listed in
14316    the ProfilePath (this is likely to be c:\windows\profiles\username),
14317    ask them if they have any important files stored on their desktop
14318    or in their start menu.  delete the contents of the directory
14319    ProfilePath (making a backup if any of the files are needed).
14320         </P
14321 ><P
14322 >   This will have the effect of removing the local (read-only hidden
14323    system file) user.DAT in their profile directory, as well as the
14324    local "desktop", "nethood", "start menu" and "programs" folders.
14325         </P
14326 ></LI
14327 ><LI
14328 ><P
14329 >        search for the user's .PWL password-caching file in the c:\windows
14330         directory, and delete it.
14331         </P
14332 ></LI
14333 ><LI
14334 ><P
14335 >        log off the windows 95 client.
14336         </P
14337 ></LI
14338 ><LI
14339 ><P
14340 >        check the contents of the profile path (see "logon path" described
14341         above), and delete the user.DAT or user.MAN file for the user,
14342         making a backup if required.
14343         </P
14344 ></LI
14345 ></OL
14346 ><P
14347 >If all else fails, increase samba's debug log levels to between 3 and 10,
14348 and / or run a packet trace program such as tcpdump or netmon.exe, and
14349 look for any error reports.</P
14350 ><P
14351 >If you have access to an NT server, then first set up roaming profiles
14352 and / or netlogons on the NT server.  Make a packet trace, or examine
14353 the example packet traces provided with NT server, and see what the
14354 differences are with the equivalent samba trace.</P
14355 ></DIV
14356 ><DIV
14357 CLASS="SECT2"
14358 ><HR><H3
14359 CLASS="SECT2"
14360 ><A
14361 NAME="AEN2829"
14362 >18.1.5. Windows NT Workstation 4.0</A
14363 ></H3
14364 ><P
14365 >When a user first logs in to a Windows NT Workstation, the profile
14366 NTuser.DAT is created.  The profile location can be now specified
14367 through the "logon path" parameter.</P
14368 ><P
14369 >There is a parameter that is now available for use with NT Profiles:
14370 "logon drive".  This should be set to "h:" or any other drive, and
14371 should be used in conjunction with the new "logon home" parameter.</P
14372 ><P
14373 >The entry for the NT 4.0 profile is a _directory_ not a file.  The NT
14374 help on profiles mentions that a directory is also created with a .PDS
14375 extension.  The user, while logging in, must have write permission to
14376 create the full profile path (and the folder with the .PDS extension
14377 for those situations where it might be created.)</P
14378 ><P
14379 >In the profile directory, NT creates more folders than 95.  It creates
14380 "Application Data" and others, as well as "Desktop", "Nethood",
14381 "Start Menu" and "Programs".  The profile itself is stored in a file
14382 NTuser.DAT.  Nothing appears to be stored in the .PDS directory, and
14383 its purpose is currently unknown.</P
14384 ><P
14385 >You can use the System Control Panel to copy a local profile onto
14386 a samba server (see NT Help on profiles: it is also capable of firing
14387 up the correct location in the System Control Panel for you).  The
14388 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
14389 turns a profile into a mandatory one.</P
14390 ><P
14391 >The case of the profile is significant.  The file must be called
14392 NTuser.DAT or, for a mandatory profile, NTuser.MAN.</P
14393 ></DIV
14394 ><DIV
14395 CLASS="SECT2"
14396 ><HR><H3
14397 CLASS="SECT2"
14398 ><A
14399 NAME="AEN2837"
14400 >18.1.6. Windows NT/200x Server</A
14401 ></H3
14402 ><P
14403 >There is nothing to stop you specifying any path that you like for the
14404 location of users' profiles.  Therefore, you could specify that the
14405 profile be stored on a samba server, or any other SMB server, as long as
14406 that SMB server supports encrypted passwords.</P
14407 ></DIV
14408 ><DIV
14409 CLASS="SECT2"
14410 ><HR><H3
14411 CLASS="SECT2"
14412 ><A
14413 NAME="AEN2840"
14414 >18.1.7. Sharing Profiles between W9x/Me and NT4/200x/XP workstations</A
14415 ></H3
14416 ><P
14417 >Sharing of desktop profiles between Windows versions is NOT recommended.
14418 Desktop profiles are an evolving phenomenon and profiles for later versions
14419 of MS Windows clients add features that may interfere with earlier versions
14420 of MS Windows clients. Probably the more salient reason to NOT mix profiles
14421 is that when logging off an earlier version of MS Windows the older format
14422 of profile contents may overwrite information that belongs to the newer
14423 version resulting in loss of profile information content when that user logs
14424 on again with the newer version of MS Windows.</P
14425 ><P
14426 >If you then want to share the same Start Menu / Desktop with W9x/Me, you will
14427 need to specify a common location for the profiles. The smb.conf parameters
14428 that need to be common are <SPAN
14429 CLASS="emphasis"
14430 ><I
14431 CLASS="EMPHASIS"
14432 >logon path</I
14433 ></SPAN
14434 > and
14435 <SPAN
14436 CLASS="emphasis"
14437 ><I
14438 CLASS="EMPHASIS"
14439 >logon home</I
14440 ></SPAN
14441 >.</P
14442 ><P
14443 >If you have this set up correctly, you will find separate user.DAT and
14444 NTuser.DAT files in the same profile directory.</P
14445 ></DIV
14446 ><DIV
14447 CLASS="SECT2"
14448 ><HR><H3
14449 CLASS="SECT2"
14450 ><A
14451 NAME="AEN2847"
14452 >18.1.8. Windows NT 4</A
14453 ></H3
14454 ><P
14455 >Unfortunately, the Resource Kit info is Win NT4 or 200x specific.</P
14456 ><P
14457 >Here is a quick guide:</P
14458 ><P
14459 ></P
14460 ><UL
14461 ><LI
14462 ><P
14463 >On your NT4 Domain Controller, right click on 'My Computer', then
14464 select the tab labelled 'User Profiles'.</P
14465 ></LI
14466 ><LI
14467 ><P
14468 >Select a user profile you want to migrate and click on it.</P
14469 ><DIV
14470 CLASS="NOTE"
14471 ><P
14472 ></P
14473 ><TABLE
14474 CLASS="NOTE"
14475 WIDTH="90%"
14476 BORDER="0"
14477 ><TR
14478 ><TD
14479 WIDTH="25"
14480 ALIGN="CENTER"
14481 VALIGN="TOP"
14482 ><IMG
14483 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
14484 HSPACE="5"
14485 ALT="Note"></TD
14486 ><TD
14487 ALIGN="LEFT"
14488 VALIGN="TOP"
14489 ><P
14490 >I am using the term "migrate" lossely. You can copy a profile to
14491 create a group profile. You can give the user 'Everyone' rights to the
14492 profile you copy this to. That is what you need to do, since your samba
14493 domain is not a member of a trust relationship with your NT4 PDC.</P
14494 ></TD
14495 ></TR
14496 ></TABLE
14497 ></DIV
14498 ></LI
14499 ><LI
14500 ><P
14501 >Click the 'Copy To' button.</P
14502 ></LI
14503 ><LI
14504 ><P
14505 >In the box labelled 'Copy Profile to' add your new path, eg:
14506 <TT
14507 CLASS="FILENAME"
14508 >c:\temp\foobar</TT
14509 ></P
14510 ></LI
14511 ><LI
14512 ><P
14513 >Click on the button labelled 'Change' in the "Permitted to use" box.</P
14514 ></LI
14515 ><LI
14516 ><P
14517 >Click on the group 'Everyone' and then click OK. This closes the
14518 'chose user' box.</P
14519 ></LI
14520 ><LI
14521 ><P
14522 >Now click OK.</P
14523 ></LI
14524 ></UL
14525 ><P
14526 >Follow the above for every profile you need to migrate.</P
14527 ><DIV
14528 CLASS="SECT3"
14529 ><HR><H4
14530 CLASS="SECT3"
14531 ><A
14532 NAME="AEN2870"
14533 >18.1.8.1. Side bar Notes</A
14534 ></H4
14535 ><P
14536 >You should obtain the SID of your NT4 domain. You can use smbpasswd to do
14537 this. Read the man page.</P
14538 ><P
14539 >With Samba-3.0.0 alpha code you can import all you NT4 domain accounts
14540 using the net samsync method. This way you can retain your profile
14541 settings as well as all your users.</P
14542 ></DIV
14543 ><DIV
14544 CLASS="SECT3"
14545 ><HR><H4
14546 CLASS="SECT3"
14547 ><A
14548 NAME="AEN2874"
14549 >18.1.8.2. Mandatory profiles</A
14550 ></H4
14551 ><P
14552 >The above method can be used to create mandatory profiles also. To convert
14553 a group profile into a mandatory profile simply locate the NTUser.DAT file
14554 in the copied profile and rename it to NTUser.MAN.</P
14555 ></DIV
14556 ><DIV
14557 CLASS="SECT3"
14558 ><HR><H4
14559 CLASS="SECT3"
14560 ><A
14561 NAME="AEN2877"
14562 >18.1.8.3. moveuser.exe</A
14563 ></H4
14564 ><P
14565 >The W2K professional resource kit has moveuser.exe. moveuser.exe changes
14566 the security of a profile from one user to another.  This allows the account
14567 domain to change, and/or the user name to change.</P
14568 ></DIV
14569 ><DIV
14570 CLASS="SECT3"
14571 ><HR><H4
14572 CLASS="SECT3"
14573 ><A
14574 NAME="AEN2880"
14575 >18.1.8.4. Get SID</A
14576 ></H4
14577 ><P
14578 >You can identify the SID by using GetSID.exe from the Windows NT Server 4.0
14579 Resource Kit.</P
14580 ><P
14581 >Windows NT 4.0 stores the local profile information in the registry under
14582 the following key:
14583 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList</P
14584 ><P
14585 >Under the ProfileList key, there will be subkeys named with the SIDs of the
14586 users who have logged on to this computer. (To find the profile information
14587 for the user whose locally cached profile you want to move, find the SID for
14588 the user with the GetSID.exe utility.) Inside of the appropriate user's
14589 subkey, you will see a string value named ProfileImagePath.</P
14590 ></DIV
14591 ></DIV
14592 ><DIV
14593 CLASS="SECT2"
14594 ><HR><H3
14595 CLASS="SECT2"
14596 ><A
14597 NAME="AEN2885"
14598 >18.1.9. Windows 2000/XP</A
14599 ></H3
14600 ><P
14601 >You must first convert the profile from a local profile to a domain
14602 profile on the MS Windows workstation as follows:</P
14603 ><P
14604 ></P
14605 ><UL
14606 ><LI
14607 ><P
14608 >Log on as the LOCAL workstation administrator.</P
14609 ></LI
14610 ><LI
14611 ><P
14612 >Right click on the 'My Computer' Icon, select 'Properties'</P
14613 ></LI
14614 ><LI
14615 ><P
14616 >Click on the 'User Profiles' tab</P
14617 ></LI
14618 ><LI
14619 ><P
14620 >Select the profile you wish to convert (click on it once)</P
14621 ></LI
14622 ><LI
14623 ><P
14624 >Click on the button 'Copy To'</P
14625 ></LI
14626 ><LI
14627 ><P
14628 >In the "Permitted to use" box, click on the 'Change' button.</P
14629 ></LI
14630 ><LI
14631 ><P
14632 >Click on the 'Look in" area that lists the machine name, when you click
14633 here it will open up a selection box. Click on the domain to which the
14634 profile must be accessible.</P
14635 ><DIV
14636 CLASS="NOTE"
14637 ><P
14638 ></P
14639 ><TABLE
14640 CLASS="NOTE"
14641 WIDTH="90%"
14642 BORDER="0"
14643 ><TR
14644 ><TD
14645 WIDTH="25"
14646 ALIGN="CENTER"
14647 VALIGN="TOP"
14648 ><IMG
14649 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
14650 HSPACE="5"
14651 ALT="Note"></TD
14652 ><TD
14653 ALIGN="LEFT"
14654 VALIGN="TOP"
14655 ><P
14656 >You will need to log on if a logon box opens up. Eg: In the connect
14657 as: MIDEARTH\root, password: mypassword.</P
14658 ></TD
14659 ></TR
14660 ></TABLE
14661 ></DIV
14662 ></LI
14663 ><LI
14664 ><P
14665 >To make the profile capable of being used by anyone select 'Everyone'</P
14666 ></LI
14667 ><LI
14668 ><P
14669 >Click OK. The Selection box will close.</P
14670 ></LI
14671 ><LI
14672 ><P
14673 >Now click on the 'Ok' button to create the profile in the path you
14674 nominated.</P
14675 ></LI
14676 ></UL
14677 ><P
14678 >Done. You now have a profile that can be editted using the samba-3.0.0
14679 profiles tool.</P
14680 ><DIV
14681 CLASS="NOTE"
14682 ><P
14683 ></P
14684 ><TABLE
14685 CLASS="NOTE"
14686 WIDTH="100%"
14687 BORDER="0"
14688 ><TR
14689 ><TD
14690 WIDTH="25"
14691 ALIGN="CENTER"
14692 VALIGN="TOP"
14693 ><IMG
14694 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
14695 HSPACE="5"
14696 ALT="Note"></TD
14697 ><TD
14698 ALIGN="LEFT"
14699 VALIGN="TOP"
14700 ><P
14701 >Under NT/2K the use of mandotory profiles forces the use of MS Exchange
14702 storage of mail data. That keeps desktop profiles usable.</P
14703 ></TD
14704 ></TR
14705 ></TABLE
14706 ></DIV
14707 ><DIV
14708 CLASS="NOTE"
14709 ><P
14710 ></P
14711 ><TABLE
14712 CLASS="NOTE"
14713 WIDTH="100%"
14714 BORDER="0"
14715 ><TR
14716 ><TD
14717 WIDTH="25"
14718 ALIGN="CENTER"
14719 VALIGN="TOP"
14720 ><IMG
14721 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
14722 HSPACE="5"
14723 ALT="Note"></TD
14724 ><TD
14725 ALIGN="LEFT"
14726 VALIGN="TOP"
14727 ><P
14728 ></P
14729 ><UL
14730 ><LI
14731 ><P
14732 >This is a security check new to Windows XP (or maybe only
14733 Windows XP service pack 1).  It can be disabled via a group policy in
14734 Active Directory.  The policy is:</P
14735 ><P
14736 >"Computer Configuration\Administrative Templates\System\User
14737 Profiles\Do not check for user ownership of Roaming Profile Folders"</P
14738 ><P
14739 >...and it should be set to "Enabled".
14740 Does the new version of samba have an Active Directory analogue?  If so,
14741 then you may be able to set the policy through this.</P
14742 ><P
14743 >If you cannot set group policies in samba, then you may be able to set
14744 the policy locally on each machine.  If you want to try this, then do
14745 the following (N.B. I don't know for sure that this will work in the
14746 same way as a domain group policy):</P
14747 ></LI
14748 ><LI
14749 ><P
14750 >On the XP workstation log in with an Administrator account.</P
14751 ></LI
14752 ><LI
14753 ><P
14754 >Click: "Start", "Run"</P
14755 ></LI
14756 ><LI
14757 ><P
14758 >Type: "mmc"</P
14759 ></LI
14760 ><LI
14761 ><P
14762 >Click: "OK"</P
14763 ></LI
14764 ><LI
14765 ><P
14766 >A Microsoft Management Console should appear.</P
14767 ></LI
14768 ><LI
14769 ><P
14770 >Click: File, "Add/Remove Snap-in...", "Add"</P
14771 ></LI
14772 ><LI
14773 ><P
14774 >Double-Click: "Group Policy"</P
14775 ></LI
14776 ><LI
14777 ><P
14778 >Click: "Finish", "Close"</P
14779 ></LI
14780 ><LI
14781 ><P
14782 >Click: "OK"</P
14783 ></LI
14784 ><LI
14785 ><P
14786 >In the "Console Root" window:</P
14787 ></LI
14788 ><LI
14789 ><P
14790 >Expand: "Local Computer Policy", "Computer Configuration",</P
14791 ></LI
14792 ><LI
14793 ><P
14794 >"Administrative Templates", "System", "User Profiles"</P
14795 ></LI
14796 ><LI
14797 ><P
14798 >Double-Click: "Do not check for user ownership of Roaming Profile</P
14799 ></LI
14800 ><LI
14801 ><P
14802 >Folders"</P
14803 ></LI
14804 ><LI
14805 ><P
14806 >Select: "Enabled"</P
14807 ></LI
14808 ><LI
14809 ><P
14810 >Click: OK"</P
14811 ></LI
14812 ><LI
14813 ><P
14814 >Close the whole console.  You do not need to save the settings (this
14815 refers to the console settings rather than the policies you have
14816 changed).</P
14817 ></LI
14818 ><LI
14819 ><P
14820 >Reboot</P
14821 ></LI
14822 ></UL
14823 ></TD
14824 ></TR
14825 ></TABLE
14826 ></DIV
14827 ></DIV
14828 ></DIV
14829 ></DIV
14830 ><DIV
14831 CLASS="CHAPTER"
14832 ><HR><H1
14833 ><A
14834 NAME="INTEGRATE-MS-NETWORKS"
14835 ></A
14836 >Chapter 19. Integrating MS Windows networks with Samba</H1
14837 ><P
14838 >This section deals with NetBIOS over TCP/IP name to IP address resolution. If you
14839 your MS Windows clients are NOT configured to use NetBIOS over TCP/IP then this
14840 section does not apply to your installation. If your installation involves use of
14841 NetBIOS over TCP/IP then this section may help you to resolve networking problems.</P
14842 ><DIV
14843 CLASS="NOTE"
14844 ><P
14845 ></P
14846 ><TABLE
14847 CLASS="NOTE"
14848 WIDTH="100%"
14849 BORDER="0"
14850 ><TR
14851 ><TD
14852 WIDTH="25"
14853 ALIGN="CENTER"
14854 VALIGN="TOP"
14855 ><IMG
14856 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
14857 HSPACE="5"
14858 ALT="Note"></TD
14859 ><TD
14860 ALIGN="LEFT"
14861 VALIGN="TOP"
14862 ><P
14863 >       NetBIOS over TCP/IP has nothing to do with NetBEUI. NetBEUI is NetBIOS
14864         over Logical Link Control (LLC). On modern networks it is highly advised
14865         to NOT run NetBEUI at all. Note also that there is NO such thing as
14866         NetBEUI over TCP/IP - the existence of such a protocol is a complete
14867         and utter mis-apprehension.</P
14868 ></TD
14869 ></TR
14870 ></TABLE
14871 ></DIV
14872 ><P
14873 >Since the introduction of MS Windows 2000 it is possible to run MS Windows networking
14874 without the use of NetBIOS over TCP/IP. NetBIOS over TCP/IP uses UDP port 137 for NetBIOS
14875 name resolution and uses TCP port 139 for NetBIOS session services. When NetBIOS over
14876 TCP/IP is disabled on MS Windows 2000 and later clients then only TCP port 445 will be
14877 used and UDP port 137 and TCP port 139 will not.</P
14878 ><DIV
14879 CLASS="NOTE"
14880 ><P
14881 ></P
14882 ><TABLE
14883 CLASS="NOTE"
14884 WIDTH="100%"
14885 BORDER="0"
14886 ><TR
14887 ><TD
14888 WIDTH="25"
14889 ALIGN="CENTER"
14890 VALIGN="TOP"
14891 ><IMG
14892 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
14893 HSPACE="5"
14894 ALT="Note"></TD
14895 ><TD
14896 ALIGN="LEFT"
14897 VALIGN="TOP"
14898 ><P
14899 >When using Windows 2000 or later clients, if NetBIOS over TCP/IP is NOT disabled, then
14900 the client will use UDP port 137 (NetBIOS Name Service, also known as the Windows Internet
14901 Name Service or WINS), TCP port 139 AND TCP port 445 (for actual file and print traffic).</P
14902 ></TD
14903 ></TR
14904 ></TABLE
14905 ></DIV
14906 ><P
14907 >When NetBIOS over TCP/IP is disabled the use of DNS is essential. Most installations that
14908 disable NetBIOS over TCP/IP today use MS Active Directory Service (ADS). ADS requires
14909 Dynamic DNS with Service Resource Records (SRV RR) and with Incremental Zone Transfers (IXFR).
14910 Use of DHCP with ADS is recommended as a further means of maintaining central control
14911 over client workstation network configuration.</P
14912 ><DIV
14913 CLASS="SECT1"
14914 ><HR><H2
14915 CLASS="SECT1"
14916 ><A
14917 NAME="AEN2975"
14918 >19.1. Name Resolution in a pure Unix/Linux world</A
14919 ></H2
14920 ><P
14921 >The key configuration files covered in this section are:</P
14922 ><P
14923 ></P
14924 ><UL
14925 ><LI
14926 ><P
14927 ><TT
14928 CLASS="FILENAME"
14929 >/etc/hosts</TT
14930 ></P
14931 ></LI
14932 ><LI
14933 ><P
14934 ><TT
14935 CLASS="FILENAME"
14936 >/etc/resolv.conf</TT
14937 ></P
14938 ></LI
14939 ><LI
14940 ><P
14941 ><TT
14942 CLASS="FILENAME"
14943 >/etc/host.conf</TT
14944 ></P
14945 ></LI
14946 ><LI
14947 ><P
14948 ><TT
14949 CLASS="FILENAME"
14950 >/etc/nsswitch.conf</TT
14951 ></P
14952 ></LI
14953 ></UL
14954 ><DIV
14955 CLASS="SECT2"
14956 ><HR><H3
14957 CLASS="SECT2"
14958 ><A
14959 NAME="AEN2991"
14960 >19.1.1. <TT
14961 CLASS="FILENAME"
14962 >/etc/hosts</TT
14963 ></A
14964 ></H3
14965 ><P
14966 >Contains a static list of IP Addresses and names.
14967 eg:</P
14968 ><P
14969 ><PRE
14970 CLASS="PROGRAMLISTING"
14971 >       127.0.0.1       localhost localhost.localdomain
14972         192.168.1.1     bigbox.caldera.com      bigbox  alias4box</PRE
14973 ></P
14974 ><P
14975 >The purpose of <TT
14976 CLASS="FILENAME"
14977 >/etc/hosts</TT
14978 > is to provide a 
14979 name resolution mechanism so that uses do not need to remember 
14980 IP addresses.</P
14981 ><P
14982 >Network packets that are sent over the physical network transport 
14983 layer communicate not via IP addresses but rather using the Media 
14984 Access Control address, or MAC address. IP Addresses are currently 
14985 32 bits in length and are typically presented as four (4) decimal 
14986 numbers that are separated by a dot (or period). eg: 168.192.1.1</P
14987 ><P
14988 >MAC Addresses use 48 bits (or 6 bytes) and are typically represented 
14989 as two digit hexadecimal numbers separated by colons. eg: 
14990 40:8e:0a:12:34:56</P
14991 ><P
14992 >Every network interfrace must have an MAC address. Associated with 
14993 a MAC address there may be one or more IP addresses. There is NO 
14994 relationship between an IP address and a MAC address, all such assignments 
14995 are arbitary or discretionary in nature. At the most basic level all 
14996 network communications takes place using MAC addressing. Since MAC 
14997 addresses must be globally unique, and generally remains fixed for 
14998 any particular interface, the assignment of an IP address makes sense 
14999 from a network management perspective. More than one IP address can 
15000 be assigned per MAC address. One address must be the primary IP address, 
15001 this is the address that will be returned in the ARP reply.</P
15002 ><P
15003 >When a user or a process wants to communicate with another machine 
15004 the protocol implementation ensures that the "machine name" or "host 
15005 name" is resolved to an IP address in a manner that is controlled 
15006 by the TCP/IP configuration control files. The file 
15007 <TT
15008 CLASS="FILENAME"
15009 >/etc/hosts</TT
15010 > is one such file.</P
15011 ><P
15012 >When the IP address of the destination interface has been 
15013 determined a protocol called ARP/RARP is used to identify 
15014 the MAC address of the target interface. ARP stands for Address 
15015 Resolution Protocol, and is a broadcast oriented method that 
15016 uses UDP (User Datagram Protocol) to send a request to all 
15017 interfaces on the local network segment using the all 1's MAC 
15018 address. Network interfaces are programmed to respond to two 
15019 MAC addresses only; their own unique address and the address 
15020 ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will 
15021 contain the MAC address and the primary IP address for each 
15022 interface.</P
15023 ><P
15024 >The <TT
15025 CLASS="FILENAME"
15026 >/etc/hosts</TT
15027 > file is foundational to all 
15028 Unix/Linux TCP/IP installations and as a minumum will contain 
15029 the localhost and local network interface IP addresses and the 
15030 primary names by which they are known within the local machine. 
15031 This file helps to prime the pump so that a basic level of name 
15032 resolution can exist before any other method of name resolution 
15033 becomes available.</P
15034 ></DIV
15035 ><DIV
15036 CLASS="SECT2"
15037 ><HR><H3
15038 CLASS="SECT2"
15039 ><A
15040 NAME="AEN3007"
15041 >19.1.2. <TT
15042 CLASS="FILENAME"
15043 >/etc/resolv.conf</TT
15044 ></A
15045 ></H3
15046 ><P
15047 >This file tells the name resolution libraries:</P
15048 ><P
15049 ></P
15050 ><UL
15051 ><LI
15052 ><P
15053 >The name of the domain to which the machine 
15054         belongs
15055         </P
15056 ></LI
15057 ><LI
15058 ><P
15059 >The name(s) of any domains that should be 
15060         automatically searched when trying to resolve unqualified 
15061         host names to their IP address
15062         </P
15063 ></LI
15064 ><LI
15065 ><P
15066 >The name or IP address of available Domain 
15067         Name Servers that may be asked to perform name to address 
15068         translation lookups
15069         </P
15070 ></LI
15071 ></UL
15072 ></DIV
15073 ><DIV
15074 CLASS="SECT2"
15075 ><HR><H3
15076 CLASS="SECT2"
15077 ><A
15078 NAME="AEN3018"
15079 >19.1.3. <TT
15080 CLASS="FILENAME"
15081 >/etc/host.conf</TT
15082 ></A
15083 ></H3
15084 ><P
15085 ><TT
15086 CLASS="FILENAME"
15087 >/etc/host.conf</TT
15088 > is the primary means by 
15089 which the setting in /etc/resolv.conf may be affected. It is a 
15090 critical configuration file.  This file controls the order by 
15091 which name resolution may procede. The typical structure is:</P
15092 ><P
15093 ><PRE
15094 CLASS="PROGRAMLISTING"
15095 >       order hosts,bind
15096         multi on</PRE
15097 ></P
15098 ><P
15099 >then both addresses should be returned. Please refer to the 
15100 man page for host.conf for further details.</P
15101 ></DIV
15102 ><DIV
15103 CLASS="SECT2"
15104 ><HR><H3
15105 CLASS="SECT2"
15106 ><A
15107 NAME="AEN3026"
15108 >19.1.4. <TT
15109 CLASS="FILENAME"
15110 >/etc/nsswitch.conf</TT
15111 ></A
15112 ></H3
15113 ><P
15114 >This file controls the actual name resolution targets. The 
15115 file typically has resolver object specifications as follows:</P
15116 ><P
15117 ><PRE
15118 CLASS="PROGRAMLISTING"
15119 >       # /etc/nsswitch.conf
15120         #
15121         # Name Service Switch configuration file.
15122         #
15123
15124         passwd:         compat
15125         # Alternative entries for password authentication are:
15126         # passwd:       compat files nis ldap winbind
15127         shadow:         compat
15128         group:          compat
15129
15130         hosts:          files nis dns
15131         # Alternative entries for host name resolution are:
15132         # hosts:        files dns nis nis+ hesoid db compat ldap wins
15133         networks:       nis files dns
15134
15135         ethers:         nis files
15136         protocols:      nis files
15137         rpc:            nis files
15138         services:       nis files</PRE
15139 ></P
15140 ><P
15141 >Of course, each of these mechanisms requires that the appropriate 
15142 facilities and/or services are correctly configured.</P
15143 ><P
15144 >It should be noted that unless a network request/message must be 
15145 sent, TCP/IP networks are silent. All TCP/IP communications assumes a 
15146 principal of speaking only when necessary.</P
15147 ><P
15148 >Starting with version 2.2.0 samba has Linux support for extensions to 
15149 the name service switch infrastructure so that linux clients will 
15150 be able to obtain resolution of MS Windows NetBIOS names to IP 
15151 Addresses. To gain this functionality Samba needs to be compiled 
15152 with appropriate arguments to the make command (ie: <B
15153 CLASS="COMMAND"
15154 >make 
15155 nsswitch/libnss_wins.so</B
15156 >). The resulting library should 
15157 then be installed in the <TT
15158 CLASS="FILENAME"
15159 >/lib</TT
15160 > directory and 
15161 the "wins" parameter needs to be added to the "hosts:" line in 
15162 the <TT
15163 CLASS="FILENAME"
15164 >/etc/nsswitch.conf</TT
15165 > file. At this point it 
15166 will be possible to ping any MS Windows machine by it's NetBIOS 
15167 machine name, so long as that machine is within the workgroup to 
15168 which both the samba machine and the MS Windows machine belong.</P
15169 ></DIV
15170 ></DIV
15171 ><DIV
15172 CLASS="SECT1"
15173 ><HR><H2
15174 CLASS="SECT1"
15175 ><A
15176 NAME="AEN3038"
15177 >19.2. Name resolution as used within MS Windows networking</A
15178 ></H2
15179 ><P
15180 >MS Windows networking is predicated about the name each machine 
15181 is given. This name is known variously (and inconsistently) as 
15182 the "computer name", "machine name", "networking name", "netbios name", 
15183 "SMB name". All terms mean the same thing with the exception of 
15184 "netbios name" which can apply also to the name of the workgroup or the 
15185 domain name. The terms "workgroup" and "domain" are really just a 
15186 simply name with which the machine is associated. All NetBIOS names 
15187 are exactly 16 characters in length. The 16th character is reserved. 
15188 It is used to store a one byte value that indicates service level 
15189 information for the NetBIOS name that is registered. A NetBIOS machine 
15190 name is therefore registered for each service type that is provided by 
15191 the client/server.</P
15192 ><P
15193 >The following are typical NetBIOS name/service type registrations:</P
15194 ><P
15195 ><PRE
15196 CLASS="PROGRAMLISTING"
15197 >       Unique NetBIOS Names:
15198                 MACHINENAME&#60;00&#62; = Server Service is running on MACHINENAME
15199                 MACHINENAME&#60;03&#62; = Generic Machine Name (NetBIOS name)
15200                 MACHINENAME&#60;20&#62; = LanMan Server service is running on MACHINENAME
15201                 WORKGROUP&#60;1b&#62; = Domain Master Browser
15202
15203         Group Names:
15204                 WORKGROUP&#60;03&#62; = Generic Name registered by all members of WORKGROUP
15205                 WORKGROUP&#60;1c&#62; = Domain Controllers / Netlogon Servers
15206                 WORKGROUP&#60;1d&#62; = Local Master Browsers
15207                 WORKGROUP&#60;1e&#62; = Internet Name Resolvers</PRE
15208 ></P
15209 ><P
15210 >It should be noted that all NetBIOS machines register their own 
15211 names as per the above. This is in vast contrast to TCP/IP 
15212 installations where traditionally the system administrator will 
15213 determine in the /etc/hosts or in the DNS database what names 
15214 are associated with each IP address.</P
15215 ><P
15216 >One further point of clarification should be noted, the <TT
15217 CLASS="FILENAME"
15218 >/etc/hosts</TT
15219
15220 file and the DNS records do not provide the NetBIOS name type information 
15221 that MS Windows clients depend on to locate the type of service that may 
15222 be needed. An example of this is what happens when an MS Windows client 
15223 wants to locate a domain logon server. It find this service and the IP 
15224 address of a server that provides it by performing a lookup (via a 
15225 NetBIOS broadcast) for enumeration of all machines that have 
15226 registered the name type *&#60;1c&#62;. A logon request is then sent to each 
15227 IP address that is returned in the enumerated list of IP addresses. Which 
15228 ever machine first replies then ends up providing the logon services.</P
15229 ><P
15230 >The name "workgroup" or "domain" really can be confusing since these 
15231 have the added significance of indicating what is the security 
15232 architecture of the MS Windows network. The term "workgroup" indicates 
15233 that the primary nature of the network environment is that of a 
15234 peer-to-peer design. In a WORKGROUP all machines are responsible for 
15235 their own security, and generally such security is limited to use of 
15236 just a password (known as SHARE MODE security). In most situations 
15237 with peer-to-peer networking the users who control their own machines 
15238 will simply opt to have no security at all. It is possible to have 
15239 USER MODE security in a WORKGROUP environment, thus requiring use 
15240 of a user name and a matching password.</P
15241 ><P
15242 >MS Windows networking is thus predetermined to use machine names 
15243 for all local and remote machine message passing. The protocol used is 
15244 called Server Message Block (SMB) and this is implemented using 
15245 the NetBIOS protocol (Network Basic Input Output System). NetBIOS can 
15246 be encapsulated using LLC (Logical Link Control) protocol - in which case 
15247 the resulting protocol is called NetBEUI (Network Basic Extended User 
15248 Interface). NetBIOS can also be run over IPX (Internetworking Packet 
15249 Exchange) protocol as used by Novell NetWare, and it can be run 
15250 over TCP/IP protocols - in which case the resulting protocol is called 
15251 NBT or NetBT, the NetBIOS over TCP/IP.</P
15252 ><P
15253 >MS Windows machines use a complex array of name resolution mechanisms. 
15254 Since we are primarily concerned with TCP/IP this demonstration is 
15255 limited to this area.</P
15256 ><DIV
15257 CLASS="SECT2"
15258 ><HR><H3
15259 CLASS="SECT2"
15260 ><A
15261 NAME="AEN3050"
15262 >19.2.1. The NetBIOS Name Cache</A
15263 ></H3
15264 ><P
15265 >All MS Windows machines employ an in memory buffer in which is 
15266 stored the NetBIOS names and IP addresses for all external 
15267 machines that that machine has communicated with over the 
15268 past 10-15 minutes. It is more efficient to obtain an IP address 
15269 for a machine from the local cache than it is to go through all the 
15270 configured name resolution mechanisms.</P
15271 ><P
15272 >If a machine whose name is in the local name cache has been shut 
15273 down before the name had been expired and flushed from the cache, then 
15274 an attempt to exchange a message with that machine will be subject 
15275 to time-out delays. i.e.: Its name is in the cache, so a name resolution 
15276 lookup will succeed, but the machine can not respond. This can be 
15277 frustrating for users - but it is a characteristic of the protocol.</P
15278 ><P
15279 >The MS Windows utility that allows examination of the NetBIOS 
15280 name cache is called "nbtstat". The Samba equivalent of this 
15281 is called "nmblookup".</P
15282 ></DIV
15283 ><DIV
15284 CLASS="SECT2"
15285 ><HR><H3
15286 CLASS="SECT2"
15287 ><A
15288 NAME="AEN3055"
15289 >19.2.2. The LMHOSTS file</A
15290 ></H3
15291 ><P
15292 >This file is usually located in MS Windows NT 4.0 or 
15293 2000 in <TT
15294 CLASS="FILENAME"
15295 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
15296 > and contains 
15297 the IP Address and the machine name in matched pairs. The 
15298 <TT
15299 CLASS="FILENAME"
15300 >LMHOSTS</TT
15301 > file performs NetBIOS name 
15302 to IP address mapping oriented.</P
15303 ><P
15304 >It typically looks like:</P
15305 ><P
15306 ><PRE
15307 CLASS="PROGRAMLISTING"
15308 >       # Copyright (c) 1998 Microsoft Corp.
15309         #
15310         # This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
15311         # over TCP/IP) stack for Windows98
15312         #
15313         # This file contains the mappings of IP addresses to NT computernames
15314         # (NetBIOS) names.  Each entry should be kept on an individual line.
15315         # The IP address should be placed in the first column followed by the
15316         # corresponding computername. The address and the comptername
15317         # should be separated by at least one space or tab. The "#" character
15318         # is generally used to denote the start of a comment (see the exceptions
15319         # below).
15320         #
15321         # This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
15322         # files and offers the following extensions:
15323         #
15324         #      #PRE
15325         #      #DOM:&#60;domain&#62;
15326         #      #INCLUDE &#60;filename&#62;
15327         #      #BEGIN_ALTERNATE
15328         #      #END_ALTERNATE
15329         #      \0xnn (non-printing character support)
15330         #
15331         # Following any entry in the file with the characters "#PRE" will cause
15332         # the entry to be preloaded into the name cache. By default, entries are
15333         # not preloaded, but are parsed only after dynamic name resolution fails.
15334         #
15335         # Following an entry with the "#DOM:&#60;domain&#62;" tag will associate the
15336         # entry with the domain specified by &#60;domain&#62;. This affects how the
15337         # browser and logon services behave in TCP/IP environments. To preload
15338         # the host name associated with #DOM entry, it is necessary to also add a
15339         # #PRE to the line. The &#60;domain&#62; is always preloaded although it will not
15340         # be shown when the name cache is viewed.
15341         #
15342         # Specifying "#INCLUDE &#60;filename&#62;" will force the RFC NetBIOS (NBT)
15343         # software to seek the specified &#60;filename&#62; and parse it as if it were
15344         # local. &#60;filename&#62; is generally a UNC-based name, allowing a
15345         # centralized lmhosts file to be maintained on a server.
15346         # It is ALWAYS necessary to provide a mapping for the IP address of the
15347         # server prior to the #INCLUDE. This mapping must use the #PRE directive.
15348         # In addtion the share "public" in the example below must be in the
15349         # LanManServer list of "NullSessionShares" in order for client machines to
15350         # be able to read the lmhosts file successfully. This key is under
15351         # \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
15352         # in the registry. Simply add "public" to the list found there.
15353         #
15354         # The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
15355         # statements to be grouped together. Any single successful include
15356         # will cause the group to succeed.
15357         #
15358         # Finally, non-printing characters can be embedded in mappings by
15359         # first surrounding the NetBIOS name in quotations, then using the
15360         # \0xnn notation to specify a hex value for a non-printing character.
15361         #
15362         # The following example illustrates all of these extensions:
15363         #
15364         # 102.54.94.97     rhino         #PRE #DOM:networking  #net group's DC
15365         # 102.54.94.102    "appname  \0x14"                    #special app server
15366         # 102.54.94.123    popular            #PRE             #source server
15367         # 102.54.94.117    localsrv           #PRE             #needed for the include
15368         #
15369         # #BEGIN_ALTERNATE
15370         # #INCLUDE \\localsrv\public\lmhosts
15371         # #INCLUDE \\rhino\public\lmhosts
15372         # #END_ALTERNATE
15373         #
15374         # In the above example, the "appname" server contains a special
15375         # character in its name, the "popular" and "localsrv" server names are
15376         # preloaded, and the "rhino" server name is specified so it can be used
15377         # to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
15378         # system is unavailable.
15379         #
15380         # Note that the whole file is parsed including comments on each lookup,
15381         # so keeping the number of comments to a minimum will improve performance.
15382         # Therefore it is not advisable to simply add lmhosts file entries onto the
15383         # end of this file.</PRE
15384 ></P
15385 ></DIV
15386 ><DIV
15387 CLASS="SECT2"
15388 ><HR><H3
15389 CLASS="SECT2"
15390 ><A
15391 NAME="AEN3063"
15392 >19.2.3. HOSTS file</A
15393 ></H3
15394 ><P
15395 >This file is usually located in MS Windows NT 4.0 or 2000 in 
15396 <TT
15397 CLASS="FILENAME"
15398 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
15399 > and contains 
15400 the IP Address and the IP hostname in matched pairs. It can be 
15401 used by the name resolution infrastructure in MS Windows, depending 
15402 on how the TCP/IP environment is configured. This file is in 
15403 every way the equivalent of the Unix/Linux <TT
15404 CLASS="FILENAME"
15405 >/etc/hosts</TT
15406 > file.</P
15407 ></DIV
15408 ><DIV
15409 CLASS="SECT2"
15410 ><HR><H3
15411 CLASS="SECT2"
15412 ><A
15413 NAME="AEN3068"
15414 >19.2.4. DNS Lookup</A
15415 ></H3
15416 ><P
15417 >This capability is configured in the TCP/IP setup area in the network 
15418 configuration facility. If enabled an elaborate name resolution sequence 
15419 is followed the precise nature of which isdependant on what the NetBIOS 
15420 Node Type parameter is configured to. A Node Type of 0 means use 
15421 NetBIOS broadcast (over UDP broadcast) is first used if the name 
15422 that is the subject of a name lookup is not found in the NetBIOS name 
15423 cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to 
15424 Node Type 8, then a NetBIOS Unicast (over UDP Unicast) is sent to the 
15425 WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast 
15426 lookup is used.</P
15427 ></DIV
15428 ><DIV
15429 CLASS="SECT2"
15430 ><HR><H3
15431 CLASS="SECT2"
15432 ><A
15433 NAME="AEN3071"
15434 >19.2.5. WINS Lookup</A
15435 ></H3
15436 ><P
15437 >A WINS (Windows Internet Name Server) service is the equivaent of the 
15438 rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores 
15439 the names and IP addresses that are registered by a Windows client 
15440 if the TCP/IP setup has been given at least one WINS Server IP Address.</P
15441 ><P
15442 >To configure Samba to be a WINS server the following parameter needs 
15443 to be added to the <TT
15444 CLASS="FILENAME"
15445 >smb.conf</TT
15446 > file:</P
15447 ><P
15448 ><PRE
15449 CLASS="PROGRAMLISTING"
15450 >       wins support = Yes</PRE
15451 ></P
15452 ><P
15453 >To configure Samba to use a WINS server the following parameters are 
15454 needed in the smb.conf file:</P
15455 ><P
15456 ><PRE
15457 CLASS="PROGRAMLISTING"
15458 >       wins support = No
15459         wins server = xxx.xxx.xxx.xxx</PRE
15460 ></P
15461 ><P
15462 >where <VAR
15463 CLASS="REPLACEABLE"
15464 >xxx.xxx.xxx.xxx</VAR
15465 > is the IP address 
15466 of the WINS server.</P
15467 ></DIV
15468 ></DIV
15469 ></DIV
15470 ><DIV
15471 CLASS="CHAPTER"
15472 ><HR><H1
15473 ><A
15474 NAME="IMPROVED-BROWSING"
15475 ></A
15476 >Chapter 20. Improved browsing in samba</H1
15477 ><DIV
15478 CLASS="SECT1"
15479 ><H2
15480 CLASS="SECT1"
15481 ><A
15482 NAME="AEN3090"
15483 >20.1. Overview of browsing</A
15484 ></H2
15485 ><P
15486 >SMB networking provides a mechanism by which clients can access a list
15487 of machines in a network, a so-called "browse list".  This list
15488 contains machines that are ready to offer file and/or print services
15489 to other machines within the network. Thus it does not include
15490 machines which aren't currently able to do server tasks.  The browse
15491 list is heavily used by all SMB clients.  Configuration of SMB
15492 browsing has been problematic for some Samba users, hence this
15493 document.</P
15494 ><P
15495 >MS Windows 2000 and later, as with Samba-3 and later, can be
15496 configured to not use NetBIOS over TCP/IP. When configured this way
15497 it is imperative that name resolution (using DNS/LDAP/ADS) be correctly
15498 configured and operative. Browsing will NOT work if name resolution
15499 from SMB machine names to IP addresses does not function correctly.</P
15500 ><P
15501 >Where NetBIOS over TCP/IP is enabled use of a WINS server is highly
15502 recommended to aid the resolution of NetBIOS (SMB) names to IP addresses.
15503 WINS allows remote segment clients to obtain NetBIOS name_type information
15504 that can NOT be provided by any other means of name resolution.</P
15505 ></DIV
15506 ><DIV
15507 CLASS="SECT1"
15508 ><HR><H2
15509 CLASS="SECT1"
15510 ><A
15511 NAME="AEN3095"
15512 >20.2. Browsing support in samba</A
15513 ></H2
15514 ><P
15515 >Samba facilitates browsing.  The browsing is supported by nmbd
15516 and is also controlled by options in the smb.conf file (see smb.conf(5)).
15517 Samba can act as a local browse master for a workgroup and the ability
15518 for samba to support domain logons and scripts is now available.</P
15519 ><P
15520 >Samba can also act as a domain master browser for a workgroup.  This
15521 means that it will collate lists from local browse masters into a
15522 wide area network server list.  In order for browse clients to
15523 resolve the names they may find in this list, it is recommended that
15524 both samba and your clients use a WINS server.</P
15525 ><P
15526 >Note that you should NOT set Samba to be the domain master for a
15527 workgroup that has the same name as an NT Domain: on each wide area
15528 network, you must only ever have one domain master browser per workgroup,
15529 regardless of whether it is NT, Samba or any other type of domain master
15530 that is providing this service.</P
15531 ><P
15532 >[Note that nmbd can be configured as a WINS server, but it is not
15533 necessary to specifically use samba as your WINS server.  MS Windows
15534 NT4, Server or Advanced Server 2000 or 2003 can be configured as
15535 your WINS server.  In a mixed NT/2000/2003 server and samba environment on
15536 a Wide Area Network, it is recommended that you use the Microsoft
15537 WINS server capabilities.  In a samba-only environment, it is
15538 recommended that you use one and only one Samba server as your WINS server.</P
15539 ><P
15540 >To get browsing to work you need to run nmbd as usual, but will need
15541 to use the "workgroup" option in smb.conf to control what workgroup
15542 Samba becomes a part of.</P
15543 ><P
15544 >Samba also has a useful option for a Samba server to offer itself for
15545 browsing on another subnet.  It is recommended that this option is only
15546 used for 'unusual' purposes: announcements over the internet, for
15547 example.  See "remote announce" in the smb.conf man page.  </P
15548 ></DIV
15549 ><DIV
15550 CLASS="SECT1"
15551 ><HR><H2
15552 CLASS="SECT1"
15553 ><A
15554 NAME="AEN3103"
15555 >20.3. Problem resolution</A
15556 ></H2
15557 ><P
15558 >If something doesn't work then hopefully the log.nmb file will help
15559 you track down the problem.  Try a debug level of 2 or 3 for finding
15560 problems. Also note that the current browse list usually gets stored
15561 in text form in a file called browse.dat.</P
15562 ><P
15563 >Note that if it doesn't work for you, then you should still be able to
15564 type the server name as \\SERVER in filemanager then hit enter and
15565 filemanager should display the list of available shares.</P
15566 ><P
15567 >Some people find browsing fails because they don't have the global
15568 "guest account" set to a valid account.  Remember that the IPC$
15569 connection that lists the shares is done as guest, and thus you must
15570 have a valid guest account.</P
15571 ><P
15572 ><SPAN
15573 CLASS="emphasis"
15574 ><I
15575 CLASS="EMPHASIS"
15576 >MS Windows 2000 and upwards (as with Samba) can be configured to disallow
15577 anonymous (ie: Guest account) access to the IPC$ share. In that case, the
15578 MS Windows 2000/XP/2003 machine acting as an SMB/CIFS client will use the
15579 name of the currently logged in user to query the IPC$ share. MS Windows
15580 9X clients are not able to do this and thus will NOT be able to browse
15581 server resources.</I
15582 ></SPAN
15583 ></P
15584 ><P
15585 >Also, a lot of people are getting bitten by the problem of too many
15586 parameters on the command line of nmbd in inetd.conf.  This trick is to
15587 not use spaces between the option and the parameter (eg: -d2 instead
15588 of -d 2), and to not use the -B and -N options.  New versions of nmbd
15589 are now far more likely to correctly find your broadcast and network
15590 address, so in most cases these aren't needed.</P
15591 ><P
15592 >The other big problem people have is that their broadcast address,
15593 netmask or IP address is wrong (specified with the "interfaces" option
15594 in smb.conf)</P
15595 ></DIV
15596 ><DIV
15597 CLASS="SECT1"
15598 ><HR><H2
15599 CLASS="SECT1"
15600 ><A
15601 NAME="AEN3112"
15602 >20.4. Browsing across subnets</A
15603 ></H2
15604 ><P
15605 >Since the release of Samba 1.9.17(alpha1) Samba has been
15606 updated to enable it to support the replication of browse lists
15607 across subnet boundaries.  New code and options have been added to
15608 achieve this.  This section describes how to set this feature up
15609 in different settings.</P
15610 ><P
15611 >To see browse lists that span TCP/IP subnets (ie.  networks separated
15612 by routers that don't pass broadcast traffic) you must set up at least
15613 one WINS server.  The WINS server acts as a DNS for NetBIOS names, allowing
15614 NetBIOS name to IP address translation to be done by doing a direct
15615 query of the WINS server.  This is done via a directed UDP packet on
15616 port 137 to the WINS server machine.  The reason for a WINS server is
15617 that by default, all NetBIOS name to IP address translation is done
15618 by broadcasts from the querying machine.  This means that machines
15619 on one subnet will not be able to resolve the names of machines on
15620 another subnet without using a WINS server.</P
15621 ><P
15622 >Remember, for browsing across subnets to work correctly, all machines,
15623 be they Windows 95, Windows NT, or Samba servers must have the IP address
15624 of a WINS server given to them by a DHCP server, or by manual configuration 
15625 (for Win95 and WinNT, this is in the TCP/IP Properties, under Network 
15626 settings) for Samba this is in the smb.conf file.</P
15627 ><DIV
15628 CLASS="SECT2"
15629 ><HR><H3
15630 CLASS="SECT2"
15631 ><A
15632 NAME="AEN3117"
15633 >20.4.1. How does cross subnet browsing work ?</A
15634 ></H3
15635 ><P
15636 >Cross subnet browsing is a complicated dance, containing multiple
15637 moving parts.  It has taken Microsoft several years to get the code
15638 that achieves this correct, and Samba lags behind in some areas.
15639 Samba is capable of cross subnet browsing when configured correctly.</P
15640 ><P
15641 >Consider a network set up as follows :</P
15642 ><P
15643 ><PRE
15644 CLASS="PROGRAMLISTING"
15645 >                                   (DMB)
15646              N1_A      N1_B        N1_C       N1_D        N1_E
15647               |          |           |          |           |
15648           -------------------------------------------------------
15649             |          subnet 1                       |
15650           +---+                                      +---+
15651           |R1 | Router 1                  Router 2   |R2 |
15652           +---+                                      +---+
15653             |                                          |
15654             |  subnet 2              subnet 3          |
15655   --------------------------       ------------------------------------
15656   |     |     |      |               |        |         |           |
15657  N2_A  N2_B  N2_C   N2_D           N3_A     N3_B      N3_C        N3_D 
15658                     (WINS)</PRE
15659 ></P
15660 ><P
15661 >Consisting of 3 subnets (1, 2, 3) connected by two routers
15662 (R1, R2) - these do not pass broadcasts.  Subnet 1 has 5 machines
15663 on it, subnet 2 has 4 machines, subnet 3 has 4 machines.  Assume
15664 for the moment that all these machines are configured to be in the
15665 same workgroup (for simplicities sake).  Machine N1_C on subnet 1
15666 is configured as Domain Master Browser (ie.  it will collate the
15667 browse lists for the workgroup).  Machine N2_D is configured as
15668 WINS server and all the other machines are configured to register
15669 their NetBIOS names with it.</P
15670 ><P
15671 >As all these machines are booted up, elections for master browsers
15672 will take place on each of the three subnets.  Assume that machine
15673 N1_C wins on subnet 1, N2_B wins on subnet 2, and N3_D wins on
15674 subnet 3 - these machines are known as local master browsers for
15675 their particular subnet.  N1_C has an advantage in winning as the
15676 local master browser on subnet 1 as it is set up as Domain Master
15677 Browser.</P
15678 ><P
15679 >On each of the three networks, machines that are configured to 
15680 offer sharing services will broadcast that they are offering
15681 these services.  The local master browser on each subnet will
15682 receive these broadcasts and keep a record of the fact that
15683 the machine is offering a service.  This list of records is
15684 the basis of the browse list.  For this case, assume that
15685 all the machines are configured to offer services so all machines
15686 will be on the browse list.</P
15687 ><P
15688 >For each network, the local master browser on that network is
15689 considered 'authoritative' for all the names it receives via
15690 local broadcast.  This is because a machine seen by the local
15691 master browser via a local broadcast must be on the same 
15692 network as the local master browser and thus is a 'trusted'
15693 and 'verifiable' resource.  Machines on other networks that
15694 the local master browsers learn about when collating their
15695 browse lists have not been directly seen - these records are
15696 called 'non-authoritative'.</P
15697 ><P
15698 >At this point the browse lists look as follows (these are 
15699 the machines you would see in your network neighborhood if
15700 you looked in it on a particular network right now).</P
15701 ><P
15702 ><PRE
15703 CLASS="PROGRAMLISTING"
15704 >Subnet           Browse Master   List
15705 ------           -------------   ----
15706 Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E
15707
15708 Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
15709
15710 Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D</PRE
15711 ></P
15712 ><P
15713 >Note that at this point all the subnets are separate, no
15714 machine is seen across any of the subnets.</P
15715 ><P
15716 >Now examine subnet 2.  As soon as N2_B has become the local
15717 master browser it looks for a Domain master browser to synchronize
15718 its browse list with.  It does this by querying the WINS server
15719 (N2_D) for the IP address associated with the NetBIOS name 
15720 WORKGROUP&#62;1B&#60;.  This name was registerd by the Domain master
15721 browser (N1_C) with the WINS server as soon as it was booted.</P
15722 ><P
15723 >Once N2_B knows the address of the Domain master browser it
15724 tells it that is the local master browser for subnet 2 by
15725 sending a MasterAnnouncement packet as a UDP port 138 packet.
15726 It then synchronizes with it by doing a NetServerEnum2 call.  This
15727 tells the Domain Master Browser to send it all the server
15728 names it knows about.  Once the domain master browser receives
15729 the MasterAnnouncement packet it schedules a synchronization
15730 request to the sender of that packet.  After both synchronizations
15731 are done the browse lists look like :</P
15732 ><P
15733 ><PRE
15734 CLASS="PROGRAMLISTING"
15735 >Subnet           Browse Master   List
15736 ------           -------------   ----
15737 Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
15738                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*)
15739
15740 Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
15741                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
15742
15743 Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
15744
15745 Servers with a (*) after them are non-authoritative names.</PRE
15746 ></P
15747 ><P
15748 >At this point users looking in their network neighborhood on
15749 subnets 1 or 2 will see all the servers on both, users on
15750 subnet 3 will still only see the servers on their own subnet.</P
15751 ><P
15752 >The same sequence of events that occured for N2_B now occurs
15753 for the local master browser on subnet 3 (N3_D).  When it
15754 synchronizes browse lists with the domain master browser (N1_A)
15755 it gets both the server entries on subnet 1, and those on
15756 subnet 2.  After N3_D has synchronized with N1_C and vica-versa
15757 the browse lists look like.</P
15758 ><P
15759 ><PRE
15760 CLASS="PROGRAMLISTING"
15761 >Subnet           Browse Master   List
15762 ------           -------------   ----
15763 Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
15764                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*),
15765                                  N3_A(*), N3_B(*), N3_C(*), N3_D(*)
15766
15767 Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
15768                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
15769
15770 Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
15771                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*),
15772                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*)
15773
15774 Servers with a (*) after them are non-authoritative names.</PRE
15775 ></P
15776 ><P
15777 >At this point users looking in their network neighborhood on
15778 subnets 1 or 3 will see all the servers on all sunbets, users on
15779 subnet 2 will still only see the servers on subnets 1 and 2, but not 3.</P
15780 ><P
15781 >Finally, the local master browser for subnet 2 (N2_B) will sync again
15782 with the domain master browser (N1_C) and will recieve the missing
15783 server entries.  Finally - and as a steady state (if no machines
15784 are removed or shut off) the browse lists will look like :</P
15785 ><P
15786 ><PRE
15787 CLASS="PROGRAMLISTING"
15788 >Subnet           Browse Master   List
15789 ------           -------------   ----
15790 Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
15791                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*),
15792                                  N3_A(*), N3_B(*), N3_C(*), N3_D(*)
15793
15794 Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
15795                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
15796                                  N3_A(*), N3_B(*), N3_C(*), N3_D(*)
15797
15798 Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
15799                                  N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*),
15800                                  N2_A(*), N2_B(*), N2_C(*), N2_D(*)
15801         
15802 Servers with a (*) after them are non-authoritative names.</PRE
15803 ></P
15804 ><P
15805 >Synchronizations between the domain master browser and local
15806 master browsers will continue to occur, but this should be a
15807 steady state situation.</P
15808 ><P
15809 >If either router R1 or R2 fails the following will occur:</P
15810 ><P
15811 ></P
15812 ><OL
15813 TYPE="1"
15814 ><LI
15815 ><P
15816 >       Names of computers on each side of the inaccessible network fragments
15817         will be maintained for as long as 36 minutes, in the network neighbourhood
15818         lists.
15819         </P
15820 ></LI
15821 ><LI
15822 ><P
15823 >       Attempts to connect to these inaccessible computers will fail, but the
15824         names will not be removed from the network neighbourhood lists.
15825         </P
15826 ></LI
15827 ><LI
15828 ><P
15829 >       If one of the fragments is cut off from the WINS server, it will only
15830         be able to access servers on its local subnet, by using subnet-isolated
15831         broadcast NetBIOS name resolution.  The effects are similar to that of
15832         losing access to a DNS server.
15833         </P
15834 ></LI
15835 ></OL
15836 ></DIV
15837 ></DIV
15838 ><DIV
15839 CLASS="SECT1"
15840 ><HR><H2
15841 CLASS="SECT1"
15842 ><A
15843 NAME="AEN3152"
15844 >20.5. Setting up a WINS server</A
15845 ></H2
15846 ><P
15847 >Either a Samba machine or a Windows NT Server machine may be set up
15848 as a WINS server.  To set a Samba machine to be a WINS server you must
15849 add the following option to the smb.conf file on the selected machine :
15850 in the [globals] section add the line </P
15851 ><P
15852 ><B
15853 CLASS="COMMAND"
15854 >               wins support = yes</B
15855 ></P
15856 ><P
15857 >Versions of Samba prior to 1.9.17 had this parameter default to
15858 yes.  If you have any older versions of Samba on your network it is
15859 strongly suggested you upgrade to a recent version, or at the very
15860 least set the parameter to 'no' on all these machines.</P
15861 ><P
15862 >Machines with "<B
15863 CLASS="COMMAND"
15864 >wins support = yes</B
15865 >" will keep a list of 
15866 all NetBIOS names registered with them, acting as a DNS for NetBIOS names.</P
15867 ><P
15868 >You should set up only ONE wins server.  Do NOT set the
15869 "<B
15870 CLASS="COMMAND"
15871 >wins support = yes</B
15872 >" option on more than one Samba 
15873 server.</P
15874 ><P
15875 >To set up a Windows NT Server as a WINS server you need to set up
15876 the WINS service - see your NT documentation for details.  Note that
15877 Windows NT WINS Servers can replicate to each other, allowing more
15878 than one to be set up in a complex subnet environment.  As Microsoft
15879 refuse to document these replication protocols Samba cannot currently
15880 participate in these replications.  It is possible in the future that
15881 a Samba-&#62;Samba WINS replication protocol may be defined, in which
15882 case more than one Samba machine could be set up as a WINS server
15883 but currently only one Samba server should have the "wins support = yes"
15884 parameter set.</P
15885 ><P
15886 >After the WINS server has been configured you must ensure that all
15887 machines participating on the network are configured with the address
15888 of this WINS server.  If your WINS server is a Samba machine, fill in
15889 the Samba machine IP address in the "Primary WINS Server" field of
15890 the "Control Panel-&#62;Network-&#62;Protocols-&#62;TCP-&#62;WINS Server" dialogs
15891 in Windows 95 or Windows NT.  To tell a Samba server the IP address
15892 of the WINS server add the following line to the [global] section of
15893 all smb.conf files :</P
15894 ><P
15895 ><B
15896 CLASS="COMMAND"
15897 >wins server = &#62;name or IP address&#60;</B
15898 ></P
15899 ><P
15900 >where &#62;name or IP address&#60; is either the DNS name of the WINS server
15901 machine or its IP address.</P
15902 ><P
15903 >Note that this line MUST NOT BE SET in the smb.conf file of the Samba
15904 server acting as the WINS server itself.  If you set both the
15905 "<B
15906 CLASS="COMMAND"
15907 >wins support = yes</B
15908 >" option and the 
15909 "<B
15910 CLASS="COMMAND"
15911 >wins server = &#60;name&#62;</B
15912 >" option then
15913 nmbd will fail to start.</P
15914 ><P
15915 >There are two possible scenarios for setting up cross subnet browsing.
15916 The first details setting up cross subnet browsing on a network containing
15917 Windows 95, Samba and Windows NT machines that are not configured as
15918 part of a Windows NT Domain.  The second details setting up cross subnet
15919 browsing on networks that contain NT Domains.</P
15920 ></DIV
15921 ><DIV
15922 CLASS="SECT1"
15923 ><HR><H2
15924 CLASS="SECT1"
15925 ><A
15926 NAME="AEN3171"
15927 >20.6. Setting up Browsing in a WORKGROUP</A
15928 ></H2
15929 ><P
15930 >To set up cross subnet browsing on a network containing machines
15931 in up to be in a WORKGROUP, not an NT Domain you need to set up one
15932 Samba server to be the Domain Master Browser (note that this is *NOT*
15933 the same as a Primary Domain Controller, although in an NT Domain the
15934 same machine plays both roles).  The role of a Domain master browser is
15935 to collate the browse lists from local master browsers on all the
15936 subnets that have a machine participating in the workgroup.  Without
15937 one machine configured as a domain master browser each subnet would
15938 be an isolated workgroup, unable to see any machines on any other
15939 subnet.  It is the presense of a domain master browser that makes
15940 cross subnet browsing possible for a workgroup.</P
15941 ><P
15942 >In an WORKGROUP environment the domain master browser must be a
15943 Samba server, and there must only be one domain master browser per
15944 workgroup name.  To set up a Samba server as a domain master browser,
15945 set the following option in the [global] section of the smb.conf file :</P
15946 ><P
15947 ><B
15948 CLASS="COMMAND"
15949 >domain master = yes</B
15950 ></P
15951 ><P
15952 >The domain master browser should also preferrably be the local master
15953 browser for its own subnet.  In order to achieve this set the following
15954 options in the [global] section of the smb.conf file :</P
15955 ><P
15956 ><PRE
15957 CLASS="PROGRAMLISTING"
15958 >domain master = yes
15959 local master = yes
15960 preferred master = yes
15961 os level = 65</PRE
15962 ></P
15963 ><P
15964 >The domain master browser may be the same machine as the WINS
15965 server, if you require.</P
15966 ><P
15967 >Next, you should ensure that each of the subnets contains a
15968 machine that can act as a local master browser for the
15969 workgroup.  Any MS Windows NT/2K/XP/2003  machine should be
15970 able to do this, as will Windows 9x machines (although these
15971 tend to get rebooted more often, so it's not such a good idea
15972 to use these).  To make a Samba server a local master browser
15973 set the following options in the [global] section of the
15974 smb.conf file :</P
15975 ><P
15976 ><PRE
15977 CLASS="PROGRAMLISTING"
15978 >domain master = no
15979 local master = yes
15980 preferred master = yes
15981 os level = 65</PRE
15982 ></P
15983 ><P
15984 >Do not do this for more than one Samba server on each subnet,
15985 or they will war with each other over which is to be the local
15986 master browser.</P
15987 ><P
15988 >The "local master" parameter allows Samba to act as a local master
15989 browser.  The "preferred master" causes nmbd to force a browser
15990 election on startup and the "os level" parameter sets Samba high
15991 enough so that it should win any browser elections.</P
15992 ><P
15993 >If you have an NT machine on the subnet that you wish to
15994 be the local master browser then you can disable Samba from
15995 becoming a local master browser by setting the following
15996 options in the [global] section of the smb.conf file :</P
15997 ><P
15998 ><PRE
15999 CLASS="PROGRAMLISTING"
16000 >domain master = no
16001 local master = no
16002 preferred master = no
16003 os level = 0</PRE
16004 ></P
16005 ></DIV
16006 ><DIV
16007 CLASS="SECT1"
16008 ><HR><H2
16009 CLASS="SECT1"
16010 ><A
16011 NAME="AEN3189"
16012 >20.7. Setting up Browsing in a DOMAIN</A
16013 ></H2
16014 ><P
16015 >If you are adding Samba servers to a Windows NT Domain then
16016 you must not set up a Samba server as a domain master browser.
16017 By default, a Windows NT Primary Domain Controller for a Domain
16018 name is also the Domain master browser for that name, and many
16019 things will break if a Samba server registers the Domain master
16020 browser NetBIOS name (DOMAIN&#60;1B&#62;) with WINS instead of the PDC.</P
16021 ><P
16022 >For subnets other than the one containing the Windows NT PDC
16023 you may set up Samba servers as local master browsers as
16024 described.  To make a Samba server a local master browser set 
16025 the following options in the [global] section of the smb.conf 
16026 file :</P
16027 ><P
16028 ><PRE
16029 CLASS="PROGRAMLISTING"
16030 >domain master = no
16031 local master = yes
16032 preferred master = yes
16033 os level = 65</PRE
16034 ></P
16035 ><P
16036 >If you wish to have a Samba server fight the election with machines
16037 on the same subnet you may set the "os level" parameter to lower
16038 levels.  By doing this you can tune the order of machines that
16039 will become local master browsers if they are running.  For
16040 more details on this see the section "FORCING SAMBA TO BE THE MASTER"
16041 below.</P
16042 ><P
16043 >If you have Windows NT machines that are members of the domain
16044 on all subnets, and you are sure they will always be running then
16045 you can disable Samba from taking part in browser elections and
16046 ever becoming a local master browser by setting following options 
16047 in the [global] section of the smb.conf file :</P
16048 ><P
16049 ><B
16050 CLASS="COMMAND"
16051 >        domain master = no
16052         local master = no
16053         preferred master = no
16054         os level = 0</B
16055 ></P
16056 ></DIV
16057 ><DIV
16058 CLASS="SECT1"
16059 ><HR><H2
16060 CLASS="SECT1"
16061 ><A
16062 NAME="AEN3199"
16063 >20.8. Forcing samba to be the master</A
16064 ></H2
16065 ><P
16066 >Who becomes the "master browser" is determined by an election process
16067 using broadcasts.  Each election packet contains a number of parameters
16068 which determine what precedence (bias) a host should have in the
16069 election.  By default Samba uses a very low precedence and thus loses
16070 elections to just about anyone else.</P
16071 ><P
16072 >If you want Samba to win elections then just set the "os level" global
16073 option in smb.conf to a higher number.  It defaults to 0.  Using 34
16074 would make it win all elections over every other system (except other
16075 samba systems!)</P
16076 ><P
16077 >A "os level" of 2 would make it beat WfWg and Win95, but not MS Windows
16078 NT/2K Server.  A MS Windows NT/2K Server domain controller uses level 32.</P
16079 ><P
16080 >The maximum os level is 255</P
16081 ><P
16082 >If you want samba to force an election on startup, then set the
16083 "preferred master" global option in smb.conf to "yes".  Samba will
16084 then have a slight advantage over other potential master browsers
16085 that are not preferred master browsers.  Use this parameter with
16086 care, as if you have two hosts (whether they are windows 95 or NT or
16087 samba) on the same local subnet both set with "preferred master" to
16088 "yes", then periodically and continually they will force an election
16089 in order to become the local master browser.</P
16090 ><P
16091 >If you want samba to be a "domain master browser", then it is
16092 recommended that you also set "preferred master" to "yes", because
16093 samba will not become a domain master browser for the whole of your
16094 LAN or WAN if it is not also a local master browser on its own
16095 broadcast isolated subnet.</P
16096 ><P
16097 >It is possible to configure two samba servers to attempt to become
16098 the domain master browser for a domain.  The first server that comes
16099 up will be the domain master browser.  All other samba servers will
16100 attempt to become the domain master browser every 5 minutes.  They
16101 will find that another samba server is already the domain master
16102 browser and will fail.  This provides automatic redundancy, should
16103 the current domain master browser fail.</P
16104 ></DIV
16105 ><DIV
16106 CLASS="SECT1"
16107 ><HR><H2
16108 CLASS="SECT1"
16109 ><A
16110 NAME="AEN3208"
16111 >20.9. Making samba the domain master</A
16112 ></H2
16113 ><P
16114 >The domain master is responsible for collating the browse lists of
16115 multiple subnets so that browsing can occur between subnets.  You can
16116 make samba act as the domain master by setting "domain master = yes"
16117 in smb.conf.  By default it will not be a domain master.</P
16118 ><P
16119 >Note that you should NOT set Samba to be the domain master for a
16120 workgroup that has the same name as an NT Domain.</P
16121 ><P
16122 >When samba is the domain master and the master browser it will listen
16123 for master announcements (made roughly every twelve minutes) from local
16124 master browsers on other subnets and then contact them to synchronise
16125 browse lists.</P
16126 ><P
16127 >If you want samba to be the domain master then I suggest you also set
16128 the "os level" high enough to make sure it wins elections, and set
16129 "preferred master" to "yes", to get samba to force an election on
16130 startup.</P
16131 ><P
16132 >Note that all your servers (including samba) and clients should be
16133 using a WINS server to resolve NetBIOS names.  If your clients are only
16134 using broadcasting to resolve NetBIOS names, then two things will occur:</P
16135 ><P
16136 ></P
16137 ><OL
16138 TYPE="1"
16139 ><LI
16140 ><P
16141 >       your local master browsers will be unable to find a domain master
16142         browser, as it will only be looking on the local subnet.
16143         </P
16144 ></LI
16145 ><LI
16146 ><P
16147 >       if a client happens to get hold of a domain-wide browse list, and
16148         a user attempts to access a host in that list, it will be unable to
16149         resolve the NetBIOS name of that host.
16150         </P
16151 ></LI
16152 ></OL
16153 ><P
16154 >If, however, both samba and your clients are using a WINS server, then:</P
16155 ><P
16156 ></P
16157 ><OL
16158 TYPE="1"
16159 ><LI
16160 ><P
16161 >       your local master browsers will contact the WINS server and, as long as
16162         samba has registered that it is a domain master browser with the WINS
16163         server, your local master browser will receive samba's ip address
16164         as its domain master browser.
16165         </P
16166 ></LI
16167 ><LI
16168 ><P
16169 >       when a client receives a domain-wide browse list, and a user attempts
16170         to access a host in that list, it will contact the WINS server to
16171         resolve the NetBIOS name of that host.  as long as that host has
16172         registered its NetBIOS name with the same WINS server, the user will
16173         be able to see that host.  
16174         </P
16175 ></LI
16176 ></OL
16177 ></DIV
16178 ><DIV
16179 CLASS="SECT1"
16180 ><HR><H2
16181 CLASS="SECT1"
16182 ><A
16183 NAME="AEN3226"
16184 >20.10. Note about broadcast addresses</A
16185 ></H2
16186 ><P
16187 >If your network uses a "0" based broadcast address (for example if it
16188 ends in a 0) then you will strike problems.  Windows for Workgroups
16189 does not seem to support a 0's broadcast and you will probably find
16190 that browsing and name lookups won't work.</P
16191 ></DIV
16192 ><DIV
16193 CLASS="SECT1"
16194 ><HR><H2
16195 CLASS="SECT1"
16196 ><A
16197 NAME="AEN3229"
16198 >20.11. Multiple interfaces</A
16199 ></H2
16200 ><P
16201 >Samba now supports machines with multiple network interfaces.  If you
16202 have multiple interfaces then you will need to use the "interfaces"
16203 option in smb.conf to configure them.  See smb.conf(5) for details.</P
16204 ></DIV
16205 ></DIV
16206 ><DIV
16207 CLASS="CHAPTER"
16208 ><HR><H1
16209 ><A
16210 NAME="MSDFS"
16211 ></A
16212 >Chapter 21. Hosting a Microsoft Distributed File System tree on Samba</H1
16213 ><DIV
16214 CLASS="SECT1"
16215 ><H2
16216 CLASS="SECT1"
16217 ><A
16218 NAME="AEN3243"
16219 >21.1. Instructions</A
16220 ></H2
16221 ><P
16222 >The Distributed File System (or Dfs) provides a means of 
16223         separating the logical view of files and directories that users 
16224         see from the actual physical locations of these resources on the 
16225         network. It allows for higher availability, smoother storage expansion, 
16226         load balancing etc. For more information about Dfs, refer to  <A
16227 HREF="http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp"
16228 TARGET="_top"
16229 >       Microsoft documentation</A
16230 >. </P
16231 ><P
16232 >This document explains how to host a Dfs tree on a Unix 
16233         machine (for Dfs-aware clients to browse) using Samba.</P
16234 ><P
16235 >To enable SMB-based DFS for Samba, configure it with the 
16236         <VAR
16237 CLASS="PARAMETER"
16238 >--with-msdfs</VAR
16239 > option. Once built, a 
16240         Samba server can be made a Dfs server by setting the global 
16241         boolean <A
16242 HREF="smb.conf.5.html#HOSTMSDFS"
16243 TARGET="_top"
16244 ><VAR
16245 CLASS="PARAMETER"
16246 >       host msdfs</VAR
16247 ></A
16248 > parameter in the <TT
16249 CLASS="FILENAME"
16250 >smb.conf
16251         </TT
16252 > file. You designate a share as a Dfs root using the share 
16253         level boolean <A
16254 HREF="smb.conf.5.html#MSDFSROOT"
16255 TARGET="_top"
16256 ><VAR
16257 CLASS="PARAMETER"
16258 >       msdfs root</VAR
16259 ></A
16260 > parameter. A Dfs root directory on 
16261         Samba hosts Dfs links in the form of symbolic links that point 
16262         to other servers. For example, a symbolic link
16263         <TT
16264 CLASS="FILENAME"
16265 >junction-&#62;msdfs:storage1\share1</TT
16266 > in 
16267         the share directory acts as the Dfs junction. When Dfs-aware 
16268         clients attempt to access the junction link, they are redirected 
16269         to the storage location (in this case, \\storage1\share1).</P
16270 ><P
16271 >Dfs trees on Samba work with all Dfs-aware clients ranging 
16272         from Windows 95 to 2000.</P
16273 ><P
16274 >Here's an example of setting up a Dfs tree on a Samba 
16275         server.</P
16276 ><P
16277 ><PRE
16278 CLASS="PROGRAMLISTING"
16279 ># The smb.conf file:
16280 [global]
16281         netbios name = SAMBA
16282         host msdfs   = yes
16283
16284 [dfs]
16285         path = /export/dfsroot
16286         msdfs root = yes
16287         </PRE
16288 ></P
16289 ><P
16290 >In the /export/dfsroot directory we set up our dfs links to 
16291         other servers on the network.</P
16292 ><P
16293 ><SAMP
16294 CLASS="PROMPT"
16295 >root# </SAMP
16296 ><KBD
16297 CLASS="USERINPUT"
16298 >cd /export/dfsroot</KBD
16299 ></P
16300 ><P
16301 ><SAMP
16302 CLASS="PROMPT"
16303 >root# </SAMP
16304 ><KBD
16305 CLASS="USERINPUT"
16306 >chown root /export/dfsroot</KBD
16307 ></P
16308 ><P
16309 ><SAMP
16310 CLASS="PROMPT"
16311 >root# </SAMP
16312 ><KBD
16313 CLASS="USERINPUT"
16314 >chmod 755 /export/dfsroot</KBD
16315 ></P
16316 ><P
16317 ><SAMP
16318 CLASS="PROMPT"
16319 >root# </SAMP
16320 ><KBD
16321 CLASS="USERINPUT"
16322 >ln -s msdfs:storageA\\shareA linka</KBD
16323 ></P
16324 ><P
16325 ><SAMP
16326 CLASS="PROMPT"
16327 >root# </SAMP
16328 ><KBD
16329 CLASS="USERINPUT"
16330 >ln -s msdfs:serverB\\share,serverC\\share linkb</KBD
16331 ></P
16332 ><P
16333 >You should set up the permissions and ownership of 
16334         the directory acting as the Dfs root such that only designated 
16335         users can create, delete or modify the msdfs links. Also note 
16336         that symlink names should be all lowercase. This limitation exists 
16337         to have Samba avoid trying all the case combinations to get at 
16338         the link name. Finally set up the symbolic links to point to the 
16339         network shares you want, and start Samba.</P
16340 ><P
16341 >Users on Dfs-aware clients can now browse the Dfs tree 
16342         on the Samba server at \\samba\dfs. Accessing 
16343         links linka or linkb (which appear as directories to the client) 
16344         takes users directly to the appropriate shares on the network.</P
16345 ><DIV
16346 CLASS="SECT2"
16347 ><HR><H3
16348 CLASS="SECT2"
16349 ><A
16350 NAME="AEN3278"
16351 >21.1.1. Notes</A
16352 ></H3
16353 ><P
16354 ></P
16355 ><UL
16356 ><LI
16357 ><P
16358 >Windows clients need to be rebooted 
16359                         if a previously mounted non-dfs share is made a dfs 
16360                         root or vice versa. A better way is to introduce a 
16361                         new share and make it the dfs root.</P
16362 ></LI
16363 ><LI
16364 ><P
16365 >Currently there's a restriction that msdfs 
16366                         symlink names should all be lowercase.</P
16367 ></LI
16368 ><LI
16369 ><P
16370 >For security purposes, the directory 
16371                         acting as the root of the Dfs tree should have ownership 
16372                         and permissions set so that only designated users can 
16373                         modify the symbolic links in the directory.</P
16374 ></LI
16375 ></UL
16376 ></DIV
16377 ></DIV
16378 ></DIV
16379 ><DIV
16380 CLASS="CHAPTER"
16381 ><HR><H1
16382 ><A
16383 NAME="VFS"
16384 ></A
16385 >Chapter 22. Stackable VFS modules</H1
16386 ><DIV
16387 CLASS="SECT1"
16388 ><H2
16389 CLASS="SECT1"
16390 ><A
16391 NAME="AEN3302"
16392 >22.1. Introduction and configuration</A
16393 ></H2
16394 ><P
16395 >Since samba 3.0, samba supports stackable VFS(Virtual File System) modules.  
16396 Samba passes each request to access the unix file system thru the loaded VFS modules. 
16397 This chapter covers all the modules that come with the samba source and references to 
16398 some external modules.</P
16399 ><P
16400 >You may have problems to compile these modules, as shared libraries are
16401 compiled and linked in different ways on different systems.
16402 They currently have been tested against GNU/linux and IRIX.</P
16403 ><P
16404 >To use the VFS modules, create a share similar to the one below.  The
16405 important parameter is the <B
16406 CLASS="COMMAND"
16407 >vfs object</B
16408 > parameter which must point to
16409 the exact pathname of the shared library objects. For example, to log all access 
16410 to files and use a recycle bin:
16411
16412 <PRE
16413 CLASS="PROGRAMLISTING"
16414 >       [audit]
16415                 comment = Audited /data directory
16416                 path = /data
16417                 vfs object = /path/to/audit.so /path/to/recycle.so
16418                 writeable = yes
16419                 browseable = yes</PRE
16420 ></P
16421 ><P
16422 >The modules are used in the order they are specified.</P
16423 ><P
16424 >Further documentation on writing VFS modules for Samba can be found in
16425 the Samba Developers Guide.</P
16426 ></DIV
16427 ><DIV
16428 CLASS="SECT1"
16429 ><HR><H2
16430 CLASS="SECT1"
16431 ><A
16432 NAME="AEN3311"
16433 >22.2. Included modules</A
16434 ></H2
16435 ><DIV
16436 CLASS="SECT2"
16437 ><H3
16438 CLASS="SECT2"
16439 ><A
16440 NAME="AEN3313"
16441 >22.2.1. audit</A
16442 ></H3
16443 ><P
16444 >A simple module to audit file access to the syslog
16445 facility.  The following operations are logged:
16446 <P
16447 ></P
16448 ><TABLE
16449 BORDER="0"
16450 ><TBODY
16451 ><TR
16452 ><TD
16453 >share</TD
16454 ></TR
16455 ><TR
16456 ><TD
16457 >connect/disconnect</TD
16458 ></TR
16459 ><TR
16460 ><TD
16461 >directory opens/create/remove</TD
16462 ></TR
16463 ><TR
16464 ><TD
16465 >file open/close/rename/unlink/chmod</TD
16466 ></TR
16467 ></TBODY
16468 ></TABLE
16469 ><P
16470 ></P
16471 ></P
16472 ></DIV
16473 ><DIV
16474 CLASS="SECT2"
16475 ><HR><H3
16476 CLASS="SECT2"
16477 ><A
16478 NAME="AEN3321"
16479 >22.2.2. recycle</A
16480 ></H3
16481 ><P
16482 >A recycle-bin like modules. When used any unlink call
16483 will be intercepted and files moved to the recycle
16484 directory instead of beeing deleted.</P
16485 ><P
16486 >Supported options:
16487 <P
16488 ></P
16489 ><DIV
16490 CLASS="VARIABLELIST"
16491 ><DL
16492 ><DT
16493 >vfs_recycle_bin:repository</DT
16494 ><DD
16495 ><P
16496 >FIXME</P
16497 ></DD
16498 ><DT
16499 >vfs_recycle_bin:keeptree</DT
16500 ><DD
16501 ><P
16502 >FIXME</P
16503 ></DD
16504 ><DT
16505 >vfs_recycle_bin:versions</DT
16506 ><DD
16507 ><P
16508 >FIXME</P
16509 ></DD
16510 ><DT
16511 >vfs_recycle_bin:touch</DT
16512 ><DD
16513 ><P
16514 >FIXME</P
16515 ></DD
16516 ><DT
16517 >vfs_recycle_bin:maxsize</DT
16518 ><DD
16519 ><P
16520 >FIXME</P
16521 ></DD
16522 ><DT
16523 >vfs_recycle_bin:exclude</DT
16524 ><DD
16525 ><P
16526 >FIXME</P
16527 ></DD
16528 ><DT
16529 >vfs_recycle_bin:exclude_dir</DT
16530 ><DD
16531 ><P
16532 >FIXME</P
16533 ></DD
16534 ><DT
16535 >vfs_recycle_bin:noversions</DT
16536 ><DD
16537 ><P
16538 >FIXME</P
16539 ></DD
16540 ></DL
16541 ></DIV
16542 ></P
16543 ></DIV
16544 ><DIV
16545 CLASS="SECT2"
16546 ><HR><H3
16547 CLASS="SECT2"
16548 ><A
16549 NAME="AEN3358"
16550 >22.2.3. netatalk</A
16551 ></H3
16552 ><P
16553 >A netatalk module, that will ease co-existence of samba and
16554 netatalk file sharing services.</P
16555 ><P
16556 >Advantages compared to the old netatalk module:
16557 <P
16558 ></P
16559 ><TABLE
16560 BORDER="0"
16561 ><TBODY
16562 ><TR
16563 ><TD
16564 >it doesn't care about creating of .AppleDouble forks, just keeps ones in sync</TD
16565 ></TR
16566 ><TR
16567 ><TD
16568 >if share in smb.conf doesn't contain .AppleDouble item in hide or veto list, it will be added automatically</TD
16569 ></TR
16570 ></TBODY
16571 ></TABLE
16572 ><P
16573 ></P
16574 ></P
16575 ></DIV
16576 ></DIV
16577 ><DIV
16578 CLASS="SECT1"
16579 ><HR><H2
16580 CLASS="SECT1"
16581 ><A
16582 NAME="AEN3365"
16583 >22.3. VFS modules available elsewhere</A
16584 ></H2
16585 ><P
16586 >This section contains a listing of various other VFS modules that 
16587 have been posted but don't currently reside in the Samba CVS 
16588 tree for one reason ot another (e.g. it is easy for the maintainer 
16589 to have his or her own CVS tree).</P
16590 ><P
16591 >No statemets about the stability or functionality any module
16592 should be implied due to its presence here.</P
16593 ><DIV
16594 CLASS="SECT2"
16595 ><HR><H3
16596 CLASS="SECT2"
16597 ><A
16598 NAME="AEN3369"
16599 >22.3.1. DatabaseFS</A
16600 ></H3
16601 ><P
16602 >URL: <A
16603 HREF="http://www.css.tayloru.edu/~elorimer/databasefs/index.php"
16604 TARGET="_top"
16605 >http://www.css.tayloru.edu/~elorimer/databasefs/index.php</A
16606 ></P
16607 ><P
16608 >By <A
16609 HREF="mailto:elorimer@css.tayloru.edu"
16610 TARGET="_top"
16611 >Eric Lorimer</A
16612 >.</P
16613 ><P
16614 >I have created a VFS module which implements a fairly complete read-only
16615 filesystem.  It presents information from a database as a filesystem in
16616 a modular and generic way to allow different databases to be used
16617 (originally designed for organizing MP3s under directories such as
16618 "Artists," "Song Keywords," etc... I have since applied it to a student
16619 roster database very easily).  The directory structure is stored in the
16620 database itself and the module makes no assumptions about the database
16621 structure beyond the table it requires to run.</P
16622 ><P
16623 >Any feedback would be appreciated: comments, suggestions, patches,
16624 etc...  If nothing else, hopefully it might prove useful for someone
16625 else who wishes to create a virtual filesystem.</P
16626 ></DIV
16627 ><DIV
16628 CLASS="SECT2"
16629 ><HR><H3
16630 CLASS="SECT2"
16631 ><A
16632 NAME="AEN3377"
16633 >22.3.2. vscan</A
16634 ></H3
16635 ><P
16636 >URL: <A
16637 HREF="http://www.openantivirus.org/"
16638 TARGET="_top"
16639 >http://www.openantivirus.org/</A
16640 ></P
16641 ><P
16642 >samba-vscan is a proof-of-concept module for Samba, which
16643 uses the VFS (virtual file system) features of Samba 2.2.x/3.0
16644 alphaX. Of couse, Samba has to be compiled with VFS support. 
16645 samba-vscan supports various virus scanners and is maintained 
16646 by Rainer Link.</P
16647 ></DIV
16648 ></DIV
16649 ></DIV
16650 ><DIV
16651 CLASS="CHAPTER"
16652 ><HR><H1
16653 ><A
16654 NAME="SECURING-SAMBA"
16655 ></A
16656 >Chapter 23. Securing Samba</H1
16657 ><DIV
16658 CLASS="SECT1"
16659 ><H2
16660 CLASS="SECT1"
16661 ><A
16662 NAME="AEN3391"
16663 >23.1. Introduction</A
16664 ></H2
16665 ><P
16666 >This note was attached to the Samba 2.2.8 release notes as it contained an
16667 important security fix.  The information contained here applies to Samba
16668 installations in general.</P
16669 ></DIV
16670 ><DIV
16671 CLASS="SECT1"
16672 ><HR><H2
16673 CLASS="SECT1"
16674 ><A
16675 NAME="AEN3394"
16676 >23.2. Using host based protection</A
16677 ></H2
16678 ><P
16679 >In many installations of Samba the greatest threat comes for outside
16680 your immediate network. By default Samba will accept connections from
16681 any host, which means that if you run an insecure version of Samba on
16682 a host that is directly connected to the Internet you can be
16683 especially vulnerable.</P
16684 ><P
16685 >One of the simplest fixes in this case is to use the 'hosts allow' and
16686 'hosts deny' options in the Samba smb.conf configuration file to only
16687 allow access to your server from a specific range of hosts. An example
16688 might be:</P
16689 ><P
16690 ><PRE
16691 CLASS="PROGRAMLISTING"
16692 >  hosts allow = 127.0.0.1 192.168.2.0/24 192.168.3.0/24
16693   hosts deny = 0.0.0.0/0</PRE
16694 ></P
16695 ><P
16696 >The above will only allow SMB connections from 'localhost' (your own
16697 computer) and from the two private networks 192.168.2 and
16698 192.168.3. All other connections will be refused connections as soon
16699 as the client sends its first packet. The refusal will be marked as a
16700 'not listening on called name' error.</P
16701 ></DIV
16702 ><DIV
16703 CLASS="SECT1"
16704 ><HR><H2
16705 CLASS="SECT1"
16706 ><A
16707 NAME="AEN3401"
16708 >23.3. Using interface protection</A
16709 ></H2
16710 ><P
16711 >By default Samba will accept connections on any network interface that
16712 it finds on your system. That means if you have a ISDN line or a PPP
16713 connection to the Internet then Samba will accept connections on those
16714 links. This may not be what you want.</P
16715 ><P
16716 >You can change this behaviour using options like the following:</P
16717 ><P
16718 ><PRE
16719 CLASS="PROGRAMLISTING"
16720 >  interfaces = eth* lo
16721   bind interfaces only = yes</PRE
16722 ></P
16723 ><P
16724 ></P
16725 ><P
16726 >This tells Samba to only listen for connections on interfaces with a
16727 name starting with 'eth' such as eth0, eth1, plus on the loopback
16728 interface called 'lo'. The name you will need to use depends on what
16729 OS you are using, in the above I used the common name for Ethernet
16730 adapters on Linux.</P
16731 ><P
16732 >If you use the above and someone tries to make a SMB connection to
16733 your host over a PPP interface called 'ppp0' then they will get a TCP
16734 connection refused reply. In that case no Samba code is run at all as
16735 the operating system has been told not to pass connections from that
16736 interface to any process.</P
16737 ></DIV
16738 ><DIV
16739 CLASS="SECT1"
16740 ><HR><H2
16741 CLASS="SECT1"
16742 ><A
16743 NAME="AEN3410"
16744 >23.4. Using a firewall</A
16745 ></H2
16746 ><P
16747 >Many people use a firewall to deny access to services that they don't
16748 want exposed outside their network. This can be a very good idea,
16749 although I would recommend using it in conjunction with the above
16750 methods so that you are protected even if your firewall is not active
16751 for some reason.</P
16752 ><P
16753 >If you are setting up a firewall then you need to know what TCP and
16754 UDP ports to allow and block. Samba uses the following:</P
16755 ><P
16756 ><PRE
16757 CLASS="PROGRAMLISTING"
16758 >UDP/137    - used by nmbd
16759 UDP/138    - used by nmbd
16760 TCP/139    - used by smbd
16761 TCP/445    - used by smbd</PRE
16762 ></P
16763 ><P
16764 >The last one is important as many older firewall setups may not be
16765 aware of it, given that this port was only added to the protocol in
16766 recent years. </P
16767 ></DIV
16768 ><DIV
16769 CLASS="SECT1"
16770 ><HR><H2
16771 CLASS="SECT1"
16772 ><A
16773 NAME="AEN3417"
16774 >23.5. Using a IPC$ share deny</A
16775 ></H2
16776 ><P
16777 >If the above methods are not suitable, then you could also place a
16778 more specific deny on the IPC$ share that is used in the recently
16779 discovered security hole. This allows you to offer access to other
16780 shares while denying access to IPC$ from potentially untrustworthy
16781 hosts.</P
16782 ><P
16783 >To do that you could use:</P
16784 ><P
16785 ><PRE
16786 CLASS="PROGRAMLISTING"
16787 >  [ipc$]
16788      hosts allow = 192.168.115.0/24 127.0.0.1
16789      hosts deny = 0.0.0.0/0</PRE
16790 ></P
16791 ><P
16792 >this would tell Samba that IPC$ connections are not allowed from
16793 anywhere but the two listed places (localhost and a local
16794 subnet). Connections to other shares would still be allowed. As the
16795 IPC$ share is the only share that is always accessible anonymously
16796 this provides some level of protection against attackers that do not
16797 know a username/password for your host.</P
16798 ><P
16799 >If you use this method then clients will be given a 'access denied'
16800 reply when they try to access the IPC$ share. That means that those
16801 clients will not be able to browse shares, and may also be unable to
16802 access some other resources. </P
16803 ><P
16804 >This is not recommended unless you cannot use one of the other
16805 methods listed above for some reason.</P
16806 ></DIV
16807 ><DIV
16808 CLASS="SECT1"
16809 ><HR><H2
16810 CLASS="SECT1"
16811 ><A
16812 NAME="AEN3426"
16813 >23.6. Upgrading Samba</A
16814 ></H2
16815 ><P
16816 >Please check regularly on http://www.samba.org/ for updates and
16817 important announcements.  Occasionally security releases are made and 
16818 it is highly recommended to upgrade Samba when a security vulnerability
16819 is discovered.</P
16820 ></DIV
16821 ></DIV
16822 ><DIV
16823 CLASS="CHAPTER"
16824 ><HR><H1
16825 ><A
16826 NAME="UNICODE"
16827 ></A
16828 >Chapter 24. Unicode/Charsets</H1
16829 ><DIV
16830 CLASS="SECT1"
16831 ><H2
16832 CLASS="SECT1"
16833 ><A
16834 NAME="AEN3440"
16835 >24.1. What are charsets and unicode?</A
16836 ></H2
16837 ><P
16838 >Computers communicate in numbers. In texts, each number will be 
16839 translated to a corresponding letter. The meaning that will be assigned 
16840 to a certain number depends on the <SPAN
16841 CLASS="emphasis"
16842 ><I
16843 CLASS="EMPHASIS"
16844 >character set(charset)</I
16845 ></SPAN
16846 > that is used. 
16847 A charset can be seen as a table that is used to translate numbers to 
16848 letters. Not all computers use the same charset (there are charsets 
16849 with German umlauts, Japanese characters, etc). Usually a charset contains 
16850 256 characters, which means that storing a character with it takes 
16851 exactly one byte. </P
16852 ><P
16853 >There are also charsets that support even more characters, 
16854 but those need twice(or even more) as much storage space. These 
16855 charsets can contain <B
16856 CLASS="COMMAND"
16857 >256 * 256 = 65536</B
16858 > characters, which
16859 is more then all possible characters one could think of. They are called 
16860 multibyte charsets (because they use more then one byte to 
16861 store one character). </P
16862 ><P
16863 >A standardised multibyte charset is unicode, info available at 
16864 <A
16865 HREF="http://www.unicode.org/"
16866 TARGET="_top"
16867 >www.unicode.org</A
16868 >. 
16869 Big advantage of using a multibyte charset is that you only need one; no 
16870 need to make sure two computers use the same charset when they are 
16871 communicating.</P
16872 ><P
16873 >Old windows clients used to use single-byte charsets, named 
16874 'codepages' by microsoft. However, there is no support for 
16875 negotiating the charset to be used in the smb protocol. Thus, you 
16876 have to make sure you are using the same charset when talking to an old client.
16877 Newer clients (Windows NT, 2K, XP) talk unicode over the wire.</P
16878 ></DIV
16879 ><DIV
16880 CLASS="SECT1"
16881 ><HR><H2
16882 CLASS="SECT1"
16883 ><A
16884 NAME="AEN3449"
16885 >24.2. Samba and charsets</A
16886 ></H2
16887 ><P
16888 >As of samba 3.0, samba can (and will) talk unicode over the wire. Internally, 
16889 samba knows of three kinds of character sets: </P
16890 ><P
16891 ></P
16892 ><DIV
16893 CLASS="VARIABLELIST"
16894 ><DL
16895 ><DT
16896 >unix charset</DT
16897 ><DD
16898 ><P
16899 >               This is the charset used internally by your operating system. 
16900                 The default is <SPAN
16901 CLASS="emphasis"
16902 ><I
16903 CLASS="EMPHASIS"
16904 >ASCII</I
16905 ></SPAN
16906 >, which is fine for most 
16907                 systems.
16908                 </P
16909 ></DD
16910 ><DT
16911 >display charset</DT
16912 ><DD
16913 ><P
16914 >This is the charset samba will use to print messages
16915                 on your screen. It should generally be the same as the <B
16916 CLASS="COMMAND"
16917 >unix charset</B
16918 >.
16919                 </P
16920 ></DD
16921 ><DT
16922 >dos charset</DT
16923 ><DD
16924 ><P
16925 >This is the charset samba uses when communicating with 
16926                 DOS and Windows 9x clients. It will talk unicode to all newer clients.
16927                 The default depends on the charsets you have installed on your system.
16928                 Run <B
16929 CLASS="COMMAND"
16930 >testparm -v | grep "dos charset"</B
16931 > to see 
16932                 what the default is on your system. 
16933                 </P
16934 ></DD
16935 ></DL
16936 ></DIV
16937 ><P
16938 ></P
16939 ></DIV
16940 ></DIV
16941 ></DIV
16942 ><DIV
16943 CLASS="PART"
16944 ><A
16945 NAME="APPENDIXES"
16946 ></A
16947 ><DIV
16948 CLASS="TITLEPAGE"
16949 ><H1
16950 CLASS="TITLE"
16951 >IV. Appendixes</H1
16952 ><DIV
16953 CLASS="TOC"
16954 ><DL
16955 ><DT
16956 ><B
16957 >Table of Contents</B
16958 ></DT
16959 ><DT
16960 >25. <A
16961 HREF="#SPEED"
16962 >Samba performance issues</A
16963 ></DT
16964 ><DD
16965 ><DL
16966 ><DT
16967 >25.1. <A
16968 HREF="#AEN3486"
16969 >Comparisons</A
16970 ></DT
16971 ><DT
16972 >25.2. <A
16973 HREF="#AEN3492"
16974 >Socket options</A
16975 ></DT
16976 ><DT
16977 >25.3. <A
16978 HREF="#AEN3499"
16979 >Read size</A
16980 ></DT
16981 ><DT
16982 >25.4. <A
16983 HREF="#AEN3504"
16984 >Max xmit</A
16985 ></DT
16986 ><DT
16987 >25.5. <A
16988 HREF="#AEN3509"
16989 >Log level</A
16990 ></DT
16991 ><DT
16992 >25.6. <A
16993 HREF="#AEN3512"
16994 >Read raw</A
16995 ></DT
16996 ><DT
16997 >25.7. <A
16998 HREF="#AEN3517"
16999 >Write raw</A
17000 ></DT
17001 ><DT
17002 >25.8. <A
17003 HREF="#AEN3521"
17004 >Slow Clients</A
17005 ></DT
17006 ><DT
17007 >25.9. <A
17008 HREF="#AEN3525"
17009 >Slow Logins</A
17010 ></DT
17011 ><DT
17012 >25.10. <A
17013 HREF="#AEN3528"
17014 >Client tuning</A
17015 ></DT
17016 ></DL
17017 ></DD
17018 ><DT
17019 >26. <A
17020 HREF="#PORTABILITY"
17021 >Portability</A
17022 ></DT
17023 ><DD
17024 ><DL
17025 ><DT
17026 >26.1. <A
17027 HREF="#AEN3568"
17028 >HPUX</A
17029 ></DT
17030 ><DT
17031 >26.2. <A
17032 HREF="#AEN3574"
17033 >SCO Unix</A
17034 ></DT
17035 ><DT
17036 >26.3. <A
17037 HREF="#AEN3578"
17038 >DNIX</A
17039 ></DT
17040 ><DT
17041 >26.4. <A
17042 HREF="#AEN3607"
17043 >RedHat Linux Rembrandt-II</A
17044 ></DT
17045 ><DT
17046 >26.5. <A
17047 HREF="#AEN3613"
17048 >AIX</A
17049 ></DT
17050 ><DD
17051 ><DL
17052 ><DT
17053 >26.5.1. <A
17054 HREF="#AEN3615"
17055 >Sequential Read Ahead</A
17056 ></DT
17057 ></DL
17058 ></DD
17059 ></DL
17060 ></DD
17061 ><DT
17062 >27. <A
17063 HREF="#OTHER-CLIENTS"
17064 >Samba and other CIFS clients</A
17065 ></DT
17066 ><DD
17067 ><DL
17068 ><DT
17069 >27.1. <A
17070 HREF="#AEN3633"
17071 >Macintosh clients?</A
17072 ></DT
17073 ><DT
17074 >27.2. <A
17075 HREF="#AEN3642"
17076 >OS2 Client</A
17077 ></DT
17078 ><DD
17079 ><DL
17080 ><DT
17081 >27.2.1. <A
17082 HREF="#AEN3644"
17083 >How can I configure OS/2 Warp Connect or 
17084                 OS/2 Warp 4 as a client for Samba?</A
17085 ></DT
17086 ><DT
17087 >27.2.2. <A
17088 HREF="#AEN3659"
17089 >How can I configure OS/2 Warp 3 (not Connect), 
17090                 OS/2 1.2, 1.3 or 2.x for Samba?</A
17091 ></DT
17092 ><DT
17093 >27.2.3. <A
17094 HREF="#AEN3668"
17095 >Are there any other issues when OS/2 (any version) 
17096                 is used as a client?</A
17097 ></DT
17098 ><DT
17099 >27.2.4. <A
17100 HREF="#AEN3672"
17101 >How do I get printer driver download working 
17102                 for OS/2 clients?</A
17103 ></DT
17104 ></DL
17105 ></DD
17106 ><DT
17107 >27.3. <A
17108 HREF="#AEN3682"
17109 >Windows for Workgroups</A
17110 ></DT
17111 ><DD
17112 ><DL
17113 ><DT
17114 >27.3.1. <A
17115 HREF="#AEN3684"
17116 >Use latest TCP/IP stack from Microsoft</A
17117 ></DT
17118 ><DT
17119 >27.3.2. <A
17120 HREF="#AEN3689"
17121 >Delete .pwl files after password change</A
17122 ></DT
17123 ><DT
17124 >27.3.3. <A
17125 HREF="#AEN3694"
17126 >Configure WfW password handling</A
17127 ></DT
17128 ><DT
17129 >27.3.4. <A
17130 HREF="#AEN3698"
17131 >Case handling of passwords</A
17132 ></DT
17133 ><DT
17134 >27.3.5. <A
17135 HREF="#AEN3703"
17136 >Use TCP/IP as default protocol</A
17137 ></DT
17138 ></DL
17139 ></DD
17140 ><DT
17141 >27.4. <A
17142 HREF="#AEN3706"
17143 >Windows '95/'98</A
17144 ></DT
17145 ><DT
17146 >27.5. <A
17147 HREF="#AEN3722"
17148 >Windows 2000 Service Pack 2</A
17149 ></DT
17150 ></DL
17151 ></DD
17152 ><DT
17153 >28. <A
17154 HREF="#COMPILING"
17155 >How to compile SAMBA</A
17156 ></DT
17157 ><DD
17158 ><DL
17159 ><DT
17160 >28.1. <A
17161 HREF="#AEN3749"
17162 >Access Samba source code via CVS</A
17163 ></DT
17164 ><DD
17165 ><DL
17166 ><DT
17167 >28.1.1. <A
17168 HREF="#AEN3751"
17169 >Introduction</A
17170 ></DT
17171 ><DT
17172 >28.1.2. <A
17173 HREF="#AEN3756"
17174 >CVS Access to samba.org</A
17175 ></DT
17176 ></DL
17177 ></DD
17178 ><DT
17179 >28.2. <A
17180 HREF="#AEN3792"
17181 >Accessing the samba sources via rsync and ftp</A
17182 ></DT
17183 ><DT
17184 >28.3. <A
17185 HREF="#AEN3798"
17186 >Building the Binaries</A
17187 ></DT
17188 ><DD
17189 ><DL
17190 ><DT
17191 >28.3.1. <A
17192 HREF="#AEN3826"
17193 >Compiling samba with Active Directory support</A
17194 ></DT
17195 ></DL
17196 ></DD
17197 ><DT
17198 >28.4. <A
17199 HREF="#AEN3855"
17200 >Starting the smbd and nmbd</A
17201 ></DT
17202 ><DD
17203 ><DL
17204 ><DT
17205 >28.4.1. <A
17206 HREF="#AEN3865"
17207 >Starting from inetd.conf</A
17208 ></DT
17209 ><DT
17210 >28.4.2. <A
17211 HREF="#AEN3894"
17212 >Alternative: starting it as a daemon</A
17213 ></DT
17214 ></DL
17215 ></DD
17216 ></DL
17217 ></DD
17218 ><DT
17219 >29. <A
17220 HREF="#BUGREPORT"
17221 >Reporting Bugs</A
17222 ></DT
17223 ><DD
17224 ><DL
17225 ><DT
17226 >29.1. <A
17227 HREF="#AEN3917"
17228 >Introduction</A
17229 ></DT
17230 ><DT
17231 >29.2. <A
17232 HREF="#AEN3927"
17233 >General info</A
17234 ></DT
17235 ><DT
17236 >29.3. <A
17237 HREF="#AEN3933"
17238 >Debug levels</A
17239 ></DT
17240 ><DT
17241 >29.4. <A
17242 HREF="#AEN3950"
17243 >Internal errors</A
17244 ></DT
17245 ><DT
17246 >29.5. <A
17247 HREF="#AEN3960"
17248 >Attaching to a running process</A
17249 ></DT
17250 ><DT
17251 >29.6. <A
17252 HREF="#AEN3963"
17253 >Patches</A
17254 ></DT
17255 ></DL
17256 ></DD
17257 ><DT
17258 >30. <A
17259 HREF="#DIAGNOSIS"
17260 >The samba checklist</A
17261 ></DT
17262 ><DD
17263 ><DL
17264 ><DT
17265 >30.1. <A
17266 HREF="#AEN3986"
17267 >Introduction</A
17268 ></DT
17269 ><DT
17270 >30.2. <A
17271 HREF="#AEN3991"
17272 >Assumptions</A
17273 ></DT
17274 ><DT
17275 >30.3. <A
17276 HREF="#AEN4001"
17277 >Tests</A
17278 ></DT
17279 ><DD
17280 ><DL
17281 ><DT
17282 >30.3.1. <A
17283 HREF="#AEN4003"
17284 >Test 1</A
17285 ></DT
17286 ><DT
17287 >30.3.2. <A
17288 HREF="#AEN4009"
17289 >Test 2</A
17290 ></DT
17291 ><DT
17292 >30.3.3. <A
17293 HREF="#AEN4015"
17294 >Test 3</A
17295 ></DT
17296 ><DT
17297 >30.3.4. <A
17298 HREF="#AEN4030"
17299 >Test 4</A
17300 ></DT
17301 ><DT
17302 >30.3.5. <A
17303 HREF="#AEN4035"
17304 >Test 5</A
17305 ></DT
17306 ><DT
17307 >30.3.6. <A
17308 HREF="#AEN4041"
17309 >Test 6</A
17310 ></DT
17311 ><DT
17312 >30.3.7. <A
17313 HREF="#AEN4049"
17314 >Test 7</A
17315 ></DT
17316 ><DT
17317 >30.3.8. <A
17318 HREF="#AEN4075"
17319 >Test 8</A
17320 ></DT
17321 ><DT
17322 >30.3.9. <A
17323 HREF="#AEN4092"
17324 >Test 9</A
17325 ></DT
17326 ><DT
17327 >30.3.10. <A
17328 HREF="#AEN4100"
17329 >Test 10</A
17330 ></DT
17331 ><DT
17332 >30.3.11. <A
17333 HREF="#AEN4106"
17334 >Test 11</A
17335 ></DT
17336 ></DL
17337 ></DD
17338 ><DT
17339 >30.4. <A
17340 HREF="#AEN4111"
17341 >Still having troubles?</A
17342 ></DT
17343 ></DL
17344 ></DD
17345 ></DL
17346 ></DIV
17347 ></DIV
17348 ><DIV
17349 CLASS="CHAPTER"
17350 ><HR><H1
17351 ><A
17352 NAME="SPEED"
17353 ></A
17354 >Chapter 25. Samba performance issues</H1
17355 ><DIV
17356 CLASS="SECT1"
17357 ><H2
17358 CLASS="SECT1"
17359 ><A
17360 NAME="AEN3486"
17361 >25.1. Comparisons</A
17362 ></H2
17363 ><P
17364 >The Samba server uses TCP to talk to the client. Thus if you are
17365 trying to see if it performs well you should really compare it to
17366 programs that use the same protocol. The most readily available
17367 programs for file transfer that use TCP are ftp or another TCP based
17368 SMB server.</P
17369 ><P
17370 >If you want to test against something like a NT or WfWg server then
17371 you will have to disable all but TCP on either the client or
17372 server. Otherwise you may well be using a totally different protocol
17373 (such as Netbeui) and comparisons may not be valid.</P
17374 ><P
17375 >Generally you should find that Samba performs similarly to ftp at raw
17376 transfer speed. It should perform quite a bit faster than NFS,
17377 although this very much depends on your system.</P
17378 ><P
17379 >Several people have done comparisons between Samba and Novell, NFS or
17380 WinNT. In some cases Samba performed the best, in others the worst. I
17381 suspect the biggest factor is not Samba vs some other system but the
17382 hardware and drivers used on the various systems. Given similar
17383 hardware Samba should certainly be competitive in speed with other
17384 systems.</P
17385 ></DIV
17386 ><DIV
17387 CLASS="SECT1"
17388 ><HR><H2
17389 CLASS="SECT1"
17390 ><A
17391 NAME="AEN3492"
17392 >25.2. Socket options</A
17393 ></H2
17394 ><P
17395 >There are a number of socket options that can greatly affect the
17396 performance of a TCP based server like Samba.</P
17397 ><P
17398 >The socket options that Samba uses are settable both on the command
17399 line with the -O option, or in the smb.conf file.</P
17400 ><P
17401 >The "socket options" section of the smb.conf manual page describes how
17402 to set these and gives recommendations.</P
17403 ><P
17404 >Getting the socket options right can make a big difference to your
17405 performance, but getting them wrong can degrade it by just as
17406 much. The correct settings are very dependent on your local network.</P
17407 ><P
17408 >The socket option TCP_NODELAY is the one that seems to make the
17409 biggest single difference for most networks. Many people report that
17410 adding "socket options = TCP_NODELAY" doubles the read performance of
17411 a Samba drive. The best explanation I have seen for this is that the
17412 Microsoft TCP/IP stack is slow in sending tcp ACKs.</P
17413 ></DIV
17414 ><DIV
17415 CLASS="SECT1"
17416 ><HR><H2
17417 CLASS="SECT1"
17418 ><A
17419 NAME="AEN3499"
17420 >25.3. Read size</A
17421 ></H2
17422 ><P
17423 >The option "read size" affects the overlap of disk reads/writes with
17424 network reads/writes. If the amount of data being transferred in
17425 several of the SMB commands (currently SMBwrite, SMBwriteX and
17426 SMBreadbraw) is larger than this value then the server begins writing
17427 the data before it has received the whole packet from the network, or
17428 in the case of SMBreadbraw, it begins writing to the network before
17429 all the data has been read from disk.</P
17430 ><P
17431 >This overlapping works best when the speeds of disk and network access
17432 are similar, having very little effect when the speed of one is much
17433 greater than the other.</P
17434 ><P
17435 >The default value is 16384, but very little experimentation has been
17436 done yet to determine the optimal value, and it is likely that the best
17437 value will vary greatly between systems anyway. A value over 65536 is
17438 pointless and will cause you to allocate memory unnecessarily.</P
17439 ></DIV
17440 ><DIV
17441 CLASS="SECT1"
17442 ><HR><H2
17443 CLASS="SECT1"
17444 ><A
17445 NAME="AEN3504"
17446 >25.4. Max xmit</A
17447 ></H2
17448 ><P
17449 >At startup the client and server negotiate a "maximum transmit" size,
17450 which limits the size of nearly all SMB commands. You can set the
17451 maximum size that Samba will negotiate using the "max xmit = " option
17452 in smb.conf. Note that this is the maximum size of SMB request that 
17453 Samba will accept, but not the maximum size that the *client* will accept.
17454 The client maximum receive size is sent to Samba by the client and Samba
17455 honours this limit.</P
17456 ><P
17457 >It defaults to 65536 bytes (the maximum), but it is possible that some
17458 clients may perform better with a smaller transmit unit. Trying values
17459 of less than 2048 is likely to cause severe problems.</P
17460 ><P
17461 >In most cases the default is the best option.</P
17462 ></DIV
17463 ><DIV
17464 CLASS="SECT1"
17465 ><HR><H2
17466 CLASS="SECT1"
17467 ><A
17468 NAME="AEN3509"
17469 >25.5. Log level</A
17470 ></H2
17471 ><P
17472 >If you set the log level (also known as "debug level") higher than 2
17473 then you may suffer a large drop in performance. This is because the
17474 server flushes the log file after each operation, which can be very
17475 expensive. </P
17476 ></DIV
17477 ><DIV
17478 CLASS="SECT1"
17479 ><HR><H2
17480 CLASS="SECT1"
17481 ><A
17482 NAME="AEN3512"
17483 >25.6. Read raw</A
17484 ></H2
17485 ><P
17486 >The "read raw" operation is designed to be an optimised, low-latency
17487 file read operation. A server may choose to not support it,
17488 however. and Samba makes support for "read raw" optional, with it
17489 being enabled by default.</P
17490 ><P
17491 >In some cases clients don't handle "read raw" very well and actually
17492 get lower performance using it than they get using the conventional
17493 read operations. </P
17494 ><P
17495 >So you might like to try "read raw = no" and see what happens on your
17496 network. It might lower, raise or not affect your performance. Only
17497 testing can really tell.</P
17498 ></DIV
17499 ><DIV
17500 CLASS="SECT1"
17501 ><HR><H2
17502 CLASS="SECT1"
17503 ><A
17504 NAME="AEN3517"
17505 >25.7. Write raw</A
17506 ></H2
17507 ><P
17508 >The "write raw" operation is designed to be an optimised, low-latency
17509 file write operation. A server may choose to not support it,
17510 however. and Samba makes support for "write raw" optional, with it
17511 being enabled by default.</P
17512 ><P
17513 >Some machines may find "write raw" slower than normal write, in which
17514 case you may wish to change this option.</P
17515 ></DIV
17516 ><DIV
17517 CLASS="SECT1"
17518 ><HR><H2
17519 CLASS="SECT1"
17520 ><A
17521 NAME="AEN3521"
17522 >25.8. Slow Clients</A
17523 ></H2
17524 ><P
17525 >One person has reported that setting the protocol to COREPLUS rather
17526 than LANMAN2 gave a dramatic speed improvement (from 10k/s to 150k/s).</P
17527 ><P
17528 >I suspect that his PC's (386sx16 based) were asking for more data than
17529 they could chew. I suspect a similar speed could be had by setting
17530 "read raw = no" and "max xmit = 2048", instead of changing the
17531 protocol. Lowering the "read size" might also help.</P
17532 ></DIV
17533 ><DIV
17534 CLASS="SECT1"
17535 ><HR><H2
17536 CLASS="SECT1"
17537 ><A
17538 NAME="AEN3525"
17539 >25.9. Slow Logins</A
17540 ></H2
17541 ><P
17542 >Slow logins are almost always due to the password checking time. Using
17543 the lowest practical "password level" will improve things a lot. You
17544 could also enable the "UFC crypt" option in the Makefile.</P
17545 ></DIV
17546 ><DIV
17547 CLASS="SECT1"
17548 ><HR><H2
17549 CLASS="SECT1"
17550 ><A
17551 NAME="AEN3528"
17552 >25.10. Client tuning</A
17553 ></H2
17554 ><P
17555 >Often a speed problem can be traced to the client. The client (for
17556 example Windows for Workgroups) can often be tuned for better TCP
17557 performance.</P
17558 ><P
17559 >See your client docs for details. In particular, I have heard rumours
17560 that the WfWg options TCPWINDOWSIZE and TCPSEGMENTSIZE can have a
17561 large impact on performance.</P
17562 ><P
17563 >Also note that some people have found that setting DefaultRcvWindow in
17564 the [MSTCP] section of the SYSTEM.INI file under WfWg to 3072 gives a
17565 big improvement. I don't know why.</P
17566 ><P
17567 >My own experience wth DefaultRcvWindow is that I get much better
17568 performance with a large value (16384 or larger). Other people have
17569 reported that anything over 3072 slows things down enourmously. One
17570 person even reported a speed drop of a factor of 30 when he went from
17571 3072 to 8192. I don't know why.</P
17572 ><P
17573 >It probably depends a lot on your hardware, and the type of unix box
17574 you have at the other end of the link.</P
17575 ><P
17576 >Paul Cochrane has done some testing on client side tuning and come 
17577 to the following conclusions:</P
17578 ><P
17579 >Install the W2setup.exe file from www.microsoft.com. This is an 
17580 update for the winsock stack and utilities which improve performance.</P
17581 ><P
17582 >Configure the win95 TCPIP registry settings to give better 
17583 perfomance. I use a program called MTUSPEED.exe which I got off the 
17584 net. There are various other utilities of this type freely available. 
17585 The setting which give the best performance for me are:</P
17586 ><P
17587 ></P
17588 ><OL
17589 TYPE="1"
17590 ><LI
17591 ><P
17592 >MaxMTU                  Remove</P
17593 ></LI
17594 ><LI
17595 ><P
17596 >RWIN                    Remove</P
17597 ></LI
17598 ><LI
17599 ><P
17600 >MTUAutoDiscover         Disable</P
17601 ></LI
17602 ><LI
17603 ><P
17604 >MTUBlackHoleDetect      Disable</P
17605 ></LI
17606 ><LI
17607 ><P
17608 >Time To Live            Enabled</P
17609 ></LI
17610 ><LI
17611 ><P
17612 >Time To Live - HOPS     32</P
17613 ></LI
17614 ><LI
17615 ><P
17616 >NDI Cache Size          0</P
17617 ></LI
17618 ></OL
17619 ><P
17620 >I tried virtually all of the items mentioned in the document and 
17621 the only one which made a difference to me was the socket options. It 
17622 turned out I was better off without any!!!!!</P
17623 ><P
17624 >In terms of overall speed of transfer, between various win95 clients 
17625 and a DX2-66 20MB server with a crappy NE2000 compatible and old IDE 
17626 drive (Kernel 2.0.30). The transfer rate was reasonable for 10 baseT.</P
17627 ><P
17628 ><PRE
17629 CLASS="PROGRAMLISTING"
17630 >The figures are:          Put              Get 
17631 P166 client 3Com card:    420-440kB/s      500-520kB/s
17632 P100 client 3Com card:    390-410kB/s      490-510kB/s
17633 DX4-75 client NE2000:     370-380kB/s      330-350kB/s</PRE
17634 ></P
17635 ><P
17636 >I based these test on transfer two files a 4.5MB text file and a 15MB 
17637 textfile. The results arn't bad considering the hardware Samba is 
17638 running on. It's a crap machine!!!!</P
17639 ><P
17640 >The updates mentioned in 1 and 2 brought up the transfer rates from 
17641 just over 100kB/s in some clients.</P
17642 ><P
17643 >A new client is a P333 connected via a 100MB/s card and hub. The 
17644 transfer rates from this were good: 450-500kB/s on put and 600+kB/s 
17645 on get.</P
17646 ><P
17647 >Looking at standard FTP throughput, Samba is a bit slower (100kB/s 
17648 upwards). I suppose there is more going on in the samba protocol, but 
17649 if it could get up to the rate of FTP the perfomance would be quite 
17650 staggering.</P
17651 ></DIV
17652 ></DIV
17653 ><DIV
17654 CLASS="CHAPTER"
17655 ><HR><H1
17656 ><A
17657 NAME="PORTABILITY"
17658 ></A
17659 >Chapter 26. Portability</H1
17660 ><P
17661 >Samba works on a wide range of platforms but the interface all the 
17662 platforms provide is not always compatible. This chapter contains 
17663 platform-specific information about compiling and using samba.</P
17664 ><DIV
17665 CLASS="SECT1"
17666 ><HR><H2
17667 CLASS="SECT1"
17668 ><A
17669 NAME="AEN3568"
17670 >26.1. HPUX</A
17671 ></H2
17672 ><P
17673 >HP's implementation of supplementary groups is, er, non-standard (for
17674 hysterical reasons).  There are two group files, /etc/group and
17675 /etc/logingroup; the system maps UIDs to numbers using the former, but
17676 initgroups() reads the latter.  Most system admins who know the ropes
17677 symlink /etc/group to /etc/logingroup (hard link doesn't work for reasons
17678 too stupid to go into here).  initgroups() will complain if one of the
17679 groups you're in in /etc/logingroup has what it considers to be an invalid
17680 ID, which means outside the range [0..UID_MAX], where UID_MAX is (I think)
17681 60000 currently on HP-UX.  This precludes -2 and 65534, the usual 'nobody'
17682 GIDs.</P
17683 ><P
17684 >If you encounter this problem, make sure that the programs that are failing 
17685 to initgroups() be run as users not in any groups with GIDs outside the 
17686 allowed range.</P
17687 ><P
17688 >This is documented in the HP manual pages under setgroups(2) and passwd(4).</P
17689 ><P
17690 >On HPUX you must use gcc or the HP Ansi compiler. The free compiler
17691 that comes with HP-UX is not Ansi compliant and cannot compile
17692 Samba.</P
17693 ></DIV
17694 ><DIV
17695 CLASS="SECT1"
17696 ><HR><H2
17697 CLASS="SECT1"
17698 ><A
17699 NAME="AEN3574"
17700 >26.2. SCO Unix</A
17701 ></H2
17702 ><P
17703
17704 If you run an old version of  SCO Unix then you may need to get important 
17705 TCP/IP patches for Samba to work correctly. Without the patch, you may 
17706 encounter corrupt data transfers using samba.</P
17707 ><P
17708 >The patch you need is UOD385 Connection Drivers SLS. It is available from
17709 SCO (ftp.sco.com, directory SLS, files uod385a.Z and uod385a.ltr.Z).</P
17710 ></DIV
17711 ><DIV
17712 CLASS="SECT1"
17713 ><HR><H2
17714 CLASS="SECT1"
17715 ><A
17716 NAME="AEN3578"
17717 >26.3. DNIX</A
17718 ></H2
17719 ><P
17720 >DNIX has a problem with seteuid() and setegid(). These routines are
17721 needed for Samba to work correctly, but they were left out of the DNIX
17722 C library for some reason.</P
17723 ><P
17724 >For this reason Samba by default defines the macro NO_EID in the DNIX
17725 section of includes.h. This works around the problem in a limited way,
17726 but it is far from ideal, some things still won't work right.</P
17727 ><P
17728
17729 To fix the problem properly you need to assemble the following two
17730 functions and then either add them to your C library or link them into
17731 Samba.</P
17732 ><P
17733
17734 put this in the file <TT
17735 CLASS="FILENAME"
17736 >setegid.s</TT
17737 >:</P
17738 ><P
17739 ><PRE
17740 CLASS="PROGRAMLISTING"
17741 >        .globl  _setegid
17742 _setegid:
17743         moveq   #47,d0
17744         movl    #100,a0
17745         moveq   #1,d1
17746         movl    4(sp),a1
17747         trap    #9
17748         bccs    1$
17749         jmp     cerror
17750 1$:
17751         clrl    d0
17752         rts</PRE
17753 ></P
17754 ><P
17755 >put this in the file <TT
17756 CLASS="FILENAME"
17757 >seteuid.s</TT
17758 >:</P
17759 ><P
17760 ><PRE
17761 CLASS="PROGRAMLISTING"
17762 >        .globl  _seteuid
17763 _seteuid:
17764         moveq   #47,d0
17765         movl    #100,a0
17766         moveq   #0,d1
17767         movl    4(sp),a1
17768         trap    #9
17769         bccs    1$
17770         jmp     cerror
17771 1$:
17772         clrl    d0
17773         rts</PRE
17774 ></P
17775 ><P
17776 >after creating the above files you then assemble them using</P
17777 ><P
17778 ><B
17779 CLASS="COMMAND"
17780 >as seteuid.s</B
17781 ></P
17782 ><P
17783 ><B
17784 CLASS="COMMAND"
17785 >as setegid.s</B
17786 ></P
17787 ><P
17788 >that should produce the files <TT
17789 CLASS="FILENAME"
17790 >seteuid.o</TT
17791 > and 
17792 <TT
17793 CLASS="FILENAME"
17794 >setegid.o</TT
17795 ></P
17796 ><P
17797 >then you need to add these to the LIBSM line in the DNIX section of
17798 the Samba Makefile. Your LIBSM line will then look something like this:</P
17799 ><P
17800 ><PRE
17801 CLASS="PROGRAMLISTING"
17802 >LIBSM = setegid.o seteuid.o -ln</PRE
17803 ></P
17804 ><P
17805
17806 You should then remove the line:</P
17807 ><P
17808 ><PRE
17809 CLASS="PROGRAMLISTING"
17810 >#define NO_EID</PRE
17811 ></P
17812 ><P
17813 >from the DNIX section of <TT
17814 CLASS="FILENAME"
17815 >includes.h</TT
17816 ></P
17817 ></DIV
17818 ><DIV
17819 CLASS="SECT1"
17820 ><HR><H2
17821 CLASS="SECT1"
17822 ><A
17823 NAME="AEN3607"
17824 >26.4. RedHat Linux Rembrandt-II</A
17825 ></H2
17826 ><P
17827 >By default RedHat Rembrandt-II during installation adds an
17828 entry to /etc/hosts as follows:
17829 <PRE
17830 CLASS="PROGRAMLISTING"
17831 >       127.0.0.1 loopback "hostname"."domainname"</PRE
17832 ></P
17833 ><P
17834 >This causes Samba to loop back onto the loopback interface.
17835 The result is that Samba fails to communicate correctly with
17836 the world and therefor may fail to correctly negotiate who
17837 is the master browse list holder and who is the master browser.</P
17838 ><P
17839 >Corrective Action:     Delete the entry after the word loopback
17840         in the line starting 127.0.0.1</P
17841 ></DIV
17842 ><DIV
17843 CLASS="SECT1"
17844 ><HR><H2
17845 CLASS="SECT1"
17846 ><A
17847 NAME="AEN3613"
17848 >26.5. AIX</A
17849 ></H2
17850 ><DIV
17851 CLASS="SECT2"
17852 ><H3
17853 CLASS="SECT2"
17854 ><A
17855 NAME="AEN3615"
17856 >26.5.1. Sequential Read Ahead</A
17857 ></H3
17858 ><P
17859 >Disabling Sequential Read Ahead using "vmtune -r 0" improves 
17860 samba performance significally.</P
17861 ></DIV
17862 ></DIV
17863 ></DIV
17864 ><DIV
17865 CLASS="CHAPTER"
17866 ><HR><H1
17867 ><A
17868 NAME="OTHER-CLIENTS"
17869 ></A
17870 >Chapter 27. Samba and other CIFS clients</H1
17871 ><P
17872 >This chapter contains client-specific information.</P
17873 ><DIV
17874 CLASS="SECT1"
17875 ><HR><H2
17876 CLASS="SECT1"
17877 ><A
17878 NAME="AEN3633"
17879 >27.1. Macintosh clients?</A
17880 ></H2
17881 ><P
17882 >Yes. <A
17883 HREF="http://www.thursby.com/"
17884 TARGET="_top"
17885 >Thursby</A
17886 > now have a CIFS Client / Server called DAVE - see</P
17887 ><P
17888 >They test it against Windows 95, Windows NT and samba for
17889 compatibility issues.  At the time of writing, DAVE was at version
17890 1.0.1. The 1.0.0 to 1.0.1 update is available as a free download from
17891 the Thursby web site (the speed of finder copies has been greatly
17892 enhanced, and there are bug-fixes included).</P
17893 ><P
17894
17895 Alternatives - There are two free implementations of AppleTalk for
17896 several kinds of UNIX machnes, and several more commercial ones.
17897 These products allow you to run file services and print services
17898 natively to Macintosh users, with no additional support required on
17899 the Macintosh.  The two free omplementations are 
17900 <A
17901 HREF="http://www.umich.edu/~rsug/netatalk/"
17902 TARGET="_top"
17903 >Netatalk</A
17904 >, and 
17905 <A
17906 HREF="http://www.cs.mu.oz.au/appletalk/atalk.html"
17907 TARGET="_top"
17908 >CAP</A
17909 >.  
17910 What Samba offers MS
17911 Windows users, these packages offer to Macs.  For more info on these
17912 packages, Samba, and Linux (and other UNIX-based systems) see
17913 <A
17914 HREF="http://www.eats.com/linux_mac_win.html"
17915 TARGET="_top"
17916 >http://www.eats.com/linux_mac_win.html</A
17917 ></P
17918 ></DIV
17919 ><DIV
17920 CLASS="SECT1"
17921 ><HR><H2
17922 CLASS="SECT1"
17923 ><A
17924 NAME="AEN3642"
17925 >27.2. OS2 Client</A
17926 ></H2
17927 ><DIV
17928 CLASS="SECT2"
17929 ><H3
17930 CLASS="SECT2"
17931 ><A
17932 NAME="AEN3644"
17933 >27.2.1. How can I configure OS/2 Warp Connect or 
17934                 OS/2 Warp 4 as a client for Samba?</A
17935 ></H3
17936 ><P
17937 >A more complete answer to this question can be 
17938                 found on <A
17939 HREF="http://carol.wins.uva.nl/~leeuw/samba/warp.html"
17940 TARGET="_top"
17941 >               http://carol.wins.uva.nl/~leeuw/samba/warp.html</A
17942 >.</P
17943 ><P
17944 >Basically, you need three components:</P
17945 ><P
17946 ></P
17947 ><UL
17948 ><LI
17949 ><P
17950 >The File and Print Client ('IBM Peer')
17951                         </P
17952 ></LI
17953 ><LI
17954 ><P
17955 >TCP/IP ('Internet support') 
17956                         </P
17957 ></LI
17958 ><LI
17959 ><P
17960 >The "NetBIOS over TCP/IP" driver ('TCPBEUI')
17961                         </P
17962 ></LI
17963 ></UL
17964 ><P
17965 >Installing the first two together with the base operating 
17966                 system on a blank system is explained in the Warp manual. If Warp 
17967                 has already been installed, but you now want to install the 
17968                 networking support, use the "Selective Install for Networking" 
17969                 object in the "System Setup" folder.</P
17970 ><P
17971 >Adding the "NetBIOS over TCP/IP" driver is not described 
17972                 in the manual and just barely in the online documentation. Start 
17973                 MPTS.EXE, click on OK, click on "Configure LAPS" and click 
17974                 on "IBM OS/2 NETBIOS OVER TCP/IP" in  'Protocols'.  This line 
17975                 is then moved to 'Current Configuration'. Select that line, 
17976                 click on "Change number" and increase it from 0 to 1. Save this
17977                 configuration.</P
17978 ><P
17979 >If the Samba server(s) is not on your local subnet, you 
17980                 can optionally add IP names and addresses of these servers 
17981                 to the "Names List", or specify a  WINS server ('NetBIOS 
17982                 Nameserver' in IBM and RFC terminology). For Warp Connect you 
17983                 may need to download an update for 'IBM Peer' to bring it on 
17984                 the same level as Warp 4. See the webpage mentioned above.</P
17985 ></DIV
17986 ><DIV
17987 CLASS="SECT2"
17988 ><HR><H3
17989 CLASS="SECT2"
17990 ><A
17991 NAME="AEN3659"
17992 >27.2.2. How can I configure OS/2 Warp 3 (not Connect), 
17993                 OS/2 1.2, 1.3 or 2.x for Samba?</A
17994 ></H3
17995 ><P
17996 >You can use the free Microsoft LAN Manager 2.2c Client 
17997                 for OS/2 from 
17998                 <A
17999 HREF="ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/"
18000 TARGET="_top"
18001 >               ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/</A
18002 >.
18003         See <A
18004 HREF="http://carol.wins.uva.nl/~leeuw/lanman.html"
18005 TARGET="_top"
18006 >               http://carol.wins.uva.nl/~leeuw/lanman.html</A
18007 > for 
18008                 more information on how to install and use this client. In 
18009                 a nutshell, edit the file \OS2VER in the root directory of 
18010                 the OS/2 boot partition and add the lines:</P
18011 ><P
18012 ><PRE
18013 CLASS="PROGRAMLISTING"
18014 >               20=setup.exe
18015                 20=netwksta.sys
18016                 20=netvdd.sys
18017                 </PRE
18018 ></P
18019 ><P
18020 >before you install the client. Also, don't use the 
18021                 included NE2000 driver because it is buggy. Try the NE2000 
18022                 or NS2000 driver from 
18023                 <A
18024 HREF="ftp://ftp.cdrom.com/pub/os2/network/ndis/"
18025 TARGET="_top"
18026 >               ftp://ftp.cdrom.com/pub/os2/network/ndis/</A
18027 > instead.
18028                 </P
18029 ></DIV
18030 ><DIV
18031 CLASS="SECT2"
18032 ><HR><H3
18033 CLASS="SECT2"
18034 ><A
18035 NAME="AEN3668"
18036 >27.2.3. Are there any other issues when OS/2 (any version) 
18037                 is used as a client?</A
18038 ></H3
18039 ><P
18040 >When you do a NET VIEW or use the "File and Print 
18041                 Client Resource Browser", no Samba servers show up. This can 
18042                 be fixed by a patch from <A
18043 HREF="http://carol.wins.uva.nl/~leeuw/samba/fix.html"
18044 TARGET="_top"
18045 >               http://carol.wins.uva.nl/~leeuw/samba/fix.html</A
18046 >.
18047                 The patch will be included in a later version of Samba. It also 
18048                 fixes a couple of other problems, such as preserving long 
18049                 filenames when objects are dragged from the Workplace Shell 
18050                 to the Samba server. </P
18051 ></DIV
18052 ><DIV
18053 CLASS="SECT2"
18054 ><HR><H3
18055 CLASS="SECT2"
18056 ><A
18057 NAME="AEN3672"
18058 >27.2.4. How do I get printer driver download working 
18059                 for OS/2 clients?</A
18060 ></H3
18061 ><P
18062 >First, create a share called [PRINTDRV] that is 
18063                 world-readable.  Copy your OS/2 driver files there.  Note 
18064                 that the .EA_ files must still be separate, so you will need 
18065                 to use the original install files, and not copy an installed 
18066                 driver from an OS/2 system.</P
18067 ><P
18068 >Install the NT driver first for that printer.  Then, 
18069                 add to your smb.conf a parameter, os2 driver map = 
18070                 <VAR
18071 CLASS="REPLACEABLE"
18072 >filename</VAR
18073 >".  Then, in the file 
18074                 specified by <VAR
18075 CLASS="REPLACEABLE"
18076 >filename</VAR
18077 >, map the 
18078                 name of the NT driver name to the OS/2 driver name as 
18079                 follows:</P
18080 ><P
18081 ><B
18082 CLASS="COMMAND"
18083 >nt driver name = os2 "driver 
18084                 name"."device name"</B
18085 >, e.g.:
18086                 HP LaserJet 5L = LASERJET.HP LaserJet 5L</P
18087 ><P
18088 >You can have multiple drivers mapped in this file.</P
18089 ><P
18090 >If you only specify the OS/2 driver name, and not the 
18091                 device name, the first attempt to download the driver will 
18092                 actually download the files, but the OS/2 client will tell 
18093                 you the driver is not available.  On the second attempt, it 
18094                 will work.  This is fixed simply by adding the device name
18095                  to the mapping, after which it will work on the first attempt.
18096                 </P
18097 ></DIV
18098 ></DIV
18099 ><DIV
18100 CLASS="SECT1"
18101 ><HR><H2
18102 CLASS="SECT1"
18103 ><A
18104 NAME="AEN3682"
18105 >27.3. Windows for Workgroups</A
18106 ></H2
18107 ><DIV
18108 CLASS="SECT2"
18109 ><H3
18110 CLASS="SECT2"
18111 ><A
18112 NAME="AEN3684"
18113 >27.3.1. Use latest TCP/IP stack from Microsoft</A
18114 ></H3
18115 ><P
18116 >Use the latest TCP/IP stack from microsoft if you use Windows
18117 for workgroups.</P
18118 ><P
18119 >The early TCP/IP stacks had lots of bugs.</P
18120 ><P
18121
18122 Microsoft has released an incremental upgrade to their TCP/IP 32-Bit
18123 VxD drivers.  The latest release can be found on their ftp site at
18124 ftp.microsoft.com, located in /peropsys/windows/public/tcpip/wfwt32.exe.
18125 There is an update.txt file there that describes the problems that were
18126 fixed.  New files include WINSOCK.DLL, TELNET.EXE, WSOCK.386, VNBT.386,
18127 WSTCP.386, TRACERT.EXE, NETSTAT.EXE, and NBTSTAT.EXE.</P
18128 ></DIV
18129 ><DIV
18130 CLASS="SECT2"
18131 ><HR><H3
18132 CLASS="SECT2"
18133 ><A
18134 NAME="AEN3689"
18135 >27.3.2. Delete .pwl files after password change</A
18136 ></H3
18137 ><P
18138 >WfWg does a lousy job with passwords. I find that if I change my
18139 password on either the unix box or the PC the safest thing to do is to
18140 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
18141 ><P
18142
18143 If you don't do this you may find that WfWg remembers and uses the old
18144 password, even if you told it a new one.</P
18145 ><P
18146
18147 Often WfWg will totally ignore a password you give it in a dialog box.</P
18148 ></DIV
18149 ><DIV
18150 CLASS="SECT2"
18151 ><HR><H3
18152 CLASS="SECT2"
18153 ><A
18154 NAME="AEN3694"
18155 >27.3.3. Configure WfW password handling</A
18156 ></H3
18157 ><P
18158 >There is a program call admincfg.exe
18159 on the last disk (disk 8) of the WFW 3.11 disk set.  To install it
18160 type EXPAND A:\ADMINCFG.EX_ C:\WINDOWS\ADMINCFG.EXE Then add an icon
18161 for it via the "Progam Manager" "New" Menu.  This program allows you
18162 to control how WFW handles passwords.  ie disable Password Caching etc
18163 for use with <B
18164 CLASS="COMMAND"
18165 >security = user</B
18166 ></P
18167 ></DIV
18168 ><DIV
18169 CLASS="SECT2"
18170 ><HR><H3
18171 CLASS="SECT2"
18172 ><A
18173 NAME="AEN3698"
18174 >27.3.4. Case handling of passwords</A
18175 ></H3
18176 ><P
18177 >Windows for Workgroups uppercases the password before sending it to the server. Unix passwords can be case-sensitive though. Check the <A
18178 HREF="smb.conf.5.html"
18179 TARGET="_top"
18180 >smb.conf(5)</A
18181 > information on <B
18182 CLASS="COMMAND"
18183 >password level</B
18184 > to specify what characters samba should try to uppercase when checking.</P
18185 ></DIV
18186 ><DIV
18187 CLASS="SECT2"
18188 ><HR><H3
18189 CLASS="SECT2"
18190 ><A
18191 NAME="AEN3703"
18192 >27.3.5. Use TCP/IP as default protocol</A
18193 ></H3
18194 ><P
18195 >To support print queue reporting you may find
18196 that you have to use TCP/IP as the default protocol under
18197 WfWg. For some reason if you leave Netbeui as the default
18198 it may break the print queue reporting on some systems.
18199 It is presumably a WfWg bug.</P
18200 ></DIV
18201 ></DIV
18202 ><DIV
18203 CLASS="SECT1"
18204 ><HR><H2
18205 CLASS="SECT1"
18206 ><A
18207 NAME="AEN3706"
18208 >27.4. Windows '95/'98</A
18209 ></H2
18210 ><P
18211 >When using Windows 95 OEM SR2 the following updates are recommended where Samba
18212 is being used. Please NOTE that the above change will affect you once these
18213 updates  have been installed.</P
18214 ><P
18215
18216 There are more updates than the ones mentioned here. You are referred to the
18217 Microsoft Web site for all currently available updates to your specific version
18218 of Windows 95.</P
18219 ><P
18220 ></P
18221 ><OL
18222 TYPE="1"
18223 ><LI
18224 ><P
18225 >Kernel Update: KRNLUPD.EXE</P
18226 ></LI
18227 ><LI
18228 ><P
18229 >Ping Fix: PINGUPD.EXE</P
18230 ></LI
18231 ><LI
18232 ><P
18233 >RPC Update: RPCRTUPD.EXE</P
18234 ></LI
18235 ><LI
18236 ><P
18237 >TCP/IP Update: VIPUPD.EXE</P
18238 ></LI
18239 ><LI
18240 ><P
18241 >Redirector Update: VRDRUPD.EXE</P
18242 ></LI
18243 ></OL
18244 ><P
18245 >Also, if using MS OutLook it is desirable to install the OLEUPD.EXE fix. This
18246 fix may stop your machine from hanging for an extended period when exiting
18247 OutLook and you may also notice a significant speedup when accessing network
18248 neighborhood services.</P
18249 ></DIV
18250 ><DIV
18251 CLASS="SECT1"
18252 ><HR><H2
18253 CLASS="SECT1"
18254 ><A
18255 NAME="AEN3722"
18256 >27.5. Windows 2000 Service Pack 2</A
18257 ></H2
18258 ><P
18259
18260 There are several annoyances with Windows 2000 SP2. One of which
18261 only appears when using a Samba server to host user profiles
18262 to Windows 2000 SP2 clients in a Windows domain.  This assumes
18263 that Samba is a member of the domain, but the problem will
18264 likely occur if it is not.</P
18265 ><P
18266
18267 In order to server profiles successfully to Windows 2000 SP2 
18268 clients (when not operating as a PDC), Samba must have 
18269 <B
18270 CLASS="COMMAND"
18271 >nt acl support = no</B
18272 >
18273 added to the file share which houses the roaming profiles.
18274 If this is not done, then the Windows 2000 SP2 client will
18275 complain about not being able to access the profile (Access 
18276 Denied) and create multiple copies of it on disk (DOMAIN.user.001,
18277 DOMAIN.user.002, etc...).  See the 
18278 <A
18279 HREF="smb.conf.5.html"
18280 TARGET="_top"
18281 >smb.conf(5)</A
18282 > man page
18283 for more details on this option.  Also note that the 
18284 <B
18285 CLASS="COMMAND"
18286 >nt acl support</B
18287 > parameter was formally a global parameter in
18288 releases prior to Samba 2.2.2.</P
18289 ><P
18290
18291 The following is a minimal profile share:</P
18292 ><P
18293 ><PRE
18294 CLASS="PROGRAMLISTING"
18295 >       [profile]
18296                 path = /export/profile
18297                 create mask = 0600
18298                 directory mask = 0700
18299                 nt acl support = no
18300                 read only = no</PRE
18301 ></P
18302 ><P
18303 >The reason for this bug is that the Win2k SP2 client copies
18304 the security descriptor for the profile which contains
18305 the Samba server's SID, and not the domain SID.  The client
18306 compares the SID for SAMBA\user and realizes it is
18307 different that the one assigned to DOMAIN\user.  Hence the reason
18308 for the "access denied" message.</P
18309 ><P
18310 >By disabling the <B
18311 CLASS="COMMAND"
18312 >nt acl support</B
18313 > parameter, Samba will send
18314 the Win2k client a response to the QuerySecurityDescriptor
18315 trans2 call which causes the client to set a default ACL
18316 for the profile. This default ACL includes </P
18317 ><P
18318 ><B
18319 CLASS="COMMAND"
18320 >DOMAIN\user    "Full Control"</B
18321 ></P
18322 ><P
18323 ><SPAN
18324 CLASS="emphasis"
18325 ><I
18326 CLASS="EMPHASIS"
18327 >NOTE : This bug does not occur when using winbind to
18328 create accounts on the Samba host for Domain users.</I
18329 ></SPAN
18330 ></P
18331 ></DIV
18332 ></DIV
18333 ><DIV
18334 CLASS="CHAPTER"
18335 ><HR><H1
18336 ><A
18337 NAME="COMPILING"
18338 ></A
18339 >Chapter 28. How to compile SAMBA</H1
18340 ><P
18341 >You can obtain the samba source from the <A
18342 HREF="http://samba.org/"
18343 TARGET="_top"
18344 >samba website</A
18345 >. To obtain a development version, 
18346 you can download samba from CVS or using rsync. </P
18347 ><DIV
18348 CLASS="SECT1"
18349 ><HR><H2
18350 CLASS="SECT1"
18351 ><A
18352 NAME="AEN3749"
18353 >28.1. Access Samba source code via CVS</A
18354 ></H2
18355 ><DIV
18356 CLASS="SECT2"
18357 ><H3
18358 CLASS="SECT2"
18359 ><A
18360 NAME="AEN3751"
18361 >28.1.1. Introduction</A
18362 ></H3
18363 ><P
18364 >Samba is developed in an open environment.  Developers use CVS
18365 (Concurrent Versioning System) to "checkin" (also known as 
18366 "commit") new source code.  Samba's various CVS branches can
18367 be accessed via anonymous CVS using the instructions
18368 detailed in this chapter.</P
18369 ><P
18370 >This chapter is a modified version of the instructions found at
18371 <A
18372 HREF="http://samba.org/samba/cvs.html"
18373 TARGET="_top"
18374 >http://samba.org/samba/cvs.html</A
18375 ></P
18376 ></DIV
18377 ><DIV
18378 CLASS="SECT2"
18379 ><HR><H3
18380 CLASS="SECT2"
18381 ><A
18382 NAME="AEN3756"
18383 >28.1.2. CVS Access to samba.org</A
18384 ></H3
18385 ><P
18386 >The machine samba.org runs a publicly accessible CVS 
18387 repository for access to the source code of several packages, 
18388 including samba, rsync and jitterbug. There are two main ways of 
18389 accessing the CVS server on this host.</P
18390 ><DIV
18391 CLASS="SECT3"
18392 ><HR><H4
18393 CLASS="SECT3"
18394 ><A
18395 NAME="AEN3759"
18396 >28.1.2.1. Access via CVSweb</A
18397 ></H4
18398 ><P
18399 >You can access the source code via your 
18400 favourite WWW browser. This allows you to access the contents of 
18401 individual files in the repository and also to look at the revision 
18402 history and commit logs of individual files. You can also ask for a diff 
18403 listing between any two versions on the repository.</P
18404 ><P
18405 >Use the URL : <A
18406 HREF="http://samba.org/cgi-bin/cvsweb"
18407 TARGET="_top"
18408 >http://samba.org/cgi-bin/cvsweb</A
18409 ></P
18410 ></DIV
18411 ><DIV
18412 CLASS="SECT3"
18413 ><HR><H4
18414 CLASS="SECT3"
18415 ><A
18416 NAME="AEN3764"
18417 >28.1.2.2. Access via cvs</A
18418 ></H4
18419 ><P
18420 >You can also access the source code via a 
18421 normal cvs client.  This gives you much more control over you can 
18422 do with the repository and allows you to checkout whole source trees 
18423 and keep them up to date via normal cvs commands. This is the 
18424 preferred method of access if you are a developer and not
18425 just a casual browser.</P
18426 ><P
18427 >To download the latest cvs source code, point your
18428 browser at the URL : <A
18429 HREF="http://www.cyclic.com/"
18430 TARGET="_top"
18431 >http://www.cyclic.com/</A
18432 >.
18433 and click on the 'How to get cvs' link. CVS is free software under 
18434 the GNU GPL (as is Samba).  Note that there are several graphical CVS clients
18435 which provide a graphical interface to the sometimes mundane CVS commands.
18436 Links to theses clients are also available from http://www.cyclic.com.</P
18437 ><P
18438 >To gain access via anonymous cvs use the following steps. 
18439 For this example it is assumed that you want a copy of the 
18440 samba source code. For the other source code repositories 
18441 on this system just substitute the correct package name</P
18442 ><P
18443 ></P
18444 ><OL
18445 TYPE="1"
18446 ><LI
18447 ><P
18448 >       Install a recent copy of cvs. All you really need is a 
18449         copy of the cvs client binary. 
18450         </P
18451 ></LI
18452 ><LI
18453 ><P
18454 >       Run the command 
18455         </P
18456 ><P
18457 >       <B
18458 CLASS="COMMAND"
18459 >cvs -d :pserver:cvs@samba.org:/cvsroot login</B
18460 >
18461         </P
18462 ><P
18463 >       When it asks you for a password type <KBD
18464 CLASS="USERINPUT"
18465 >cvs</KBD
18466 >.
18467         </P
18468 ></LI
18469 ><LI
18470 ><P
18471 >       Run the command 
18472         </P
18473 ><P
18474 >       <B
18475 CLASS="COMMAND"
18476 >cvs -d :pserver:cvs@samba.org:/cvsroot co samba</B
18477 >
18478         </P
18479 ><P
18480 >       This will create a directory called samba containing the 
18481         latest samba source code (i.e. the HEAD tagged cvs branch). This 
18482         currently corresponds to the 3.0 development tree. 
18483         </P
18484 ><P
18485 >       CVS branches other HEAD can be obtained by using the <VAR
18486 CLASS="PARAMETER"
18487 >-r</VAR
18488 >
18489         and defining a tag name.  A list of branch tag names can be found on the
18490         "Development" page of the samba web site.  A common request is to obtain the
18491         latest 2.2 release code.  This could be done by using the following command.
18492         </P
18493 ><P
18494 >       <B
18495 CLASS="COMMAND"
18496 >cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_2_2 samba</B
18497 >
18498         </P
18499 ></LI
18500 ><LI
18501 ><P
18502 >       Whenever you want to merge in the latest code changes use 
18503         the following command from within the samba directory: 
18504         </P
18505 ><P
18506 >       <B
18507 CLASS="COMMAND"
18508 >cvs update -d -P</B
18509 >
18510         </P
18511 ></LI
18512 ></OL
18513 ></DIV
18514 ></DIV
18515 ></DIV
18516 ><DIV
18517 CLASS="SECT1"
18518 ><HR><H2
18519 CLASS="SECT1"
18520 ><A
18521 NAME="AEN3792"
18522 >28.2. Accessing the samba sources via rsync and ftp</A
18523 ></H2
18524 ><P
18525 >       pserver.samba.org also exports unpacked copies of most parts of the CVS tree at <A
18526 HREF="ftp://pserver.samba.org/pub/unpacked"
18527 TARGET="_top"
18528 >ftp://pserver.samba.org/pub/unpacked</A
18529 > and also via anonymous rsync at rsync://pserver.samba.org/ftp/unpacked/. I recommend using rsync rather than ftp.
18530         See <A
18531 HREF="http://rsync.samba.org/"
18532 TARGET="_top"
18533 >the rsync homepage</A
18534 > for more info on rsync.                       
18535         </P
18536 ><P
18537 >       The disadvantage of the unpacked trees
18538         is that they do not support automatic
18539         merging of local changes like CVS does.
18540         rsync access is most convenient for an 
18541         initial install.                       
18542         </P
18543 ></DIV
18544 ><DIV
18545 CLASS="SECT1"
18546 ><HR><H2
18547 CLASS="SECT1"
18548 ><A
18549 NAME="AEN3798"
18550 >28.3. Building the Binaries</A
18551 ></H2
18552 ><P
18553 >To do this, first run the program <B
18554 CLASS="COMMAND"
18555 >./configure
18556         </B
18557 > in the source directory. This should automatically 
18558         configure Samba for your operating system. If you have unusual 
18559         needs then you may wish to run</P
18560 ><P
18561 ><SAMP
18562 CLASS="PROMPT"
18563 >root# </SAMP
18564 ><KBD
18565 CLASS="USERINPUT"
18566 >./configure --help
18567         </KBD
18568 ></P
18569 ><P
18570 >first to see what special options you can enable.
18571         Then executing</P
18572 ><P
18573 ><SAMP
18574 CLASS="PROMPT"
18575 >root# </SAMP
18576 ><KBD
18577 CLASS="USERINPUT"
18578 >make</KBD
18579 ></P
18580 ><P
18581 >will create the binaries. Once it's successfully 
18582         compiled you can use </P
18583 ><P
18584 ><SAMP
18585 CLASS="PROMPT"
18586 >root# </SAMP
18587 ><KBD
18588 CLASS="USERINPUT"
18589 >make install</KBD
18590 ></P
18591 ><P
18592 >to install the binaries and manual pages. You can 
18593         separately install the binaries and/or man pages using</P
18594 ><P
18595 ><SAMP
18596 CLASS="PROMPT"
18597 >root# </SAMP
18598 ><KBD
18599 CLASS="USERINPUT"
18600 >make installbin
18601         </KBD
18602 ></P
18603 ><P
18604 >and</P
18605 ><P
18606 ><SAMP
18607 CLASS="PROMPT"
18608 >root# </SAMP
18609 ><KBD
18610 CLASS="USERINPUT"
18611 >make installman
18612         </KBD
18613 ></P
18614 ><P
18615 >Note that if you are upgrading for a previous version 
18616         of Samba you might like to know that the old versions of 
18617         the binaries will be renamed with a ".old" extension. You 
18618         can go back to the previous version with</P
18619 ><P
18620 ><SAMP
18621 CLASS="PROMPT"
18622 >root# </SAMP
18623 ><KBD
18624 CLASS="USERINPUT"
18625 >make revert
18626         </KBD
18627 ></P
18628 ><P
18629 >if you find this version a disaster!</P
18630 ><DIV
18631 CLASS="SECT2"
18632 ><HR><H3
18633 CLASS="SECT2"
18634 ><A
18635 NAME="AEN3826"
18636 >28.3.1. Compiling samba with Active Directory support</A
18637 ></H3
18638 ><P
18639 >In order to compile samba with ADS support, you need to have installed
18640         on your system: 
18641         <P
18642 ></P
18643 ><TABLE
18644 BORDER="0"
18645 ><TBODY
18646 ><TR
18647 ><TD
18648 >the MIT kerberos development libraries (either install from the sources or use a package). The heimdal libraries will not work.</TD
18649 ></TR
18650 ><TR
18651 ><TD
18652 >the OpenLDAP development libraries.</TD
18653 ></TR
18654 ></TBODY
18655 ></TABLE
18656 ><P
18657 ></P
18658 >
18659
18660         </P
18661 ><P
18662 >If your kerberos libraries are in a non-standard location then
18663           remember to add the configure option --with-krb5=DIR.</P
18664 ><P
18665 >After you run configure make sure that <TT
18666 CLASS="FILENAME"
18667 >include/config.h</TT
18668 > it generates contains lines like this:</P
18669 ><P
18670 ><PRE
18671 CLASS="PROGRAMLISTING"
18672 >#define HAVE_KRB5 1
18673 #define HAVE_LDAP 1
18674                   </PRE
18675 ></P
18676 ><P
18677 >If it doesn't then configure did not find your krb5 libraries or
18678             your ldap libraries. Look in config.log to figure out why and fix
18679                   it.</P
18680 ><DIV
18681 CLASS="SECT3"
18682 ><HR><H4
18683 CLASS="SECT3"
18684 ><A
18685 NAME="AEN3838"
18686 >28.3.1.1. Installing the required packages for Debian</A
18687 ></H4
18688 ><P
18689 >On Debian you need to install the following packages:</P
18690 ><P
18691 >       <P
18692 ></P
18693 ><TABLE
18694 BORDER="0"
18695 ><TBODY
18696 ><TR
18697 ><TD
18698 >libkrb5-dev</TD
18699 ></TR
18700 ><TR
18701 ><TD
18702 >krb5-user</TD
18703 ></TR
18704 ></TBODY
18705 ></TABLE
18706 ><P
18707 ></P
18708 >
18709         </P
18710 ></DIV
18711 ><DIV
18712 CLASS="SECT3"
18713 ><HR><H4
18714 CLASS="SECT3"
18715 ><A
18716 NAME="AEN3845"
18717 >28.3.1.2. Installing the required packages for RedHat</A
18718 ></H4
18719 ><P
18720 >On RedHat this means you should have at least: </P
18721 ><P
18722 >       <P
18723 ></P
18724 ><TABLE
18725 BORDER="0"
18726 ><TBODY
18727 ><TR
18728 ><TD
18729 >krb5-workstation (for kinit)</TD
18730 ></TR
18731 ><TR
18732 ><TD
18733 >krb5-libs (for linking with)</TD
18734 ></TR
18735 ><TR
18736 ><TD
18737 >krb5-devel (because you are compiling from source)</TD
18738 ></TR
18739 ></TBODY
18740 ></TABLE
18741 ><P
18742 ></P
18743 >
18744         </P
18745 ><P
18746 >in addition to the standard development environment.</P
18747 ><P
18748 >Note that these are not standard on a RedHat install, and you may need
18749         to get them off CD2.</P
18750 ></DIV
18751 ></DIV
18752 ></DIV
18753 ><DIV
18754 CLASS="SECT1"
18755 ><HR><H2
18756 CLASS="SECT1"
18757 ><A
18758 NAME="AEN3855"
18759 >28.4. Starting the smbd and nmbd</A
18760 ></H2
18761 ><P
18762 >You must choose to start smbd and nmbd either
18763         as daemons or from <B
18764 CLASS="COMMAND"
18765 >inetd</B
18766 >. Don't try
18767         to do both!  Either you can put them in <TT
18768 CLASS="FILENAME"
18769 >       inetd.conf</TT
18770 > and have them started on demand
18771         by <B
18772 CLASS="COMMAND"
18773 >inetd</B
18774 >, or you can start them as
18775         daemons either from the command line or in <TT
18776 CLASS="FILENAME"
18777 >       /etc/rc.local</TT
18778 >. See the man pages for details
18779         on the command line options. Take particular care to read
18780         the bit about what user you need to be in order to start
18781         Samba.  In many cases you must be root.</P
18782 ><P
18783 >The main advantage of starting <B
18784 CLASS="COMMAND"
18785 >smbd</B
18786 >
18787         and <B
18788 CLASS="COMMAND"
18789 >nmbd</B
18790 > using the recommended daemon method
18791         is that they will respond slightly more quickly to an initial connection
18792         request.</P
18793 ><DIV
18794 CLASS="SECT2"
18795 ><HR><H3
18796 CLASS="SECT2"
18797 ><A
18798 NAME="AEN3865"
18799 >28.4.1. Starting from inetd.conf</A
18800 ></H3
18801 ><P
18802 >NOTE; The following will be different if 
18803                 you use NIS, NIS+ or LDAP to distribute services maps.</P
18804 ><P
18805 >Look at your <TT
18806 CLASS="FILENAME"
18807 >/etc/services</TT
18808 >. 
18809                 What is defined at port 139/tcp. If nothing is defined 
18810                 then add a line like this:</P
18811 ><P
18812 ><KBD
18813 CLASS="USERINPUT"
18814 >netbios-ssn     139/tcp</KBD
18815 ></P
18816 ><P
18817 >similarly for 137/udp you should have an entry like:</P
18818 ><P
18819 ><KBD
18820 CLASS="USERINPUT"
18821 >netbios-ns     137/udp</KBD
18822 ></P
18823 ><P
18824 >Next edit your <TT
18825 CLASS="FILENAME"
18826 >/etc/inetd.conf</TT
18827
18828                 and add two lines something like this:</P
18829 ><P
18830 ><PRE
18831 CLASS="PROGRAMLISTING"
18832 >               netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd 
18833                 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd 
18834                 </PRE
18835 ></P
18836 ><P
18837 >The exact syntax of <TT
18838 CLASS="FILENAME"
18839 >/etc/inetd.conf</TT
18840
18841                 varies between unixes. Look at the other entries in inetd.conf 
18842                 for a guide.</P
18843 ><P
18844 >NOTE: Some unixes already have entries like netbios_ns 
18845                 (note the underscore) in <TT
18846 CLASS="FILENAME"
18847 >/etc/services</TT
18848 >. 
18849                 You must either edit <TT
18850 CLASS="FILENAME"
18851 >/etc/services</TT
18852 > or
18853                 <TT
18854 CLASS="FILENAME"
18855 >/etc/inetd.conf</TT
18856 > to make them consistent.</P
18857 ><P
18858 >NOTE: On many systems you may need to use the 
18859                 "interfaces" option in smb.conf to specify the IP address 
18860                 and netmask of your interfaces. Run <B
18861 CLASS="COMMAND"
18862 >ifconfig</B
18863
18864                 as root if you don't know what the broadcast is for your
18865                 net. <B
18866 CLASS="COMMAND"
18867 >nmbd</B
18868 > tries to determine it at run 
18869                 time, but fails on some unixes. See the section on "testing nmbd" 
18870                 for a method of finding if you need to do this.</P
18871 ><P
18872 >!!!WARNING!!! Many unixes only accept around 5 
18873                 parameters on the command line in <TT
18874 CLASS="FILENAME"
18875 >inetd.conf</TT
18876 >. 
18877                 This means you shouldn't use spaces between the options and 
18878                 arguments, or you should use a script, and start the script 
18879                 from <B
18880 CLASS="COMMAND"
18881 >inetd</B
18882 >.</P
18883 ><P
18884 >Restart <B
18885 CLASS="COMMAND"
18886 >inetd</B
18887 >, perhaps just send 
18888                 it a HUP. If you have installed an earlier version of <B
18889 CLASS="COMMAND"
18890 >               nmbd</B
18891 > then you may need to kill nmbd as well.</P
18892 ></DIV
18893 ><DIV
18894 CLASS="SECT2"
18895 ><HR><H3
18896 CLASS="SECT2"
18897 ><A
18898 NAME="AEN3894"
18899 >28.4.2. Alternative: starting it as a daemon</A
18900 ></H3
18901 ><P
18902 >To start the server as a daemon you should create 
18903                 a script something like this one, perhaps calling 
18904                 it <TT
18905 CLASS="FILENAME"
18906 >startsmb</TT
18907 >.</P
18908 ><P
18909 ><PRE
18910 CLASS="PROGRAMLISTING"
18911 >               #!/bin/sh
18912                 /usr/local/samba/bin/smbd -D 
18913                 /usr/local/samba/bin/nmbd -D 
18914                 </PRE
18915 ></P
18916 ><P
18917 >then make it executable with <B
18918 CLASS="COMMAND"
18919 >chmod 
18920                 +x startsmb</B
18921 ></P
18922 ><P
18923 >You can then run <B
18924 CLASS="COMMAND"
18925 >startsmb</B
18926 > by 
18927                 hand or execute it from <TT
18928 CLASS="FILENAME"
18929 >/etc/rc.local</TT
18930 >
18931                 </P
18932 ><P
18933 >To kill it send a kill signal to the processes 
18934                 <B
18935 CLASS="COMMAND"
18936 >nmbd</B
18937 > and <B
18938 CLASS="COMMAND"
18939 >smbd</B
18940 >.</P
18941 ><P
18942 >NOTE: If you use the SVR4 style init system then 
18943                 you may like to look at the <TT
18944 CLASS="FILENAME"
18945 >examples/svr4-startup</TT
18946 >
18947                 script to make Samba fit into that system.</P
18948 ></DIV
18949 ></DIV
18950 ></DIV
18951 ><DIV
18952 CLASS="CHAPTER"
18953 ><HR><H1
18954 ><A
18955 NAME="BUGREPORT"
18956 ></A
18957 >Chapter 29. Reporting Bugs</H1
18958 ><DIV
18959 CLASS="SECT1"
18960 ><H2
18961 CLASS="SECT1"
18962 ><A
18963 NAME="AEN3917"
18964 >29.1. Introduction</A
18965 ></H2
18966 ><P
18967 >The email address for bug reports for stable releases is <A
18968 HREF="samba@samba.org"
18969 TARGET="_top"
18970 >samba@samba.org</A
18971 >. 
18972 Bug reports for alpha releases should go to <A
18973 HREF="mailto:samba-technical@samba.org"
18974 TARGET="_top"
18975 >samba-technical@samba.org</A
18976 >.</P
18977 ><P
18978 >Please take the time to read this file before you submit a bug
18979 report. Also, please see if it has changed between releases, as we
18980 may be changing the bug reporting mechanism at some time.</P
18981 ><P
18982 >Please also do as much as you can yourself to help track down the
18983 bug. Samba is maintained by a dedicated group of people who volunteer
18984 their time, skills and efforts. We receive far more mail about it than
18985 we can possibly answer, so you have a much higher chance of an answer
18986 and a fix if you send us a "developer friendly" bug report that lets
18987 us fix it fast. </P
18988 ><P
18989 >Do not assume that if you post the bug to the comp.protocols.smb
18990 newsgroup or the mailing list that we will read it. If you suspect that your 
18991 problem is not a bug but a configuration problem then it is better to send 
18992 it to the Samba mailing list, as there are (at last count) 5000 other users on
18993 that list that may be able to help you.</P
18994 ><P
18995 >You may also like to look though the recent mailing list archives,
18996 which are conveniently accessible on the Samba web pages
18997 at <A
18998 HREF="http://samba.org/samba/"
18999 TARGET="_top"
19000 >http://samba.org/samba/</A
19001 >.</P
19002 ></DIV
19003 ><DIV
19004 CLASS="SECT1"
19005 ><HR><H2
19006 CLASS="SECT1"
19007 ><A
19008 NAME="AEN3927"
19009 >29.2. General info</A
19010 ></H2
19011 ><P
19012 >Before submitting a bug report check your config for silly
19013 errors. Look in your log files for obvious messages that tell you that
19014 you've misconfigured something and run testparm to test your config
19015 file for correct syntax.</P
19016 ><P
19017 >Have you run through the <A
19018 HREF="Diagnosis.html"
19019 TARGET="_top"
19020 >diagnosis</A
19021 >? 
19022 This is very important.</P
19023 ><P
19024 >If you include part of a log file with your bug report then be sure to
19025 annotate it with exactly what you were doing on the client at the
19026 time, and exactly what the results were.</P
19027 ></DIV
19028 ><DIV
19029 CLASS="SECT1"
19030 ><HR><H2
19031 CLASS="SECT1"
19032 ><A
19033 NAME="AEN3933"
19034 >29.3. Debug levels</A
19035 ></H2
19036 ><P
19037 >If the bug has anything to do with Samba behaving incorrectly as a
19038 server (like refusing to open a file) then the log files will probably
19039 be very useful. Depending on the problem a log level of between 3 and
19040 10 showing the problem may be appropriate. A higher level givesmore
19041 detail, but may use too much disk space.</P
19042 ><P
19043 >To set the debug level use <B
19044 CLASS="COMMAND"
19045 >log level =</B
19046 > in your 
19047 <TT
19048 CLASS="FILENAME"
19049 >smb.conf</TT
19050 >. You may also find it useful to set the log 
19051 level higher for just one machine and keep separate logs for each machine. 
19052 To do this use:</P
19053 ><P
19054 ><PRE
19055 CLASS="PROGRAMLISTING"
19056 >log level = 10
19057 log file = /usr/local/samba/lib/log.%m
19058 include = /usr/local/samba/lib/smb.conf.%m</PRE
19059 ></P
19060 ><P
19061 >then create a file 
19062 <TT
19063 CLASS="FILENAME"
19064 >/usr/local/samba/lib/smb.conf.machine</TT
19065 > where
19066 "machine" is the name of the client you wish to debug. In that file
19067 put any smb.conf commands you want, for example 
19068 <B
19069 CLASS="COMMAND"
19070 >log level=</B
19071 > may be useful. This also allows you to 
19072 experiment with different security systems, protocol levels etc on just 
19073 one machine.</P
19074 ><P
19075 >The <TT
19076 CLASS="FILENAME"
19077 >smb.conf</TT
19078 > entry <B
19079 CLASS="COMMAND"
19080 >log level =</B
19081
19082 is synonymous with the entry <B
19083 CLASS="COMMAND"
19084 >debuglevel =</B
19085 > that has been 
19086 used in older versions of Samba and is being retained for backwards 
19087 compatibility of smb.conf files.</P
19088 ><P
19089 >As the <B
19090 CLASS="COMMAND"
19091 >log level =</B
19092 > value is increased you will record 
19093 a significantly increasing level of debugging information. For most 
19094 debugging operations you may not need a setting higher than 3. Nearly 
19095 all bugs can be tracked at a setting of 10, but be prepared for a VERY 
19096 large volume of log data.</P
19097 ></DIV
19098 ><DIV
19099 CLASS="SECT1"
19100 ><HR><H2
19101 CLASS="SECT1"
19102 ><A
19103 NAME="AEN3950"
19104 >29.4. Internal errors</A
19105 ></H2
19106 ><P
19107 >If you get a "INTERNAL ERROR" message in your log files it means that
19108 Samba got an unexpected signal while running. It is probably a
19109 segmentation fault and almost certainly means a bug in Samba (unless
19110 you have faulty hardware or system software)</P
19111 ><P
19112 >If the message came from smbd then it will probably be accompanied by
19113 a message which details the last SMB message received by smbd. This
19114 info is often very useful in tracking down the problem so please
19115 include it in your bug report.</P
19116 ><P
19117 >You should also detail how to reproduce the problem, if
19118 possible. Please make this reasonably detailed.</P
19119 ><P
19120 >You may also find that a core file appeared in a "corefiles"
19121 subdirectory of the directory where you keep your samba log
19122 files. This file is the most useful tool for tracking down the bug. To
19123 use it you do this:</P
19124 ><P
19125 ><B
19126 CLASS="COMMAND"
19127 >gdb smbd core</B
19128 ></P
19129 ><P
19130 >adding appropriate paths to smbd and core so gdb can find them. If you
19131 don't have gdb then try "dbx". Then within the debugger use the
19132 command "where" to give a stack trace of where the problem
19133 occurred. Include this in your mail.</P
19134 ><P
19135 >If you known any assembly language then do a "disass" of the routine
19136 where the problem occurred (if its in a library routine then
19137 disassemble the routine that called it) and try to work out exactly
19138 where the problem is by looking at the surrounding code. Even if you
19139 don't know assembly then incuding this info in the bug report can be
19140 useful. </P
19141 ></DIV
19142 ><DIV
19143 CLASS="SECT1"
19144 ><HR><H2
19145 CLASS="SECT1"
19146 ><A
19147 NAME="AEN3960"
19148 >29.5. Attaching to a running process</A
19149 ></H2
19150 ><P
19151 >Unfortunately some unixes (in particular some recent linux kernels)
19152 refuse to dump a core file if the task has changed uid (which smbd
19153 does often). To debug with this sort of system you could try to attach
19154 to the running process using "gdb smbd PID" where you get PID from
19155 smbstatus. Then use "c" to continue and try to cause the core dump
19156 using the client. The debugger should catch the fault and tell you
19157 where it occurred.</P
19158 ></DIV
19159 ><DIV
19160 CLASS="SECT1"
19161 ><HR><H2
19162 CLASS="SECT1"
19163 ><A
19164 NAME="AEN3963"
19165 >29.6. Patches</A
19166 ></H2
19167 ><P
19168 >The best sort of bug report is one that includes a fix! If you send us
19169 patches please use <B
19170 CLASS="COMMAND"
19171 >diff -u</B
19172 > format if your version of 
19173 diff supports it, otherwise use <B
19174 CLASS="COMMAND"
19175 >diff -c4</B
19176 >. Make sure 
19177 your do the diff against a clean version of the source and let me know 
19178 exactly what version you used. </P
19179 ></DIV
19180 ></DIV
19181 ><DIV
19182 CLASS="CHAPTER"
19183 ><HR><H1
19184 ><A
19185 NAME="DIAGNOSIS"
19186 ></A
19187 >Chapter 30. The samba checklist</H1
19188 ><DIV
19189 CLASS="SECT1"
19190 ><H2
19191 CLASS="SECT1"
19192 ><A
19193 NAME="AEN3986"
19194 >30.1. Introduction</A
19195 ></H2
19196 ><P
19197 >This file contains a list of tests you can perform to validate your
19198 Samba server. It also tells you what the likely cause of the problem
19199 is if it fails any one of these steps. If it passes all these tests
19200 then it is probably working fine.</P
19201 ><P
19202 >You should do ALL the tests, in the order shown. We have tried to
19203 carefully choose them so later tests only use capabilities verified in
19204 the earlier tests.</P
19205 ><P
19206 >If you send one of the samba mailing lists  an email saying "it doesn't work"
19207 and you have not followed this test procedure then you should not be surprised
19208 your email is ignored.</P
19209 ></DIV
19210 ><DIV
19211 CLASS="SECT1"
19212 ><HR><H2
19213 CLASS="SECT1"
19214 ><A
19215 NAME="AEN3991"
19216 >30.2. Assumptions</A
19217 ></H2
19218 ><P
19219 >In all of the tests it is assumed you have a Samba server called 
19220 BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP.</P
19221 ><P
19222 >The procedure is similar for other types of clients.</P
19223 ><P
19224 >It is also assumed you know the name of an available share in your
19225 smb.conf. I will assume this share is called "tmp". You can add a
19226 "tmp" share like by adding the following to smb.conf:</P
19227 ><P
19228 ><PRE
19229 CLASS="PROGRAMLISTING"
19230 >&#13;[tmp]
19231  comment = temporary files 
19232  path = /tmp
19233  read only = yes&#13;</PRE
19234 ></P
19235 ><P
19236 >THESE TESTS ASSUME VERSION 3.0.0 OR LATER OF THE SAMBA SUITE. SOME
19237 COMMANDS SHOWN DID NOT EXIST IN EARLIER VERSIONS</P
19238 ><P
19239 >Please pay attention to the error messages you receive. If any error message
19240 reports that your server is being unfriendly you should first check that you
19241 IP name resolution is correctly set up. eg: Make sure your /etc/resolv.conf
19242 file points to name servers that really do exist.</P
19243 ><P
19244 >Also, if you do not have DNS server access for name resolution please check
19245 that the settings for your smb.conf file results in "dns proxy = no". The
19246 best way to check this is with "testparm smb.conf"</P
19247 ></DIV
19248 ><DIV
19249 CLASS="SECT1"
19250 ><HR><H2
19251 CLASS="SECT1"
19252 ><A
19253 NAME="AEN4001"
19254 >30.3. Tests</A
19255 ></H2
19256 ><DIV
19257 CLASS="SECT2"
19258 ><H3
19259 CLASS="SECT2"
19260 ><A
19261 NAME="AEN4003"
19262 >30.3.1. Test 1</A
19263 ></H3
19264 ><P
19265 >In the directory in which you store your smb.conf file, run the command
19266 "testparm smb.conf". If it reports any errors then your smb.conf
19267 configuration file is faulty.</P
19268 ><P
19269 >Note:  Your smb.conf file may be located in: <TT
19270 CLASS="FILENAME"
19271 >/etc/samba</TT
19272 >
19273         Or in:   <TT
19274 CLASS="FILENAME"
19275 >/usr/local/samba/lib</TT
19276 ></P
19277 ></DIV
19278 ><DIV
19279 CLASS="SECT2"
19280 ><HR><H3
19281 CLASS="SECT2"
19282 ><A
19283 NAME="AEN4009"
19284 >30.3.2. Test 2</A
19285 ></H3
19286 ><P
19287 >Run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from
19288 the unix box. If you don't get a valid response then your TCP/IP
19289 software is not correctly installed. </P
19290 ><P
19291 >Note that you will need to start a "dos prompt" window on the PC to
19292 run ping.</P
19293 ><P
19294 >If you get a message saying "host not found" or similar then your DNS
19295 software or /etc/hosts file is not correctly setup. It is possible to
19296 run samba without DNS entries for the server and client, but I assume
19297 you do have correct entries for the remainder of these tests. </P
19298 ><P
19299 >Another reason why ping might fail is if your host is running firewall 
19300 software. You will need to relax the rules to let in the workstation
19301 in question, perhaps by allowing access from another subnet (on Linux
19302 this is done via the ipfwadm program.)</P
19303 ></DIV
19304 ><DIV
19305 CLASS="SECT2"
19306 ><HR><H3
19307 CLASS="SECT2"
19308 ><A
19309 NAME="AEN4015"
19310 >30.3.3. Test 3</A
19311 ></H3
19312 ><P
19313 >Run the command "smbclient -L BIGSERVER" on the unix box. You
19314 should get a list of available shares back. </P
19315 ><P
19316 >If you get a error message containing the string "Bad password" then
19317 you probably have either an incorrect "hosts allow", "hosts deny" or
19318 "valid users" line in your smb.conf, or your guest account is not
19319 valid. Check what your guest account is using "testparm" and
19320 temporarily remove any "hosts allow", "hosts deny", "valid users" or
19321 "invalid users" lines.</P
19322 ><P
19323 >If you get a "connection refused" response then the smbd server may
19324 not be running. If you installed it in inetd.conf then you probably edited
19325 that file incorrectly. If you installed it as a daemon then check that
19326 it is running, and check that the netbios-ssn port is in a LISTEN
19327 state using "netstat -a".</P
19328 ><P
19329 >If you get a "session request failed" then the server refused the
19330 connection. If it says "Your server software is being unfriendly" then
19331 its probably because you have invalid command line parameters to smbd,
19332 or a similar fatal problem with the initial startup of smbd. Also
19333 check your config file (smb.conf) for syntax errors with "testparm"
19334 and that the various directories where samba keeps its log and lock
19335 files exist.</P
19336 ><P
19337 >There are a number of reasons for which smbd may refuse or decline
19338 a session request. The most common of these involve one or more of
19339 the following smb.conf file entries:</P
19340 ><P
19341 ><PRE
19342 CLASS="PROGRAMLISTING"
19343 >       hosts deny = ALL
19344         hosts allow = xxx.xxx.xxx.xxx/yy
19345         bind interfaces only = Yes</PRE
19346 ></P
19347 ><P
19348 >In the above, no allowance has been made for any session requests that
19349 will automatically translate to the loopback adaptor address 127.0.0.1.
19350 To solve this problem change these lines to:</P
19351 ><P
19352 ><PRE
19353 CLASS="PROGRAMLISTING"
19354 >       hosts deny = ALL
19355         hosts allow = xxx.xxx.xxx.xxx/yy 127.</PRE
19356 ></P
19357 ><P
19358 >Do NOT use the "bind interfaces only" parameter where you may wish to
19359 use the samba password change facility, or where smbclient may need to
19360 access local service for name resolution or for local resource
19361 connections. (Note: the "bind interfaces only" parameter deficiency
19362 where it will not allow connections to the loopback address will be
19363 fixed soon).</P
19364 ><P
19365 >Another common cause of these two errors is having something already running 
19366 on port 139, such as Samba (ie: smbd is running from inetd already) or
19367 something like Digital's Pathworks. Check your inetd.conf file before trying
19368 to start smbd as a daemon, it can avoid a lot of frustration!</P
19369 ><P
19370 >And yet another possible cause for failure of TEST 3 is when the subnet mask
19371 and / or broadcast address settings are incorrect. Please check that the
19372 network interface IP Address / Broadcast Address / Subnet Mask settings are
19373 correct and that Samba has correctly noted these in the log.nmb file.</P
19374 ></DIV
19375 ><DIV
19376 CLASS="SECT2"
19377 ><HR><H3
19378 CLASS="SECT2"
19379 ><A
19380 NAME="AEN4030"
19381 >30.3.4. Test 4</A
19382 ></H3
19383 ><P
19384 >Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
19385 IP address of your Samba server back.</P
19386 ><P
19387 >If you don't then nmbd is incorrectly installed. Check your inetd.conf
19388 if you run it from there, or that the daemon is running and listening
19389 to udp port 137.</P
19390 ><P
19391 >One common problem is that many inetd implementations can't take many
19392 parameters on the command line. If this is the case then create a
19393 one-line script that contains the right parameters and run that from
19394 inetd.</P
19395 ></DIV
19396 ><DIV
19397 CLASS="SECT2"
19398 ><HR><H3
19399 CLASS="SECT2"
19400 ><A
19401 NAME="AEN4035"
19402 >30.3.5. Test 5</A
19403 ></H3
19404 ><P
19405 >run the command <B
19406 CLASS="COMMAND"
19407 >nmblookup -B ACLIENT '*'</B
19408 ></P
19409 ><P
19410 >You should get the PCs IP address back. If you don't then the client
19411 software on the PC isn't installed correctly, or isn't started, or you
19412 got the name of the PC wrong. </P
19413 ><P
19414 >If ACLIENT doesn't resolve via DNS then use the IP address of the
19415 client in the above test.</P
19416 ></DIV
19417 ><DIV
19418 CLASS="SECT2"
19419 ><HR><H3
19420 CLASS="SECT2"
19421 ><A
19422 NAME="AEN4041"
19423 >30.3.6. Test 6</A
19424 ></H3
19425 ><P
19426 >Run the command <B
19427 CLASS="COMMAND"
19428 >nmblookup -d 2 '*'</B
19429 ></P
19430 ><P
19431 >This time we are trying the same as the previous test but are trying
19432 it via a broadcast to the default broadcast address. A number of
19433 Netbios/TCPIP hosts on the network should respond, although Samba may
19434 not catch all of the responses in the short time it listens. You
19435 should see "got a positive name query response" messages from several
19436 hosts.</P
19437 ><P
19438 >If this doesn't give a similar result to the previous test then
19439 nmblookup isn't correctly getting your broadcast address through its
19440 automatic mechanism. In this case you should experiment use the
19441 "interfaces" option in smb.conf to manually configure your IP
19442 address, broadcast and netmask. </P
19443 ><P
19444 >If your PC and server aren't on the same subnet then you will need to
19445 use the -B option to set the broadcast address to the that of the PCs
19446 subnet.</P
19447 ><P
19448 >This test will probably fail if your subnet mask and broadcast address are
19449 not correct. (Refer to TEST 3 notes above).</P
19450 ></DIV
19451 ><DIV
19452 CLASS="SECT2"
19453 ><HR><H3
19454 CLASS="SECT2"
19455 ><A
19456 NAME="AEN4049"
19457 >30.3.7. Test 7</A
19458 ></H3
19459 ><P
19460 >Run the command <B
19461 CLASS="COMMAND"
19462 >smbclient //BIGSERVER/TMP</B
19463 >. You should 
19464 then be prompted for a password. You should use the password of the account
19465 you are logged into the unix box with. If you want to test with
19466 another account then add the -U &#62;accountname&#60; option to the end of
19467 the command line.  eg: 
19468 <B
19469 CLASS="COMMAND"
19470 >smbclient //bigserver/tmp -Ujohndoe</B
19471 ></P
19472 ><P
19473 >Note: It is possible to specify the password along with the username
19474 as follows:
19475 <B
19476 CLASS="COMMAND"
19477 >smbclient //bigserver/tmp -Ujohndoe%secret</B
19478 ></P
19479 ><P
19480 >Once you enter the password you should get the "smb&#62;" prompt. If you
19481 don't then look at the error message. If it says "invalid network
19482 name" then the service "tmp" is not correctly setup in your smb.conf.</P
19483 ><P
19484 >If it says "bad password" then the likely causes are:</P
19485 ><P
19486 ></P
19487 ><OL
19488 TYPE="1"
19489 ><LI
19490 ><P
19491 >       you have shadow passords (or some other password system) but didn't
19492         compile in support for them in smbd
19493         </P
19494 ></LI
19495 ><LI
19496 ><P
19497 >       your "valid users" configuration is incorrect
19498         </P
19499 ></LI
19500 ><LI
19501 ><P
19502 >       you have a mixed case password and you haven't enabled the "password
19503         level" option at a high enough level
19504         </P
19505 ></LI
19506 ><LI
19507 ><P
19508 >       the "path =" line in smb.conf is incorrect. Check it with testparm
19509         </P
19510 ></LI
19511 ><LI
19512 ><P
19513 >       you enabled password encryption but didn't create the SMB encrypted
19514         password file
19515         </P
19516 ></LI
19517 ></OL
19518 ><P
19519 >Once connected you should be able to use the commands 
19520 <B
19521 CLASS="COMMAND"
19522 >dir</B
19523 > <B
19524 CLASS="COMMAND"
19525 >get</B
19526 > <B
19527 CLASS="COMMAND"
19528 >put</B
19529 > etc. 
19530 Type <B
19531 CLASS="COMMAND"
19532 >help &#62;command&#60;</B
19533 > for instructions. You should
19534 especially check that the amount of free disk space shown is correct
19535 when you type <B
19536 CLASS="COMMAND"
19537 >dir</B
19538 >.</P
19539 ></DIV
19540 ><DIV
19541 CLASS="SECT2"
19542 ><HR><H3
19543 CLASS="SECT2"
19544 ><A
19545 NAME="AEN4075"
19546 >30.3.8. Test 8</A
19547 ></H3
19548 ><P
19549 >On the PC type the command <B
19550 CLASS="COMMAND"
19551 >net view \\BIGSERVER</B
19552 >. You will 
19553 need to do this from within a "dos prompt" window. You should get back a 
19554 list of available shares on the server.</P
19555 ><P
19556 >If you get a "network name not found" or similar error then netbios
19557 name resolution is not working. This is usually caused by a problem in
19558 nmbd. To overcome it you could do one of the following (you only need
19559 to choose one of them):</P
19560 ><P
19561 ></P
19562 ><OL
19563 TYPE="1"
19564 ><LI
19565 ><P
19566 >       fixup the nmbd installation</P
19567 ></LI
19568 ><LI
19569 ><P
19570 >       add the IP address of BIGSERVER to the "wins server" box in the
19571         advanced tcp/ip setup on the PC.</P
19572 ></LI
19573 ><LI
19574 ><P
19575 >       enable windows name resolution via DNS in the advanced section of
19576         the tcp/ip setup</P
19577 ></LI
19578 ><LI
19579 ><P
19580 >       add BIGSERVER to your lmhosts file on the PC.</P
19581 ></LI
19582 ></OL
19583 ><P
19584 >If you get a "invalid network name" or "bad password error" then the
19585 same fixes apply as they did for the "smbclient -L" test above. In
19586 particular, make sure your "hosts allow" line is correct (see the man
19587 pages)</P
19588 ><P
19589 >Also, do not overlook that fact that when the workstation requests the
19590 connection to the samba server it will attempt to connect using the 
19591 name with which you logged onto your Windows machine. You need to make
19592 sure that an account exists on your Samba server with that exact same
19593 name and password.</P
19594 ><P
19595 >If you get "specified computer is not receiving requests" or similar
19596 it probably means that the host is not contactable via tcp services.
19597 Check to see if the host is running tcp wrappers, and if so add an entry in
19598 the hosts.allow file for your client (or subnet, etc.)</P
19599 ></DIV
19600 ><DIV
19601 CLASS="SECT2"
19602 ><HR><H3
19603 CLASS="SECT2"
19604 ><A
19605 NAME="AEN4092"
19606 >30.3.9. Test 9</A
19607 ></H3
19608 ><P
19609 >Run the command <B
19610 CLASS="COMMAND"
19611 >net use x: \\BIGSERVER\TMP</B
19612 >. You should 
19613 be prompted for a password then you should get a "command completed 
19614 successfully" message. If not then your PC software is incorrectly 
19615 installed or your smb.conf is incorrect. make sure your "hosts allow" 
19616 and other config lines in smb.conf are correct.</P
19617 ><P
19618 >It's also possible that the server can't work out what user name to
19619 connect you as. To see if this is the problem add the line "user =
19620 USERNAME" to the [tmp] section of smb.conf where "USERNAME" is the
19621 username corresponding to the password you typed. If you find this
19622 fixes things you may need the username mapping option. </P
19623 ><P
19624 >It might also be the case that your client only sends encrypted passwords 
19625 and you have <B
19626 CLASS="COMMAND"
19627 >encrypt passwords = no</B
19628 > in <TT
19629 CLASS="FILENAME"
19630 >smb.conf</TT
19631 >.
19632 Turn it back on to fix.</P
19633 ></DIV
19634 ><DIV
19635 CLASS="SECT2"
19636 ><HR><H3
19637 CLASS="SECT2"
19638 ><A
19639 NAME="AEN4100"
19640 >30.3.10. Test 10</A
19641 ></H3
19642 ><P
19643 >Run the command <B
19644 CLASS="COMMAND"
19645 >nmblookup -M TESTGROUP</B
19646 > where 
19647 TESTGROUP is the name of the workgroup that your Samba server and 
19648 Windows PCs belong to. You should get back the IP address of the 
19649 master browser for that workgroup.</P
19650 ><P
19651 >If you don't then the election process has failed. Wait a minute to
19652 see if it is just being slow then try again. If it still fails after
19653 that then look at the browsing options you have set in smb.conf. Make
19654 sure you have <B
19655 CLASS="COMMAND"
19656 >preferred master = yes</B
19657 > to ensure that 
19658 an election is held at startup.</P
19659 ></DIV
19660 ><DIV
19661 CLASS="SECT2"
19662 ><HR><H3
19663 CLASS="SECT2"
19664 ><A
19665 NAME="AEN4106"
19666 >30.3.11. Test 11</A
19667 ></H3
19668 ><P
19669 >From file manager try to browse the server. Your samba server should
19670 appear in the browse list of your local workgroup (or the one you
19671 specified in smb.conf). You should be able to double click on the name
19672 of the server and get a list of shares. If you get a "invalid
19673 password" error when you do then you are probably running WinNT and it
19674 is refusing to browse a server that has no encrypted password
19675 capability and is in user level security mode. In this case either set
19676 <B
19677 CLASS="COMMAND"
19678 >security = server</B
19679 > AND 
19680 <B
19681 CLASS="COMMAND"
19682 >password server = Windows_NT_Machine</B
19683 > in your
19684 smb.conf file, or enable encrypted passwords AFTER compiling in support
19685 for encrypted passwords (refer to the Makefile).</P
19686 ></DIV
19687 ></DIV
19688 ><DIV
19689 CLASS="SECT1"
19690 ><HR><H2
19691 CLASS="SECT1"
19692 ><A
19693 NAME="AEN4111"
19694 >30.4. Still having troubles?</A
19695 ></H2
19696 ><P
19697 >Try the mailing list or newsgroup, or use the ethereal utility to
19698 sniff the problem. The official samba mailing list can be reached at
19699 <A
19700 HREF="mailto:samba@samba.org"
19701 TARGET="_top"
19702 >samba@samba.org</A
19703 >. To find 
19704 out more about samba and how to subscribe to the mailing list check 
19705 out the samba web page at 
19706 <A
19707 HREF="http://samba.org/samba"
19708 TARGET="_top"
19709 >http://samba.org/samba</A
19710 ></P
19711 ><P
19712 >Also look at the other docs in the Samba package!</P
19713 ></DIV
19714 ></DIV
19715 ></DIV
19716 ></DIV
19717 ></BODY
19718 ></HTML
19719 >