fix a few typos; submitted by Kurt
[Samba.git] / docs / htmldocs / Samba-HOWTO-Collection.html
blob515f2f7eb2e6e5d7d2904ec8d96afdea0858cbe9
1 <HTML
2 ><HEAD
3 ><TITLE
4 >SAMBA Project Documentation</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD
8 ><BODY
9 CLASS="BOOK"
10 BGCOLOR="#FFFFFF"
11 TEXT="#000000"
12 LINK="#0000FF"
13 VLINK="#840084"
14 ALINK="#0000FF"
15 ><DIV
16 CLASS="BOOK"
17 ><A
18 NAME="SAMBA-PROJECT-DOCUMENTATION"
19 ></A
20 ><DIV
21 CLASS="TITLEPAGE"
22 ><H1
23 CLASS="TITLE"
24 ><A
25 NAME="SAMBA-PROJECT-DOCUMENTATION"
26 >SAMBA Project Documentation</A
27 ></H1
28 ><H3
29 CLASS="AUTHOR"
30 ><A
31 NAME="AEN4"
32 >SAMBA Team</A
33 ></H3
34 ><HR></DIV
35 ><HR><H1
36 ><A
37 NAME="AEN8"
38 >Abstract</A
39 ></H1
40 ><P
41 ><EM
42 >Last Update</EM
43 > : Mon Apr 1 08:47:26 CST 2002</P
44 ><P
45 >This book is a collection of HOWTOs added to Samba documentation over the years.
46 I try to ensure that all are current, but sometimes the is a larger job
47 than one person can maintain. The most recent version of this document
48 can be found at <A
49 HREF="http://www.samba.org/"
50 TARGET="_top"
51 >http://www.samba.org/</A
53 on the "Documentation" page. Please send updates to <A
54 HREF="mailto:jerry@samba.org"
55 TARGET="_top"
56 >jerry@samba.org</A
57 >.</P
58 ><P
59 >This documentation is distributed under the GNU General Public License (GPL)
60 version 2. A copy of the license is included with the Samba source
61 distribution. A copy can be found on-line at <A
62 HREF="http://www.fsf.org/licenses/gpl.txt"
63 TARGET="_top"
64 >http://www.fsf.org/licenses/gpl.txt</A
65 ></P
66 ><P
67 >Cheers, jerry</P
68 ><DIV
69 CLASS="TOC"
70 ><DL
71 ><DT
72 ><B
73 >Table of Contents</B
74 ></DT
75 ><DT
76 >1. <A
77 HREF="#INSTALL"
78 >How to Install and Test SAMBA</A
79 ></DT
80 ><DD
81 ><DL
82 ><DT
83 >1.1. <A
84 HREF="#AEN20"
85 >Step 0: Read the man pages</A
86 ></DT
87 ><DT
88 >1.2. <A
89 HREF="#AEN28"
90 >Step 1: Building the Binaries</A
91 ></DT
92 ><DT
93 >1.3. <A
94 HREF="#AEN56"
95 >Step 2: The all important step</A
96 ></DT
97 ><DT
98 >1.4. <A
99 HREF="#AEN60"
100 >Step 3: Create the smb configuration file.</A
101 ></DT
102 ><DT
103 >1.5. <A
104 HREF="#AEN74"
105 >Step 4: Test your config file with
107 CLASS="COMMAND"
108 >testparm</B
109 ></A
110 ></DT
111 ><DT
112 >1.6. <A
113 HREF="#AEN80"
114 >Step 5: Starting the smbd and nmbd</A
115 ></DT
116 ><DD
117 ><DL
118 ><DT
119 >1.6.1. <A
120 HREF="#AEN90"
121 >Step 5a: Starting from inetd.conf</A
122 ></DT
123 ><DT
124 >1.6.2. <A
125 HREF="#AEN119"
126 >Step 5b. Alternative: starting it as a daemon</A
127 ></DT
128 ></DL
129 ></DD
130 ><DT
131 >1.7. <A
132 HREF="#AEN135"
133 >Step 6: Try listing the shares available on your
134 server</A
135 ></DT
136 ><DT
137 >1.8. <A
138 HREF="#AEN144"
139 >Step 7: Try connecting with the unix client</A
140 ></DT
141 ><DT
142 >1.9. <A
143 HREF="#AEN160"
144 >Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT,
145 Win2k, OS/2, etc... client</A
146 ></DT
147 ><DT
148 >1.10. <A
149 HREF="#AEN174"
150 >What If Things Don't Work?</A
151 ></DT
152 ><DD
153 ><DL
154 ><DT
155 >1.10.1. <A
156 HREF="#AEN179"
157 >Diagnosing Problems</A
158 ></DT
159 ><DT
160 >1.10.2. <A
161 HREF="#AEN183"
162 >Scope IDs</A
163 ></DT
164 ><DT
165 >1.10.3. <A
166 HREF="#AEN186"
167 >Choosing the Protocol Level</A
168 ></DT
169 ><DT
170 >1.10.4. <A
171 HREF="#AEN195"
172 >Printing from UNIX to a Client PC</A
173 ></DT
174 ><DT
175 >1.10.5. <A
176 HREF="#AEN199"
177 >Locking</A
178 ></DT
179 ><DT
180 >1.10.6. <A
181 HREF="#AEN209"
182 >Mapping Usernames</A
183 ></DT
184 ><DT
185 >1.10.7. <A
186 HREF="#AEN212"
187 >Other Character Sets</A
188 ></DT
189 ></DL
190 ></DD
191 ></DL
192 ></DD
193 ><DT
194 >2. <A
195 HREF="#INTEGRATE-MS-NETWORKS"
196 >Integrating MS Windows networks with Samba</A
197 ></DT
198 ><DD
199 ><DL
200 ><DT
201 >2.1. <A
202 HREF="#AEN226"
203 >Agenda</A
204 ></DT
205 ><DT
206 >2.2. <A
207 HREF="#AEN248"
208 >Name Resolution in a pure Unix/Linux world</A
209 ></DT
210 ><DD
211 ><DL
212 ><DT
213 >2.2.1. <A
214 HREF="#AEN264"
215 ><TT
216 CLASS="FILENAME"
217 >/etc/hosts</TT
218 ></A
219 ></DT
220 ><DT
221 >2.2.2. <A
222 HREF="#AEN280"
223 ><TT
224 CLASS="FILENAME"
225 >/etc/resolv.conf</TT
226 ></A
227 ></DT
228 ><DT
229 >2.2.3. <A
230 HREF="#AEN291"
231 ><TT
232 CLASS="FILENAME"
233 >/etc/host.conf</TT
234 ></A
235 ></DT
236 ><DT
237 >2.2.4. <A
238 HREF="#AEN299"
239 ><TT
240 CLASS="FILENAME"
241 >/etc/nsswitch.conf</TT
242 ></A
243 ></DT
244 ></DL
245 ></DD
246 ><DT
247 >2.3. <A
248 HREF="#AEN311"
249 >Name resolution as used within MS Windows networking</A
250 ></DT
251 ><DD
252 ><DL
253 ><DT
254 >2.3.1. <A
255 HREF="#AEN323"
256 >The NetBIOS Name Cache</A
257 ></DT
258 ><DT
259 >2.3.2. <A
260 HREF="#AEN328"
261 >The LMHOSTS file</A
262 ></DT
263 ><DT
264 >2.3.3. <A
265 HREF="#AEN336"
266 >HOSTS file</A
267 ></DT
268 ><DT
269 >2.3.4. <A
270 HREF="#AEN341"
271 >DNS Lookup</A
272 ></DT
273 ><DT
274 >2.3.5. <A
275 HREF="#AEN344"
276 >WINS Lookup</A
277 ></DT
278 ></DL
279 ></DD
280 ><DT
281 >2.4. <A
282 HREF="#AEN356"
283 >How browsing functions and how to deploy stable and
284 dependable browsing using Samba</A
285 ></DT
286 ><DT
287 >2.5. <A
288 HREF="#AEN366"
289 >MS Windows security options and how to configure
290 Samba for seemless integration</A
291 ></DT
292 ><DD
293 ><DL
294 ><DT
295 >2.5.1. <A
296 HREF="#AEN394"
297 >Use MS Windows NT as an authentication server</A
298 ></DT
299 ><DT
300 >2.5.2. <A
301 HREF="#AEN402"
302 >Make Samba a member of an MS Windows NT security domain</A
303 ></DT
304 ><DT
305 >2.5.3. <A
306 HREF="#AEN419"
307 >Configure Samba as an authentication server</A
308 ></DT
309 ><DD
310 ><DL
311 ><DT
312 >2.5.3.1. <A
313 HREF="#AEN426"
314 >Users</A
315 ></DT
316 ><DT
317 >2.5.3.2. <A
318 HREF="#AEN431"
319 >MS Windows NT Machine Accounts</A
320 ></DT
321 ></DL
322 ></DD
323 ></DL
324 ></DD
325 ><DT
326 >2.6. <A
327 HREF="#AEN436"
328 >Conclusions</A
329 ></DT
330 ></DL
331 ></DD
332 ><DT
333 >3. <A
334 HREF="#PAM"
335 >Configuring PAM for distributed but centrally
336 managed authentication</A
337 ></DT
338 ><DD
339 ><DL
340 ><DT
341 >3.1. <A
342 HREF="#AEN457"
343 >Samba and PAM</A
344 ></DT
345 ><DT
346 >3.2. <A
347 HREF="#AEN501"
348 >Distributed Authentication</A
349 ></DT
350 ><DT
351 >3.3. <A
352 HREF="#AEN508"
353 >PAM Configuration in smb.conf</A
354 ></DT
355 ></DL
356 ></DD
357 ><DT
358 >4. <A
359 HREF="#MSDFS"
360 >Hosting a Microsoft Distributed File System tree on Samba</A
361 ></DT
362 ><DD
363 ><DL
364 ><DT
365 >4.1. <A
366 HREF="#AEN528"
367 >Instructions</A
368 ></DT
369 ><DD
370 ><DL
371 ><DT
372 >4.1.1. <A
373 HREF="#AEN563"
374 >Notes</A
375 ></DT
376 ></DL
377 ></DD
378 ></DL
379 ></DD
380 ><DT
381 >5. <A
382 HREF="#UNIX-PERMISSIONS"
383 >UNIX Permission Bits and Windows NT Access Control Lists</A
384 ></DT
385 ><DD
386 ><DL
387 ><DT
388 >5.1. <A
389 HREF="#AEN583"
390 >Viewing and changing UNIX permissions using the NT
391 security dialogs</A
392 ></DT
393 ><DT
394 >5.2. <A
395 HREF="#AEN592"
396 >How to view file security on a Samba share</A
397 ></DT
398 ><DT
399 >5.3. <A
400 HREF="#AEN603"
401 >Viewing file ownership</A
402 ></DT
403 ><DT
404 >5.4. <A
405 HREF="#AEN623"
406 >Viewing file or directory permissions</A
407 ></DT
408 ><DD
409 ><DL
410 ><DT
411 >5.4.1. <A
412 HREF="#AEN638"
413 >File Permissions</A
414 ></DT
415 ><DT
416 >5.4.2. <A
417 HREF="#AEN652"
418 >Directory Permissions</A
419 ></DT
420 ></DL
421 ></DD
422 ><DT
423 >5.5. <A
424 HREF="#AEN659"
425 >Modifying file or directory permissions</A
426 ></DT
427 ><DT
428 >5.6. <A
429 HREF="#AEN681"
430 >Interaction with the standard Samba create mask
431 parameters</A
432 ></DT
433 ><DT
434 >5.7. <A
435 HREF="#AEN745"
436 >Interaction with the standard Samba file attribute
437 mapping</A
438 ></DT
439 ></DL
440 ></DD
441 ><DT
442 >6. <A
443 HREF="#PRINTING"
444 >Printing Support in Samba 2.2.x</A
445 ></DT
446 ><DD
447 ><DL
448 ><DT
449 >6.1. <A
450 HREF="#AEN766"
451 >Introduction</A
452 ></DT
453 ><DT
454 >6.2. <A
455 HREF="#AEN788"
456 >Configuration</A
457 ></DT
458 ><DD
459 ><DL
460 ><DT
461 >6.2.1. <A
462 HREF="#AEN799"
463 >Creating [print$]</A
464 ></DT
465 ><DT
466 >6.2.2. <A
467 HREF="#AEN834"
468 >Setting Drivers for Existing Printers</A
469 ></DT
470 ><DT
471 >6.2.3. <A
472 HREF="#AEN851"
473 >Support a large number of printers</A
474 ></DT
475 ><DT
476 >6.2.4. <A
477 HREF="#AEN862"
478 >Adding New Printers via the Windows NT APW</A
479 ></DT
480 ><DT
481 >6.2.5. <A
482 HREF="#AEN887"
483 >Samba and Printer Ports</A
484 ></DT
485 ></DL
486 ></DD
487 ><DT
488 >6.3. <A
489 HREF="#AEN895"
490 >The Imprints Toolset</A
491 ></DT
492 ><DD
493 ><DL
494 ><DT
495 >6.3.1. <A
496 HREF="#AEN899"
497 >What is Imprints?</A
498 ></DT
499 ><DT
500 >6.3.2. <A
501 HREF="#AEN909"
502 >Creating Printer Driver Packages</A
503 ></DT
504 ><DT
505 >6.3.3. <A
506 HREF="#AEN912"
507 >The Imprints server</A
508 ></DT
509 ><DT
510 >6.3.4. <A
511 HREF="#AEN916"
512 >The Installation Client</A
513 ></DT
514 ></DL
515 ></DD
516 ><DT
517 >6.4. <A
518 HREF="#AEN938"
520 NAME="MIGRATION"
521 ></A
522 >Migration to from Samba 2.0.x to 2.2.x</A
523 ></DT
524 ></DL
525 ></DD
526 ><DT
527 >7. <A
528 HREF="#CUPS"
529 >Printing with CUPS in Samba 2.2.x</A
530 ></DT
531 ><DD
532 ><DL
533 ><DT
534 >7.1. <A
535 HREF="#AEN984"
536 >Printing with CUPS in Samba 2.2.x</A
537 ></DT
538 ><DT
539 >7.2. <A
540 HREF="#AEN988"
541 >Configuring <TT
542 CLASS="FILENAME"
543 >smb.conf</TT
544 > for CUPS</A
545 ></DT
546 ><DT
547 >7.3. <A
548 HREF="#AEN1007"
549 >Using CUPS as a mere spooling print server -- "raw"
550 printing with vendor drivers download</A
551 ></DT
552 ><DT
553 >7.4. <A
554 HREF="#AEN1010"
555 >CUPS as a network PostScript RIP -- CUPS drivers working on server, Adobe
556 PostScript driver with CUPS-PPDs downloaded to clients</A
557 ></DT
558 ><DT
559 >7.5. <A
560 HREF="#AEN1031"
561 >Windows Terminal Servers (WTS) as CUPS clients</A
562 ></DT
563 ><DT
564 >7.6. <A
565 HREF="#AEN1035"
566 >Setting up CUPS for driver download</A
567 ></DT
568 ><DT
569 >7.7. <A
570 HREF="#AEN1047"
571 >Sources of CUPS drivers / PPDs</A
572 ></DT
573 ><DD
574 ><DL
575 ><DT
576 >7.7.1. <A
577 HREF="#AEN1074"
579 CLASS="COMMAND"
580 >cupsaddsmb</B
581 ></A
582 ></DT
583 ></DL
584 ></DD
585 ></DL
586 ></DD
587 ><DT
588 >8. <A
589 HREF="#DOMAIN-SECURITY"
590 >security = domain in Samba 2.x</A
591 ></DT
592 ><DD
593 ><DL
594 ><DT
595 >8.1. <A
596 HREF="#AEN1119"
597 >Joining an NT Domain with Samba 2.2</A
598 ></DT
599 ><DT
600 >8.2. <A
601 HREF="#AEN1183"
602 >Samba and Windows 2000 Domains</A
603 ></DT
604 ><DT
605 >8.3. <A
606 HREF="#AEN1188"
607 >Why is this better than security = server?</A
608 ></DT
609 ></DL
610 ></DD
611 ><DT
612 >9. <A
613 HREF="#SAMBA-PDC"
614 >How to Configure Samba 2.2 as a Primary Domain Controller</A
615 ></DT
616 ><DD
617 ><DL
618 ><DT
619 >9.1. <A
620 HREF="#AEN1221"
621 >Prerequisite Reading</A
622 ></DT
623 ><DT
624 >9.2. <A
625 HREF="#AEN1227"
626 >Background</A
627 ></DT
628 ><DT
629 >9.3. <A
630 HREF="#AEN1266"
631 >Configuring the Samba Domain Controller</A
632 ></DT
633 ><DT
634 >9.4. <A
635 HREF="#AEN1309"
636 >Creating Machine Trust Accounts and Joining Clients to the
637 Domain</A
638 ></DT
639 ><DD
640 ><DL
641 ><DT
642 >9.4.1. <A
643 HREF="#AEN1328"
644 >Manual Creation of Machine Trust Accounts</A
645 ></DT
646 ><DT
647 >9.4.2. <A
648 HREF="#AEN1363"
649 >"On-the-Fly" Creation of Machine Trust Accounts</A
650 ></DT
651 ><DT
652 >9.4.3. <A
653 HREF="#AEN1372"
654 >Joining the Client to the Domain</A
655 ></DT
656 ></DL
657 ></DD
658 ><DT
659 >9.5. <A
660 HREF="#AEN1387"
661 >Common Problems and Errors</A
662 ></DT
663 ><DT
664 >9.6. <A
665 HREF="#AEN1435"
666 >System Policies and Profiles</A
667 ></DT
668 ><DT
669 >9.7. <A
670 HREF="#AEN1479"
671 >What other help can I get?</A
672 ></DT
673 ><DT
674 >9.8. <A
675 HREF="#AEN1593"
676 >Domain Control for Windows 9x/ME</A
677 ></DT
678 ><DD
679 ><DL
680 ><DT
681 >9.8.1. <A
682 HREF="#AEN1619"
683 >Configuration Instructions: Network Logons</A
684 ></DT
685 ><DT
686 >9.8.2. <A
687 HREF="#AEN1638"
688 >Configuration Instructions: Setting up Roaming User Profiles</A
689 ></DT
690 ><DD
691 ><DL
692 ><DT
693 >9.8.2.1. <A
694 HREF="#AEN1646"
695 >Windows NT Configuration</A
696 ></DT
697 ><DT
698 >9.8.2.2. <A
699 HREF="#AEN1654"
700 >Windows 9X Configuration</A
701 ></DT
702 ><DT
703 >9.8.2.3. <A
704 HREF="#AEN1662"
705 >Win9X and WinNT Configuration</A
706 ></DT
707 ><DT
708 >9.8.2.4. <A
709 HREF="#AEN1669"
710 >Windows 9X Profile Setup</A
711 ></DT
712 ><DT
713 >9.8.2.5. <A
714 HREF="#AEN1705"
715 >Windows NT Workstation 4.0</A
716 ></DT
717 ><DT
718 >9.8.2.6. <A
719 HREF="#AEN1718"
720 >Windows NT Server</A
721 ></DT
722 ><DT
723 >9.8.2.7. <A
724 HREF="#AEN1721"
725 >Sharing Profiles between W95 and NT Workstation 4.0</A
726 ></DT
727 ></DL
728 ></DD
729 ></DL
730 ></DD
731 ><DT
732 >9.9. <A
733 HREF="#AEN1731"
734 >DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
735 ></DT
736 ></DL
737 ></DD
738 ><DT
739 >10. <A
740 HREF="#SAMBA-BDC"
741 >How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</A
742 ></DT
743 ><DD
744 ><DL
745 ><DT
746 >10.1. <A
747 HREF="#AEN1767"
748 >Prerequisite Reading</A
749 ></DT
750 ><DT
751 >10.2. <A
752 HREF="#AEN1771"
753 >Background</A
754 ></DT
755 ><DT
756 >10.3. <A
757 HREF="#AEN1779"
758 >What qualifies a Domain Controller on the network?</A
759 ></DT
760 ><DD
761 ><DL
762 ><DT
763 >10.3.1. <A
764 HREF="#AEN1782"
765 >How does a Workstation find its domain controller?</A
766 ></DT
767 ><DT
768 >10.3.2. <A
769 HREF="#AEN1785"
770 >When is the PDC needed?</A
771 ></DT
772 ></DL
773 ></DD
774 ><DT
775 >10.4. <A
776 HREF="#AEN1788"
777 >Can Samba be a Backup Domain Controller?</A
778 ></DT
779 ><DT
780 >10.5. <A
781 HREF="#AEN1792"
782 >How do I set up a Samba BDC?</A
783 ></DT
784 ><DD
785 ><DL
786 ><DT
787 >10.5.1. <A
788 HREF="#AEN1808"
789 >How do I replicate the smbpasswd file?</A
790 ></DT
791 ></DL
792 ></DD
793 ></DL
794 ></DD
795 ><DT
796 >11. <A
797 HREF="#SAMBA-LDAP-HOWTO"
798 >Storing Samba's User/Machine Account information in an LDAP Directory</A
799 ></DT
800 ><DD
801 ><DL
802 ><DT
803 >11.1. <A
804 HREF="#AEN1829"
805 >Purpose</A
806 ></DT
807 ><DT
808 >11.2. <A
809 HREF="#AEN1849"
810 >Introduction</A
811 ></DT
812 ><DT
813 >11.3. <A
814 HREF="#AEN1878"
815 >Supported LDAP Servers</A
816 ></DT
817 ><DT
818 >11.4. <A
819 HREF="#AEN1883"
820 >Schema and Relationship to the RFC 2307 posixAccount</A
821 ></DT
822 ><DT
823 >11.5. <A
824 HREF="#AEN1895"
825 >Configuring Samba with LDAP</A
826 ></DT
827 ><DD
828 ><DL
829 ><DT
830 >11.5.1. <A
831 HREF="#AEN1897"
832 >OpenLDAP configuration</A
833 ></DT
834 ><DT
835 >11.5.2. <A
836 HREF="#AEN1914"
837 >Configuring Samba</A
838 ></DT
839 ></DL
840 ></DD
841 ><DT
842 >11.6. <A
843 HREF="#AEN1942"
844 >Accounts and Groups management</A
845 ></DT
846 ><DT
847 >11.7. <A
848 HREF="#AEN1947"
849 >Security and sambaAccount</A
850 ></DT
851 ><DT
852 >11.8. <A
853 HREF="#AEN1967"
854 >LDAP specials attributes for sambaAccounts</A
855 ></DT
856 ><DT
857 >11.9. <A
858 HREF="#AEN2037"
859 >Example LDIF Entries for a sambaAccount</A
860 ></DT
861 ><DT
862 >11.10. <A
863 HREF="#AEN2045"
864 >Comments</A
865 ></DT
866 ></DL
867 ></DD
868 ><DT
869 >12. <A
870 HREF="#WINBIND"
871 >Unified Logons between Windows NT and UNIX using Winbind</A
872 ></DT
873 ><DD
874 ><DL
875 ><DT
876 >12.1. <A
877 HREF="#AEN2074"
878 >Abstract</A
879 ></DT
880 ><DT
881 >12.2. <A
882 HREF="#AEN2078"
883 >Introduction</A
884 ></DT
885 ><DT
886 >12.3. <A
887 HREF="#AEN2091"
888 >What Winbind Provides</A
889 ></DT
890 ><DD
891 ><DL
892 ><DT
893 >12.3.1. <A
894 HREF="#AEN2098"
895 >Target Uses</A
896 ></DT
897 ></DL
898 ></DD
899 ><DT
900 >12.4. <A
901 HREF="#AEN2102"
902 >How Winbind Works</A
903 ></DT
904 ><DD
905 ><DL
906 ><DT
907 >12.4.1. <A
908 HREF="#AEN2107"
909 >Microsoft Remote Procedure Calls</A
910 ></DT
911 ><DT
912 >12.4.2. <A
913 HREF="#AEN2111"
914 >Name Service Switch</A
915 ></DT
916 ><DT
917 >12.4.3. <A
918 HREF="#AEN2127"
919 >Pluggable Authentication Modules</A
920 ></DT
921 ><DT
922 >12.4.4. <A
923 HREF="#AEN2135"
924 >User and Group ID Allocation</A
925 ></DT
926 ><DT
927 >12.4.5. <A
928 HREF="#AEN2139"
929 >Result Caching</A
930 ></DT
931 ></DL
932 ></DD
933 ><DT
934 >12.5. <A
935 HREF="#AEN2142"
936 >Installation and Configuration</A
937 ></DT
938 ><DD
939 ><DL
940 ><DT
941 >12.5.1. <A
942 HREF="#AEN2149"
943 >Introduction</A
944 ></DT
945 ><DT
946 >12.5.2. <A
947 HREF="#AEN2162"
948 >Requirements</A
949 ></DT
950 ><DT
951 >12.5.3. <A
952 HREF="#AEN2176"
953 >Testing Things Out</A
954 ></DT
955 ><DD
956 ><DL
957 ><DT
958 >12.5.3.1. <A
959 HREF="#AEN2187"
960 >Configure and compile SAMBA</A
961 ></DT
962 ><DT
963 >12.5.3.2. <A
964 HREF="#AEN2206"
965 >Configure <TT
966 CLASS="FILENAME"
967 >nsswitch.conf</TT
968 > and the
969 winbind libraries</A
970 ></DT
971 ><DT
972 >12.5.3.3. <A
973 HREF="#AEN2231"
974 >Configure smb.conf</A
975 ></DT
976 ><DT
977 >12.5.3.4. <A
978 HREF="#AEN2247"
979 >Join the SAMBA server to the PDC domain</A
980 ></DT
981 ><DT
982 >12.5.3.5. <A
983 HREF="#AEN2258"
984 >Start up the winbindd daemon and test it!</A
985 ></DT
986 ><DT
987 >12.5.3.6. <A
988 HREF="#AEN2294"
989 >Fix the <TT
990 CLASS="FILENAME"
991 >/etc/rc.d/init.d/smb</TT
992 > startup files</A
993 ></DT
994 ><DT
995 >12.5.3.7. <A
996 HREF="#AEN2316"
997 >Configure Winbind and PAM</A
998 ></DT
999 ></DL
1000 ></DD
1001 ></DL
1002 ></DD
1003 ><DT
1004 >12.6. <A
1005 HREF="#AEN2363"
1006 >Limitations</A
1007 ></DT
1008 ><DT
1009 >12.7. <A
1010 HREF="#AEN2373"
1011 >Conclusion</A
1012 ></DT
1013 ></DL
1014 ></DD
1015 ><DT
1016 >13. <A
1017 HREF="#OS2"
1018 >OS2 Client HOWTO</A
1019 ></DT
1020 ><DD
1021 ><DL
1022 ><DT
1023 >13.1. <A
1024 HREF="#AEN2387"
1025 >FAQs</A
1026 ></DT
1027 ><DD
1028 ><DL
1029 ><DT
1030 >13.1.1. <A
1031 HREF="#AEN2389"
1032 >How can I configure OS/2 Warp Connect or
1033 OS/2 Warp 4 as a client for Samba?</A
1034 ></DT
1035 ><DT
1036 >13.1.2. <A
1037 HREF="#AEN2404"
1038 >How can I configure OS/2 Warp 3 (not Connect),
1039 OS/2 1.2, 1.3 or 2.x for Samba?</A
1040 ></DT
1041 ><DT
1042 >13.1.3. <A
1043 HREF="#AEN2413"
1044 >Are there any other issues when OS/2 (any version)
1045 is used as a client?</A
1046 ></DT
1047 ><DT
1048 >13.1.4. <A
1049 HREF="#AEN2417"
1050 >How do I get printer driver download working
1051 for OS/2 clients?</A
1052 ></DT
1053 ></DL
1054 ></DD
1055 ></DL
1056 ></DD
1057 ><DT
1058 >14. <A
1059 HREF="#CVS-ACCESS"
1060 >HOWTO Access Samba source code via CVS</A
1061 ></DT
1062 ><DD
1063 ><DL
1064 ><DT
1065 >14.1. <A
1066 HREF="#AEN2433"
1067 >Introduction</A
1068 ></DT
1069 ><DT
1070 >14.2. <A
1071 HREF="#AEN2438"
1072 >CVS Access to samba.org</A
1073 ></DT
1074 ><DD
1075 ><DL
1076 ><DT
1077 >14.2.1. <A
1078 HREF="#AEN2441"
1079 >Access via CVSweb</A
1080 ></DT
1081 ><DT
1082 >14.2.2. <A
1083 HREF="#AEN2446"
1084 >Access via cvs</A
1085 ></DT
1086 ></DL
1087 ></DD
1088 ></DL
1089 ></DD
1090 ><DT
1092 HREF="#AEN2474"
1093 >Index</A
1094 ></DT
1095 ></DL
1096 ></DIV
1097 ><DIV
1098 CLASS="CHAPTER"
1099 ><HR><H1
1101 NAME="INSTALL"
1102 >Chapter 1. How to Install and Test SAMBA</A
1103 ></H1
1104 ><DIV
1105 CLASS="SECT1"
1106 ><H1
1107 CLASS="SECT1"
1109 NAME="AEN20"
1110 >1.1. Step 0: Read the man pages</A
1111 ></H1
1113 >The man pages distributed with SAMBA contain
1114 lots of useful info that will help to get you started.
1115 If you don't know how to read man pages then try
1116 something like:</P
1118 ><TT
1119 CLASS="PROMPT"
1120 >$ </TT
1121 ><TT
1122 CLASS="USERINPUT"
1124 >nroff -man smbd.8 | more
1126 ></TT
1127 ></P
1129 >Other sources of information are pointed to
1130 by the Samba web site,<A
1131 HREF="http://www.samba.org/"
1132 TARGET="_top"
1133 > http://www.samba.org</A
1134 ></P
1135 ></DIV
1136 ><DIV
1137 CLASS="SECT1"
1138 ><HR><H1
1139 CLASS="SECT1"
1141 NAME="AEN28"
1142 >1.2. Step 1: Building the Binaries</A
1143 ></H1
1145 >To do this, first run the program <B
1146 CLASS="COMMAND"
1147 >./configure
1149 > in the source directory. This should automatically
1150 configure Samba for your operating system. If you have unusual
1151 needs then you may wish to run</P
1153 ><TT
1154 CLASS="PROMPT"
1155 >root# </TT
1156 ><TT
1157 CLASS="USERINPUT"
1159 >./configure --help
1161 ></TT
1162 ></P
1164 >first to see what special options you can enable.
1165 Then executing</P
1167 ><TT
1168 CLASS="PROMPT"
1169 >root# </TT
1170 ><TT
1171 CLASS="USERINPUT"
1173 >make</B
1174 ></TT
1175 ></P
1177 >will create the binaries. Once it's successfully
1178 compiled you can use </P
1180 ><TT
1181 CLASS="PROMPT"
1182 >root# </TT
1183 ><TT
1184 CLASS="USERINPUT"
1186 >make install</B
1187 ></TT
1188 ></P
1190 >to install the binaries and manual pages. You can
1191 separately install the binaries and/or man pages using</P
1193 ><TT
1194 CLASS="PROMPT"
1195 >root# </TT
1196 ><TT
1197 CLASS="USERINPUT"
1199 >make installbin
1201 ></TT
1202 ></P
1204 >and</P
1206 ><TT
1207 CLASS="PROMPT"
1208 >root# </TT
1209 ><TT
1210 CLASS="USERINPUT"
1212 >make installman
1214 ></TT
1215 ></P
1217 >Note that if you are upgrading for a previous version
1218 of Samba you might like to know that the old versions of
1219 the binaries will be renamed with a ".old" extension. You
1220 can go back to the previous version with</P
1222 ><TT
1223 CLASS="PROMPT"
1224 >root# </TT
1225 ><TT
1226 CLASS="USERINPUT"
1228 >make revert
1230 ></TT
1231 ></P
1233 >if you find this version a disaster!</P
1234 ></DIV
1235 ><DIV
1236 CLASS="SECT1"
1237 ><HR><H1
1238 CLASS="SECT1"
1240 NAME="AEN56"
1241 >1.3. Step 2: The all important step</A
1242 ></H1
1244 >At this stage you must fetch yourself a
1245 coffee or other drink you find stimulating. Getting the rest
1246 of the install right can sometimes be tricky, so you will
1247 probably need it.</P
1249 >If you have installed samba before then you can skip
1250 this step.</P
1251 ></DIV
1252 ><DIV
1253 CLASS="SECT1"
1254 ><HR><H1
1255 CLASS="SECT1"
1257 NAME="AEN60"
1258 >1.4. Step 3: Create the smb configuration file.</A
1259 ></H1
1261 >There are sample configuration files in the examples
1262 subdirectory in the distribution. I suggest you read them
1263 carefully so you can see how the options go together in
1264 practice. See the man page for all the options.</P
1266 >The simplest useful configuration file would be
1267 something like this:</P
1269 ><TABLE
1270 BORDER="0"
1271 BGCOLOR="#E0E0E0"
1272 WIDTH="100%"
1273 ><TR
1274 ><TD
1275 ><PRE
1276 CLASS="PROGRAMLISTING"
1277 > [global]
1278 workgroup = MYGROUP
1280 [homes]
1281 guest ok = no
1282 read only = no
1283 </PRE
1284 ></TD
1285 ></TR
1286 ></TABLE
1287 ></P
1289 >which would allow connections by anyone with an
1290 account on the server, using either their login name or
1291 "homes" as the service name. (Note that I also set the
1292 workgroup that Samba is part of. See BROWSING.txt for details)</P
1294 >Note that <B
1295 CLASS="COMMAND"
1296 >make install</B
1297 > will not install
1298 a <TT
1299 CLASS="FILENAME"
1300 >smb.conf</TT
1301 > file. You need to create it
1302 yourself. </P
1304 >Make sure you put the smb.conf file in the same place
1305 you specified in the<TT
1306 CLASS="FILENAME"
1307 >Makefile</TT
1308 > (the default is to
1309 look for it in <TT
1310 CLASS="FILENAME"
1311 >/usr/local/samba/lib/</TT
1312 >).</P
1314 >For more information about security settings for the
1315 [homes] share please refer to the document UNIX_SECURITY.txt.</P
1316 ></DIV
1317 ><DIV
1318 CLASS="SECT1"
1319 ><HR><H1
1320 CLASS="SECT1"
1322 NAME="AEN74"
1323 >1.5. Step 4: Test your config file with
1325 CLASS="COMMAND"
1326 >testparm</B
1327 ></A
1328 ></H1
1330 >It's important that you test the validity of your
1332 CLASS="FILENAME"
1333 >smb.conf</TT
1334 > file using the testparm program.
1335 If testparm runs OK then it will list the loaded services. If
1336 not it will give an error message.</P
1338 >Make sure it runs OK and that the services look
1339 reasonable before proceeding. </P
1340 ></DIV
1341 ><DIV
1342 CLASS="SECT1"
1343 ><HR><H1
1344 CLASS="SECT1"
1346 NAME="AEN80"
1347 >1.6. Step 5: Starting the smbd and nmbd</A
1348 ></H1
1350 >You must choose to start smbd and nmbd either
1351 as daemons or from <B
1352 CLASS="COMMAND"
1353 >inetd</B
1354 >. Don't try
1355 to do both! Either you can put them in <TT
1356 CLASS="FILENAME"
1357 > inetd.conf</TT
1358 > and have them started on demand
1359 by <B
1360 CLASS="COMMAND"
1361 >inetd</B
1362 >, or you can start them as
1363 daemons either from the command line or in <TT
1364 CLASS="FILENAME"
1365 > /etc/rc.local</TT
1366 >. See the man pages for details
1367 on the command line options. Take particular care to read
1368 the bit about what user you need to be in order to start
1369 Samba. In many cases you must be root.</P
1371 >The main advantage of starting <B
1372 CLASS="COMMAND"
1373 >smbd</B
1375 and <B
1376 CLASS="COMMAND"
1377 >nmbd</B
1378 > using the recommended daemon method
1379 is that they will respond slightly more quickly to an initial connection
1380 request.</P
1381 ><DIV
1382 CLASS="SECT2"
1383 ><HR><H2
1384 CLASS="SECT2"
1386 NAME="AEN90"
1387 >1.6.1. Step 5a: Starting from inetd.conf</A
1388 ></H2
1390 >NOTE; The following will be different if
1391 you use NIS or NIS+ to distributed services maps.</P
1393 >Look at your <TT
1394 CLASS="FILENAME"
1395 >/etc/services</TT
1397 What is defined at port 139/tcp. If nothing is defined
1398 then add a line like this:</P
1400 ><TT
1401 CLASS="USERINPUT"
1403 >netbios-ssn 139/tcp</B
1404 ></TT
1405 ></P
1407 >similarly for 137/udp you should have an entry like:</P
1409 ><TT
1410 CLASS="USERINPUT"
1412 >netbios-ns 137/udp</B
1413 ></TT
1414 ></P
1416 >Next edit your <TT
1417 CLASS="FILENAME"
1418 >/etc/inetd.conf</TT
1420 and add two lines something like this:</P
1422 ><TABLE
1423 BORDER="0"
1424 BGCOLOR="#E0E0E0"
1425 WIDTH="100%"
1426 ><TR
1427 ><TD
1428 ><PRE
1429 CLASS="PROGRAMLISTING"
1430 > netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
1431 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
1432 </PRE
1433 ></TD
1434 ></TR
1435 ></TABLE
1436 ></P
1438 >The exact syntax of <TT
1439 CLASS="FILENAME"
1440 >/etc/inetd.conf</TT
1442 varies between unixes. Look at the other entries in inetd.conf
1443 for a guide.</P
1445 >NOTE: Some unixes already have entries like netbios_ns
1446 (note the underscore) in <TT
1447 CLASS="FILENAME"
1448 >/etc/services</TT
1450 You must either edit <TT
1451 CLASS="FILENAME"
1452 >/etc/services</TT
1453 > or
1455 CLASS="FILENAME"
1456 >/etc/inetd.conf</TT
1457 > to make them consistent.</P
1459 >NOTE: On many systems you may need to use the
1460 "interfaces" option in smb.conf to specify the IP address
1461 and netmask of your interfaces. Run <B
1462 CLASS="COMMAND"
1463 >ifconfig</B
1465 as root if you don't know what the broadcast is for your
1466 net. <B
1467 CLASS="COMMAND"
1468 >nmbd</B
1469 > tries to determine it at run
1470 time, but fails on some unixes. See the section on "testing nmbd"
1471 for a method of finding if you need to do this.</P
1473 >!!!WARNING!!! Many unixes only accept around 5
1474 parameters on the command line in <TT
1475 CLASS="FILENAME"
1476 >inetd.conf</TT
1478 This means you shouldn't use spaces between the options and
1479 arguments, or you should use a script, and start the script
1480 from <B
1481 CLASS="COMMAND"
1482 >inetd</B
1483 >.</P
1485 >Restart <B
1486 CLASS="COMMAND"
1487 >inetd</B
1488 >, perhaps just send
1489 it a HUP. If you have installed an earlier version of <B
1490 CLASS="COMMAND"
1491 > nmbd</B
1492 > then you may need to kill nmbd as well.</P
1493 ></DIV
1494 ><DIV
1495 CLASS="SECT2"
1496 ><HR><H2
1497 CLASS="SECT2"
1499 NAME="AEN119"
1500 >1.6.2. Step 5b. Alternative: starting it as a daemon</A
1501 ></H2
1503 >To start the server as a daemon you should create
1504 a script something like this one, perhaps calling
1505 it <TT
1506 CLASS="FILENAME"
1507 >startsmb</TT
1508 >.</P
1510 ><TABLE
1511 BORDER="0"
1512 BGCOLOR="#E0E0E0"
1513 WIDTH="100%"
1514 ><TR
1515 ><TD
1516 ><PRE
1517 CLASS="PROGRAMLISTING"
1518 > #!/bin/sh
1519 /usr/local/samba/bin/smbd -D
1520 /usr/local/samba/bin/nmbd -D
1521 </PRE
1522 ></TD
1523 ></TR
1524 ></TABLE
1525 ></P
1527 >then make it executable with <B
1528 CLASS="COMMAND"
1529 >chmod
1530 +x startsmb</B
1531 ></P
1533 >You can then run <B
1534 CLASS="COMMAND"
1535 >startsmb</B
1536 > by
1537 hand or execute it from <TT
1538 CLASS="FILENAME"
1539 >/etc/rc.local</TT
1543 >To kill it send a kill signal to the processes
1545 CLASS="COMMAND"
1546 >nmbd</B
1547 > and <B
1548 CLASS="COMMAND"
1549 >smbd</B
1550 >.</P
1552 >NOTE: If you use the SVR4 style init system then
1553 you may like to look at the <TT
1554 CLASS="FILENAME"
1555 >examples/svr4-startup</TT
1557 script to make Samba fit into that system.</P
1558 ></DIV
1559 ></DIV
1560 ><DIV
1561 CLASS="SECT1"
1562 ><HR><H1
1563 CLASS="SECT1"
1565 NAME="AEN135"
1566 >1.7. Step 6: Try listing the shares available on your
1567 server</A
1568 ></H1
1570 ><TT
1571 CLASS="PROMPT"
1572 >$ </TT
1573 ><TT
1574 CLASS="USERINPUT"
1576 >smbclient -L
1578 CLASS="REPLACEABLE"
1580 >yourhostname</I
1581 ></TT
1582 ></B
1583 ></TT
1584 ></P
1586 >You should get back a list of shares available on
1587 your server. If you don't then something is incorrectly setup.
1588 Note that this method can also be used to see what shares
1589 are available on other LanManager clients (such as WfWg).</P
1591 >If you choose user level security then you may find
1592 that Samba requests a password before it will list the shares.
1593 See the <B
1594 CLASS="COMMAND"
1595 >smbclient</B
1596 > man page for details. (you
1597 can force it to list the shares without a password by
1598 adding the option -U% to the command line. This will not work
1599 with non-Samba servers)</P
1600 ></DIV
1601 ><DIV
1602 CLASS="SECT1"
1603 ><HR><H1
1604 CLASS="SECT1"
1606 NAME="AEN144"
1607 >1.8. Step 7: Try connecting with the unix client</A
1608 ></H1
1610 ><TT
1611 CLASS="PROMPT"
1612 >$ </TT
1613 ><TT
1614 CLASS="USERINPUT"
1616 >smbclient <TT
1617 CLASS="REPLACEABLE"
1619 > //yourhostname/aservice</I
1620 ></TT
1621 ></B
1622 ></TT
1623 ></P
1625 >Typically the <TT
1626 CLASS="REPLACEABLE"
1628 >yourhostname</I
1629 ></TT
1631 would be the name of the host where you installed <B
1632 CLASS="COMMAND"
1633 > smbd</B
1634 >. The <TT
1635 CLASS="REPLACEABLE"
1637 >aservice</I
1638 ></TT
1639 > is
1640 any service you have defined in the <TT
1641 CLASS="FILENAME"
1642 >smb.conf</TT
1644 file. Try your user name if you just have a [homes] section
1645 in <TT
1646 CLASS="FILENAME"
1647 >smb.conf</TT
1648 >.</P
1650 >For example if your unix host is bambi and your login
1651 name is fred you would type:</P
1653 ><TT
1654 CLASS="PROMPT"
1655 >$ </TT
1656 ><TT
1657 CLASS="USERINPUT"
1659 >smbclient //bambi/fred
1661 ></TT
1662 ></P
1663 ></DIV
1664 ><DIV
1665 CLASS="SECT1"
1666 ><HR><H1
1667 CLASS="SECT1"
1669 NAME="AEN160"
1670 >1.9. Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT,
1671 Win2k, OS/2, etc... client</A
1672 ></H1
1674 >Try mounting disks. eg:</P
1676 ><TT
1677 CLASS="PROMPT"
1678 >C:\WINDOWS\&#62; </TT
1679 ><TT
1680 CLASS="USERINPUT"
1682 >net use d: \\servername\service
1684 ></TT
1685 ></P
1687 >Try printing. eg:</P
1689 ><TT
1690 CLASS="PROMPT"
1691 >C:\WINDOWS\&#62; </TT
1692 ><TT
1693 CLASS="USERINPUT"
1695 >net use lpt1:
1696 \\servername\spoolservice</B
1697 ></TT
1698 ></P
1700 ><TT
1701 CLASS="PROMPT"
1702 >C:\WINDOWS\&#62; </TT
1703 ><TT
1704 CLASS="USERINPUT"
1706 >print filename
1708 ></TT
1709 ></P
1711 >Celebrate, or send me a bug report!</P
1712 ></DIV
1713 ><DIV
1714 CLASS="SECT1"
1715 ><HR><H1
1716 CLASS="SECT1"
1718 NAME="AEN174"
1719 >1.10. What If Things Don't Work?</A
1720 ></H1
1722 >If nothing works and you start to think "who wrote
1723 this pile of trash" then I suggest you do step 2 again (and
1724 again) till you calm down.</P
1726 >Then you might read the file DIAGNOSIS.txt and the
1727 FAQ. If you are still stuck then try the mailing list or
1728 newsgroup (look in the README for details). Samba has been
1729 successfully installed at thousands of sites worldwide, so maybe
1730 someone else has hit your problem and has overcome it. You could
1731 also use the WWW site to scan back issues of the samba-digest.</P
1733 >When you fix the problem PLEASE send me some updates to the
1734 documentation (or source code) so that the next person will find it
1735 easier. </P
1736 ><DIV
1737 CLASS="SECT2"
1738 ><HR><H2
1739 CLASS="SECT2"
1741 NAME="AEN179"
1742 >1.10.1. Diagnosing Problems</A
1743 ></H2
1745 >If you have installation problems then go to
1747 CLASS="FILENAME"
1748 >DIAGNOSIS.txt</TT
1749 > to try to find the
1750 problem.</P
1751 ></DIV
1752 ><DIV
1753 CLASS="SECT2"
1754 ><HR><H2
1755 CLASS="SECT2"
1757 NAME="AEN183"
1758 >1.10.2. Scope IDs</A
1759 ></H2
1761 >By default Samba uses a blank scope ID. This means
1762 all your windows boxes must also have a blank scope ID.
1763 If you really want to use a non-blank scope ID then you will
1764 need to use the -i &#60;scope&#62; option to nmbd, smbd, and
1765 smbclient. All your PCs will need to have the same setting for
1766 this to work. I do not recommend scope IDs.</P
1767 ></DIV
1768 ><DIV
1769 CLASS="SECT2"
1770 ><HR><H2
1771 CLASS="SECT2"
1773 NAME="AEN186"
1774 >1.10.3. Choosing the Protocol Level</A
1775 ></H2
1777 >The SMB protocol has many dialects. Currently
1778 Samba supports 5, called CORE, COREPLUS, LANMAN1,
1779 LANMAN2 and NT1.</P
1781 >You can choose what maximum protocol to support
1782 in the <TT
1783 CLASS="FILENAME"
1784 >smb.conf</TT
1785 > file. The default is
1786 NT1 and that is the best for the vast majority of sites.</P
1788 >In older versions of Samba you may have found it
1789 necessary to use COREPLUS. The limitations that led to
1790 this have mostly been fixed. It is now less likely that you
1791 will want to use less than LANMAN1. The only remaining advantage
1792 of COREPLUS is that for some obscure reason WfWg preserves
1793 the case of passwords in this protocol, whereas under LANMAN1,
1794 LANMAN2 or NT1 it uppercases all passwords before sending them,
1795 forcing you to use the "password level=" option in some cases.</P
1797 >The main advantage of LANMAN2 and NT1 is support for
1798 long filenames with some clients (eg: smbclient, Windows NT
1799 or Win95). </P
1801 >See the smb.conf(5) manual page for more details.</P
1803 >Note: To support print queue reporting you may find
1804 that you have to use TCP/IP as the default protocol under
1805 WfWg. For some reason if you leave Netbeui as the default
1806 it may break the print queue reporting on some systems.
1807 It is presumably a WfWg bug.</P
1808 ></DIV
1809 ><DIV
1810 CLASS="SECT2"
1811 ><HR><H2
1812 CLASS="SECT2"
1814 NAME="AEN195"
1815 >1.10.4. Printing from UNIX to a Client PC</A
1816 ></H2
1818 >To use a printer that is available via a smb-based
1819 server from a unix host you will need to compile the
1820 smbclient program. You then need to install the script
1821 "smbprint". Read the instruction in smbprint for more details.
1824 >There is also a SYSV style script that does much
1825 the same thing called smbprint.sysv. It contains instructions.</P
1826 ></DIV
1827 ><DIV
1828 CLASS="SECT2"
1829 ><HR><H2
1830 CLASS="SECT2"
1832 NAME="AEN199"
1833 >1.10.5. Locking</A
1834 ></H2
1836 >One area which sometimes causes trouble is locking.</P
1838 >There are two types of locking which need to be
1839 performed by a SMB server. The first is "record locking"
1840 which allows a client to lock a range of bytes in a open file.
1841 The second is the "deny modes" that are specified when a file
1842 is open.</P
1844 >Record locking semantics under Unix is very
1845 different from record locking under Windows. Versions
1846 of Samba before 2.2 have tried to use the native
1847 fcntl() unix system call to implement proper record
1848 locking between different Samba clients. This can not
1849 be fully correct due to several reasons. The simplest
1850 is the fact that a Windows client is allowed to lock a
1851 byte range up to 2^32 or 2^64, depending on the client
1852 OS. The unix locking only supports byte ranges up to
1853 2^31. So it is not possible to correctly satisfy a
1854 lock request above 2^31. There are many more
1855 differences, too many to be listed here.</P
1857 >Samba 2.2 and above implements record locking
1858 completely independent of the underlying unix
1859 system. If a byte range lock that the client requests
1860 happens to fall into the range 0-2^31, Samba hands
1861 this request down to the Unix system. All other locks
1862 can not be seen by unix anyway.</P
1864 >Strictly a SMB server should check for locks before
1865 every read and write call on a file. Unfortunately with the
1866 way fcntl() works this can be slow and may overstress the
1867 rpc.lockd. It is also almost always unnecessary as clients
1868 are supposed to independently make locking calls before reads
1869 and writes anyway if locking is important to them. By default
1870 Samba only makes locking calls when explicitly asked
1871 to by a client, but if you set "strict locking = yes" then it will
1872 make lock checking calls on every read and write. </P
1874 >You can also disable by range locking completely
1875 using "locking = no". This is useful for those shares that
1876 don't support locking or don't need it (such as cdroms). In
1877 this case Samba fakes the return codes of locking calls to
1878 tell clients that everything is OK.</P
1880 >The second class of locking is the "deny modes". These
1881 are set by an application when it opens a file to determine
1882 what types of access should be allowed simultaneously with
1883 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE
1884 or DENY_ALL. There are also special compatibility modes called
1885 DENY_FCB and DENY_DOS.</P
1887 >You can disable share modes using "share modes = no".
1888 This may be useful on a heavily loaded server as the share
1889 modes code is very slow. See also the FAST_SHARE_MODES
1890 option in the Makefile for a way to do full share modes
1891 very fast using shared memory (if your OS supports it).</P
1892 ></DIV
1893 ><DIV
1894 CLASS="SECT2"
1895 ><HR><H2
1896 CLASS="SECT2"
1898 NAME="AEN209"
1899 >1.10.6. Mapping Usernames</A
1900 ></H2
1902 >If you have different usernames on the PCs and
1903 the unix server then take a look at the "username map" option.
1904 See the smb.conf man page for details.</P
1905 ></DIV
1906 ><DIV
1907 CLASS="SECT2"
1908 ><HR><H2
1909 CLASS="SECT2"
1911 NAME="AEN212"
1912 >1.10.7. Other Character Sets</A
1913 ></H2
1915 >If you have problems using filenames with accented
1916 characters in them (like the German, French or Scandinavian
1917 character sets) then I recommend you look at the "valid chars"
1918 option in smb.conf and also take a look at the validchars
1919 package in the examples directory.</P
1920 ></DIV
1921 ></DIV
1922 ></DIV
1923 ><DIV
1924 CLASS="CHAPTER"
1925 ><HR><H1
1927 NAME="INTEGRATE-MS-NETWORKS"
1928 >Chapter 2. Integrating MS Windows networks with Samba</A
1929 ></H1
1930 ><DIV
1931 CLASS="SECT1"
1932 ><H1
1933 CLASS="SECT1"
1935 NAME="AEN226"
1936 >2.1. Agenda</A
1937 ></H1
1939 >To identify the key functional mechanisms of MS Windows networking
1940 to enable the deployment of Samba as a means of extending and/or
1941 replacing MS Windows NT/2000 technology.</P
1943 >We will examine:</P
1945 ></P
1946 ><OL
1947 TYPE="1"
1948 ><LI
1950 >Name resolution in a pure Unix/Linux TCP/IP
1951 environment
1953 ></LI
1954 ><LI
1956 >Name resolution as used within MS Windows
1957 networking
1959 ></LI
1960 ><LI
1962 >How browsing functions and how to deploy stable
1963 and dependable browsing using Samba
1965 ></LI
1966 ><LI
1968 >MS Windows security options and how to
1969 configure Samba for seemless integration
1971 ></LI
1972 ><LI
1974 >Configuration of Samba as:</P
1976 ></P
1977 ><OL
1978 TYPE="a"
1979 ><LI
1981 >A stand-alone server</P
1982 ></LI
1983 ><LI
1985 >An MS Windows NT 3.x/4.0 security domain member
1987 ></LI
1988 ><LI
1990 >An alternative to an MS Windows NT 3.x/4.0 Domain Controller
1992 ></LI
1993 ></OL
1994 ></LI
1995 ></OL
1996 ></DIV
1997 ><DIV
1998 CLASS="SECT1"
1999 ><HR><H1
2000 CLASS="SECT1"
2002 NAME="AEN248"
2003 >2.2. Name Resolution in a pure Unix/Linux world</A
2004 ></H1
2006 >The key configuration files covered in this section are:</P
2008 ></P
2009 ><UL
2010 ><LI
2012 ><TT
2013 CLASS="FILENAME"
2014 >/etc/hosts</TT
2015 ></P
2016 ></LI
2017 ><LI
2019 ><TT
2020 CLASS="FILENAME"
2021 >/etc/resolv.conf</TT
2022 ></P
2023 ></LI
2024 ><LI
2026 ><TT
2027 CLASS="FILENAME"
2028 >/etc/host.conf</TT
2029 ></P
2030 ></LI
2031 ><LI
2033 ><TT
2034 CLASS="FILENAME"
2035 >/etc/nsswitch.conf</TT
2036 ></P
2037 ></LI
2038 ></UL
2039 ><DIV
2040 CLASS="SECT2"
2041 ><HR><H2
2042 CLASS="SECT2"
2044 NAME="AEN264"
2045 >2.2.1. <TT
2046 CLASS="FILENAME"
2047 >/etc/hosts</TT
2048 ></A
2049 ></H2
2051 >Contains a static list of IP Addresses and names.
2052 eg:</P
2054 ><TABLE
2055 BORDER="0"
2056 BGCOLOR="#E0E0E0"
2057 WIDTH="100%"
2058 ><TR
2059 ><TD
2060 ><PRE
2061 CLASS="PROGRAMLISTING"
2062 > 127.0.0.1 localhost localhost.localdomain
2063 192.168.1.1 bigbox.caldera.com bigbox alias4box</PRE
2064 ></TD
2065 ></TR
2066 ></TABLE
2067 ></P
2069 >The purpose of <TT
2070 CLASS="FILENAME"
2071 >/etc/hosts</TT
2072 > is to provide a
2073 name resolution mechanism so that uses do not need to remember
2074 IP addresses.</P
2076 >Network packets that are sent over the physical network transport
2077 layer communicate not via IP addresses but rather using the Media
2078 Access Control address, or MAC address. IP Addresses are currently
2079 32 bits in length and are typically presented as four (4) decimal
2080 numbers that are separated by a dot (or period). eg: 168.192.1.1</P
2082 >MAC Addresses use 48 bits (or 6 bytes) and are typically represented
2083 as two digit hexadecimal numbers separated by colons. eg:
2084 40:8e:0a:12:34:56</P
2086 >Every network interfrace must have an MAC address. Associated with
2087 a MAC address there may be one or more IP addresses. There is NO
2088 relationship between an IP address and a MAC address, all such assignments
2089 are arbitary or discretionary in nature. At the most basic level all
2090 network communications takes place using MAC addressing. Since MAC
2091 addresses must be globally unique, and generally remains fixed for
2092 any particular interface, the assignment of an IP address makes sense
2093 from a network management perspective. More than one IP address can
2094 be assigned per MAC address. One address must be the primary IP address,
2095 this is the address that will be returned in the ARP reply.</P
2097 >When a user or a process wants to communicate with another machine
2098 the protocol implementation ensures that the "machine name" or "host
2099 name" is resolved to an IP address in a manner that is controlled
2100 by the TCP/IP configuration control files. The file
2102 CLASS="FILENAME"
2103 >/etc/hosts</TT
2104 > is one such file.</P
2106 >When the IP address of the destination interface has been
2107 determined a protocol called ARP/RARP isused to identify
2108 the MAC address of the target interface. ARP stands for Address
2109 Resolution Protocol, and is a broadcast oriented method that
2110 uses UDP (User Datagram Protocol) to send a request to all
2111 interfaces on the local network segment using the all 1's MAC
2112 address. Network interfaces are programmed to respond to two
2113 MAC addresses only; their own unique address and the address
2114 ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will
2115 contain the MAC address and the primary IP address for each
2116 interface.</P
2118 >The <TT
2119 CLASS="FILENAME"
2120 >/etc/hosts</TT
2121 > file is foundational to all
2122 Unix/Linux TCP/IP installations and as a minumum will contain
2123 the localhost and local network interface IP addresses and the
2124 primary names by which they are known within the local machine.
2125 This file helps to prime the pump so that a basic level of name
2126 resolution can exist before any other method of name resolution
2127 becomes available.</P
2128 ></DIV
2129 ><DIV
2130 CLASS="SECT2"
2131 ><HR><H2
2132 CLASS="SECT2"
2134 NAME="AEN280"
2135 >2.2.2. <TT
2136 CLASS="FILENAME"
2137 >/etc/resolv.conf</TT
2138 ></A
2139 ></H2
2141 >This file tells the name resolution libraries:</P
2143 ></P
2144 ><UL
2145 ><LI
2147 >The name of the domain to which the machine
2148 belongs
2150 ></LI
2151 ><LI
2153 >The name(s) of any domains that should be
2154 automatically searched when trying to resolve unqualified
2155 host names to their IP address
2157 ></LI
2158 ><LI
2160 >The name or IP address of available Domain
2161 Name Servers that may be asked to perform name to address
2162 translation lookups
2164 ></LI
2165 ></UL
2166 ></DIV
2167 ><DIV
2168 CLASS="SECT2"
2169 ><HR><H2
2170 CLASS="SECT2"
2172 NAME="AEN291"
2173 >2.2.3. <TT
2174 CLASS="FILENAME"
2175 >/etc/host.conf</TT
2176 ></A
2177 ></H2
2179 ><TT
2180 CLASS="FILENAME"
2181 >/etc/host.conf</TT
2182 > is the primary means by
2183 which the setting in /etc/resolv.conf may be affected. It is a
2184 critical configuration file. This file controls the order by
2185 which name resolution may procede. The typical structure is:</P
2187 ><TABLE
2188 BORDER="0"
2189 BGCOLOR="#E0E0E0"
2190 WIDTH="100%"
2191 ><TR
2192 ><TD
2193 ><PRE
2194 CLASS="PROGRAMLISTING"
2195 > order hosts,bind
2196 multi on</PRE
2197 ></TD
2198 ></TR
2199 ></TABLE
2200 ></P
2202 >then both addresses should be returned. Please refer to the
2203 man page for host.conf for further details.</P
2204 ></DIV
2205 ><DIV
2206 CLASS="SECT2"
2207 ><HR><H2
2208 CLASS="SECT2"
2210 NAME="AEN299"
2211 >2.2.4. <TT
2212 CLASS="FILENAME"
2213 >/etc/nsswitch.conf</TT
2214 ></A
2215 ></H2
2217 >This file controls the actual name resolution targets. The
2218 file typically has resolver object specifications as follows:</P
2220 ><TABLE
2221 BORDER="0"
2222 BGCOLOR="#E0E0E0"
2223 WIDTH="100%"
2224 ><TR
2225 ><TD
2226 ><PRE
2227 CLASS="PROGRAMLISTING"
2228 > # /etc/nsswitch.conf
2230 # Name Service Switch configuration file.
2233 passwd: compat
2234 # Alternative entries for password authentication are:
2235 # passwd: compat files nis ldap winbind
2236 shadow: compat
2237 group: compat
2239 hosts: files nis dns
2240 # Alternative entries for host name resolution are:
2241 # hosts: files dns nis nis+ hesoid db compat ldap wins
2242 networks: nis files dns
2244 ethers: nis files
2245 protocols: nis files
2246 rpc: nis files
2247 services: nis files</PRE
2248 ></TD
2249 ></TR
2250 ></TABLE
2251 ></P
2253 >Of course, each of these mechanisms requires that the appropriate
2254 facilities and/or services are correctly configured.</P
2256 >It should be noted that unless a network request/message must be
2257 sent, TCP/IP networks are silent. All TCP/IP communications assumes a
2258 principal of speaking only when necessary.</P
2260 >Samba version 2.2.0 will add Linux support for extensions to
2261 the name service switch infrastructure so that linux clients will
2262 be able to obtain resolution of MS Windows NetBIOS names to IP
2263 Addresses. To gain this functionality Samba needs to be compiled
2264 with appropriate arguments to the make command (ie: <B
2265 CLASS="COMMAND"
2266 >make
2267 nsswitch/libnss_wins.so</B
2268 >). The resulting library should
2269 then be installed in the <TT
2270 CLASS="FILENAME"
2271 >/lib</TT
2272 > directory and
2273 the "wins" parameter needs to be added to the "hosts:" line in
2274 the <TT
2275 CLASS="FILENAME"
2276 >/etc/nsswitch.conf</TT
2277 > file. At this point it
2278 will be possible to ping any MS Windows machine by it's NetBIOS
2279 machine name, so long as that machine is within the workgroup to
2280 which both the samba machine and the MS Windows machine belong.</P
2281 ></DIV
2282 ></DIV
2283 ><DIV
2284 CLASS="SECT1"
2285 ><HR><H1
2286 CLASS="SECT1"
2288 NAME="AEN311"
2289 >2.3. Name resolution as used within MS Windows networking</A
2290 ></H1
2292 >MS Windows networking is predicated about the name each machine
2293 is given. This name is known variously (and inconsistently) as
2294 the "computer name", "machine name", "networking name", "netbios name",
2295 "SMB name". All terms mean the same thing with the exception of
2296 "netbios name" which can apply also to the name of the workgroup or the
2297 domain name. The terms "workgroup" and "domain" are really just a
2298 simply name with which the machine is associated. All NetBIOS names
2299 are exactly 16 characters in length. The 16th character is reserved.
2300 It is used to store a one byte value that indicates service level
2301 information for the NetBIOS name that is registered. A NetBIOS machine
2302 name is therefore registered for each service type that is provided by
2303 the client/server.</P
2305 >The following are typical NetBIOS name/service type registrations:</P
2307 ><TABLE
2308 BORDER="0"
2309 BGCOLOR="#E0E0E0"
2310 WIDTH="100%"
2311 ><TR
2312 ><TD
2313 ><PRE
2314 CLASS="PROGRAMLISTING"
2315 > Unique NetBIOS Names:
2316 MACHINENAME&#60;00&#62; = Server Service is running on MACHINENAME
2317 MACHINENAME&#60;03&#62; = Generic Machine Name (NetBIOS name)
2318 MACHINENAME&#60;20&#62; = LanMan Server service is running on MACHINENAME
2319 WORKGROUP&#60;1b&#62; = Domain Master Browser
2321 Group Names:
2322 WORKGROUP&#60;03&#62; = Generic Name registered by all members of WORKGROUP
2323 WORKGROUP&#60;1c&#62; = Domain Controllers / Netlogon Servers
2324 WORKGROUP&#60;1d&#62; = Local Master Browsers
2325 WORKGROUP&#60;1e&#62; = Internet Name Resolvers</PRE
2326 ></TD
2327 ></TR
2328 ></TABLE
2329 ></P
2331 >It should be noted that all NetBIOS machines register their own
2332 names as per the above. This is in vast contrast to TCP/IP
2333 installations where traditionally the system administrator will
2334 determine in the /etc/hosts or in the DNS database what names
2335 are associated with each IP address.</P
2337 >One further point of clarification should be noted, the <TT
2338 CLASS="FILENAME"
2339 >/etc/hosts</TT
2341 file and the DNS records do not provide the NetBIOS name type information
2342 that MS Windows clients depend on to locate the type of service that may
2343 be needed. An example of this is what happens when an MS Windows client
2344 wants to locate a domain logon server. It find this service and the IP
2345 address of a server that provides it by performing a lookup (via a
2346 NetBIOS broadcast) for enumeration of all machines that have
2347 registered the name type *&#60;1c&#62;. A logon request is then sent to each
2348 IP address that is returned in the enumerated list of IP addresses. Which
2349 ever machine first replies then ends up providing the logon services.</P
2351 >The name "workgroup" or "domain" really can be confusing since these
2352 have the added significance of indicating what is the security
2353 architecture of the MS Windows network. The term "workgroup" indicates
2354 that the primary nature of the network environment is that of a
2355 peer-to-peer design. In a WORKGROUP all machines are responsible for
2356 their own security, and generally such security is limited to use of
2357 just a password (known as SHARE MORE security). In most situations
2358 with peer-to-peer networking the users who control their own machines
2359 will simply opt to have no security at all. It is possible to have
2360 USER MODE security in a WORKGROUP environment, thus requiring use
2361 of a user name and a matching password.</P
2363 >MS Windows networking is thus predetermined to use machine names
2364 for all local and remote machine message passing. The protocol used is
2365 called Server Message Block (SMB) and this is implemented using
2366 the NetBIOS protocol (Network Basic Input Output System). NetBIOS can
2367 be encapsulated using LLC (Logical Link Control) protocol - in which case
2368 the resulting protocol is called NetBEUI (Network Basic Extended User
2369 Interface). NetBIOS can also be run over IPX (Internetworking Packet
2370 Exchange) protocol as used by Novell NetWare, and it can be run
2371 over TCP/IP protocols - in which case the resulting protocol is called
2372 NBT or NetBT, the NetBIOS over TCP/IP.</P
2374 >MS Windows machines use a complex array of name resolution mechanisms.
2375 Since we are primarily concerned with TCP/IP this demonstration is
2376 limited to this area.</P
2377 ><DIV
2378 CLASS="SECT2"
2379 ><HR><H2
2380 CLASS="SECT2"
2382 NAME="AEN323"
2383 >2.3.1. The NetBIOS Name Cache</A
2384 ></H2
2386 >All MS Windows machines employ an in memory buffer in which is
2387 stored the NetBIOS names and their IP addresses for all external
2388 machines that that the local machine has communicated with over the
2389 past 10-15 minutes. It is more efficient to obtain an IP address
2390 for a machine from the local cache than it is to go through all the
2391 configured name resolution mechanisms.</P
2393 >If a machine whose name is in the local name cache has been shut
2394 down before the name had been expired and flushed from the cache, then
2395 an attempt to exchange a message with that machine will be subject
2396 to time-out delays. ie: It's name is in the cache, so a name resolution
2397 lookup will succeed, but the machine can not respond. This can be
2398 frustrating for users - but it is a characteristic of the protocol.</P
2400 >The MS Windows utility that allows examination of the NetBIOS
2401 name cache is called "nbtstat". The Samba equivalent of this
2402 is called "nmblookup".</P
2403 ></DIV
2404 ><DIV
2405 CLASS="SECT2"
2406 ><HR><H2
2407 CLASS="SECT2"
2409 NAME="AEN328"
2410 >2.3.2. The LMHOSTS file</A
2411 ></H2
2413 >This file is usually located in MS Windows NT 4.0 or
2414 2000 in <TT
2415 CLASS="FILENAME"
2416 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2417 > and contains
2418 the IP Address and the machine name in matched pairs. The
2420 CLASS="FILENAME"
2421 >LMHOSTS</TT
2422 > file performs NetBIOS name
2423 to IP address mapping oriented.</P
2425 >It typically looks like:</P
2427 ><TABLE
2428 BORDER="0"
2429 BGCOLOR="#E0E0E0"
2430 WIDTH="100%"
2431 ><TR
2432 ><TD
2433 ><PRE
2434 CLASS="PROGRAMLISTING"
2435 > # Copyright (c) 1998 Microsoft Corp.
2437 # This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
2438 # over TCP/IP) stack for Windows98
2440 # This file contains the mappings of IP addresses to NT computernames
2441 # (NetBIOS) names. Each entry should be kept on an individual line.
2442 # The IP address should be placed in the first column followed by the
2443 # corresponding computername. The address and the comptername
2444 # should be separated by at least one space or tab. The "#" character
2445 # is generally used to denote the start of a comment (see the exceptions
2446 # below).
2448 # This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
2449 # files and offers the following extensions:
2451 # #PRE
2452 # #DOM:&#60;domain&#62;
2453 # #INCLUDE &#60;filename&#62;
2454 # #BEGIN_ALTERNATE
2455 # #END_ALTERNATE
2456 # \0xnn (non-printing character support)
2458 # Following any entry in the file with the characters "#PRE" will cause
2459 # the entry to be preloaded into the name cache. By default, entries are
2460 # not preloaded, but are parsed only after dynamic name resolution fails.
2462 # Following an entry with the "#DOM:&#60;domain&#62;" tag will associate the
2463 # entry with the domain specified by &#60;domain&#62;. This affects how the
2464 # browser and logon services behave in TCP/IP environments. To preload
2465 # the host name associated with #DOM entry, it is necessary to also add a
2466 # #PRE to the line. The &#60;domain&#62; is always preloaded although it will not
2467 # be shown when the name cache is viewed.
2469 # Specifying "#INCLUDE &#60;filename&#62;" will force the RFC NetBIOS (NBT)
2470 # software to seek the specified &#60;filename&#62; and parse it as if it were
2471 # local. &#60;filename&#62; is generally a UNC-based name, allowing a
2472 # centralized lmhosts file to be maintained on a server.
2473 # It is ALWAYS necessary to provide a mapping for the IP address of the
2474 # server prior to the #INCLUDE. This mapping must use the #PRE directive.
2475 # In addtion the share "public" in the example below must be in the
2476 # LanManServer list of "NullSessionShares" in order for client machines to
2477 # be able to read the lmhosts file successfully. This key is under
2478 # \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
2479 # in the registry. Simply add "public" to the list found there.
2481 # The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
2482 # statements to be grouped together. Any single successful include
2483 # will cause the group to succeed.
2485 # Finally, non-printing characters can be embedded in mappings by
2486 # first surrounding the NetBIOS name in quotations, then using the
2487 # \0xnn notation to specify a hex value for a non-printing character.
2489 # The following example illustrates all of these extensions:
2491 # 102.54.94.97 rhino #PRE #DOM:networking #net group's DC
2492 # 102.54.94.102 "appname \0x14" #special app server
2493 # 102.54.94.123 popular #PRE #source server
2494 # 102.54.94.117 localsrv #PRE #needed for the include
2496 # #BEGIN_ALTERNATE
2497 # #INCLUDE \\localsrv\public\lmhosts
2498 # #INCLUDE \\rhino\public\lmhosts
2499 # #END_ALTERNATE
2501 # In the above example, the "appname" server contains a special
2502 # character in its name, the "popular" and "localsrv" server names are
2503 # preloaded, and the "rhino" server name is specified so it can be used
2504 # to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
2505 # system is unavailable.
2507 # Note that the whole file is parsed including comments on each lookup,
2508 # so keeping the number of comments to a minimum will improve performance.
2509 # Therefore it is not advisable to simply add lmhosts file entries onto the
2510 # end of this file.</PRE
2511 ></TD
2512 ></TR
2513 ></TABLE
2514 ></P
2515 ></DIV
2516 ><DIV
2517 CLASS="SECT2"
2518 ><HR><H2
2519 CLASS="SECT2"
2521 NAME="AEN336"
2522 >2.3.3. HOSTS file</A
2523 ></H2
2525 >This file is usually located in MS Windows NT 4.0 or 2000 in
2527 CLASS="FILENAME"
2528 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2529 > and contains
2530 the IP Address and the IP hostname in matched pairs. It can be
2531 used by the name resolution infrastructure in MS Windows, depending
2532 on how the TCP/IP environment is configured. This file is in
2533 every way the equivalent of the Unix/Linux <TT
2534 CLASS="FILENAME"
2535 >/etc/hosts</TT
2536 > file.</P
2537 ></DIV
2538 ><DIV
2539 CLASS="SECT2"
2540 ><HR><H2
2541 CLASS="SECT2"
2543 NAME="AEN341"
2544 >2.3.4. DNS Lookup</A
2545 ></H2
2547 >This capability is configured in the TCP/IP setup area in the network
2548 configuration facility. If enabled an elaborate name resolution sequence
2549 is followed the precise nature of which isdependant on what the NetBIOS
2550 Node Type parameter is configured to. A Node Type of 0 means use
2551 NetBIOS broadcast (over UDP broadcast) is first used if the name
2552 that is the subject of a name lookup is not found in the NetBIOS name
2553 cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to
2554 Node Type 8, then a NetBIOS Unicast (over UDP Unicast) is sent to the
2555 WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast
2556 lookup is used.</P
2557 ></DIV
2558 ><DIV
2559 CLASS="SECT2"
2560 ><HR><H2
2561 CLASS="SECT2"
2563 NAME="AEN344"
2564 >2.3.5. WINS Lookup</A
2565 ></H2
2567 >A WINS (Windows Internet Name Server) service is the equivaent of the
2568 rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores
2569 the names and IP addresses that are registered by a Windows client
2570 if the TCP/IP setup has been given at least one WINS Server IP Address.</P
2572 >To configure Samba to be a WINS server the following parameter needs
2573 to be added to the <TT
2574 CLASS="FILENAME"
2575 >smb.conf</TT
2576 > file:</P
2578 ><TABLE
2579 BORDER="0"
2580 BGCOLOR="#E0E0E0"
2581 WIDTH="100%"
2582 ><TR
2583 ><TD
2584 ><PRE
2585 CLASS="PROGRAMLISTING"
2586 > wins support = Yes</PRE
2587 ></TD
2588 ></TR
2589 ></TABLE
2590 ></P
2592 >To configure Samba to use a WINS server the following parameters are
2593 needed in the smb.conf file:</P
2595 ><TABLE
2596 BORDER="0"
2597 BGCOLOR="#E0E0E0"
2598 WIDTH="100%"
2599 ><TR
2600 ><TD
2601 ><PRE
2602 CLASS="PROGRAMLISTING"
2603 > wins support = No
2604 wins server = xxx.xxx.xxx.xxx</PRE
2605 ></TD
2606 ></TR
2607 ></TABLE
2608 ></P
2610 >where <TT
2611 CLASS="REPLACEABLE"
2613 >xxx.xxx.xxx.xxx</I
2614 ></TT
2615 > is the IP address
2616 of the WINS server.</P
2617 ></DIV
2618 ></DIV
2619 ><DIV
2620 CLASS="SECT1"
2621 ><HR><H1
2622 CLASS="SECT1"
2624 NAME="AEN356"
2625 >2.4. How browsing functions and how to deploy stable and
2626 dependable browsing using Samba</A
2627 ></H1
2629 >As stated above, MS Windows machines register their NetBIOS names
2630 (ie: the machine name for each service type in operation) on start
2631 up. Also, as stated above, the exact method by which this name registration
2632 takes place is determined by whether or not the MS Windows client/server
2633 has been given a WINS server address, whether or not LMHOSTS lookup
2634 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.</P
2636 >In the case where there is no WINS server all name registrations as
2637 well as name lookups are done by UDP broadcast. This isolates name
2638 resolution to the local subnet, unless LMHOSTS is used to list all
2639 names and IP addresses. In such situations Samba provides a means by
2640 which the samba server name may be forcibly injected into the browse
2641 list of a remote MS Windows network (using the "remote announce" parameter).</P
2643 >Where a WINS server is used, the MS Windows client will use UDP
2644 unicast to register with the WINS server. Such packets can be routed
2645 and thus WINS allows name resolution to function across routed networks.</P
2647 >During the startup process an election will take place to create a
2648 local master browser if one does not already exist. On each NetBIOS network
2649 one machine will be elected to function as the domain master browser. This
2650 domain browsing has nothing to do with MS security domain control.
2651 Instead, the domain master browser serves the role of contacting each local
2652 master browser (found by asking WINS or from LMHOSTS) and exchanging browse
2653 list contents. This way every master browser will eventually obtain a complete
2654 list of all machines that are on the network. Every 11-15 minutes an election
2655 is held to determine which machine will be the master browser. By nature of
2656 the election criteria used, the machine with the highest uptime, or the
2657 most senior protocol version, or other criteria, will win the election
2658 as domain master browser.</P
2660 >Clients wishing to browse the network make use of this list, but also depend
2661 on the availability of correct name resolution to the respective IP
2662 address/addresses. </P
2664 >Any configuration that breaks name resolution and/or browsing intrinsics
2665 will annoy users because they will have to put up with protracted
2666 inability to use the network services.</P
2668 >Samba supports a feature that allows forced synchonisation
2669 of browse lists across routed networks using the "remote
2670 browse sync" parameter in the smb.conf file. This causes Samba
2671 to contact the local master browser on a remote network and
2672 to request browse list synchronisation. This effectively bridges
2673 two networks that are separated by routers. The two remote
2674 networks may use either broadcast based name resolution or WINS
2675 based name resolution, but it should be noted that the "remote
2676 browse sync" parameter provides browse list synchronisation - and
2677 that is distinct from name to address resolution, in other
2678 words, for cross subnet browsing to function correctly it is
2679 essential that a name to address resolution mechanism be provided.
2680 This mechanism could be via DNS, <TT
2681 CLASS="FILENAME"
2682 >/etc/hosts</TT
2684 and so on.</P
2685 ></DIV
2686 ><DIV
2687 CLASS="SECT1"
2688 ><HR><H1
2689 CLASS="SECT1"
2691 NAME="AEN366"
2692 >2.5. MS Windows security options and how to configure
2693 Samba for seemless integration</A
2694 ></H1
2696 >MS Windows clients may use encrypted passwords as part of a
2697 challenege/response authentication model (a.k.a. NTLMv1) or
2698 alone, or clear text strings for simple password based
2699 authentication. It should be realized that with the SMB
2700 protocol the password is passed over the network either
2701 in plain text or encrypted, but not both in the same
2702 authentication requets.</P
2704 >When encrypted passwords are used a password that has been
2705 entered by the user is encrypted in two ways:</P
2707 ></P
2708 ><UL
2709 ><LI
2711 >An MD4 hash of the UNICODE of the password
2712 string. This is known as the NT hash.
2714 ></LI
2715 ><LI
2717 >The password is converted to upper case,
2718 and then padded or trucated to 14 bytes. This string is
2719 then appended with 5 bytes of NULL characters and split to
2720 form two 56 bit DES keys to encrypt a "magic" 8 byte value.
2721 The resulting 16 bytes for the LanMan hash.
2723 ></LI
2724 ></UL
2726 >You should refer to the <A
2727 HREF="ENCRYPTION.html"
2728 TARGET="_top"
2729 >Password Encryption</A
2730 > chapter in this HOWTO collection
2731 for more details on the inner workings</P
2733 >MS Windows 95 pre-service pack 1, MS Windows NT versions 3.x
2734 and version 4.0 pre-service pack 3 will use either mode of
2735 password authentication. All versions of MS Windows that follow
2736 these versions no longer support plain text passwords by default.</P
2738 >MS Windows clients have a habit of dropping network mappings that
2739 have been idle for 10 minutes or longer. When the user attempts to
2740 use the mapped drive connection that has been dropped the SMB protocol
2741 has a mechanism by which the connection can be re-established using
2742 a cached copy of the password.</P
2744 >When Microsoft changed the default password mode, they dropped support for
2745 caching of the plain text password. This means that when the registry
2746 parameter is changed to re-enable use of plain text passwords it appears to
2747 work, but when a dropped mapping attempts to revalidate it will fail if
2748 the remote authentication server does not support encrypted passwords.
2749 This means that it is definitely not a good idea to re-enable plain text
2750 password support in such clients.</P
2752 >The following parameters can be used to work around the
2753 issue of Windows 9x client upper casing usernames and
2754 password before transmitting them to the SMB server
2755 when using clear text authentication.</P
2757 ><TABLE
2758 BORDER="0"
2759 BGCOLOR="#E0E0E0"
2760 WIDTH="100%"
2761 ><TR
2762 ><TD
2763 ><PRE
2764 CLASS="PROGRAMLISTING"
2765 > <A
2766 HREF="smb.conf.5.html#PASSWORDLEVEL"
2767 TARGET="_top"
2768 >passsword level</A
2769 > = <TT
2770 CLASS="REPLACEABLE"
2772 >integer</I
2773 ></TT
2776 HREF="smb.conf.5.html#USERNAMELEVEL"
2777 TARGET="_top"
2778 >username level</A
2779 > = <TT
2780 CLASS="REPLACEABLE"
2782 >integer</I
2783 ></TT
2784 ></PRE
2785 ></TD
2786 ></TR
2787 ></TABLE
2788 ></P
2790 >By default Samba will lower case the username before attempting
2791 to lookup the user in the database of local system accounts.
2792 Because UNIX usernames conventionally only contain lower case
2793 character, the <TT
2794 CLASS="PARAMETER"
2796 >username level</I
2797 ></TT
2798 > parameter
2799 is rarely even needed.</P
2801 >However, password on UNIX systems often make use of mixed case
2802 characters. This means that in order for a user on a Windows 9x
2803 client to connect to a Samba server using clear text authentication,
2804 the <TT
2805 CLASS="PARAMETER"
2807 >password level</I
2808 ></TT
2809 > must be set to the maximum
2810 number of upper case letter which <EM
2811 >could</EM
2812 > appear
2813 is a password. Note that is the server OS uses the traditional
2814 DES version of crypt(), then a <TT
2815 CLASS="PARAMETER"
2817 >password level</I
2818 ></TT
2820 of 8 will result in case insensitive passwords as seen from Windows
2821 users. This will also result in longer login times as Samba
2822 hash to compute the permutations of the password string and
2823 try them one by one until a match is located (or all combinations fail).</P
2825 >The best option to adopt is to enable support for encrypted passwords
2826 where ever Samba is used. There are three configuration possibilities
2827 for support of encrypted passwords:</P
2828 ><DIV
2829 CLASS="SECT2"
2830 ><HR><H2
2831 CLASS="SECT2"
2833 NAME="AEN394"
2834 >2.5.1. Use MS Windows NT as an authentication server</A
2835 ></H2
2837 >This method involves the additions of the following parameters
2838 in the smb.conf file:</P
2840 ><TABLE
2841 BORDER="0"
2842 BGCOLOR="#E0E0E0"
2843 WIDTH="100%"
2844 ><TR
2845 ><TD
2846 ><PRE
2847 CLASS="PROGRAMLISTING"
2848 > encrypt passwords = Yes
2849 security = server
2850 password server = "NetBIOS_name_of_PDC"</PRE
2851 ></TD
2852 ></TR
2853 ></TABLE
2854 ></P
2856 >There are two ways of identifying whether or not a username and
2857 password pair was valid or not. One uses the reply information provided
2858 as part of the authentication messaging process, the other uses
2859 just and error code.</P
2861 >The down-side of this mode of configuration is the fact that
2862 for security reasons Samba will send the password server a bogus
2863 username and a bogus password and if the remote server fails to
2864 reject the username and password pair then an alternative mode
2865 of identification of validation is used. Where a site uses password
2866 lock out after a certain number of failed authentication attempts
2867 this will result in user lockouts.</P
2869 >Use of this mode of authentication does require there to be
2870 a standard Unix account for the user, this account can be blocked
2871 to prevent logons by other than MS Windows clients.</P
2872 ></DIV
2873 ><DIV
2874 CLASS="SECT2"
2875 ><HR><H2
2876 CLASS="SECT2"
2878 NAME="AEN402"
2879 >2.5.2. Make Samba a member of an MS Windows NT security domain</A
2880 ></H2
2882 >This method involves additon of the following paramters in the smb.conf file:</P
2884 ><TABLE
2885 BORDER="0"
2886 BGCOLOR="#E0E0E0"
2887 WIDTH="100%"
2888 ><TR
2889 ><TD
2890 ><PRE
2891 CLASS="PROGRAMLISTING"
2892 > encrypt passwords = Yes
2893 security = domain
2894 workgroup = "name of NT domain"
2895 password server = *</PRE
2896 ></TD
2897 ></TR
2898 ></TABLE
2899 ></P
2901 >The use of the "*" argument to "password server" will cause samba
2902 to locate the domain controller in a way analogous to the way
2903 this is done within MS Windows NT.</P
2905 >In order for this method to work the Samba server needs to join the
2906 MS Windows NT security domain. This is done as follows:</P
2908 ></P
2909 ><UL
2910 ><LI
2912 >On the MS Windows NT domain controller using
2913 the Server Manager add a machine account for the Samba server.
2915 ></LI
2916 ><LI
2918 >Next, on the Linux system execute:
2920 CLASS="COMMAND"
2921 >smbpasswd -r PDC_NAME -j DOMAIN_NAME</B
2924 ></LI
2925 ></UL
2927 >Use of this mode of authentication does require there to be
2928 a standard Unix account for the user in order to assign
2929 a uid once the account has been authenticated by the remote
2930 Windows DC. This account can be blocked to prevent logons by
2931 other than MS Windows clients by things such as setting an invalid
2932 shell in the <TT
2933 CLASS="FILENAME"
2934 >/etc/passwd</TT
2935 > entry.</P
2937 >An alternative to assigning UIDs to Windows users on a
2938 Samba member server is presented in the <A
2939 HREF="winbind.html"
2940 TARGET="_top"
2941 >Winbind Overview</A
2942 > chapter in
2943 this HOWTO collection.</P
2944 ></DIV
2945 ><DIV
2946 CLASS="SECT2"
2947 ><HR><H2
2948 CLASS="SECT2"
2950 NAME="AEN419"
2951 >2.5.3. Configure Samba as an authentication server</A
2952 ></H2
2954 >This mode of authentication demands that there be on the
2955 Unix/Linux system both a Unix style account as well as and
2956 smbpasswd entry for the user. The Unix system account can be
2957 locked if required as only the encrypted password will be
2958 used for SMB client authentication.</P
2960 >This method involves addition of the following parameters to
2961 the smb.conf file:</P
2963 ><TABLE
2964 BORDER="0"
2965 BGCOLOR="#E0E0E0"
2966 WIDTH="100%"
2967 ><TR
2968 ><TD
2969 ><PRE
2970 CLASS="PROGRAMLISTING"
2971 >## please refer to the Samba PDC HOWTO chapter later in
2972 ## this collection for more details
2973 [global]
2974 encrypt passwords = Yes
2975 security = user
2976 domain logons = Yes
2977 ; an OS level of 33 or more is recommended
2978 os level = 33
2980 [NETLOGON]
2981 path = /somewhare/in/file/system
2982 read only = yes</PRE
2983 ></TD
2984 ></TR
2985 ></TABLE
2986 ></P
2988 >in order for this method to work a Unix system account needs
2989 to be created for each user, as well as for each MS Windows NT/2000
2990 machine. The following structure is required.</P
2991 ><DIV
2992 CLASS="SECT3"
2993 ><HR><H3
2994 CLASS="SECT3"
2996 NAME="AEN426"
2997 >2.5.3.1. Users</A
2998 ></H3
3000 >A user account that may provide a home directory should be
3001 created. The following Linux system commands are typical of
3002 the procedure for creating an account.</P
3004 ><TABLE
3005 BORDER="0"
3006 BGCOLOR="#E0E0E0"
3007 WIDTH="100%"
3008 ><TR
3009 ><TD
3010 ><PRE
3011 CLASS="PROGRAMLISTING"
3012 > # useradd -s /bin/bash -d /home/"userid" -m "userid"
3013 # passwd "userid"
3014 Enter Password: &#60;pw&#62;
3016 # smbpasswd -a "userid"
3017 Enter Password: &#60;pw&#62;</PRE
3018 ></TD
3019 ></TR
3020 ></TABLE
3021 ></P
3022 ></DIV
3023 ><DIV
3024 CLASS="SECT3"
3025 ><HR><H3
3026 CLASS="SECT3"
3028 NAME="AEN431"
3029 >2.5.3.2. MS Windows NT Machine Accounts</A
3030 ></H3
3032 >These are required only when Samba is used as a domain
3033 controller. Refer to the Samba-PDC-HOWTO for more details.</P
3035 ><TABLE
3036 BORDER="0"
3037 BGCOLOR="#E0E0E0"
3038 WIDTH="100%"
3039 ><TR
3040 ><TD
3041 ><PRE
3042 CLASS="PROGRAMLISTING"
3043 > # useradd -s /bin/false -d /dev/null "machine_name"\$
3044 # passwd -l "machine_name"\$
3045 # smbpasswd -a -m "machine_name"</PRE
3046 ></TD
3047 ></TR
3048 ></TABLE
3049 ></P
3050 ></DIV
3051 ></DIV
3052 ></DIV
3053 ><DIV
3054 CLASS="SECT1"
3055 ><HR><H1
3056 CLASS="SECT1"
3058 NAME="AEN436"
3059 >2.6. Conclusions</A
3060 ></H1
3062 >Samba provides a flexible means to operate as...</P
3064 ></P
3065 ><UL
3066 ><LI
3068 >A Stand-alone server - No special action is needed
3069 other than to create user accounts. Stand-alone servers do NOT
3070 provide network logon services, meaning that machines that use this
3071 server do NOT perform a domain logon but instead make use only of
3072 the MS Windows logon which is local to the MS Windows
3073 workstation/server.
3075 ></LI
3076 ><LI
3078 >An MS Windows NT 3.x/4.0 security domain member.
3080 ></LI
3081 ><LI
3083 >An alternative to an MS Windows NT 3.x/4.0
3084 Domain Controller.
3086 ></LI
3087 ></UL
3088 ></DIV
3089 ></DIV
3090 ><DIV
3091 CLASS="CHAPTER"
3092 ><HR><H1
3094 NAME="PAM"
3095 >Chapter 3. Configuring PAM for distributed but centrally
3096 managed authentication</A
3097 ></H1
3098 ><DIV
3099 CLASS="SECT1"
3100 ><H1
3101 CLASS="SECT1"
3103 NAME="AEN457"
3104 >3.1. Samba and PAM</A
3105 ></H1
3107 >A number of Unix systems (eg: Sun Solaris), as well as the
3108 xxxxBSD family and Linux, now utilize the Pluggable Authentication
3109 Modules (PAM) facility to provide all authentication,
3110 authorization and resource control services. Prior to the
3111 introduction of PAM, a decision to use an alternative to
3112 the system password database (<TT
3113 CLASS="FILENAME"
3114 >/etc/passwd</TT
3116 would require the provision of alternatives for all programs that provide
3117 security services. Such a choice would involve provision of
3118 alternatives to such programs as: <B
3119 CLASS="COMMAND"
3120 >login</B
3123 CLASS="COMMAND"
3124 >passwd</B
3125 >, <B
3126 CLASS="COMMAND"
3127 >chown</B
3128 >, etc.</P
3130 >PAM provides a mechanism that disconnects these security programs
3131 from the underlying authentication/authorization infrastructure.
3132 PAM is configured either through one file <TT
3133 CLASS="FILENAME"
3134 >/etc/pam.conf</TT
3135 > (Solaris),
3136 or by editing individual files that are located in <TT
3137 CLASS="FILENAME"
3138 >/etc/pam.d</TT
3139 >.</P
3141 >The following is an example <TT
3142 CLASS="FILENAME"
3143 >/etc/pam.d/login</TT
3144 > configuration file.
3145 This example had all options been uncommented is probably not usable
3146 as it stacks many conditions before allowing successful completion
3147 of the login process. Essentially all conditions can be disabled
3148 by commenting them out except the calls to <TT
3149 CLASS="FILENAME"
3150 >pam_pwdb.so</TT
3151 >.</P
3153 ><TABLE
3154 BORDER="0"
3155 BGCOLOR="#E0E0E0"
3156 WIDTH="100%"
3157 ><TR
3158 ><TD
3159 ><PRE
3160 CLASS="PROGRAMLISTING"
3161 >#%PAM-1.0
3162 # The PAM configuration file for the `login' service
3164 auth required pam_securetty.so
3165 auth required pam_nologin.so
3166 # auth required pam_dialup.so
3167 # auth optional pam_mail.so
3168 auth required pam_pwdb.so shadow md5
3169 # account requisite pam_time.so
3170 account required pam_pwdb.so
3171 session required pam_pwdb.so
3172 # session optional pam_lastlog.so
3173 # password required pam_cracklib.so retry=3
3174 password required pam_pwdb.so shadow md5</PRE
3175 ></TD
3176 ></TR
3177 ></TABLE
3178 ></P
3180 >PAM allows use of replacable modules. Those available on a
3181 sample system include:</P
3183 ><TABLE
3184 BORDER="0"
3185 BGCOLOR="#E0E0E0"
3186 WIDTH="100%"
3187 ><TR
3188 ><TD
3189 ><PRE
3190 CLASS="PROGRAMLISTING"
3191 >$ /bin/ls /lib/security
3192 pam_access.so pam_ftp.so pam_limits.so
3193 pam_ncp_auth.so pam_rhosts_auth.so pam_stress.so
3194 pam_cracklib.so pam_group.so pam_listfile.so
3195 pam_nologin.so pam_rootok.so pam_tally.so
3196 pam_deny.so pam_issue.so pam_mail.so
3197 pam_permit.so pam_securetty.so pam_time.so
3198 pam_dialup.so pam_lastlog.so pam_mkhomedir.so
3199 pam_pwdb.so pam_shells.so pam_unix.so
3200 pam_env.so pam_ldap.so pam_motd.so
3201 pam_radius.so pam_smbpass.so pam_unix_acct.so
3202 pam_wheel.so pam_unix_auth.so pam_unix_passwd.so
3203 pam_userdb.so pam_warn.so pam_unix_session.so</PRE
3204 ></TD
3205 ></TR
3206 ></TABLE
3207 ></P
3209 >The following example for the login program replaces the use of
3210 the <TT
3211 CLASS="FILENAME"
3212 >pam_pwdb.so</TT
3213 > module which uses the system
3214 password database (<TT
3215 CLASS="FILENAME"
3216 >/etc/passwd</TT
3219 CLASS="FILENAME"
3220 >/etc/shadow</TT
3221 >, <TT
3222 CLASS="FILENAME"
3223 >/etc/group</TT
3224 >) with
3225 the module <TT
3226 CLASS="FILENAME"
3227 >pam_smbpass.so</TT
3228 > which uses the Samba
3229 database which contains the Microsoft MD4 encrypted password
3230 hashes. This database is stored in either
3232 CLASS="FILENAME"
3233 >/usr/local/samba/private/smbpasswd</TT
3236 CLASS="FILENAME"
3237 >/etc/samba/smbpasswd</TT
3238 >, or in
3240 CLASS="FILENAME"
3241 >/etc/samba.d/smbpasswd</TT
3242 >, depending on the
3243 Samba implementation for your Unix/Linux system. The
3245 CLASS="FILENAME"
3246 >pam_smbpass.so</TT
3247 > module is provided by
3248 Samba version 2.2.1 or later. It can be compiled by specifying the
3250 CLASS="COMMAND"
3251 >--with-pam_smbpass</B
3252 > options when running Samba's
3254 CLASS="FILENAME"
3255 >configure</TT
3256 > script. For more information
3257 on the <TT
3258 CLASS="FILENAME"
3259 >pam_smbpass</TT
3260 > module, see the documentation
3261 in the <TT
3262 CLASS="FILENAME"
3263 >source/pam_smbpass</TT
3264 > directory of the Samba
3265 source distribution.</P
3267 ><TABLE
3268 BORDER="0"
3269 BGCOLOR="#E0E0E0"
3270 WIDTH="100%"
3271 ><TR
3272 ><TD
3273 ><PRE
3274 CLASS="PROGRAMLISTING"
3275 >#%PAM-1.0
3276 # The PAM configuration file for the `login' service
3278 auth required pam_smbpass.so nodelay
3279 account required pam_smbpass.so nodelay
3280 session required pam_smbpass.so nodelay
3281 password required pam_smbpass.so nodelay</PRE
3282 ></TD
3283 ></TR
3284 ></TABLE
3285 ></P
3287 >The following is the PAM configuration file for a particular
3288 Linux system. The default condition uses <TT
3289 CLASS="FILENAME"
3290 >pam_pwdb.so</TT
3291 >.</P
3293 ><TABLE
3294 BORDER="0"
3295 BGCOLOR="#E0E0E0"
3296 WIDTH="100%"
3297 ><TR
3298 ><TD
3299 ><PRE
3300 CLASS="PROGRAMLISTING"
3301 >#%PAM-1.0
3302 # The PAM configuration file for the `samba' service
3304 auth required /lib/security/pam_pwdb.so nullok nodelay shadow audit
3305 account required /lib/security/pam_pwdb.so audit nodelay
3306 session required /lib/security/pam_pwdb.so nodelay
3307 password required /lib/security/pam_pwdb.so shadow md5</PRE
3308 ></TD
3309 ></TR
3310 ></TABLE
3311 ></P
3313 >In the following example the decision has been made to use the
3314 smbpasswd database even for basic samba authentication. Such a
3315 decision could also be made for the passwd program and would
3316 thus allow the smbpasswd passwords to be changed using the passwd
3317 program.</P
3319 ><TABLE
3320 BORDER="0"
3321 BGCOLOR="#E0E0E0"
3322 WIDTH="100%"
3323 ><TR
3324 ><TD
3325 ><PRE
3326 CLASS="PROGRAMLISTING"
3327 >#%PAM-1.0
3328 # The PAM configuration file for the `samba' service
3330 auth required /lib/security/pam_smbpass.so nodelay
3331 account required /lib/security/pam_pwdb.so audit nodelay
3332 session required /lib/security/pam_pwdb.so nodelay
3333 password required /lib/security/pam_smbpass.so nodelay smbconf=/etc/samba.d/smb.conf</PRE
3334 ></TD
3335 ></TR
3336 ></TABLE
3337 ></P
3339 >Note: PAM allows stacking of authentication mechanisms. It is
3340 also possible to pass information obtained within on PAM module through
3341 to the next module in the PAM stack. Please refer to the documentation for
3342 your particular system implementation for details regarding the specific
3343 capabilities of PAM in this environment. Some Linux implmentations also
3344 provide the <TT
3345 CLASS="FILENAME"
3346 >pam_stack.so</TT
3347 > module that allows all
3348 authentication to be configured in a single central file. The
3350 CLASS="FILENAME"
3351 >pam_stack.so</TT
3352 > method has some very devoted followers
3353 on the basis that it allows for easier administration. As with all issues in
3354 life though, every decision makes trade-offs, so you may want examine the
3355 PAM documentation for further helpful information.</P
3356 ></DIV
3357 ><DIV
3358 CLASS="SECT1"
3359 ><HR><H1
3360 CLASS="SECT1"
3362 NAME="AEN501"
3363 >3.2. Distributed Authentication</A
3364 ></H1
3366 >The astute administrator will realize from this that the
3367 combination of <TT
3368 CLASS="FILENAME"
3369 >pam_smbpass.so</TT
3372 CLASS="COMMAND"
3373 >winbindd</B
3374 >, and <B
3375 CLASS="COMMAND"
3376 >rsync</B
3377 > (see
3379 HREF="http://rsync.samba.org/"
3380 TARGET="_top"
3381 >http://rsync.samba.org/</A
3383 will allow the establishment of a centrally managed, distributed
3384 user/password database that can also be used by all
3385 PAM (eg: Linux) aware programs and applications. This arrangement
3386 can have particularly potent advantages compared with the
3387 use of Microsoft Active Directory Service (ADS) in so far as
3388 reduction of wide area network authentication traffic.</P
3389 ></DIV
3390 ><DIV
3391 CLASS="SECT1"
3392 ><HR><H1
3393 CLASS="SECT1"
3395 NAME="AEN508"
3396 >3.3. PAM Configuration in smb.conf</A
3397 ></H1
3399 >There is an option in smb.conf called <A
3400 HREF="smb.conf.5.html#OBEYPAMRESTRICTIONS"
3401 TARGET="_top"
3402 >obey pam restrictions</A
3404 The following is from the on-line help for this option in SWAT;</P
3406 >When Samba 2.2 is configure to enable PAM support (i.e.
3408 CLASS="CONSTANT"
3409 >--with-pam</TT
3410 >), this parameter will
3411 control whether or not Samba should obey PAM's account
3412 and session management directives. The default behavior
3413 is to use PAM for clear text authentication only and to
3414 ignore any account or session management. Note that Samba always
3415 ignores PAM for authentication in the case of
3417 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
3418 TARGET="_top"
3419 >encrypt passwords = yes</A
3421 The reason is that PAM modules cannot support the challenge/response
3422 authentication mechanism needed in the presence of SMB
3423 password encryption. </P
3425 >Default: <B
3426 CLASS="COMMAND"
3427 >obey pam restrictions = no</B
3428 ></P
3429 ></DIV
3430 ></DIV
3431 ><DIV
3432 CLASS="CHAPTER"
3433 ><HR><H1
3435 NAME="MSDFS"
3436 >Chapter 4. Hosting a Microsoft Distributed File System tree on Samba</A
3437 ></H1
3438 ><DIV
3439 CLASS="SECT1"
3440 ><H1
3441 CLASS="SECT1"
3443 NAME="AEN528"
3444 >4.1. Instructions</A
3445 ></H1
3447 >The Distributed File System (or Dfs) provides a means of
3448 separating the logical view of files and directories that users
3449 see from the actual physical locations of these resources on the
3450 network. It allows for higher availability, smoother storage expansion,
3451 load balancing etc. For more information about Dfs, refer to <A
3452 HREF="http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp"
3453 TARGET="_top"
3454 > Microsoft documentation</A
3455 >. </P
3457 >This document explains how to host a Dfs tree on a Unix
3458 machine (for Dfs-aware clients to browse) using Samba.</P
3460 >To enable SMB-based DFS for Samba, configure it with the
3462 CLASS="PARAMETER"
3464 >--with-msdfs</I
3465 ></TT
3466 > option. Once built, a
3467 Samba server can be made a Dfs server by setting the global
3468 boolean <A
3469 HREF="smb.conf.5.html#HOSTMSDFS"
3470 TARGET="_top"
3471 ><TT
3472 CLASS="PARAMETER"
3474 > host msdfs</I
3475 ></TT
3476 ></A
3477 > parameter in the <TT
3478 CLASS="FILENAME"
3479 >smb.conf
3480 </TT
3481 > file. You designate a share as a Dfs root using the share
3482 level boolean <A
3483 HREF="smb.conf.5.html#MSDFSROOT"
3484 TARGET="_top"
3485 ><TT
3486 CLASS="PARAMETER"
3488 > msdfs root</I
3489 ></TT
3490 ></A
3491 > parameter. A Dfs root directory on
3492 Samba hosts Dfs links in the form of symbolic links that point
3493 to other servers. For example, a symbolic link
3495 CLASS="FILENAME"
3496 >junction-&#62;msdfs:storage1\share1</TT
3497 > in
3498 the share directory acts as the Dfs junction. When Dfs-aware
3499 clients attempt to access the junction link, they are redirected
3500 to the storage location (in this case, \\storage1\share1).</P
3502 >Dfs trees on Samba work with all Dfs-aware clients ranging
3503 from Windows 95 to 2000.</P
3505 >Here's an example of setting up a Dfs tree on a Samba
3506 server.</P
3508 ><TABLE
3509 BORDER="0"
3510 BGCOLOR="#E0E0E0"
3511 WIDTH="100%"
3512 ><TR
3513 ><TD
3514 ><PRE
3515 CLASS="PROGRAMLISTING"
3516 ># The smb.conf file:
3517 [global]
3518 netbios name = SAMBA
3519 host msdfs = yes
3521 [dfs]
3522 path = /export/dfsroot
3523 msdfs root = yes
3524 </PRE
3525 ></TD
3526 ></TR
3527 ></TABLE
3528 ></P
3530 >In the /export/dfsroot directory we set up our dfs links to
3531 other servers on the network.</P
3533 ><TT
3534 CLASS="PROMPT"
3535 >root# </TT
3536 ><TT
3537 CLASS="USERINPUT"
3539 >cd /export/dfsroot</B
3540 ></TT
3541 ></P
3543 ><TT
3544 CLASS="PROMPT"
3545 >root# </TT
3546 ><TT
3547 CLASS="USERINPUT"
3549 >chown root /export/dfsroot</B
3550 ></TT
3551 ></P
3553 ><TT
3554 CLASS="PROMPT"
3555 >root# </TT
3556 ><TT
3557 CLASS="USERINPUT"
3559 >chmod 755 /export/dfsroot</B
3560 ></TT
3561 ></P
3563 ><TT
3564 CLASS="PROMPT"
3565 >root# </TT
3566 ><TT
3567 CLASS="USERINPUT"
3569 >ln -s msdfs:storageA\\shareA linka</B
3570 ></TT
3571 ></P
3573 ><TT
3574 CLASS="PROMPT"
3575 >root# </TT
3576 ><TT
3577 CLASS="USERINPUT"
3579 >ln -s msdfs:serverB\\share,serverC\\share linkb</B
3580 ></TT
3581 ></P
3583 >You should set up the permissions and ownership of
3584 the directory acting as the Dfs root such that only designated
3585 users can create, delete or modify the msdfs links. Also note
3586 that symlink names should be all lowercase. This limitation exists
3587 to have Samba avoid trying all the case combinations to get at
3588 the link name. Finally set up the symbolic links to point to the
3589 network shares you want, and start Samba.</P
3591 >Users on Dfs-aware clients can now browse the Dfs tree
3592 on the Samba server at \\samba\dfs. Accessing
3593 links linka or linkb (which appear as directories to the client)
3594 takes users directly to the appropriate shares on the network.</P
3595 ><DIV
3596 CLASS="SECT2"
3597 ><HR><H2
3598 CLASS="SECT2"
3600 NAME="AEN563"
3601 >4.1.1. Notes</A
3602 ></H2
3604 ></P
3605 ><UL
3606 ><LI
3608 >Windows clients need to be rebooted
3609 if a previously mounted non-dfs share is made a dfs
3610 root or vice versa. A better way is to introduce a
3611 new share and make it the dfs root.</P
3612 ></LI
3613 ><LI
3615 >Currently there's a restriction that msdfs
3616 symlink names should all be lowercase.</P
3617 ></LI
3618 ><LI
3620 >For security purposes, the directory
3621 acting as the root of the Dfs tree should have ownership
3622 and permissions set so that only designated users can
3623 modify the symbolic links in the directory.</P
3624 ></LI
3625 ></UL
3626 ></DIV
3627 ></DIV
3628 ></DIV
3629 ><DIV
3630 CLASS="CHAPTER"
3631 ><HR><H1
3633 NAME="UNIX-PERMISSIONS"
3634 >Chapter 5. UNIX Permission Bits and Windows NT Access Control Lists</A
3635 ></H1
3636 ><DIV
3637 CLASS="SECT1"
3638 ><H1
3639 CLASS="SECT1"
3641 NAME="AEN583"
3642 >5.1. Viewing and changing UNIX permissions using the NT
3643 security dialogs</A
3644 ></H1
3646 >New in the Samba 2.0.4 release is the ability for Windows
3647 NT clients to use their native security settings dialog box to
3648 view and modify the underlying UNIX permissions.</P
3650 >Note that this ability is careful not to compromise
3651 the security of the UNIX host Samba is running on, and
3652 still obeys all the file permission rules that a Samba
3653 administrator can set.</P
3655 >In Samba 2.0.4 and above the default value of the
3656 parameter <A
3657 HREF="smb.conf.5.html#NTACLSUPPORT"
3658 TARGET="_top"
3659 ><TT
3660 CLASS="PARAMETER"
3662 > nt acl support</I
3663 ></TT
3664 ></A
3665 > has been changed from
3667 CLASS="CONSTANT"
3668 >false</TT
3669 > to <TT
3670 CLASS="CONSTANT"
3671 >true</TT
3672 >, so
3673 manipulation of permissions is turned on by default.</P
3674 ></DIV
3675 ><DIV
3676 CLASS="SECT1"
3677 ><HR><H1
3678 CLASS="SECT1"
3680 NAME="AEN592"
3681 >5.2. How to view file security on a Samba share</A
3682 ></H1
3684 >From an NT 4.0 client, single-click with the right
3685 mouse button on any file or directory in a Samba mounted
3686 drive letter or UNC path. When the menu pops-up, click
3687 on the <EM
3688 >Properties</EM
3689 > entry at the bottom of
3690 the menu. This brings up the normal file properties dialog
3691 box, but with Samba 2.0.4 this will have a new tab along the top
3692 marked <EM
3693 >Security</EM
3694 >. Click on this tab and you
3695 will see three buttons, <EM
3696 >Permissions</EM
3699 >Auditing</EM
3700 >, and <EM
3701 >Ownership</EM
3703 The <EM
3704 >Auditing</EM
3705 > button will cause either
3706 an error message <SPAN
3707 CLASS="ERRORNAME"
3708 >A requested privilege is not held
3709 by the client</SPAN
3710 > to appear if the user is not the
3711 NT Administrator, or a dialog which is intended to allow an
3712 Administrator to add auditing requirements to a file if the
3713 user is logged on as the NT Administrator. This dialog is
3714 non-functional with a Samba share at this time, as the only
3715 useful button, the <B
3716 CLASS="COMMAND"
3717 >Add</B
3718 > button will not currently
3719 allow a list of users to be seen.</P
3720 ></DIV
3721 ><DIV
3722 CLASS="SECT1"
3723 ><HR><H1
3724 CLASS="SECT1"
3726 NAME="AEN603"
3727 >5.3. Viewing file ownership</A
3728 ></H1
3730 >Clicking on the <B
3731 CLASS="COMMAND"
3732 >"Ownership"</B
3733 > button
3734 brings up a dialog box telling you who owns the given file. The
3735 owner name will be of the form :</P
3738 CLASS="COMMAND"
3739 >"SERVER\user (Long name)"</B
3740 ></P
3742 >Where <TT
3743 CLASS="REPLACEABLE"
3745 >SERVER</I
3746 ></TT
3747 > is the NetBIOS name of
3748 the Samba server, <TT
3749 CLASS="REPLACEABLE"
3751 >user</I
3752 ></TT
3753 > is the user name of
3754 the UNIX user who owns the file, and <TT
3755 CLASS="REPLACEABLE"
3757 >(Long name)</I
3758 ></TT
3760 is the descriptive string identifying the user (normally found in the
3761 GECOS field of the UNIX password database). Click on the <B
3762 CLASS="COMMAND"
3763 >Close
3765 > button to remove this dialog.</P
3767 >If the parameter <TT
3768 CLASS="PARAMETER"
3770 >nt acl support</I
3771 ></TT
3773 is set to <TT
3774 CLASS="CONSTANT"
3775 >false</TT
3776 > then the file owner will
3777 be shown as the NT user <B
3778 CLASS="COMMAND"
3779 >"Everyone"</B
3780 >.</P
3782 >The <B
3783 CLASS="COMMAND"
3784 >Take Ownership</B
3785 > button will not allow
3786 you to change the ownership of this file to yourself (clicking on
3787 it will display a dialog box complaining that the user you are
3788 currently logged onto the NT client cannot be found). The reason
3789 for this is that changing the ownership of a file is a privileged
3790 operation in UNIX, available only to the <EM
3791 >root</EM
3793 user. As clicking on this button causes NT to attempt to change
3794 the ownership of a file to the current user logged into the NT
3795 client this will not work with Samba at this time.</P
3797 >There is an NT chown command that will work with Samba
3798 and allow a user with Administrator privilege connected
3799 to a Samba 2.0.4 server as root to change the ownership of
3800 files on both a local NTFS filesystem or remote mounted NTFS
3801 or Samba drive. This is available as part of the <EM
3802 >Seclib
3803 </EM
3804 > NT security library written by Jeremy Allison of
3805 the Samba Team, available from the main Samba ftp site.</P
3806 ></DIV
3807 ><DIV
3808 CLASS="SECT1"
3809 ><HR><H1
3810 CLASS="SECT1"
3812 NAME="AEN623"
3813 >5.4. Viewing file or directory permissions</A
3814 ></H1
3816 >The third button is the <B
3817 CLASS="COMMAND"
3818 >"Permissions"</B
3820 button. Clicking on this brings up a dialog box that shows both
3821 the permissions and the UNIX owner of the file or directory.
3822 The owner is displayed in the form :</P
3825 CLASS="COMMAND"
3826 >"SERVER\user (Long name)"</B
3827 ></P
3829 >Where <TT
3830 CLASS="REPLACEABLE"
3832 >SERVER</I
3833 ></TT
3834 > is the NetBIOS name of
3835 the Samba server, <TT
3836 CLASS="REPLACEABLE"
3838 >user</I
3839 ></TT
3840 > is the user name of
3841 the UNIX user who owns the file, and <TT
3842 CLASS="REPLACEABLE"
3844 >(Long name)</I
3845 ></TT
3847 is the descriptive string identifying the user (normally found in the
3848 GECOS field of the UNIX password database).</P
3850 >If the parameter <TT
3851 CLASS="PARAMETER"
3853 >nt acl support</I
3854 ></TT
3856 is set to <TT
3857 CLASS="CONSTANT"
3858 >false</TT
3859 > then the file owner will
3860 be shown as the NT user <B
3861 CLASS="COMMAND"
3862 >"Everyone"</B
3863 > and the
3864 permissions will be shown as NT "Full Control".</P
3866 >The permissions field is displayed differently for files
3867 and directories, so I'll describe the way file permissions
3868 are displayed first.</P
3869 ><DIV
3870 CLASS="SECT2"
3871 ><HR><H2
3872 CLASS="SECT2"
3874 NAME="AEN638"
3875 >5.4.1. File Permissions</A
3876 ></H2
3878 >The standard UNIX user/group/world triple and
3879 the corresponding "read", "write", "execute" permissions
3880 triples are mapped by Samba into a three element NT ACL
3881 with the 'r', 'w', and 'x' bits mapped into the corresponding
3882 NT permissions. The UNIX world permissions are mapped into
3883 the global NT group <B
3884 CLASS="COMMAND"
3885 >Everyone</B
3886 >, followed
3887 by the list of permissions allowed for UNIX world. The UNIX
3888 owner and group permissions are displayed as an NT
3890 CLASS="COMMAND"
3891 >user</B
3892 > icon and an NT <B
3893 CLASS="COMMAND"
3894 >local
3895 group</B
3896 > icon respectively followed by the list
3897 of permissions allowed for the UNIX user and group.</P
3899 >As many UNIX permission sets don't map into common
3900 NT names such as <B
3901 CLASS="COMMAND"
3902 >"read"</B
3903 >, <B
3904 CLASS="COMMAND"
3905 > "change"</B
3906 > or <B
3907 CLASS="COMMAND"
3908 >"full control"</B
3909 > then
3910 usually the permissions will be prefixed by the words <B
3911 CLASS="COMMAND"
3912 > "Special Access"</B
3913 > in the NT display list.</P
3915 >But what happens if the file has no permissions allowed
3916 for a particular UNIX user group or world component ? In order
3917 to allow "no permissions" to be seen and modified then Samba
3918 overloads the NT <B
3919 CLASS="COMMAND"
3920 >"Take Ownership"</B
3921 > ACL attribute
3922 (which has no meaning in UNIX) and reports a component with
3923 no permissions as having the NT <B
3924 CLASS="COMMAND"
3925 >"O"</B
3926 > bit set.
3927 This was chosen of course to make it look like a zero, meaning
3928 zero permissions. More details on the decision behind this will
3929 be given below.</P
3930 ></DIV
3931 ><DIV
3932 CLASS="SECT2"
3933 ><HR><H2
3934 CLASS="SECT2"
3936 NAME="AEN652"
3937 >5.4.2. Directory Permissions</A
3938 ></H2
3940 >Directories on an NT NTFS file system have two
3941 different sets of permissions. The first set of permissions
3942 is the ACL set on the directory itself, this is usually displayed
3943 in the first set of parentheses in the normal <B
3944 CLASS="COMMAND"
3945 >"RW"</B
3947 NT style. This first set of permissions is created by Samba in
3948 exactly the same way as normal file permissions are, described
3949 above, and is displayed in the same way.</P
3951 >The second set of directory permissions has no real meaning
3952 in the UNIX permissions world and represents the <B
3953 CLASS="COMMAND"
3954 > "inherited"</B
3955 > permissions that any file created within
3956 this directory would inherit.</P
3958 >Samba synthesises these inherited permissions for NT by
3959 returning as an NT ACL the UNIX permission mode that a new file
3960 created by Samba on this share would receive.</P
3961 ></DIV
3962 ></DIV
3963 ><DIV
3964 CLASS="SECT1"
3965 ><HR><H1
3966 CLASS="SECT1"
3968 NAME="AEN659"
3969 >5.5. Modifying file or directory permissions</A
3970 ></H1
3972 >Modifying file and directory permissions is as simple
3973 as changing the displayed permissions in the dialog box, and
3974 clicking the <B
3975 CLASS="COMMAND"
3976 >OK</B
3977 > button. However, there are
3978 limitations that a user needs to be aware of, and also interactions
3979 with the standard Samba permission masks and mapping of DOS
3980 attributes that need to also be taken into account.</P
3982 >If the parameter <TT
3983 CLASS="PARAMETER"
3985 >nt acl support</I
3986 ></TT
3988 is set to <TT
3989 CLASS="CONSTANT"
3990 >false</TT
3991 > then any attempt to set
3992 security permissions will fail with an <B
3993 CLASS="COMMAND"
3994 >"Access Denied"
3996 > message.</P
3998 >The first thing to note is that the <B
3999 CLASS="COMMAND"
4000 >"Add"</B
4002 button will not return a list of users in Samba 2.0.4 (it will give
4003 an error message of <B
4004 CLASS="COMMAND"
4005 >"The remote procedure call failed
4006 and did not execute"</B
4007 >). This means that you can only
4008 manipulate the current user/group/world permissions listed in
4009 the dialog box. This actually works quite well as these are the
4010 only permissions that UNIX actually has.</P
4012 >If a permission triple (either user, group, or world)
4013 is removed from the list of permissions in the NT dialog box,
4014 then when the <B
4015 CLASS="COMMAND"
4016 >"OK"</B
4017 > button is pressed it will
4018 be applied as "no permissions" on the UNIX side. If you then
4019 view the permissions again the "no permissions" entry will appear
4020 as the NT <B
4021 CLASS="COMMAND"
4022 >"O"</B
4023 > flag, as described above. This
4024 allows you to add permissions back to a file or directory once
4025 you have removed them from a triple component.</P
4027 >As UNIX supports only the "r", "w" and "x" bits of
4028 an NT ACL then if other NT security attributes such as "Delete
4029 access" are selected then they will be ignored when applied on
4030 the Samba server.</P
4032 >When setting permissions on a directory the second
4033 set of permissions (in the second set of parentheses) is
4034 by default applied to all files within that directory. If this
4035 is not what you want you must uncheck the <B
4036 CLASS="COMMAND"
4037 >"Replace
4038 permissions on existing files"</B
4039 > checkbox in the NT
4040 dialog before clicking <B
4041 CLASS="COMMAND"
4042 >"OK"</B
4043 >.</P
4045 >If you wish to remove all permissions from a
4046 user/group/world component then you may either highlight the
4047 component and click the <B
4048 CLASS="COMMAND"
4049 >"Remove"</B
4050 > button,
4051 or set the component to only have the special <B
4052 CLASS="COMMAND"
4053 >"Take
4054 Ownership"</B
4055 > permission (displayed as <B
4056 CLASS="COMMAND"
4057 >"O"
4059 >) highlighted.</P
4060 ></DIV
4061 ><DIV
4062 CLASS="SECT1"
4063 ><HR><H1
4064 CLASS="SECT1"
4066 NAME="AEN681"
4067 >5.6. Interaction with the standard Samba create mask
4068 parameters</A
4069 ></H1
4071 >Note that with Samba 2.0.5 there are four new parameters
4072 to control this interaction. These are :</P
4074 ><TT
4075 CLASS="PARAMETER"
4077 >security mask</I
4078 ></TT
4079 ></P
4081 ><TT
4082 CLASS="PARAMETER"
4084 >force security mode</I
4085 ></TT
4086 ></P
4088 ><TT
4089 CLASS="PARAMETER"
4091 >directory security mask</I
4092 ></TT
4093 ></P
4095 ><TT
4096 CLASS="PARAMETER"
4098 >force directory security mode</I
4099 ></TT
4100 ></P
4102 >Once a user clicks <B
4103 CLASS="COMMAND"
4104 >"OK"</B
4105 > to apply the
4106 permissions Samba maps the given permissions into a user/group/world
4107 r/w/x triple set, and then will check the changed permissions for a
4108 file against the bits set in the <A
4109 HREF="smb.conf.5.html#SECURITYMASK"
4110 TARGET="_top"
4113 CLASS="PARAMETER"
4115 >security mask</I
4116 ></TT
4117 ></A
4118 > parameter. Any bits that
4119 were changed that are not set to '1' in this parameter are left alone
4120 in the file permissions.</P
4122 >Essentially, zero bits in the <TT
4123 CLASS="PARAMETER"
4125 >security mask</I
4126 ></TT
4128 mask may be treated as a set of bits the user is <EM
4129 >not</EM
4131 allowed to change, and one bits are those the user is allowed to change.
4134 >If not set explicitly this parameter is set to the same value as
4135 the <A
4136 HREF="smb.conf.5.html#CREATEMASK"
4137 TARGET="_top"
4138 ><TT
4139 CLASS="PARAMETER"
4141 >create mask
4143 ></TT
4144 ></A
4145 > parameter to provide compatibility with Samba 2.0.4
4146 where this permission change facility was introduced. To allow a user to
4147 modify all the user/group/world permissions on a file, set this parameter
4148 to 0777.</P
4150 >Next Samba checks the changed permissions for a file against
4151 the bits set in the <A
4152 HREF="smb.conf.5.html#FORCESECURITYMODE"
4153 TARGET="_top"
4154 > <TT
4155 CLASS="PARAMETER"
4157 >force security mode</I
4158 ></TT
4159 ></A
4160 > parameter. Any bits
4161 that were changed that correspond to bits set to '1' in this parameter
4162 are forced to be set.</P
4164 >Essentially, bits set in the <TT
4165 CLASS="PARAMETER"
4167 >force security mode
4169 ></TT
4170 > parameter may be treated as a set of bits that, when
4171 modifying security on a file, the user has always set to be 'on'.</P
4173 >If not set explicitly this parameter is set to the same value
4174 as the <A
4175 HREF="smb.conf.5.html#FORCECREATEMODE"
4176 TARGET="_top"
4177 ><TT
4178 CLASS="PARAMETER"
4180 >force
4181 create mode</I
4182 ></TT
4183 ></A
4184 > parameter to provide compatibility
4185 with Samba 2.0.4 where the permission change facility was introduced.
4186 To allow a user to modify all the user/group/world permissions on a file
4187 with no restrictions set this parameter to 000.</P
4189 >The <TT
4190 CLASS="PARAMETER"
4192 >security mask</I
4193 ></TT
4194 > and <TT
4195 CLASS="PARAMETER"
4197 >force
4198 security mode</I
4199 ></TT
4200 > parameters are applied to the change
4201 request in that order.</P
4203 >For a directory Samba will perform the same operations as
4204 described above for a file except using the parameter <TT
4205 CLASS="PARAMETER"
4207 > directory security mask</I
4208 ></TT
4209 > instead of <TT
4210 CLASS="PARAMETER"
4212 >security
4213 mask</I
4214 ></TT
4215 >, and <TT
4216 CLASS="PARAMETER"
4218 >force directory security mode
4220 ></TT
4221 > parameter instead of <TT
4222 CLASS="PARAMETER"
4224 >force security mode
4226 ></TT
4227 >.</P
4229 >The <TT
4230 CLASS="PARAMETER"
4232 >directory security mask</I
4233 ></TT
4234 > parameter
4235 by default is set to the same value as the <TT
4236 CLASS="PARAMETER"
4238 >directory mask
4240 ></TT
4241 > parameter and the <TT
4242 CLASS="PARAMETER"
4244 >force directory security
4245 mode</I
4246 ></TT
4247 > parameter by default is set to the same value as
4248 the <TT
4249 CLASS="PARAMETER"
4251 >force directory mode</I
4252 ></TT
4253 > parameter to provide
4254 compatibility with Samba 2.0.4 where the permission change facility
4255 was introduced.</P
4257 >In this way Samba enforces the permission restrictions that
4258 an administrator can set on a Samba share, whilst still allowing users
4259 to modify the permission bits within that restriction.</P
4261 >If you want to set up a share that allows users full control
4262 in modifying the permission bits on their files and directories and
4263 doesn't force any particular bits to be set 'on', then set the following
4264 parameters in the <A
4265 HREF="smb.conf.5.html"
4266 TARGET="_top"
4267 ><TT
4268 CLASS="FILENAME"
4269 >smb.conf(5)
4270 </TT
4271 ></A
4272 > file in that share specific section :</P
4274 ><TT
4275 CLASS="PARAMETER"
4277 >security mask = 0777</I
4278 ></TT
4279 ></P
4281 ><TT
4282 CLASS="PARAMETER"
4284 >force security mode = 0</I
4285 ></TT
4286 ></P
4288 ><TT
4289 CLASS="PARAMETER"
4291 >directory security mask = 0777</I
4292 ></TT
4293 ></P
4295 ><TT
4296 CLASS="PARAMETER"
4298 >force directory security mode = 0</I
4299 ></TT
4300 ></P
4302 >As described, in Samba 2.0.4 the parameters :</P
4304 ><TT
4305 CLASS="PARAMETER"
4307 >create mask</I
4308 ></TT
4309 ></P
4311 ><TT
4312 CLASS="PARAMETER"
4314 >force create mode</I
4315 ></TT
4316 ></P
4318 ><TT
4319 CLASS="PARAMETER"
4321 >directory mask</I
4322 ></TT
4323 ></P
4325 ><TT
4326 CLASS="PARAMETER"
4328 >force directory mode</I
4329 ></TT
4330 ></P
4332 >were used instead of the parameters discussed here.</P
4333 ></DIV
4334 ><DIV
4335 CLASS="SECT1"
4336 ><HR><H1
4337 CLASS="SECT1"
4339 NAME="AEN745"
4340 >5.7. Interaction with the standard Samba file attribute
4341 mapping</A
4342 ></H1
4344 >Samba maps some of the DOS attribute bits (such as "read
4345 only") into the UNIX permissions of a file. This means there can
4346 be a conflict between the permission bits set via the security
4347 dialog and the permission bits set by the file attribute mapping.
4350 >One way this can show up is if a file has no UNIX read access
4351 for the owner it will show up as "read only" in the standard
4352 file attributes tabbed dialog. Unfortunately this dialog is
4353 the same one that contains the security info in another tab.</P
4355 >What this can mean is that if the owner changes the permissions
4356 to allow themselves read access using the security dialog, clicks
4358 CLASS="COMMAND"
4359 >"OK"</B
4360 > to get back to the standard attributes tab
4361 dialog, and then clicks <B
4362 CLASS="COMMAND"
4363 >"OK"</B
4364 > on that dialog, then
4365 NT will set the file permissions back to read-only (as that is what
4366 the attributes still say in the dialog). This means that after setting
4367 permissions and clicking <B
4368 CLASS="COMMAND"
4369 >"OK"</B
4370 > to get back to the
4371 attributes dialog you should always hit <B
4372 CLASS="COMMAND"
4373 >"Cancel"</B
4375 rather than <B
4376 CLASS="COMMAND"
4377 >"OK"</B
4378 > to ensure that your changes
4379 are not overridden.</P
4380 ></DIV
4381 ></DIV
4382 ><DIV
4383 CLASS="CHAPTER"
4384 ><HR><H1
4386 NAME="PRINTING"
4387 >Chapter 6. Printing Support in Samba 2.2.x</A
4388 ></H1
4389 ><DIV
4390 CLASS="SECT1"
4391 ><H1
4392 CLASS="SECT1"
4394 NAME="AEN766"
4395 >6.1. Introduction</A
4396 ></H1
4398 >Beginning with the 2.2.0 release, Samba supports
4399 the native Windows NT printing mechanisms implemented via
4400 MS-RPC (i.e. the SPOOLSS named pipe). Previous versions of
4401 Samba only supported LanMan printing calls.</P
4403 >The additional functionality provided by the new
4404 SPOOLSS support includes:</P
4406 ></P
4407 ><UL
4408 ><LI
4410 >Support for downloading printer driver
4411 files to Windows 95/98/NT/2000 clients upon demand.
4413 ></LI
4414 ><LI
4416 >Uploading of printer drivers via the
4417 Windows NT Add Printer Wizard (APW) or the
4418 Imprints tool set (refer to <A
4419 HREF="http://imprints.sourceforge.net"
4420 TARGET="_top"
4421 >http://imprints.sourceforge.net</A
4422 >).
4424 ></LI
4425 ><LI
4427 >Support for the native MS-RPC printing
4428 calls such as StartDocPrinter, EnumJobs(), etc... (See
4429 the MSDN documentation at <A
4430 HREF="http://msdn.microsoft.com/"
4431 TARGET="_top"
4432 >http://msdn.microsoft.com/</A
4434 for more information on the Win32 printing API)
4436 ></LI
4437 ><LI
4439 >Support for NT Access Control Lists (ACL)
4440 on printer objects</P
4441 ></LI
4442 ><LI
4444 >Improved support for printer queue manipulation
4445 through the use of an internal databases for spooled job
4446 information</P
4447 ></LI
4448 ></UL
4450 >There has been some initial confusion about what all this means
4451 and whether or not it is a requirement for printer drivers to be
4452 installed on a Samba host in order to support printing from Windows
4453 clients. A bug existed in Samba 2.2.0 which made Windows NT/2000 clients
4454 require that the Samba server possess a valid driver for the printer.
4455 This is fixed in Samba 2.2.1 and once again, Windows NT/2000 clients
4456 can use the local APW for installing drivers to be used with a Samba
4457 served printer. This is the same behavior exhibited by Windows 9x clients.
4458 As a side note, Samba does not use these drivers in any way to process
4459 spooled files. They are utilized entirely by the clients.</P
4461 >The following MS KB article, may be of some help if you are dealing with
4462 Windows 2000 clients: <EM
4463 >How to Add Printers with No User
4464 Interaction in Windows 2000</EM
4465 ></P
4468 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
4469 TARGET="_top"
4470 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
4471 ></P
4472 ></DIV
4473 ><DIV
4474 CLASS="SECT1"
4475 ><HR><H1
4476 CLASS="SECT1"
4478 NAME="AEN788"
4479 >6.2. Configuration</A
4480 ></H1
4481 ><DIV
4482 CLASS="WARNING"
4484 ></P
4485 ><TABLE
4486 CLASS="WARNING"
4487 BORDER="1"
4488 WIDTH="100%"
4489 ><TR
4490 ><TD
4491 ALIGN="CENTER"
4493 >[print$] vs. [printer$]</B
4494 ></TD
4495 ></TR
4496 ><TR
4497 ><TD
4498 ALIGN="LEFT"
4500 >Previous versions of Samba recommended using a share named [printer$].
4501 This name was taken from the printer$ service created by Windows 9x
4502 clients when a printer was shared. Windows 9x printer servers always have
4503 a printer$ service which provides read-only access via no
4504 password in order to support printer driver downloads.</P
4506 >However, the initial implementation allowed for a
4507 parameter named <TT
4508 CLASS="PARAMETER"
4510 >printer driver location</I
4511 ></TT
4513 to be used on a per share basis to specify the location of
4514 the driver files associated with that printer. Another
4515 parameter named <TT
4516 CLASS="PARAMETER"
4518 >printer driver</I
4519 ></TT
4520 > provided
4521 a means of defining the printer driver name to be sent to
4522 the client.</P
4524 >These parameters, including <TT
4525 CLASS="PARAMETER"
4527 >printer driver
4528 file</I
4529 ></TT
4530 > parameter, are being depreciated and should not
4531 be used in new installations. For more information on this change,
4532 you should refer to the <A
4533 HREF="#MIGRATION"
4534 >Migration section</A
4536 of this document.</P
4537 ></TD
4538 ></TR
4539 ></TABLE
4540 ></DIV
4541 ><DIV
4542 CLASS="SECT2"
4543 ><HR><H2
4544 CLASS="SECT2"
4546 NAME="AEN799"
4547 >6.2.1. Creating [print$]</A
4548 ></H2
4550 >In order to support the uploading of printer driver
4551 files, you must first configure a file share named [print$].
4552 The name of this share is hard coded in Samba's internals so
4553 the name is very important (print$ is the service used by
4554 Windows NT print servers to provide support for printer driver
4555 download).</P
4557 >You should modify the server's smb.conf file to add the global
4558 parameters and to create the
4559 following file share (of course, some of the parameter values,
4560 such as 'path' are arbitrary and should be replaced with
4561 appropriate values for your site):</P
4563 ><TABLE
4564 BORDER="0"
4565 BGCOLOR="#E0E0E0"
4566 WIDTH="100%"
4567 ><TR
4568 ><TD
4569 ><PRE
4570 CLASS="PROGRAMLISTING"
4571 >[global]
4572 ; members of the ntadmin group should be able
4573 ; to add drivers and set printer properties
4574 ; root is implicitly a 'printer admin'
4575 printer admin = @ntadmin
4577 [print$]
4578 path = /usr/local/samba/printers
4579 guest ok = yes
4580 browseable = yes
4581 read only = yes
4582 ; since this share is configured as read only, then we need
4583 ; a 'write list'. Check the file system permissions to make
4584 ; sure this account can copy files to the share. If this
4585 ; is setup to a non-root account, then it should also exist
4586 ; as a 'printer admin'
4587 write list = @ntadmin,root</PRE
4588 ></TD
4589 ></TR
4590 ></TABLE
4591 ></P
4593 >The <A
4594 HREF="smb.conf.5.html#WRITELIST"
4595 TARGET="_top"
4596 ><TT
4597 CLASS="PARAMETER"
4599 >write list</I
4600 ></TT
4601 ></A
4602 > is used to allow administrative
4603 level user accounts to have write access in order to update files
4604 on the share. See the <A
4605 HREF="smb.conf.5.html"
4606 TARGET="_top"
4607 >smb.conf(5)
4608 man page</A
4609 > for more information on configuring file shares.</P
4611 >The requirement for <A
4612 HREF="smb.conf.5.html#GUESTOK"
4613 TARGET="_top"
4615 CLASS="COMMAND"
4616 >guest
4617 ok = yes</B
4618 ></A
4619 > depends upon how your
4620 site is configured. If users will be guaranteed to have
4621 an account on the Samba host, then this is a non-issue.</P
4622 ><DIV
4623 CLASS="NOTE"
4624 ><BLOCKQUOTE
4625 CLASS="NOTE"
4628 >Author's Note: </B
4629 >The non-issue is that if all your Windows NT users are guaranteed to be
4630 authenticated by the Samba server (such as a domain member server and the NT
4631 user has already been validated by the Domain Controller in
4632 order to logon to the Windows NT console), then guest access
4633 is not necessary. Of course, in a workgroup environment where
4634 you just want to be able to print without worrying about
4635 silly accounts and security, then configure the share for
4636 guest access. You'll probably want to add <A
4637 HREF="smb.conf.5.html#MAPTOGUEST"
4638 TARGET="_top"
4640 CLASS="COMMAND"
4641 >map to guest = Bad User</B
4642 ></A
4643 > in the [global] section as well. Make sure
4644 you understand what this parameter does before using it
4645 though. --jerry</P
4646 ></BLOCKQUOTE
4647 ></DIV
4649 >In order for a Windows NT print server to support
4650 the downloading of driver files by multiple client architectures,
4651 it must create subdirectories within the [print$] service
4652 which correspond to each of the supported client architectures.
4653 Samba follows this model as well.</P
4655 >Next create the directory tree below the [print$] share
4656 for each architecture you wish to support.</P
4658 ><TABLE
4659 BORDER="0"
4660 BGCOLOR="#E0E0E0"
4661 WIDTH="100%"
4662 ><TR
4663 ><TD
4664 ><PRE
4665 CLASS="PROGRAMLISTING"
4666 >[print$]-----
4667 |-W32X86 ; "Windows NT x86"
4668 |-WIN40 ; "Windows 95/98"
4669 |-W32ALPHA ; "Windows NT Alpha_AXP"
4670 |-W32MIPS ; "Windows NT R4000"
4671 |-W32PPC ; "Windows NT PowerPC"</PRE
4672 ></TD
4673 ></TR
4674 ></TABLE
4675 ></P
4676 ><DIV
4677 CLASS="WARNING"
4679 ></P
4680 ><TABLE
4681 CLASS="WARNING"
4682 BORDER="1"
4683 WIDTH="100%"
4684 ><TR
4685 ><TD
4686 ALIGN="CENTER"
4688 >ATTENTION! REQUIRED PERMISSIONS</B
4689 ></TD
4690 ></TR
4691 ><TR
4692 ><TD
4693 ALIGN="LEFT"
4695 >In order to currently add a new driver to you Samba host,
4696 one of two conditions must hold true:</P
4698 ></P
4699 ><UL
4700 ><LI
4702 >The account used to connect to the Samba host
4703 must have a uid of 0 (i.e. a root account)</P
4704 ></LI
4705 ><LI
4707 >The account used to connect to the Samba host
4708 must be a member of the <A
4709 HREF="smb.conf.5.html#PRINTERADMIN"
4710 TARGET="_top"
4711 ><TT
4712 CLASS="PARAMETER"
4714 >printer
4715 admin</I
4716 ></TT
4717 ></A
4718 > list.</P
4719 ></LI
4720 ></UL
4722 >Of course, the connected account must still possess access
4723 to add files to the subdirectories beneath [print$]. Remember
4724 that all file shares are set to 'read only' by default.</P
4725 ></TD
4726 ></TR
4727 ></TABLE
4728 ></DIV
4730 >Once you have created the required [print$] service and
4731 associated subdirectories, simply log onto the Samba server using
4732 a root (or <TT
4733 CLASS="PARAMETER"
4735 >printer admin</I
4736 ></TT
4737 >) account
4738 from a Windows NT 4.0/2k client. Open "Network Neighbourhood" or
4739 "My Network Places" and browse for the Samba host. Once you have located
4740 the server, navigate to the "Printers..." folder.
4741 You should see an initial listing of printers
4742 that matches the printer shares defined on your Samba host.</P
4743 ></DIV
4744 ><DIV
4745 CLASS="SECT2"
4746 ><HR><H2
4747 CLASS="SECT2"
4749 NAME="AEN834"
4750 >6.2.2. Setting Drivers for Existing Printers</A
4751 ></H2
4753 >The initial listing of printers in the Samba host's
4754 Printers folder will have no real printer driver assigned
4755 to them. By default, in Samba 2.2.0 this driver name was set to
4757 >NO PRINTER DRIVER AVAILABLE FOR THIS PRINTER</EM
4759 Later versions changed this to a NULL string to allow the use
4760 tof the local Add Printer Wizard on NT/2000 clients.
4761 Attempting to view the printer properties for a printer
4762 which has this default driver assigned will result in
4763 the error message:</P
4765 ><EM
4766 >Device settings cannot be displayed. The driver
4767 for the specified printer is not installed, only spooler
4768 properties will be displayed. Do you want to install the
4769 driver now?</EM
4770 ></P
4772 >Click "No" in the error dialog and you will be presented with
4773 the printer properties window. The way assign a driver to a
4774 printer is to either</P
4776 ></P
4777 ><UL
4778 ><LI
4780 >Use the "New Driver..." button to install
4781 a new printer driver, or</P
4782 ></LI
4783 ><LI
4785 >Select a driver from the popup list of
4786 installed drivers. Initially this list will be empty.</P
4787 ></LI
4788 ></UL
4790 >If you wish to install printer drivers for client
4791 operating systems other than "Windows NT x86", you will need
4792 to use the "Sharing" tab of the printer properties dialog.</P
4794 >Assuming you have connected with a root account, you
4795 will also be able modify other printer properties such as
4796 ACLs and device settings using this dialog box.</P
4798 >A few closing comments for this section, it is possible
4799 on a Windows NT print server to have printers
4800 listed in the Printers folder which are not shared. Samba does
4801 not make this distinction. By definition, the only printers of
4802 which Samba is aware are those which are specified as shares in
4804 CLASS="FILENAME"
4805 >smb.conf</TT
4806 >.</P
4808 >Another interesting side note is that Windows NT clients do
4809 not use the SMB printer share, but rather can print directly
4810 to any printer on another Windows NT host using MS-RPC. This
4811 of course assumes that the printing client has the necessary
4812 privileges on the remote host serving the printer. The default
4813 permissions assigned by Windows NT to a printer gives the "Print"
4814 permissions to the "Everyone" well-known group.</P
4815 ></DIV
4816 ><DIV
4817 CLASS="SECT2"
4818 ><HR><H2
4819 CLASS="SECT2"
4821 NAME="AEN851"
4822 >6.2.3. Support a large number of printers</A
4823 ></H2
4825 >One issue that has arisen during the development
4826 phase of Samba 2.2 is the need to support driver downloads for
4827 100's of printers. Using the Windows NT APW is somewhat
4828 awkward to say the list. If more than one printer are using the
4829 same driver, the <A
4830 HREF="rpcclient.1.html"
4831 TARGET="_top"
4833 CLASS="COMMAND"
4834 >rpcclient's
4835 setdriver command</B
4836 ></A
4837 > can be used to set the driver
4838 associated with an installed driver. The following is example
4839 of how this could be accomplished:</P
4841 ><TABLE
4842 BORDER="0"
4843 BGCOLOR="#E0E0E0"
4844 WIDTH="100%"
4845 ><TR
4846 ><TD
4847 ><PRE
4848 CLASS="PROGRAMLISTING"
4851 CLASS="PROMPT"
4852 >$ </TT
4853 >rpcclient pogo -U root%secret -c "enumdrivers"
4854 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4856 [Windows NT x86]
4857 Printer Driver Info 1:
4858 Driver Name: [HP LaserJet 4000 Series PS]
4860 Printer Driver Info 1:
4861 Driver Name: [HP LaserJet 2100 Series PS]
4863 Printer Driver Info 1:
4864 Driver Name: [HP LaserJet 4Si/4SiMX PS]
4867 CLASS="PROMPT"
4868 >$ </TT
4869 >rpcclient pogo -U root%secret -c "enumprinters"
4870 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4871 flags:[0x800000]
4872 name:[\\POGO\hp-print]
4873 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
4874 comment:[]
4877 CLASS="PROMPT"
4878 >$ </TT
4879 >rpcclient pogo -U root%secret \
4881 CLASS="PROMPT"
4882 >&#62; </TT
4883 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
4884 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4885 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
4886 ></TD
4887 ></TR
4888 ></TABLE
4889 ></P
4890 ></DIV
4891 ><DIV
4892 CLASS="SECT2"
4893 ><HR><H2
4894 CLASS="SECT2"
4896 NAME="AEN862"
4897 >6.2.4. Adding New Printers via the Windows NT APW</A
4898 ></H2
4900 >By default, Samba offers all printer shares defined in <TT
4901 CLASS="FILENAME"
4902 >smb.conf</TT
4904 in the "Printers..." folder. Also existing in this folder is the Windows NT
4905 Add Printer Wizard icon. The APW will be show only if</P
4907 ></P
4908 ><UL
4909 ><LI
4911 >The connected user is able to successfully
4912 execute an OpenPrinterEx(\\server) with administrative
4913 privileges (i.e. root or <TT
4914 CLASS="PARAMETER"
4916 >printer admin</I
4917 ></TT
4920 ></LI
4921 ><LI
4924 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
4925 TARGET="_top"
4926 ><TT
4927 CLASS="PARAMETER"
4929 >show
4930 add printer wizard = yes</I
4931 ></TT
4932 ></A
4933 > (the default).
4935 ></LI
4936 ></UL
4938 >In order to be able to use the APW to successfully add a printer to a Samba
4939 server, the <A
4940 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
4941 TARGET="_top"
4942 ><TT
4943 CLASS="PARAMETER"
4945 >add
4946 printer command</I
4947 ></TT
4948 ></A
4949 > must have a defined value. The program
4950 hook must successfully add the printer to the system (i.e.
4952 CLASS="FILENAME"
4953 >/etc/printcap</TT
4954 > or appropriate files) and
4956 CLASS="FILENAME"
4957 >smb.conf</TT
4958 > if necessary.</P
4960 >When using the APW from a client, if the named printer share does
4961 not exist, <B
4962 CLASS="COMMAND"
4963 >smbd</B
4964 > will execute the <TT
4965 CLASS="PARAMETER"
4967 >add printer
4968 command</I
4969 ></TT
4970 > and reparse to the <TT
4971 CLASS="FILENAME"
4972 >smb.conf</TT
4974 to attempt to locate the new printer share. If the share is still not defined,
4975 an error of "Access Denied" is returned to the client. Note that the
4977 CLASS="PARAMETER"
4979 >add printer program</I
4980 ></TT
4981 > is executed under the context
4982 of the connected user, not necessarily a root account.</P
4984 >There is a complementing <A
4985 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
4986 TARGET="_top"
4987 ><TT
4988 CLASS="PARAMETER"
4990 >delete
4991 printer command</I
4992 ></TT
4993 ></A
4994 > for removing entries from the "Printers..."
4995 folder.</P
4996 ></DIV
4997 ><DIV
4998 CLASS="SECT2"
4999 ><HR><H2
5000 CLASS="SECT2"
5002 NAME="AEN887"
5003 >6.2.5. Samba and Printer Ports</A
5004 ></H2
5006 >Windows NT/2000 print servers associate a port with each printer. These normally
5007 take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the
5008 concept of ports associated with a printer. By default, only one printer port,
5009 named "Samba Printer Port", exists on a system. Samba does not really a port in
5010 order to print, rather it is a requirement of Windows clients. </P
5012 >Note that Samba does not support the concept of "Printer Pooling" internally
5013 either. This is when a logical printer is assigned to multiple ports as
5014 a form of load balancing or fail over.</P
5016 >If you require that multiple ports be defined for some reason,
5018 CLASS="FILENAME"
5019 >smb.conf</TT
5020 > possesses a <A
5021 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
5022 TARGET="_top"
5023 ><TT
5024 CLASS="PARAMETER"
5026 >enumports
5027 command</I
5028 ></TT
5029 ></A
5030 > which can be used to define an external program
5031 that generates a listing of ports on a system.</P
5032 ></DIV
5033 ></DIV
5034 ><DIV
5035 CLASS="SECT1"
5036 ><HR><H1
5037 CLASS="SECT1"
5039 NAME="AEN895"
5040 >6.3. The Imprints Toolset</A
5041 ></H1
5043 >The Imprints tool set provides a UNIX equivalent of the
5044 Windows NT Add Printer Wizard. For complete information, please
5045 refer to the Imprints web site at <A
5046 HREF="http://imprints.sourceforge.net/"
5047 TARGET="_top"
5048 > http://imprints.sourceforge.net/</A
5049 > as well as the documentation
5050 included with the imprints source distribution. This section will
5051 only provide a brief introduction to the features of Imprints.</P
5052 ><DIV
5053 CLASS="SECT2"
5054 ><HR><H2
5055 CLASS="SECT2"
5057 NAME="AEN899"
5058 >6.3.1. What is Imprints?</A
5059 ></H2
5061 >Imprints is a collection of tools for supporting the goals
5062 of</P
5064 ></P
5065 ><UL
5066 ><LI
5068 >Providing a central repository information
5069 regarding Windows NT and 95/98 printer driver packages</P
5070 ></LI
5071 ><LI
5073 >Providing the tools necessary for creating
5074 the Imprints printer driver packages.</P
5075 ></LI
5076 ><LI
5078 >Providing an installation client which
5079 will obtain and install printer drivers on remote Samba
5080 and Windows NT 4 print servers.</P
5081 ></LI
5082 ></UL
5083 ></DIV
5084 ><DIV
5085 CLASS="SECT2"
5086 ><HR><H2
5087 CLASS="SECT2"
5089 NAME="AEN909"
5090 >6.3.2. Creating Printer Driver Packages</A
5091 ></H2
5093 >The process of creating printer driver packages is beyond
5094 the scope of this document (refer to Imprints.txt also included
5095 with the Samba distribution for more information). In short,
5096 an Imprints driver package is a gzipped tarball containing the
5097 driver files, related INF files, and a control file needed by the
5098 installation client.</P
5099 ></DIV
5100 ><DIV
5101 CLASS="SECT2"
5102 ><HR><H2
5103 CLASS="SECT2"
5105 NAME="AEN912"
5106 >6.3.3. The Imprints server</A
5107 ></H2
5109 >The Imprints server is really a database server that
5110 may be queried via standard HTTP mechanisms. Each printer
5111 entry in the database has an associated URL for the actual
5112 downloading of the package. Each package is digitally signed
5113 via GnuPG which can be used to verify that package downloaded
5114 is actually the one referred in the Imprints database. It is
5116 >not</EM
5117 > recommended that this security check
5118 be disabled.</P
5119 ></DIV
5120 ><DIV
5121 CLASS="SECT2"
5122 ><HR><H2
5123 CLASS="SECT2"
5125 NAME="AEN916"
5126 >6.3.4. The Installation Client</A
5127 ></H2
5129 >More information regarding the Imprints installation client
5130 is available in the <TT
5131 CLASS="FILENAME"
5132 >Imprints-Client-HOWTO.ps</TT
5134 file included with the imprints source package.</P
5136 >The Imprints installation client comes in two forms.</P
5138 ></P
5139 ><UL
5140 ><LI
5142 >a set of command line Perl scripts</P
5143 ></LI
5144 ><LI
5146 >a GTK+ based graphical interface to
5147 the command line perl scripts</P
5148 ></LI
5149 ></UL
5151 >The installation client (in both forms) provides a means
5152 of querying the Imprints database server for a matching
5153 list of known printer model names as well as a means to
5154 download and install the drivers on remote Samba and Windows
5155 NT print servers.</P
5157 >The basic installation process is in four steps and
5158 perl code is wrapped around <B
5159 CLASS="COMMAND"
5160 >smbclient</B
5162 and <B
5163 CLASS="COMMAND"
5164 >rpcclient</B
5165 >.</P
5167 ><TABLE
5168 BORDER="0"
5169 BGCOLOR="#E0E0E0"
5170 WIDTH="100%"
5171 ><TR
5172 ><TD
5173 ><PRE
5174 CLASS="PROGRAMLISTING"
5176 foreach (supported architecture for a given driver)
5178 1. rpcclient: Get the appropriate upload directory
5179 on the remote server
5180 2. smbclient: Upload the driver files
5181 3. rpcclient: Issues an AddPrinterDriver() MS-RPC
5184 4. rpcclient: Issue an AddPrinterEx() MS-RPC to actually
5185 create the printer</PRE
5186 ></TD
5187 ></TR
5188 ></TABLE
5189 ></P
5191 >One of the problems encountered when implementing
5192 the Imprints tool set was the name space issues between
5193 various supported client architectures. For example, Windows
5194 NT includes a driver named "Apple LaserWriter II NTX v51.8"
5195 and Windows 95 calls its version of this driver "Apple
5196 LaserWriter II NTX"</P
5198 >The problem is how to know what client drivers have
5199 been uploaded for a printer. As astute reader will remember
5200 that the Windows NT Printer Properties dialog only includes
5201 space for one printer driver name. A quick look in the
5202 Windows NT 4.0 system registry at</P
5204 ><TT
5205 CLASS="FILENAME"
5206 >HKLM\System\CurrentControlSet\Control\Print\Environment
5207 </TT
5208 ></P
5210 >will reveal that Windows NT always uses the NT driver
5211 name. This is ok as Windows NT always requires that at least
5212 the Windows NT version of the printer driver is present.
5213 However, Samba does not have the requirement internally.
5214 Therefore, how can you use the NT driver name if is has not
5215 already been installed?</P
5217 >The way of sidestepping this limitation is to require
5218 that all Imprints printer driver packages include both the Intel
5219 Windows NT and 95/98 printer drivers and that NT driver is
5220 installed first.</P
5221 ></DIV
5222 ></DIV
5223 ><DIV
5224 CLASS="SECT1"
5225 ><HR><H1
5226 CLASS="SECT1"
5228 NAME="AEN938"
5229 >6.4. <A
5230 NAME="MIGRATION"
5231 ></A
5232 >Migration to from Samba 2.0.x to 2.2.x</A
5233 ></H1
5235 >Given that printer driver management has changed (we hope improved) in
5236 2.2 over prior releases, migration from an existing setup to 2.2 can
5237 follow several paths. Here are the possible scenarios for
5238 migration:</P
5240 ></P
5241 ><UL
5242 ><LI
5244 >If you do not desire the new Windows NT
5245 print driver support, nothing needs to be done.
5246 All existing parameters work the same.</P
5247 ></LI
5248 ><LI
5250 >If you want to take advantage of NT printer
5251 driver support but do not want to migrate the
5252 9x drivers to the new setup, the leave the existing
5254 CLASS="FILENAME"
5255 >printers.def</TT
5256 > file. When smbd attempts
5257 to locate a
5258 9x driver for the printer in the TDB and fails it
5259 will drop down to using the printers.def (and all
5260 associated parameters). The <B
5261 CLASS="COMMAND"
5262 >make_printerdef</B
5264 tool will also remain for backwards compatibility but will
5265 be removed in the next major release.</P
5266 ></LI
5267 ><LI
5269 >If you install a Windows 9x driver for a printer
5270 on your Samba host (in the printing TDB), this information will
5271 take precedence and the three old printing parameters
5272 will be ignored (including print driver location).</P
5273 ></LI
5274 ><LI
5276 >If you want to migrate an existing <TT
5277 CLASS="FILENAME"
5278 >printers.def</TT
5280 file into the new setup, the current only solution is to use the Windows
5281 NT APW to install the NT drivers and the 9x drivers. This can be scripted
5282 using <B
5283 CLASS="COMMAND"
5284 >smbclient</B
5285 > and <B
5286 CLASS="COMMAND"
5287 >rpcclient</B
5288 >. See the
5289 Imprints installation client at <A
5290 HREF="http://imprints.sourceforge.net/"
5291 TARGET="_top"
5292 >http://imprints.sourceforge.net/</A
5294 for an example.
5296 ></LI
5297 ></UL
5298 ><DIV
5299 CLASS="WARNING"
5301 ></P
5302 ><TABLE
5303 CLASS="WARNING"
5304 BORDER="1"
5305 WIDTH="100%"
5306 ><TR
5307 ><TD
5308 ALIGN="CENTER"
5310 >Achtung!</B
5311 ></TD
5312 ></TR
5313 ><TR
5314 ><TD
5315 ALIGN="LEFT"
5317 >The following <TT
5318 CLASS="FILENAME"
5319 >smb.conf</TT
5320 > parameters are considered to
5321 be deprecated and will be removed soon. Do not use them in new
5322 installations</P
5324 ></P
5325 ><UL
5326 ><LI
5328 ><TT
5329 CLASS="PARAMETER"
5331 >printer driver file (G)</I
5332 ></TT
5335 ></LI
5336 ><LI
5338 ><TT
5339 CLASS="PARAMETER"
5341 >printer driver (S)</I
5342 ></TT
5345 ></LI
5346 ><LI
5348 ><TT
5349 CLASS="PARAMETER"
5351 >printer driver location (S)</I
5352 ></TT
5355 ></LI
5356 ></UL
5357 ></TD
5358 ></TR
5359 ></TABLE
5360 ></DIV
5362 >The have been two new parameters add in Samba 2.2.2 to for
5363 better support of Samba 2.0.x backwards capability (<TT
5364 CLASS="PARAMETER"
5366 >disable
5367 spoolss</I
5368 ></TT
5369 >) and for using local printers drivers on Windows
5370 NT/2000 clients (<TT
5371 CLASS="PARAMETER"
5373 >use client driver</I
5374 ></TT
5375 >). Both of
5376 these options are described in the smb.coinf(5) man page and are
5377 disabled by default.</P
5378 ></DIV
5379 ></DIV
5380 ><DIV
5381 CLASS="CHAPTER"
5382 ><HR><H1
5384 NAME="CUPS"
5385 >Chapter 7. Printing with CUPS in Samba 2.2.x</A
5386 ></H1
5387 ><DIV
5388 CLASS="SECT1"
5389 ><H1
5390 CLASS="SECT1"
5392 NAME="AEN984"
5393 >7.1. Printing with CUPS in Samba 2.2.x</A
5394 ></H1
5397 HREF="http://www.cups.org/"
5398 TARGET="_top"
5399 >CUPS</A
5400 > is a newcomer in
5401 the UNIX printing scene, which has convinced many people upon first trial
5402 already. However, it has quite a few new features, which make it different
5403 from other, more traditional printing systems.</P
5404 ></DIV
5405 ><DIV
5406 CLASS="SECT1"
5407 ><HR><H1
5408 CLASS="SECT1"
5410 NAME="AEN988"
5411 >7.2. Configuring <TT
5412 CLASS="FILENAME"
5413 >smb.conf</TT
5414 > for CUPS</A
5415 ></H1
5417 >Printing with CUPS in the most basic <TT
5418 CLASS="FILENAME"
5419 >smb.conf</TT
5421 setup in Samba 2.2.x only needs two settings: <B
5422 CLASS="COMMAND"
5423 >printing = cups</B
5424 > and
5426 CLASS="COMMAND"
5427 >printcap = cups</B
5428 >. While CUPS itself doesn't need a printcap
5429 anymore, the <TT
5430 CLASS="FILENAME"
5431 >cupsd.conf</TT
5432 > configuration file knows two directives
5433 (example: <B
5434 CLASS="COMMAND"
5435 >Printcap /etc/printcap</B
5436 > and <B
5437 CLASS="COMMAND"
5438 >PrintcapFormat
5439 BSD</B
5440 >), which control if such a file should be created for the
5441 convenience of third party applications. Make sure it is set! For details see
5443 CLASS="COMMAND"
5444 >man cupsd.conf</B
5445 > and other CUPS-related documentation.</P
5447 >If SAMBA is compiled against libcups, then <B
5448 CLASS="COMMAND"
5449 >printcap =
5450 cups</B
5451 > uses the CUPS API to list printers, submit jobs, etc. Otherwise it
5452 maps to the System V commands with an additional <TT
5453 CLASS="PARAMETER"
5455 >-oraw</I
5456 ></TT
5458 option for printing. On a Linux system, you can use the <B
5459 CLASS="COMMAND"
5460 >ldd</B
5461 > command to
5462 find out details (ldd may not be present on other OS platforms, or its
5463 function may be embodied by a different command):</P
5465 ><TABLE
5466 BORDER="0"
5467 BGCOLOR="#E0E0E0"
5468 WIDTH="100%"
5469 ><TR
5470 ><TD
5471 ><PRE
5472 CLASS="PROGRAMLISTING"
5473 >transmeta:/home/kurt # ldd `which smbd`
5474 libssl.so.0.9.6 =&#62; /usr/lib/libssl.so.0.9.6 (0x4002d000)
5475 libcrypto.so.0.9.6 =&#62; /usr/lib/libcrypto.so.0.9.6 (0x4005a000)
5476 libcups.so.2 =&#62; /usr/lib/libcups.so.2 (0x40123000)
5477 libdl.so.2 =&#62; /lib/libdl.so.2 (0x401e8000)
5478 libnsl.so.1 =&#62; /lib/libnsl.so.1 (0x401ec000)
5479 libpam.so.0 =&#62; /lib/libpam.so.0 (0x40202000)
5480 libc.so.6 =&#62; /lib/libc.so.6 (0x4020b000)
5481 /lib/ld-linux.so.2 =&#62; /lib/ld-linux.so.2 (0x40000000)</PRE
5482 ></TD
5483 ></TR
5484 ></TABLE
5485 ></P
5487 >The line "libcups.so.2 =&#62; /usr/lib/libcups.so.2
5488 (0x40123000)" shows there is CUPS support compiled into this version of
5489 Samba. If this is the case, and <B
5490 CLASS="COMMAND"
5491 >printing = cups</B
5492 > is set, then any
5493 otherwise manually set print command in smb.conf is ignored.</P
5494 ></DIV
5495 ><DIV
5496 CLASS="SECT1"
5497 ><HR><H1
5498 CLASS="SECT1"
5500 NAME="AEN1007"
5501 >7.3. Using CUPS as a mere spooling print server -- "raw"
5502 printing with vendor drivers download</A
5503 ></H1
5505 >You can setup Samba and your Windows clients to use the
5506 CUPS print subsystem just as you would with any of the more traditional print
5507 subsystems: that means the use of vendor provided, native Windows printer
5508 drivers for each target printer. If you setup the [print$] share to
5509 download these drivers to the clients, their GDI system (Graphical Device
5510 Interface) will output the Wndows EMF (Enhanced MetaFile) and
5511 convert it -- with the help of the printer driver -- locally into the format
5512 the printer is expecting. Samba and the CUPS print subsystem will have to
5513 treat these files as raw print files -- they are already in the
5514 shape to be digestable for the printer. This is the same traditional setup
5515 for Unix print servers handling Windows client jobs. It does not take much
5516 CPU power to handle this kind of task efficiently.</P
5517 ></DIV
5518 ><DIV
5519 CLASS="SECT1"
5520 ><HR><H1
5521 CLASS="SECT1"
5523 NAME="AEN1010"
5524 >7.4. CUPS as a network PostScript RIP -- CUPS drivers working on server, Adobe
5525 PostScript driver with CUPS-PPDs downloaded to clients</A
5526 ></H1
5528 >CUPS is perfectly able to use PPD files (PostScript
5529 Printer Descriptions). PPDs can control all print device options. They
5530 are usually provided by the manufacturer -- if you own a PostSript printer,
5531 that is. PPD files are always a component of PostScript printer drivers on MS
5532 Windows or Apple Mac OS systems. They are ASCII files containing
5533 user-selectable print options, mapped to appropriate PostScript, PCL or PJL
5534 commands for the target printer. Printer driver GUI dialogs translate these
5535 options "on-the-fly" into buttons and drop-down lists for the user to
5536 select.</P
5538 >CUPS can load, without any conversions, the PPD file from
5539 any Windows (NT is recommended) PostScript driver and handle the options.
5540 There is a web browser interface to the print options (select
5541 http://localhost:631/printers/ and click on one "Configure Printer" button
5542 to see it), a commandline interface (see <B
5543 CLASS="COMMAND"
5544 >man lpoptions</B
5545 > or
5546 try if you have <B
5547 CLASS="COMMAND"
5548 >lphelp</B
5549 > on your system) plus some different GUI frontends on Linux
5550 UNIX, which can present PPD options to the users. PPD options are normally
5551 meant to become evaluated by the PostScript RIP on the real PostScript
5552 printer.</P
5554 >CUPS doesn't stop at "real" PostScript printers in its
5555 usage of PPDs. The CUPS developers have extended the PPD concept, to also
5556 describe available device and driver options for non-PostScript printers
5557 through CUPS-PPDs.</P
5559 >This is logical, as CUPS includes a fully featured
5560 PostScript interpreter (RIP). This RIP is based on Ghostscript. It can
5561 process all received PostScript (and additionally many other file formats)
5562 from clients. All CUPS-PPDs geared to non-PostScript printers contain an
5563 additional line, starting with the keyword <TT
5564 CLASS="PARAMETER"
5566 >*cupsFilter</I
5567 ></TT
5569 This line
5570 tells the CUPS print system which printer-specific filter to use for the
5571 interpretation of the accompanying PostScript. Thus CUPS lets all its
5572 printers appear as PostScript devices to its clients, because it can act as a
5573 PostScript RIP for those printers, processing the received PostScript code
5574 into a proper raster print format.</P
5576 >CUPS-PPDs can also be used on Windows-Clients, on top of a
5577 PostScript driver (recommended is the Adobe one).</P
5579 >This feature enables CUPS to do a few tricks no other
5580 spooler can do:</P
5582 ></P
5583 ><UL
5584 ><LI
5586 >act as a networked PostScript RIP (Raster Image Processor), handling
5587 printfiles from all client platforms in a uniform way;</P
5588 ></LI
5589 ><LI
5591 >act as a central accounting and billing server, as all files are passed
5592 through the <B
5593 CLASS="COMMAND"
5594 >pstops</B
5595 > Filter and are therefor logged in
5596 the CUPS <TT
5597 CLASS="FILENAME"
5598 >page_log</TT
5599 >. - <EM
5600 >NOTE: </EM
5601 >this
5602 can not happen with "raw" print jobs, which always remain unfiltered
5603 per definition;</P
5604 ></LI
5605 ><LI
5607 >enable clients to consolidate on a single PostScript driver, even for
5608 many different target printers.</P
5609 ></LI
5610 ></UL
5611 ></DIV
5612 ><DIV
5613 CLASS="SECT1"
5614 ><HR><H1
5615 CLASS="SECT1"
5617 NAME="AEN1031"
5618 >7.5. Windows Terminal Servers (WTS) as CUPS clients</A
5619 ></H1
5621 >This setup may be of special interest to people
5622 experiencing major problems in WTS environments. WTS need often a multitude
5623 of non-PostScript drivers installed to run their clients' variety of
5624 different printer models. This often imposes the price of much increased
5625 instability. In many cases, in an attempt to overcome this problem, site
5626 administrators have resorted to restrict the allowed drivers installed on
5627 their WTS to one generic PCL- and one PostScript driver. This however
5628 restricts the clients in the amount of printer options available for them --
5629 often they can't get out more then simplex prints from one standard paper
5630 tray, while their devices could do much better, if driven by a different
5631 driver!</P
5633 >Using an Adobe PostScript driver, enabled with a CUPS-PPD,
5634 seems to be a very elegant way to overcome all these shortcomings. The
5635 PostScript driver is not known to cause major stability problems on WTS (even
5636 if used with many different PPDs). The clients will be able to (again) chose
5637 paper trays, duplex printing and other settings. However, there is a certain
5638 price for this too: a CUPS server acting as a PostScript RIP for its clients
5639 requires more CPU and RAM than just to act as a "raw spooling" device. Plus,
5640 this setup is not yet widely tested, although the first feedbacks look very
5641 promising...</P
5642 ></DIV
5643 ><DIV
5644 CLASS="SECT1"
5645 ><HR><H1
5646 CLASS="SECT1"
5648 NAME="AEN1035"
5649 >7.6. Setting up CUPS for driver download</A
5650 ></H1
5652 >The <B
5653 CLASS="COMMAND"
5654 >cupsadsmb</B
5655 > utility (shipped with all current
5656 CUPS versions) makes the sharing of any (or all) installed CUPS printers very
5657 easy. Prior to using it, you need the following settings in smb.conf:</P
5659 ><TABLE
5660 BORDER="0"
5661 BGCOLOR="#E0E0E0"
5662 WIDTH="100%"
5663 ><TR
5664 ><TD
5665 ><PRE
5666 CLASS="PROGRAMLISTING"
5667 >[global]
5668 load printers = yes
5669 printing = cups
5670 printcap name = cups
5672 [printers]
5673 comment = All Printers
5674 path = /var/spool/samba
5675 browseable = no
5676 public = yes
5677 guest ok = yes
5678 writable = no
5679 printable = yes
5680 printer admin = root
5682 [print$]
5683 comment = Printer Drivers
5684 path = /etc/samba/drivers
5685 browseable = yes
5686 guest ok = no
5687 read only = yes
5688 write list = root</PRE
5689 ></TD
5690 ></TR
5691 ></TABLE
5692 ></P
5694 >For licensing reasons the necessary files of the Adobe
5695 Postscript driver can not be distributed with either Samba or CUPS. You need
5696 to download them yourself from the Adobe website. Once extracted, create a
5698 CLASS="FILENAME"
5699 >drivers</TT
5700 > directory in the CUPS data directory (usually
5702 CLASS="FILENAME"
5703 >/usr/share/cups/</TT
5704 >). Copy the Adobe files using
5705 UPPERCASE filenames, to this directory as follows:</P
5707 ><TABLE
5708 BORDER="0"
5709 BGCOLOR="#E0E0E0"
5710 WIDTH="100%"
5711 ><TR
5712 ><TD
5713 ><PRE
5714 CLASS="PROGRAMLISTING"
5715 > ADFONTS.MFM
5716 ADOBEPS4.DRV
5717 ADOBEPS4.HLP
5718 ADOBEPS5.DLL
5719 ADOBEPSU.DLL
5720 ADOBEPSU.HLP
5721 DEFPRTR2.PPD
5722 ICONLIB.DLL</PRE
5723 ></TD
5724 ></TR
5725 ></TABLE
5726 ></P
5728 >Users of the ESP Print Pro software are able to install
5729 their "Samba Drivers" package for this purpose with no problem.</P
5730 ></DIV
5731 ><DIV
5732 CLASS="SECT1"
5733 ><HR><H1
5734 CLASS="SECT1"
5736 NAME="AEN1047"
5737 >7.7. Sources of CUPS drivers / PPDs</A
5738 ></H1
5740 >On the internet you can find now many thousand CUPS-PPD
5741 files (with their companion filters), in many national languages,
5742 supporting more than 1.000 non-PostScript models.</P
5744 ></P
5745 ><UL
5746 ><LI
5749 HREF="http://wwwl.easysw.com/printpro/"
5750 TARGET="_top"
5751 >ESP PrintPro
5752 (http://wwwl.easysw.com/printpro/)</A
5754 (commercial, non-Free) is packaged with more than 3.000 PPDs, ready for
5755 successful usage "out of the box" on Linux, IBM-AIX, HP-UX, Sun-Solaris,
5756 SGI-IRIX, Compaq Tru64, Digital Unix and some more commercial Unices (it
5757 is written by the CUPS developers themselves and its sales help finance
5758 the further development of CUPS, as they feed their creators)</P
5759 ></LI
5760 ><LI
5762 >the <A
5763 HREF="http://gimp-print.sourceforge.net/"
5764 TARGET="_top"
5765 >Gimp-Print-Project
5766 (http://gimp-print.sourceforge.net/)</A
5768 (GPL, Free Software) provides around 120 PPDs (supporting nearly 300
5769 printers, many driven to photo quality output), to be used alongside the
5770 Gimp-Print CUPS filters;</P
5771 ></LI
5772 ><LI
5775 HREF="http://www.turboprint.com/"
5776 TARGET="_top"
5777 >TurboPrint
5778 (http://www.turboprint.com/)</A
5780 (Shareware, non-Freee) supports roughly the same amount of printers in
5781 excellent quality;</P
5782 ></LI
5783 ><LI
5786 HREF="http://www-124.ibm.com/developerworks/oss/linux/projects/omni/"
5787 TARGET="_top"
5788 >OMNI
5789 (http://www-124.ibm.com/developerworks/oss/linux/projects/omni/)</A
5791 (LPGL, Free) is a package made by IBM, now containing support for more
5792 than 400 printers, stemming from the inheritance of IBM OS/2 KnowHow
5793 ported over to Linux (CUPS support is in a Beta-stage at present);</P
5794 ></LI
5795 ><LI
5798 HREF="http://hpinkjet.sourceforge.net/"
5799 TARGET="_top"
5800 >HPIJS
5801 (http://hpinkjet.sourceforge.net/)</A
5803 (BSD-style licnes, Free) supports around 120 of HP's own printers and is
5804 also providing excellent print quality now;</P
5805 ></LI
5806 ><LI
5809 HREF="http://www.linuxprinting.org/"
5810 TARGET="_top"
5811 >Foomatic/cupsomatic (http://www.linuxprinting.org/)</A
5813 (LPGL, Free) from Linuxprinting.org are providing PPDs for practically every
5814 Ghostscript filter known to the world, now usable with CUPS.</P
5815 ></LI
5816 ></UL
5818 ><EM
5819 >NOTE: </EM
5820 >the cupsomatic trick from Linuxprinting.org is
5821 working different from the other drivers. While the other drivers take the
5822 generic CUPS raster (produced by CUPS' own pstoraster PostScript RIP) as
5823 their input, cupsomatic "kidnaps" the PostScript inside CUPS, before
5824 RIP-ping, deviates it to an external Ghostscript installation (which now
5825 becomes the RIP) and gives it back to a CUPS backend once Ghostscript is
5826 finished. -- CUPS versions from 1.1.15 and later will provide their pstoraster
5827 PostScript RIP function again inside a system-wide Ghostscript
5828 installation rather than in "their own" pstoraster filter. (This
5829 CUPS-enabling Ghostscript version may be installed either as a
5830 patch to GNU or AFPL Ghostscript, or as a complete ESP Ghostscript package).
5831 However, this will not change the cupsomatic approach of guiding the printjob
5832 along a different path through the filtering system than the standard CUPS
5833 way...</P
5835 >Once you installed a printer inside CUPS with one of the
5836 recommended methods (the lpadmin command, the web browser interface or one of
5837 the available GUI wizards), you can use <B
5838 CLASS="COMMAND"
5839 >cupsaddsmb</B
5840 > to share the
5841 printer via Samba. <B
5842 CLASS="COMMAND"
5843 >cupsaddsmb</B
5844 > prepares the driver files for
5845 comfortable client download and installation upon their first contact with
5846 this printer share.</P
5847 ><DIV
5848 CLASS="SECT2"
5849 ><HR><H2
5850 CLASS="SECT2"
5852 NAME="AEN1074"
5853 >7.7.1. <B
5854 CLASS="COMMAND"
5855 >cupsaddsmb</B
5856 ></A
5857 ></H2
5859 >The <B
5860 CLASS="COMMAND"
5861 >cupsaddsmb</B
5862 > command copies the needed files
5863 for convenient Windows client installations from the previously prepared CUPS
5864 data directory to your [print$] share. Additionally, the PPD
5865 associated with this printer is copied from <TT
5866 CLASS="FILENAME"
5867 >/etc/cups/ppd/</TT
5868 > to
5869 [print$].</P
5871 ><TABLE
5872 BORDER="0"
5873 BGCOLOR="#E0E0E0"
5874 WIDTH="100%"
5875 ><TR
5876 ><TD
5877 ><PRE
5878 CLASS="PROGRAMLISTING"
5879 ><TT
5880 CLASS="PROMPT"
5881 >root# </TT
5882 > <B
5883 CLASS="COMMAND"
5884 >cupsaddsmb -U root infotec_IS2027</B
5886 Password for root required to access localhost via SAMBA: <TT
5887 CLASS="USERINPUT"
5889 >[type in password 'secret']</B
5890 ></TT
5891 ></PRE
5892 ></TD
5893 ></TR
5894 ></TABLE
5895 ></P
5897 >To share all printers and drivers, use the <TT
5898 CLASS="PARAMETER"
5900 >-a</I
5901 ></TT
5903 parameter instead of a printer name.</P
5905 >Probably you want to see what's going on. Use the
5907 CLASS="PARAMETER"
5909 >-v</I
5910 ></TT
5911 > parameter to get a more verbose output:</P
5913 ><TABLE
5914 BORDER="0"
5915 BGCOLOR="#E0E0E0"
5916 WIDTH="100%"
5917 ><TR
5918 ><TD
5919 ><PRE
5920 CLASS="PROGRAMLISTING"
5921 ><TT
5922 CLASS="PROMPT"
5923 >root# </TT
5924 > cupsaddsmb -v -U root infotec_IS2027
5925 Password for root required to access localhost via SAMBA:
5926 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir W32X86;put /var/spool/cups/tmp/3cd1cc66376c0 W32X86/infotec_IS2027.PPD;put /usr/share/cups/drivers/ADOBEPS5.DLL W32X86/ADOBEPS5.DLL;put /usr/share/cups/drivers/ADOBEPSU.DLL W32X86/ADOBEPSU.DLL;put /usr/share/cups/drivers/ADOBEPSU.HLP W32X86/ADOBEPSU.HLP'
5927 added interface ip=10.160.16.45 bcast=10.160.31.255 nmask=255.255.240.0
5928 added interface ip=192.168.182.1 bcast=192.168.182.255 nmask=255.255.255.0
5929 added interface ip=172.16.200.1 bcast=172.16.200.255 nmask=255.255.255.0
5930 Domain=[TUX-NET] OS=[Unix] Server=[Samba 2.2.3a.200204262025cvs]
5931 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
5932 putting file /var/spool/cups/tmp/3cd1cc66376c0 as \W32X86/infotec_IS2027.PPD (17394.6 kb/s) (average 17395.2 kb/s)
5933 putting file /usr/share/cups/drivers/ADOBEPS5.DLL as \W32X86/ADOBEPS5.DLL (10877.4 kb/s) (average 11343.0 kb/s)
5934 putting file /usr/share/cups/drivers/ADOBEPSU.DLL as \W32X86/ADOBEPSU.DLL (5095.2 kb/s) (average 9260.4 kb/s)
5935 putting file /usr/share/cups/drivers/ADOBEPSU.HLP as \W32X86/ADOBEPSU.HLP (8828.7 kb/s) (average 9247.1 kb/s)
5937 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir WIN40;put /var/spool/cups/tmp/3cd1cc66376c0 WIN40/infotec_IS2027.PPD;put /usr/share/cups/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;put /usr/share/cups/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;put /usr/share/cups/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;put /usr/share/cups/drivers/DEFPRTR2.PPD WIN40/DEFPRTR2.PPD;put /usr/share/cups/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL;put /usr/share/cups/drivers/PSMON.DLL WIN40/PSMON.DLL;'
5938 added interface ip=10.160.16.45 bcast=10.160.31.255 nmask=255.255.240.0
5939 added interface ip=192.168.182.1 bcast=192.168.182.255 nmask=255.255.255.0
5940 added interface ip=172.16.200.1 bcast=172.16.200.255 nmask=255.255.255.0
5941 Domain=[TUX-NET] OS=[Unix] Server=[Samba 2.2.3a.200204262025cvs]
5942 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \WIN40
5943 putting file /var/spool/cups/tmp/3cd1cc66376c0 as \WIN40/infotec_IS2027.PPD (26091.5 kb/s) (average 26092.8 kb/s)
5944 putting file /usr/share/cups/drivers/ADFONTS.MFM as \WIN40/ADFONTS.MFM (11241.6 kb/s) (average 11812.9 kb/s)
5945 putting file /usr/share/cups/drivers/ADOBEPS4.DRV as \WIN40/ADOBEPS4.DRV (16640.6 kb/s) (average 14679.3 kb/s)
5946 putting file /usr/share/cups/drivers/ADOBEPS4.HLP as \WIN40/ADOBEPS4.HLP (11285.6 kb/s) (average 14281.5 kb/s)
5947 putting file /usr/share/cups/drivers/DEFPRTR2.PPD as \WIN40/DEFPRTR2.PPD (823.5 kb/s) (average 12944.0 kb/s)
5948 putting file /usr/share/cups/drivers/ICONLIB.DLL as \WIN40/ICONLIB.DLL (19226.2 kb/s) (average 13169.7 kb/s)
5949 putting file /usr/share/cups/drivers/PSMON.DLL as \WIN40/PSMON.DLL (18666.1 kb/s) (average 13266.7 kb/s)
5951 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver "Windows NT x86" "infotec_IS2027:ADOBEPS5.DLL:infotec_IS2027.PPD:ADOBEPSU.DLL:ADOBEPSU.HLP:NULL:RAW:NULL"'
5952 cmd = adddriver "Windows NT x86" "infotec_IS2027:ADOBEPS5.DLL:infotec_IS2027.PPD:ADOBEPSU.DLL:ADOBEPSU.HLP:NULL:RAW:NULL"
5953 Printer Driver infotec_IS2027 successfully installed.
5955 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver "Windows 4.0" "infotec_IS2027:ADOBEPS4.DRV:infotec_IS2027.PPD:NULL:ADOBEPS4.HLP:PSMON.DLL:RAW:ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"'
5956 cmd = adddriver "Windows 4.0" "infotec_IS2027:ADOBEPS4.DRV:infotec_IS2027.PPD:NULL:ADOBEPS4.HLP:PSMON.DLL:RAW:ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"
5957 Printer Driver infotec_IS2027 successfully installed.
5959 Running command: rpcclient localhost -N -U'root%secret' -c 'setdriver infotec_IS2027 infotec_IS2027'
5960 cmd = setdriver infotec_IS2027 infotec_IS2027
5961 Succesfully set infotec_IS2027 to driver infotec_IS2027.
5964 CLASS="PROMPT"
5965 >root# </TT
5966 ></PRE
5967 ></TD
5968 ></TR
5969 ></TABLE
5970 ></P
5972 >If you look closely, you'll discover your root password
5973 was transfered unencrypted over the wire, so beware! Also, if you look
5974 further her, you'll discover error messages like
5976 CLASS="CONSTANT"
5977 >NT_STATUS_OBJECT_NAME_COLLISION</TT
5978 > in between. They occur, because
5979 the directories <TT
5980 CLASS="FILENAME"
5981 >WIN40</TT
5982 > and <TT
5983 CLASS="FILENAME"
5984 >W32X86</TT
5985 > already
5986 existed in the [print$] driver download share (from a previous driver
5987 installation). They are harmless here.</P
5989 >Now your printer is prepared for the clients to use. From
5990 a client, browse to the CUPS/Samba server, open the "Printers"
5991 share, right-click on this printer and select "Install..." or
5992 "Connect..." (depending on the Windows version you use). Now their
5993 should be a new printer in your client's local "Printers" folder,
5994 named (in my case) "infotec_IS2027 on kdebitshop"</P
5996 ><EM
5997 >NOTE: </EM
6000 CLASS="COMMAND"
6001 >cupsaddsmb</B
6002 > will only reliably work i
6003 with CUPS version 1.1.15 or higher
6004 and Samba from 2.2.4. If it doesn't work, or if the automatic printer
6005 driver download to the clients doesn't succeed, you can still manually
6006 install the CUPS printer PPD on top of the Adobe PostScript driver on
6007 clients and then point the client's printer queue to the Samba printer
6008 share for connection, should you desire to use the CUPS networked
6009 PostScript RIP functions.</P
6010 ></DIV
6011 ></DIV
6012 ></DIV
6013 ><DIV
6014 CLASS="CHAPTER"
6015 ><HR><H1
6017 NAME="DOMAIN-SECURITY"
6018 >Chapter 8. security = domain in Samba 2.x</A
6019 ></H1
6020 ><DIV
6021 CLASS="SECT1"
6022 ><H1
6023 CLASS="SECT1"
6025 NAME="AEN1119"
6026 >8.1. Joining an NT Domain with Samba 2.2</A
6027 ></H1
6029 >Assume you have a Samba 2.x server with a NetBIOS name of
6031 CLASS="CONSTANT"
6032 >SERV1</TT
6033 > and are joining an NT domain called
6035 CLASS="CONSTANT"
6036 >DOM</TT
6037 >, which has a PDC with a NetBIOS name
6038 of <TT
6039 CLASS="CONSTANT"
6040 >DOMPDC</TT
6041 > and two backup domain controllers
6042 with NetBIOS names <TT
6043 CLASS="CONSTANT"
6044 >DOMBDC1</TT
6045 > and <TT
6046 CLASS="CONSTANT"
6047 >DOMBDC2
6048 </TT
6049 >.</P
6051 >In order to join the domain, first stop all Samba daemons
6052 and run the command:</P
6054 ><TT
6055 CLASS="PROMPT"
6056 >root# </TT
6057 ><TT
6058 CLASS="USERINPUT"
6060 >smbpasswd -j DOM -r DOMPDC
6061 -U<TT
6062 CLASS="REPLACEABLE"
6064 >Administrator%password</I
6065 ></TT
6066 ></B
6067 ></TT
6068 ></P
6070 >as we are joining the domain DOM and the PDC for that domain
6071 (the only machine that has write access to the domain SAM database)
6072 is DOMPDC. The <TT
6073 CLASS="REPLACEABLE"
6075 >Administrator%password</I
6076 ></TT
6077 > is
6078 the login name and password for an account which has the necessary
6079 privilege to add machines to the domain. If this is successful
6080 you will see the message:</P
6082 ><TT
6083 CLASS="COMPUTEROUTPUT"
6084 >smbpasswd: Joined domain DOM.</TT
6088 >in your terminal window. See the <A
6089 HREF="smbpasswd.8.html"
6090 TARGET="_top"
6091 > smbpasswd(8)</A
6092 > man page for more details.</P
6094 >There is existing development code to join a domain
6095 without having to create the machine trust account on the PDC
6096 beforehand. This code will hopefully be available soon
6097 in release branches as well.</P
6099 >This command goes through the machine account password
6100 change protocol, then writes the new (random) machine account
6101 password for this Samba server into a file in the same directory
6102 in which an smbpasswd file would be stored - normally :</P
6104 ><TT
6105 CLASS="FILENAME"
6106 >/usr/local/samba/private</TT
6107 ></P
6109 >In Samba 2.0.x, the filename looks like this:</P
6111 ><TT
6112 CLASS="FILENAME"
6113 ><TT
6114 CLASS="REPLACEABLE"
6116 >&#60;NT DOMAIN NAME&#62;</I
6117 ></TT
6118 >.<TT
6119 CLASS="REPLACEABLE"
6121 >&#60;Samba
6122 Server Name&#62;</I
6123 ></TT
6124 >.mac</TT
6125 ></P
6127 >The <TT
6128 CLASS="FILENAME"
6129 >.mac</TT
6130 > suffix stands for machine account
6131 password file. So in our example above, the file would be called:</P
6133 ><TT
6134 CLASS="FILENAME"
6135 >DOM.SERV1.mac</TT
6136 ></P
6138 >In Samba 2.2, this file has been replaced with a TDB
6139 (Trivial Database) file named <TT
6140 CLASS="FILENAME"
6141 >secrets.tdb</TT
6145 >This file is created and owned by root and is not
6146 readable by any other user. It is the key to the domain-level
6147 security for your system, and should be treated as carefully
6148 as a shadow password file.</P
6150 >Now, before restarting the Samba daemons you must
6151 edit your <A
6152 HREF="smb.conf.5.html"
6153 TARGET="_top"
6154 ><TT
6155 CLASS="FILENAME"
6156 >smb.conf(5)</TT
6159 > file to tell Samba it should now use domain security.</P
6161 >Change (or add) your <A
6162 HREF="smb.conf.5.html#SECURITY"
6163 TARGET="_top"
6164 > <TT
6165 CLASS="PARAMETER"
6167 >security =</I
6168 ></TT
6169 ></A
6170 > line in the [global] section
6171 of your smb.conf to read:</P
6174 CLASS="COMMAND"
6175 >security = domain</B
6176 ></P
6178 >Next change the <A
6179 HREF="smb.conf.5.html#WORKGROUP"
6180 TARGET="_top"
6181 ><TT
6182 CLASS="PARAMETER"
6184 > workgroup =</I
6185 ></TT
6186 ></A
6187 > line in the [global] section to read: </P
6190 CLASS="COMMAND"
6191 >workgroup = DOM</B
6192 ></P
6194 >as this is the name of the domain we are joining. </P
6196 >You must also have the parameter <A
6197 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
6198 TARGET="_top"
6199 > <TT
6200 CLASS="PARAMETER"
6202 >encrypt passwords</I
6203 ></TT
6204 ></A
6205 > set to <TT
6206 CLASS="CONSTANT"
6207 >yes
6208 </TT
6209 > in order for your users to authenticate to the NT PDC.</P
6211 >Finally, add (or modify) a <A
6212 HREF="smb.conf.5.html#PASSWORDSERVER"
6213 TARGET="_top"
6214 > <TT
6215 CLASS="PARAMETER"
6217 >password server =</I
6218 ></TT
6219 ></A
6220 > line in the [global]
6221 section to read: </P
6224 CLASS="COMMAND"
6225 >password server = DOMPDC DOMBDC1 DOMBDC2</B
6226 ></P
6228 >These are the primary and backup domain controllers Samba
6229 will attempt to contact in order to authenticate users. Samba will
6230 try to contact each of these servers in order, so you may want to
6231 rearrange this list in order to spread out the authentication load
6232 among domain controllers.</P
6234 >Alternatively, if you want smbd to automatically determine
6235 the list of Domain controllers to use for authentication, you may
6236 set this line to be :</P
6239 CLASS="COMMAND"
6240 >password server = *</B
6241 ></P
6243 >This method, which was introduced in Samba 2.0.6,
6244 allows Samba to use exactly the same mechanism that NT does. This
6245 method either broadcasts or uses a WINS database in order to
6246 find domain controllers to authenticate against.</P
6248 >Finally, restart your Samba daemons and get ready for
6249 clients to begin using domain security!</P
6250 ></DIV
6251 ><DIV
6252 CLASS="SECT1"
6253 ><HR><H1
6254 CLASS="SECT1"
6256 NAME="AEN1183"
6257 >8.2. Samba and Windows 2000 Domains</A
6258 ></H1
6260 >Many people have asked regarding the state of Samba's ability to participate in
6261 a Windows 2000 Domain. Samba 2.2 is able to act as a member server of a Windows
6262 2000 domain operating in mixed or native mode.</P
6264 >There is much confusion between the circumstances that require a "mixed" mode
6265 Win2k DC and a when this host can be switched to "native" mode. A "mixed" mode
6266 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
6267 domain. By default, a Win2k DC in "native" mode will still support
6268 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and
6269 NT 4.0. Samba has the same requirements as a Windows NT 4.0 member server.</P
6271 >The steps for adding a Samba 2.2 host to a Win2k domain are the same as those
6272 for adding a Samba server to a Windows NT 4.0 domain. The only exception is that
6273 the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and
6274 Computers" MMC (Microsoft Management Console) plugin.</P
6275 ></DIV
6276 ><DIV
6277 CLASS="SECT1"
6278 ><HR><H1
6279 CLASS="SECT1"
6281 NAME="AEN1188"
6282 >8.3. Why is this better than security = server?</A
6283 ></H1
6285 >Currently, domain security in Samba doesn't free you from
6286 having to create local Unix users to represent the users attaching
6287 to your server. This means that if domain user <TT
6288 CLASS="CONSTANT"
6289 >DOM\fred
6290 </TT
6291 > attaches to your domain security Samba server, there needs
6292 to be a local Unix user fred to represent that user in the Unix
6293 filesystem. This is very similar to the older Samba security mode
6295 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
6296 TARGET="_top"
6297 >security = server</A
6299 where Samba would pass through the authentication request to a Windows
6300 NT server in the same way as a Windows 95 or Windows 98 server would.
6303 >Please refer to the <A
6304 HREF="winbind.html"
6305 TARGET="_top"
6306 >Winbind
6307 paper</A
6308 > for information on a system to automatically
6309 assign UNIX uids and gids to Windows NT Domain users and groups.
6310 This code is available in development branches only at the moment,
6311 but will be moved to release branches soon.</P
6313 >The advantage to domain-level security is that the
6314 authentication in domain-level security is passed down the authenticated
6315 RPC channel in exactly the same way that an NT server would do it. This
6316 means Samba servers now participate in domain trust relationships in
6317 exactly the same way NT servers do (i.e., you can add Samba servers into
6318 a resource domain and have the authentication passed on from a resource
6319 domain PDC to an account domain PDC.</P
6321 >In addition, with <B
6322 CLASS="COMMAND"
6323 >security = server</B
6324 > every Samba
6325 daemon on a server has to keep a connection open to the
6326 authenticating server for as long as that daemon lasts. This can drain
6327 the connection resources on a Microsoft NT server and cause it to run
6328 out of available connections. With <B
6329 CLASS="COMMAND"
6330 >security = domain</B
6332 however, the Samba daemons connect to the PDC/BDC only for as long
6333 as is necessary to authenticate the user, and then drop the connection,
6334 thus conserving PDC connection resources.</P
6336 >And finally, acting in the same manner as an NT server
6337 authenticating to a PDC means that as part of the authentication
6338 reply, the Samba server gets the user identification information such
6339 as the user SID, the list of NT groups the user belongs to, etc. All
6340 this information will allow Samba to be extended in the future into
6341 a mode the developers currently call appliance mode. In this mode,
6342 no local Unix users will be necessary, and Samba will generate Unix
6343 uids and gids from the information passed back from the PDC when a
6344 user is authenticated, making a Samba server truly plug and play
6345 in an NT domain environment. Watch for this code soon.</P
6347 ><EM
6348 >NOTE:</EM
6349 > Much of the text of this document
6350 was first published in the Web magazine <A
6351 HREF="http://www.linuxworld.com"
6352 TARGET="_top"
6354 LinuxWorld</A
6355 > as the article <A
6356 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
6357 TARGET="_top"
6358 >Doing
6359 the NIS/NT Samba</A
6360 >.</P
6361 ></DIV
6362 ></DIV
6363 ><DIV
6364 CLASS="CHAPTER"
6365 ><HR><H1
6367 NAME="SAMBA-PDC"
6368 >Chapter 9. How to Configure Samba 2.2 as a Primary Domain Controller</A
6369 ></H1
6370 ><DIV
6371 CLASS="SECT1"
6372 ><H1
6373 CLASS="SECT1"
6375 NAME="AEN1221"
6376 >9.1. Prerequisite Reading</A
6377 ></H1
6379 >Before you continue reading in this chapter, please make sure
6380 that you are comfortable with configuring basic files services
6381 in smb.conf and how to enable and administer password
6382 encryption in Samba. Theses two topics are covered in the
6384 HREF="smb.conf.5.html"
6385 TARGET="_top"
6386 ><TT
6387 CLASS="FILENAME"
6388 >smb.conf(5)</TT
6389 ></A
6391 manpage and the <A
6392 HREF="ENCRYPTION.html"
6393 TARGET="_top"
6394 >Encryption chapter</A
6396 of this HOWTO Collection.</P
6397 ></DIV
6398 ><DIV
6399 CLASS="SECT1"
6400 ><HR><H1
6401 CLASS="SECT1"
6403 NAME="AEN1227"
6404 >9.2. Background</A
6405 ></H1
6406 ><DIV
6407 CLASS="NOTE"
6408 ><BLOCKQUOTE
6409 CLASS="NOTE"
6412 >Note: </B
6413 ><EM
6414 >Author's Note:</EM
6415 > This document is a combination
6416 of David Bannon's "Samba 2.2 PDC HOWTO" and "Samba NT Domain FAQ".
6417 Both documents are superseded by this one.</P
6418 ></BLOCKQUOTE
6419 ></DIV
6421 >Versions of Samba prior to release 2.2 had marginal capabilities to act
6422 as a Windows NT 4.0 Primary Domain Controller
6424 (PDC). With Samba 2.2.0, we are proud to announce official support for
6425 Windows NT 4.0-style domain logons from Windows NT 4.0 and Windows
6426 2000 clients. This article outlines the steps
6427 necessary for configuring Samba as a PDC. It is necessary to have a
6428 working Samba server prior to implementing the PDC functionality. If
6429 you have not followed the steps outlined in <A
6430 HREF="UNIX_INSTALL.html"
6431 TARGET="_top"
6432 > UNIX_INSTALL.html</A
6433 >, please make sure
6434 that your server is configured correctly before proceeding. Another
6435 good resource in the <A
6436 HREF="smb.conf.5.html"
6437 TARGET="_top"
6438 >smb.conf(5) man
6439 page</A
6440 >. The following functionality should work in 2.2:</P
6442 ></P
6443 ><UL
6444 ><LI
6446 > domain logons for Windows NT 4.0/2000 clients.
6448 ></LI
6449 ><LI
6451 > placing a Windows 9x client in user level security
6453 ></LI
6454 ><LI
6456 > retrieving a list of users and groups from a Samba PDC to
6457 Windows 9x/NT/2000 clients
6459 ></LI
6460 ><LI
6462 > roving (roaming) user profiles
6464 ></LI
6465 ><LI
6467 > Windows NT 4.0-style system policies
6469 ></LI
6470 ></UL
6472 >The following pieces of functionality are not included in the 2.2 release:</P
6474 ></P
6475 ><UL
6476 ><LI
6478 > Windows NT 4 domain trusts
6480 ></LI
6481 ><LI
6483 > SAM replication with Windows NT 4.0 Domain Controllers
6484 (i.e. a Samba PDC and a Windows NT BDC or vice versa)
6486 ></LI
6487 ><LI
6489 > Adding users via the User Manager for Domains
6491 ></LI
6492 ><LI
6494 > Acting as a Windows 2000 Domain Controller (i.e. Kerberos and
6495 Active Directory)
6497 ></LI
6498 ></UL
6500 >Please note that Windows 9x clients are not true members of a domain
6501 for reasons outlined in this article. Therefore the protocol for
6502 support Windows 9x-style domain logons is completely different
6503 from NT4 domain logons and has been officially supported for some
6504 time.</P
6506 >Implementing a Samba PDC can basically be divided into 2 broad
6507 steps.</P
6509 ></P
6510 ><OL
6511 TYPE="1"
6512 ><LI
6514 > Configuring the Samba PDC
6516 ></LI
6517 ><LI
6519 > Creating machine trust accounts and joining clients
6520 to the domain
6522 ></LI
6523 ></OL
6525 >There are other minor details such as user profiles, system
6526 policies, etc... However, these are not necessarily specific
6527 to a Samba PDC as much as they are related to Windows NT networking
6528 concepts. They will be mentioned only briefly here.</P
6529 ></DIV
6530 ><DIV
6531 CLASS="SECT1"
6532 ><HR><H1
6533 CLASS="SECT1"
6535 NAME="AEN1266"
6536 >9.3. Configuring the Samba Domain Controller</A
6537 ></H1
6539 >The first step in creating a working Samba PDC is to
6540 understand the parameters necessary in smb.conf. I will not
6541 attempt to re-explain the parameters here as they are more that
6542 adequately covered in <A
6543 HREF="smb.conf.5.html"
6544 TARGET="_top"
6545 > the smb.conf
6546 man page</A
6547 >. For convenience, the parameters have been
6548 linked with the actual smb.conf description.</P
6550 >Here is an example <TT
6551 CLASS="FILENAME"
6552 >smb.conf</TT
6553 > for acting as a PDC:</P
6555 ><TABLE
6556 BORDER="0"
6557 BGCOLOR="#E0E0E0"
6558 WIDTH="100%"
6559 ><TR
6560 ><TD
6561 ><PRE
6562 CLASS="PROGRAMLISTING"
6563 >[global]
6564 ; Basic server settings
6566 HREF="smb.conf.5.html#NETBIOSNAME"
6567 TARGET="_top"
6568 >netbios name</A
6569 > = <TT
6570 CLASS="REPLACEABLE"
6572 >POGO</I
6573 ></TT
6576 HREF="smb.conf.5.html#WORKGROUP"
6577 TARGET="_top"
6578 >workgroup</A
6579 > = <TT
6580 CLASS="REPLACEABLE"
6582 >NARNIA</I
6583 ></TT
6586 ; we should act as the domain and local master browser
6588 HREF="smb.conf.5.html#OSLEVEL"
6589 TARGET="_top"
6590 >os level</A
6591 > = 64
6593 HREF="smb.conf.5.html#PERFERREDMASTER"
6594 TARGET="_top"
6595 >preferred master</A
6596 > = yes
6598 HREF="smb.conf.5.html#DOMAINMASTER"
6599 TARGET="_top"
6600 >domain master</A
6601 > = yes
6603 HREF="smb.conf.5.html#LOCALMASTER"
6604 TARGET="_top"
6605 >local master</A
6606 > = yes
6608 ; security settings (must user security = user)
6610 HREF="smb.conf.5.html#SECURITYEQUALSUSER"
6611 TARGET="_top"
6612 >security</A
6613 > = user
6615 ; encrypted passwords are a requirement for a PDC
6617 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
6618 TARGET="_top"
6619 >encrypt passwords</A
6620 > = yes
6622 ; support domain logons
6624 HREF="smb.conf.5.html#DOMAINLOGONS"
6625 TARGET="_top"
6626 >domain logons</A
6627 > = yes
6629 ; where to store user profiles?
6631 HREF="smb.conf.5.html#LOGONPATH"
6632 TARGET="_top"
6633 >logon path</A
6634 > = \\%N\profiles\%u
6636 ; where is a user's home directory and where should it
6637 ; be mounted at?
6639 HREF="smb.conf.5.html#LOGONDRIVE"
6640 TARGET="_top"
6641 >logon drive</A
6642 > = H:
6644 HREF="smb.conf.5.html#LOGONHOME"
6645 TARGET="_top"
6646 >logon home</A
6647 > = \\homeserver\%u
6649 ; specify a generic logon script for all users
6650 ; this is a relative **DOS** path to the [netlogon] share
6652 HREF="smb.conf.5.html#LOGONSCRIPT"
6653 TARGET="_top"
6654 >logon script</A
6655 > = logon.cmd
6657 ; necessary share for domain controller
6658 [netlogon]
6660 HREF="smb.conf.5.html#PATH"
6661 TARGET="_top"
6662 >path</A
6663 > = /usr/local/samba/lib/netlogon
6665 HREF="smb.conf.5.html#READONLY"
6666 TARGET="_top"
6667 >read only</A
6668 > = yes
6670 HREF="smb.conf.5.html#WRITELIST"
6671 TARGET="_top"
6672 >write list</A
6673 > = <TT
6674 CLASS="REPLACEABLE"
6676 >ntadmin</I
6677 ></TT
6680 ; share for storing user profiles
6681 [profiles]
6683 HREF="smb.conf.5.html#PATH"
6684 TARGET="_top"
6685 >path</A
6686 > = /export/smb/ntprofile
6688 HREF="smb.conf.5.html#READONLY"
6689 TARGET="_top"
6690 >read only</A
6691 > = no
6693 HREF="smb.conf.5.html#CREATEMASK"
6694 TARGET="_top"
6695 >create mask</A
6696 > = 0600
6698 HREF="smb.conf.5.html#DIRECTORYMASK"
6699 TARGET="_top"
6700 >directory mask</A
6701 > = 0700</PRE
6702 ></TD
6703 ></TR
6704 ></TABLE
6705 ></P
6707 >There are a couple of points to emphasize in the above configuration.</P
6709 ></P
6710 ><UL
6711 ><LI
6713 > Encrypted passwords must be enabled. For more details on how
6714 to do this, refer to <A
6715 HREF="ENCRYPTION.html"
6716 TARGET="_top"
6717 >ENCRYPTION.html</A
6720 ></LI
6721 ><LI
6723 > The server must support domain logons and a
6725 CLASS="FILENAME"
6726 >[netlogon]</TT
6727 > share
6729 ></LI
6730 ><LI
6732 > The server must be the domain master browser in order for Windows
6733 client to locate the server as a DC. Please refer to the various
6734 Network Browsing documentation included with this distribution for
6735 details.
6737 ></LI
6738 ></UL
6740 >As Samba 2.2 does not offer a complete implementation of group mapping
6741 between Windows NT groups and Unix groups (this is really quite
6742 complicated to explain in a short space), you should refer to the
6744 HREF="smb.conf.5.html#DOMAINADMINGROUP"
6745 TARGET="_top"
6746 >domain admin
6747 group</A
6748 > smb.conf parameter for information of creating "Domain
6749 Admins" style accounts.</P
6750 ></DIV
6751 ><DIV
6752 CLASS="SECT1"
6753 ><HR><H1
6754 CLASS="SECT1"
6756 NAME="AEN1309"
6757 >9.4. Creating Machine Trust Accounts and Joining Clients to the
6758 Domain</A
6759 ></H1
6761 >A machine trust account is a Samba account that is used to
6762 authenticate a client machine (rather than a user) to the Samba
6763 server. In Windows terminology, this is known as a "Computer
6764 Account."</P
6766 >The password of a machine trust account acts as the shared secret for
6767 secure communication with the Domain Controller. This is a security
6768 feature to prevent an unauthorized machine with the same NetBIOS name
6769 from joining the domain and gaining access to domain user/group
6770 accounts. Windows NT and 2000 clients use machine trust accounts, but
6771 Windows 9x clients do not. Hence, a Windows 9x client is never a true
6772 member of a domain because it does not possess a machine trust
6773 account, and thus has no shared secret with the domain controller.</P
6775 >A Windows PDC stores each machine trust account in the Windows
6776 Registry. A Samba PDC, however, stores each machine trust account
6777 in two parts, as follows:
6780 ></P
6781 ><UL
6782 ><LI
6784 >A Samba account, stored in the same location as user
6785 LanMan and NT password hashes (currently
6787 CLASS="FILENAME"
6788 >smbpasswd</TT
6789 >). The Samba account
6790 possesses and uses only the NT password hash.</P
6791 ></LI
6792 ><LI
6794 >A corresponding Unix account, typically stored in
6796 CLASS="FILENAME"
6797 >/etc/passwd</TT
6798 >. (Future releases will alleviate the need to
6799 create <TT
6800 CLASS="FILENAME"
6801 >/etc/passwd</TT
6802 > entries.) </P
6803 ></LI
6804 ></UL
6805 ></P
6807 >There are two ways to create machine trust accounts:</P
6809 ></P
6810 ><UL
6811 ><LI
6813 > Manual creation. Both the Samba and corresponding
6814 Unix account are created by hand.</P
6815 ></LI
6816 ><LI
6818 > "On-the-fly" creation. The Samba machine trust
6819 account is automatically created by Samba at the time the client
6820 is joined to the domain. (For security, this is the
6821 recommended method.) The corresponding Unix account may be
6822 created automatically or manually. </P
6823 ></LI
6824 ></UL
6825 ><DIV
6826 CLASS="SECT2"
6827 ><HR><H2
6828 CLASS="SECT2"
6830 NAME="AEN1328"
6831 >9.4.1. Manual Creation of Machine Trust Accounts</A
6832 ></H2
6834 >The first step in manually creating a machine trust account is to
6835 manually create the corresponding Unix account in
6837 CLASS="FILENAME"
6838 >/etc/passwd</TT
6839 >. This can be done using
6841 CLASS="COMMAND"
6842 >vipw</B
6843 > or other 'add user' command that is normally
6844 used to create new Unix accounts. The following is an example for a
6845 Linux based Samba server:</P
6847 > <TT
6848 CLASS="PROMPT"
6849 >root# </TT
6851 CLASS="COMMAND"
6852 >/usr/sbin/useradd -g 100 -d /dev/null -c <TT
6853 CLASS="REPLACEABLE"
6855 >"machine
6856 nickname"</I
6857 ></TT
6858 > -s /bin/false <TT
6859 CLASS="REPLACEABLE"
6861 >machine_name</I
6862 ></TT
6863 >$ </B
6864 ></P
6866 ><TT
6867 CLASS="PROMPT"
6868 >root# </TT
6870 CLASS="COMMAND"
6871 >passwd -l <TT
6872 CLASS="REPLACEABLE"
6874 >machine_name</I
6875 ></TT
6876 >$</B
6877 ></P
6879 >The <TT
6880 CLASS="FILENAME"
6881 >/etc/passwd</TT
6882 > entry will list the machine name
6883 with a "$" appended, won't have a password, will have a null shell and no
6884 home directory. For example a machine named 'doppy' would have an
6886 CLASS="FILENAME"
6887 >/etc/passwd</TT
6888 > entry like this:</P
6890 ><TABLE
6891 BORDER="0"
6892 BGCOLOR="#E0E0E0"
6893 WIDTH="100%"
6894 ><TR
6895 ><TD
6896 ><PRE
6897 CLASS="PROGRAMLISTING"
6898 >doppy$:x:505:501:<TT
6899 CLASS="REPLACEABLE"
6901 >machine_nickname</I
6902 ></TT
6903 >:/dev/null:/bin/false</PRE
6904 ></TD
6905 ></TR
6906 ></TABLE
6907 ></P
6909 >Above, <TT
6910 CLASS="REPLACEABLE"
6912 >machine_nickname</I
6913 ></TT
6914 > can be any
6915 descriptive name for the client, i.e., BasementComputer.
6917 CLASS="REPLACEABLE"
6919 >machine_name</I
6920 ></TT
6921 > absolutely must be the NetBIOS
6922 name of the client to be joined to the domain. The "$" must be
6923 appended to the NetBIOS name of the client or Samba will not recognize
6924 this as a machine trust account.</P
6926 >Now that the corresponding Unix account has been created, the next step is to create
6927 the Samba account for the client containing the well-known initial
6928 machine trust account password. This can be done using the <A
6929 HREF="smbpasswd.8.html"
6930 TARGET="_top"
6932 CLASS="COMMAND"
6933 >smbpasswd(8)</B
6934 ></A
6935 > command
6936 as shown here:</P
6938 ><TT
6939 CLASS="PROMPT"
6940 >root# </TT
6942 CLASS="COMMAND"
6943 >smbpasswd -a -m <TT
6944 CLASS="REPLACEABLE"
6946 >machine_name</I
6947 ></TT
6948 ></B
6949 ></P
6951 >where <TT
6952 CLASS="REPLACEABLE"
6954 >machine_name</I
6955 ></TT
6956 > is the machine's NetBIOS
6957 name. The RID of the new machine account is generated from the UID of
6958 the corresponding Unix account.</P
6959 ><DIV
6960 CLASS="WARNING"
6962 ></P
6963 ><TABLE
6964 CLASS="WARNING"
6965 BORDER="1"
6966 WIDTH="100%"
6967 ><TR
6968 ><TD
6969 ALIGN="CENTER"
6971 >Join the client to the domain immediately</B
6972 ></TD
6973 ></TR
6974 ><TR
6975 ><TD
6976 ALIGN="LEFT"
6978 > Manually creating a machine trust account using this method is the
6979 equivalent of creating a machine trust account on a Windows NT PDC using
6980 the "Server Manager". From the time at which the account is created
6981 to the time which the client joins the domain and changes the password,
6982 your domain is vulnerable to an intruder joining your domain using a
6983 a machine with the same NetBIOS name. A PDC inherently trusts
6984 members of the domain and will serve out a large degree of user
6985 information to such clients. You have been warned!
6987 ></TD
6988 ></TR
6989 ></TABLE
6990 ></DIV
6991 ></DIV
6992 ><DIV
6993 CLASS="SECT2"
6994 ><HR><H2
6995 CLASS="SECT2"
6997 NAME="AEN1363"
6998 >9.4.2. "On-the-Fly" Creation of Machine Trust Accounts</A
6999 ></H2
7001 >The second (and recommended) way of creating machine trust accounts is
7002 simply to allow the Samba server to create them as needed when the client
7003 is joined to the domain. </P
7005 >Since each Samba machine trust account requires a corresponding
7006 Unix account, a method for automatically creating the
7007 Unix account is usually supplied; this requires configuration of the
7009 HREF="smb.conf.5.html#ADDUSERSCRIPT"
7010 TARGET="_top"
7011 >add user script</A
7013 option in <TT
7014 CLASS="FILENAME"
7015 >smb.conf</TT
7016 >. This
7017 method is not required, however; corresponding Unix accounts may also
7018 be created manually.</P
7020 >Below is an example for a RedHat 6.2 Linux system.</P
7022 ><TABLE
7023 BORDER="0"
7024 BGCOLOR="#E0E0E0"
7025 WIDTH="100%"
7026 ><TR
7027 ><TD
7028 ><PRE
7029 CLASS="PROGRAMLISTING"
7030 >[global]
7031 # &#60;...remainder of parameters...&#62;
7032 add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u </PRE
7033 ></TD
7034 ></TR
7035 ></TABLE
7036 ></P
7037 ></DIV
7038 ><DIV
7039 CLASS="SECT2"
7040 ><HR><H2
7041 CLASS="SECT2"
7043 NAME="AEN1372"
7044 >9.4.3. Joining the Client to the Domain</A
7045 ></H2
7047 >The procedure for joining a client to the domain varies with the
7048 version of Windows.</P
7050 ></P
7051 ><UL
7052 ><LI
7054 ><EM
7055 >Windows 2000</EM
7056 ></P
7058 > When the user elects to join the client to a domain, Windows prompts for
7059 an account and password that is privileged to join the domain. A
7060 Samba administrative account (i.e., a Samba account that has root
7061 privileges on the Samba server) must be entered here; the
7062 operation will fail if an ordinary user account is given.
7063 The password for this account should be
7064 set to a different password than the associated
7066 CLASS="FILENAME"
7067 >/etc/passwd</TT
7068 > entry, for security
7069 reasons. </P
7071 >The session key of the Samba administrative account acts as an
7072 encryption key for setting the password of the machine trust
7073 account. The machine trust account will be created on-the-fly, or
7074 updated if it already exists.</P
7075 ></LI
7076 ><LI
7078 ><EM
7079 >Windows NT</EM
7080 ></P
7082 > If the machine trust account was created manually, on the
7083 Identification Changes menu enter the domain name, but do not
7084 check the box "Create a Computer Account in the Domain." In this case,
7085 the existing machine trust account is used to join the machine to
7086 the domain.</P
7088 > If the machine trust account is to be created
7089 on-the-fly, on the Identification Changes menu enter the domain
7090 name, and check the box "Create a Computer Account in the Domain." In
7091 this case, joining the domain proceeds as above for Windows 2000
7092 (i.e., you must supply a Samba administrative account when
7093 prompted).</P
7094 ></LI
7095 ></UL
7096 ></DIV
7097 ></DIV
7098 ><DIV
7099 CLASS="SECT1"
7100 ><HR><H1
7101 CLASS="SECT1"
7103 NAME="AEN1387"
7104 >9.5. Common Problems and Errors</A
7105 ></H1
7107 ></P
7109 ></P
7110 ><UL
7111 ><LI
7113 > <EM
7114 >I cannot include a '$' in a machine name.</EM
7118 > A 'machine name' in (typically) <TT
7119 CLASS="FILENAME"
7120 >/etc/passwd</TT
7122 of the machine name with a '$' appended. FreeBSD (and other BSD
7123 systems?) won't create a user with a '$' in their name.
7126 > The problem is only in the program used to make the entry, once
7127 made, it works perfectly. So create a user without the '$' and
7128 use <B
7129 CLASS="COMMAND"
7130 >vipw</B
7131 > to edit the entry, adding the '$'. Or create
7132 the whole entry with vipw if you like, make sure you use a
7133 unique User ID !
7135 ></LI
7136 ><LI
7138 > <EM
7139 >I get told "You already have a connection to the Domain...."
7140 or "Cannot join domain, the credentials supplied conflict with an
7141 existing set.." when creating a machine trust account.</EM
7145 > This happens if you try to create a machine trust account from the
7146 machine itself and already have a connection (e.g. mapped drive)
7147 to a share (or IPC$) on the Samba PDC. The following command
7148 will remove all network drive connections:
7151 > <TT
7152 CLASS="PROMPT"
7153 >C:\WINNT\&#62;</TT
7154 > <B
7155 CLASS="COMMAND"
7156 >net use * /d</B
7160 > Further, if the machine is a already a 'member of a workgroup' that
7161 is the same name as the domain you are joining (bad idea) you will
7162 get this message. Change the workgroup name to something else, it
7163 does not matter what, reboot, and try again.
7165 ></LI
7166 ><LI
7168 > <EM
7169 >The system can not log you on (C000019B)....</EM
7173 >I joined the domain successfully but after upgrading
7174 to a newer version of the Samba code I get the message, "The system
7175 can not log you on (C000019B), Please try a gain or consult your
7176 system administrator" when attempting to logon.
7179 > This occurs when the domain SID stored in
7181 CLASS="FILENAME"
7182 >private/WORKGROUP.SID</TT
7183 > is
7184 changed. For example, you remove the file and <B
7185 CLASS="COMMAND"
7186 >smbd</B
7187 > automatically
7188 creates a new one. Or you are swapping back and forth between
7189 versions 2.0.7, TNG and the HEAD branch code (not recommended). The
7190 only way to correct the problem is to restore the original domain
7191 SID or remove the domain client from the domain and rejoin.
7193 ></LI
7194 ><LI
7196 > <EM
7197 >The machine trust account for this computer either does not
7198 exist or is not accessible.</EM
7202 > When I try to join the domain I get the message "The machine account
7203 for this computer either does not exist or is not accessible". What's
7204 wrong?
7207 > This problem is caused by the PDC not having a suitable machine trust account.
7208 If you are using the <TT
7209 CLASS="PARAMETER"
7211 >add user script</I
7212 ></TT
7213 > method to create
7214 accounts then this would indicate that it has not worked. Ensure the domain
7215 admin user system is working.
7218 > Alternatively if you are creating account entries manually then they
7219 have not been created correctly. Make sure that you have the entry
7220 correct for the machine trust account in smbpasswd file on the Samba PDC.
7221 If you added the account using an editor rather than using the smbpasswd
7222 utility, make sure that the account name is the machine NetBIOS name
7223 with a '$' appended to it ( i.e. computer_name$ ). There must be an entry
7224 in both /etc/passwd and the smbpasswd file. Some people have reported
7225 that inconsistent subnet masks between the Samba server and the NT
7226 client have caused this problem. Make sure that these are consistent
7227 for both client and server.
7229 ></LI
7230 ><LI
7232 > <EM
7233 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
7234 I get a message about my account being disabled.</EM
7238 > This problem is caused by a PAM related bug in Samba 2.2.0. This bug is
7239 fixed in 2.2.1. Other symptoms could be unaccessible shares on
7240 NT/W2K member servers in the domain or the following error in your smbd.log:
7241 passdb/pampass.c:pam_account(268) PAM: UNKNOWN ERROR for User: %user%
7244 > At first be ensure to enable the useraccounts with <B
7245 CLASS="COMMAND"
7246 >smbpasswd -e
7247 %user%</B
7248 >, this is normally done, when you create an account.
7251 > In order to work around this problem in 2.2.0, configure the
7253 CLASS="PARAMETER"
7255 >account</I
7256 ></TT
7257 > control flag in
7259 CLASS="FILENAME"
7260 >/etc/pam.d/samba</TT
7261 > file as follows:
7264 ><TABLE
7265 BORDER="0"
7266 BGCOLOR="#E0E0E0"
7267 WIDTH="90%"
7268 ><TR
7269 ><TD
7270 ><PRE
7271 CLASS="PROGRAMLISTING"
7272 > account required pam_permit.so
7273 </PRE
7274 ></TD
7275 ></TR
7276 ></TABLE
7277 ></P
7279 > If you want to remain backward compatibility to samba 2.0.x use
7281 CLASS="FILENAME"
7282 >pam_permit.so</TT
7283 >, it's also possible to use
7285 CLASS="FILENAME"
7286 >pam_pwdb.so</TT
7287 >. There are some bugs if you try to
7288 use <TT
7289 CLASS="FILENAME"
7290 >pam_unix.so</TT
7291 >, if you need this, be ensure to use
7292 the most recent version of this file.
7294 ></LI
7295 ></UL
7296 ></DIV
7297 ><DIV
7298 CLASS="SECT1"
7299 ><HR><H1
7300 CLASS="SECT1"
7302 NAME="AEN1435"
7303 >9.6. System Policies and Profiles</A
7304 ></H1
7306 >Much of the information necessary to implement System Policies and
7307 Roving User Profiles in a Samba domain is the same as that for
7308 implementing these same items in a Windows NT 4.0 domain.
7309 You should read the white paper <A
7310 HREF="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp"
7311 TARGET="_top"
7312 >Implementing
7313 Profiles and Policies in Windows NT 4.0</A
7314 > available from Microsoft.</P
7316 >Here are some additional details:</P
7318 ></P
7319 ><UL
7320 ><LI
7322 > <EM
7323 >What about Windows NT Policy Editor?</EM
7327 > To create or edit <TT
7328 CLASS="FILENAME"
7329 >ntconfig.pol</TT
7330 > you must use
7331 the NT Server Policy Editor, <B
7332 CLASS="COMMAND"
7333 >poledit.exe</B
7334 > which
7335 is included with NT Server but <EM
7336 >not NT Workstation</EM
7338 There is a Policy Editor on a NTws
7339 but it is not suitable for creating <EM
7340 >Domain Policies</EM
7342 Further, although the Windows 95
7343 Policy Editor can be installed on an NT Workstation/Server, it will not
7344 work with NT policies because the registry key that are set by the policy templates.
7345 However, the files from the NT Server will run happily enough on an NTws.
7346 You need <TT
7347 CLASS="FILENAME"
7348 >poledit.exe, common.adm</TT
7349 > and <TT
7350 CLASS="FILENAME"
7351 >winnt.adm</TT
7352 >. It is convenient
7353 to put the two *.adm files in <TT
7354 CLASS="FILENAME"
7355 >c:\winnt\inf</TT
7356 > which is where
7357 the binary will look for them unless told otherwise. Note also that that
7358 directory is 'hidden'.
7361 > The Windows NT policy editor is also included with the Service Pack 3 (and
7362 later) for Windows NT 4.0. Extract the files using <B
7363 CLASS="COMMAND"
7364 >servicepackname /x</B
7366 i.e. that's <B
7367 CLASS="COMMAND"
7368 >Nt4sp6ai.exe /x</B
7369 > for service pack 6a. The policy editor,
7371 CLASS="COMMAND"
7372 >poledit.exe</B
7373 > and the associated template files (*.adm) should
7374 be extracted as well. It is also possible to downloaded the policy template
7375 files for Office97 and get a copy of the policy editor. Another possible
7376 location is with the Zero Administration Kit available for download from Microsoft.
7378 ></LI
7379 ><LI
7381 > <EM
7382 >Can Win95 do Policies?</EM
7386 > Install the group policy handler for Win9x to pick up group
7387 policies. Look on the Win98 CD in <TT
7388 CLASS="FILENAME"
7389 >\tools\reskit\netadmin\poledit</TT
7391 Install group policies on a Win9x client by double-clicking
7393 CLASS="FILENAME"
7394 >grouppol.inf</TT
7395 >. Log off and on again a couple of
7396 times and see if Win98 picks up group policies. Unfortunately this needs
7397 to be done on every Win9x machine that uses group policies....
7400 > If group policies don't work one reports suggests getting the updated
7401 (read: working) grouppol.dll for Windows 9x. The group list is grabbed
7402 from /etc/group.
7404 ></LI
7405 ><LI
7407 > <EM
7408 >How do I get 'User Manager' and 'Server Manager'</EM
7412 > Since I don't need to buy an NT Server CD now, how do I get
7413 the 'User Manager for Domains', the 'Server Manager'?
7416 > Microsoft distributes a version of these tools called nexus for
7417 installation on Windows 95 systems. The tools set includes
7420 ></P
7421 ><UL
7422 ><LI
7424 >Server Manager</P
7425 ></LI
7426 ><LI
7428 >User Manager for Domains</P
7429 ></LI
7430 ><LI
7432 >Event Viewer</P
7433 ></LI
7434 ></UL
7436 > Click here to download the archived file <A
7437 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE"
7438 TARGET="_top"
7439 >ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</A
7443 > The Windows NT 4.0 version of the 'User Manager for
7444 Domains' and 'Server Manager' are available from Microsoft via ftp
7445 from <A
7446 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE"
7447 TARGET="_top"
7448 >ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</A
7451 ></LI
7452 ></UL
7453 ></DIV
7454 ><DIV
7455 CLASS="SECT1"
7456 ><HR><H1
7457 CLASS="SECT1"
7459 NAME="AEN1479"
7460 >9.7. What other help can I get?</A
7461 ></H1
7463 >There are many sources of information available in the form
7464 of mailing lists, RFC's and documentation. The docs that come
7465 with the samba distribution contain very good explanations of
7466 general SMB topics such as browsing.</P
7468 ></P
7469 ><UL
7470 ><LI
7472 > <EM
7473 >What are some diagnostics tools I can use to debug the domain logon
7474 process and where can I find them?</EM
7478 > One of the best diagnostic tools for debugging problems is Samba itself.
7479 You can use the -d option for both smbd and nmbd to specify what
7480 'debug level' at which to run. See the man pages on smbd, nmbd and
7481 smb.conf for more information on debugging options. The debug
7482 level can range from 1 (the default) to 10 (100 for debugging passwords).
7485 > Another helpful method of debugging is to compile samba using the
7487 CLASS="COMMAND"
7488 >gcc -g </B
7489 > flag. This will include debug
7490 information in the binaries and allow you to attach gdb to the
7491 running smbd / nmbd process. In order to attach gdb to an smbd
7492 process for an NT workstation, first get the workstation to make the
7493 connection. Pressing ctrl-alt-delete and going down to the domain box
7494 is sufficient (at least, on the first time you join the domain) to
7495 generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation
7496 maintains an open connection, and therefore there will be an smbd
7497 process running (assuming that you haven't set a really short smbd
7498 idle timeout) So, in between pressing ctrl alt delete, and actually
7499 typing in your password, you can gdb attach and continue.
7502 > Some useful samba commands worth investigating:
7505 ></P
7506 ><UL
7507 ><LI
7509 >testparam | more</P
7510 ></LI
7511 ><LI
7513 >smbclient -L //{netbios name of server}</P
7514 ></LI
7515 ></UL
7517 > An SMB enabled version of tcpdump is available from
7519 HREF="http://www.tcpdump.org/"
7520 TARGET="_top"
7521 >http://www.tcpdup.org/</A
7523 Ethereal, another good packet sniffer for Unix and Win32
7524 hosts, can be downloaded from <A
7525 HREF="http://www.ethereal.com/"
7526 TARGET="_top"
7527 >http://www.ethereal.com</A
7531 > For tracing things on the Microsoft Windows NT, Network Monitor
7532 (aka. netmon) is available on the Microsoft Developer Network CD's,
7533 the Windows NT Server install CD and the SMS CD's. The version of
7534 netmon that ships with SMS allows for dumping packets between any two
7535 computers (i.e. placing the network interface in promiscuous mode).
7536 The version on the NT Server install CD will only allow monitoring
7537 of network traffic directed to the local NT box and broadcasts on the
7538 local subnet. Be aware that Ethereal can read and write netmon
7539 formatted files.
7541 ></LI
7542 ><LI
7544 > <EM
7545 >How do I install 'Network Monitor' on an NT Workstation
7546 or a Windows 9x box?</EM
7550 > Installing netmon on an NT workstation requires a couple
7551 of steps. The following are for installing Netmon V4.00.349, which comes
7552 with Microsoft Windows NT Server 4.0, on Microsoft Windows NT
7553 Workstation 4.0. The process should be similar for other version of
7554 Windows NT / Netmon. You will need both the Microsoft Windows
7555 NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
7558 > Initially you will need to install 'Network Monitor Tools and Agent'
7559 on the NT Server. To do this
7562 ></P
7563 ><UL
7564 ><LI
7566 >Goto Start - Settings - Control Panel -
7567 Network - Services - Add </P
7568 ></LI
7569 ><LI
7571 >Select the 'Network Monitor Tools and Agent' and
7572 click on 'OK'.</P
7573 ></LI
7574 ><LI
7576 >Click 'OK' on the Network Control Panel.
7578 ></LI
7579 ><LI
7581 >Insert the Windows NT Server 4.0 install CD
7582 when prompted.</P
7583 ></LI
7584 ></UL
7586 > At this point the Netmon files should exist in
7588 CLASS="FILENAME"
7589 >%SYSTEMROOT%\System32\netmon\*.*</TT
7591 Two subdirectories exist as well, <TT
7592 CLASS="FILENAME"
7593 >parsers\</TT
7595 which contains the necessary DLL's for parsing the netmon packet
7596 dump, and <TT
7597 CLASS="FILENAME"
7598 >captures\</TT
7602 > In order to install the Netmon tools on an NT Workstation, you will
7603 first need to install the 'Network Monitor Agent' from the Workstation
7604 install CD.
7607 ></P
7608 ><UL
7609 ><LI
7611 >Goto Start - Settings - Control Panel -
7612 Network - Services - Add</P
7613 ></LI
7614 ><LI
7616 >Select the 'Network Monitor Agent' and click
7617 on 'OK'.</P
7618 ></LI
7619 ><LI
7621 >Click 'OK' on the Network Control Panel.
7623 ></LI
7624 ><LI
7626 >Insert the Windows NT Workstation 4.0 install
7627 CD when prompted.</P
7628 ></LI
7629 ></UL
7631 > Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.*
7632 to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set
7633 permissions as you deem appropriate for your site. You will need
7634 administrative rights on the NT box to run netmon.
7637 > To install Netmon on a Windows 9x box install the network monitor agent
7638 from the Windows 9x CD (\admin\nettools\netmon). There is a readme
7639 file located with the netmon driver files on the CD if you need
7640 information on how to do this. Copy the files from a working
7641 Netmon installation.
7643 ></LI
7644 ><LI
7646 > The following is a list if helpful URLs and other links:
7649 ></P
7650 ><UL
7651 ><LI
7653 >Home of Samba site <A
7654 HREF="http://samba.org"
7655 TARGET="_top"
7656 > http://samba.org</A
7657 >. We have a mirror near you !</P
7658 ></LI
7659 ><LI
7661 > The <EM
7662 >Development</EM
7663 > document
7664 on the Samba mirrors might mention your problem. If so,
7665 it might mean that the developers are working on it.</P
7666 ></LI
7667 ><LI
7669 >See how Scott Merrill simulates a BDC behavior at
7671 HREF="http://www.skippy.net/linux/smb-howto.html"
7672 TARGET="_top"
7673 > http://www.skippy.net/linux/smb-howto.html</A
7674 >. </P
7675 ></LI
7676 ><LI
7678 >Although 2.0.7 has almost had its day as a PDC, David Bannon will
7679 keep the 2.0.7 PDC pages at <A
7680 HREF="http://bioserve.latrobe.edu.au/samba"
7681 TARGET="_top"
7682 > http://bioserve.latrobe.edu.au/samba</A
7683 > going for a while yet.</P
7684 ></LI
7685 ><LI
7687 >Misc links to CIFS information
7689 HREF="http://samba.org/cifs/"
7690 TARGET="_top"
7691 >http://samba.org/cifs/</A
7692 ></P
7693 ></LI
7694 ><LI
7696 >NT Domains for Unix <A
7697 HREF="http://mailhost.cb1.com/~lkcl/ntdom/"
7698 TARGET="_top"
7699 > http://mailhost.cb1.com/~lkcl/ntdom/</A
7700 ></P
7701 ></LI
7702 ><LI
7704 >FTP site for older SMB specs:
7706 HREF="ftp://ftp.microsoft.com/developr/drg/CIFS/"
7707 TARGET="_top"
7708 > ftp://ftp.microsoft.com/developr/drg/CIFS/</A
7709 ></P
7710 ></LI
7711 ></UL
7712 ></LI
7713 ></UL
7715 ></P
7716 ><UL
7717 ><LI
7719 > <EM
7720 >How do I get help from the mailing lists?</EM
7724 > There are a number of Samba related mailing lists. Go to <A
7725 HREF="http://samba.org"
7726 TARGET="_top"
7727 >http://samba.org</A
7728 >, click on your nearest mirror
7729 and then click on <B
7730 CLASS="COMMAND"
7731 >Support</B
7732 > and then click on <B
7733 CLASS="COMMAND"
7734 > Samba related mailing lists</B
7738 > For questions relating to Samba TNG go to
7740 HREF="http://www.samba-tng.org/"
7741 TARGET="_top"
7742 >http://www.samba-tng.org/</A
7744 It has been requested that you don't post questions about Samba-TNG to the
7745 main stream Samba lists.</P
7747 > If you post a message to one of the lists please observe the following guide lines :
7750 ></P
7751 ><UL
7752 ><LI
7754 > Always remember that the developers are volunteers, they are
7755 not paid and they never guarantee to produce a particular feature at
7756 a particular time. Any time lines are 'best guess' and nothing more.
7758 ></LI
7759 ><LI
7761 > Always mention what version of samba you are using and what
7762 operating system its running under. You should probably list the
7763 relevant sections of your smb.conf file, at least the options
7764 in [global] that affect PDC support.</P
7765 ></LI
7766 ><LI
7768 >In addition to the version, if you obtained Samba via
7769 CVS mention the date when you last checked it out.</P
7770 ></LI
7771 ><LI
7773 > Try and make your question clear and brief, lots of long,
7774 convoluted questions get deleted before they are completely read !
7775 Don't post html encoded messages (if you can select colour or font
7776 size its html).</P
7777 ></LI
7778 ><LI
7780 > If you run one of those nifty 'I'm on holidays' things when
7781 you are away, make sure its configured to not answer mailing lists.
7783 ></LI
7784 ><LI
7786 > Don't cross post. Work out which is the best list to post to
7787 and see what happens, i.e. don't post to both samba-ntdom and samba-technical.
7788 Many people active on the lists subscribe to more
7789 than one list and get annoyed to see the same message two or more times.
7790 Often someone will see a message and thinking it would be better dealt
7791 with on another, will forward it on for you.</P
7792 ></LI
7793 ><LI
7795 >You might include <EM
7796 >partial</EM
7798 log files written at a debug level set to as much as 20.
7799 Please don't send the entire log but enough to give the context of the
7800 error messages.</P
7801 ></LI
7802 ><LI
7804 >(Possibly) If you have a complete netmon trace ( from the opening of
7805 the pipe to the error ) you can send the *.CAP file as well.</P
7806 ></LI
7807 ><LI
7809 >Please think carefully before attaching a document to an email.
7810 Consider pasting the relevant parts into the body of the message. The samba
7811 mailing lists go to a huge number of people, do they all need a copy of your
7812 smb.conf in their attach directory?</P
7813 ></LI
7814 ></UL
7815 ></LI
7816 ><LI
7818 > <EM
7819 >How do I get off the mailing lists?</EM
7823 >To have your name removed from a samba mailing list, go to the
7824 same place you went to to get on it. Go to <A
7825 HREF="http://lists.samba.org/"
7826 TARGET="_top"
7827 >http://lists.samba.org</A
7829 click on your nearest mirror and then click on <B
7830 CLASS="COMMAND"
7831 >Support</B
7832 > and
7833 then click on <B
7834 CLASS="COMMAND"
7835 > Samba related mailing lists</B
7836 >. Or perhaps see
7838 HREF="http://lists.samba.org/mailman/roster/samba-ntdom"
7839 TARGET="_top"
7840 >here</A
7844 > Please don't post messages to the list asking to be removed, you will just
7845 be referred to the above address (unless that process failed in some way...)
7847 ></LI
7848 ></UL
7849 ></DIV
7850 ><DIV
7851 CLASS="SECT1"
7852 ><HR><H1
7853 CLASS="SECT1"
7855 NAME="AEN1593"
7856 >9.8. Domain Control for Windows 9x/ME</A
7857 ></H1
7858 ><DIV
7859 CLASS="NOTE"
7860 ><BLOCKQUOTE
7861 CLASS="NOTE"
7864 >Note: </B
7865 >The following section contains much of the original
7866 DOMAIN.txt file previously included with Samba. Much of
7867 the material is based on what went into the book <EM
7868 >Special
7869 Edition, Using Samba</EM
7870 >, by Richard Sharpe.</P
7871 ></BLOCKQUOTE
7872 ></DIV
7874 >A domain and a workgroup are exactly the same thing in terms of network
7875 browsing. The difference is that a distributable authentication
7876 database is associated with a domain, for secure login access to a
7877 network. Also, different access rights can be granted to users if they
7878 successfully authenticate against a domain logon server (NT server and
7879 other systems based on NT server support this, as does at least Samba TNG now).</P
7881 >The SMB client logging on to a domain has an expectation that every other
7882 server in the domain should accept the same authentication information.
7883 Network browsing functionality of domains and workgroups is
7884 identical and is explained in BROWSING.txt. It should be noted, that browsing
7885 is totally orthogonal to logon support.</P
7887 >Issues related to the single-logon network model are discussed in this
7888 section. Samba supports domain logons, network logon scripts, and user
7889 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
7890 which will be the focus of this section.</P
7892 >When an SMB client in a domain wishes to logon it broadcast requests for a
7893 logon server. The first one to reply gets the job, and validates its
7894 password using whatever mechanism the Samba administrator has installed.
7895 It is possible (but very stupid) to create a domain where the user
7896 database is not shared between servers, i.e. they are effectively workgroup
7897 servers advertising themselves as participating in a domain. This
7898 demonstrates how authentication is quite different from but closely
7899 involved with domains.</P
7901 >Using these features you can make your clients verify their logon via
7902 the Samba server; make clients run a batch file when they logon to
7903 the network and download their preferences, desktop and start menu.</P
7905 >Before launching into the configuration instructions, it is
7906 worthwhile lookingat how a Windows 9x/ME client performs a logon:</P
7908 ></P
7909 ><OL
7910 TYPE="1"
7911 ><LI
7913 > The client broadcasts (to the IP broadcast address of the subnet it is in)
7914 a NetLogon request. This is sent to the NetBIOS name DOMAIN&#60;1c&#62; at the
7915 NetBIOS layer. The client chooses the first response it receives, which
7916 contains the NetBIOS name of the logon server to use in the format of
7917 \\SERVER.
7919 ></LI
7920 ><LI
7922 > The client then connects to that server, logs on (does an SMBsessetupX) and
7923 then connects to the IPC$ share (using an SMBtconX).
7925 ></LI
7926 ><LI
7928 > The client then does a NetWkstaUserLogon request, which retrieves the name
7929 of the user's logon script.
7931 ></LI
7932 ><LI
7934 > The client then connects to the NetLogon share and searches for this
7935 and if it is found and can be read, is retrieved and executed by the client.
7936 After this, the client disconnects from the NetLogon share.
7938 ></LI
7939 ><LI
7941 > The client then sends a NetUserGetInfo request to the server, to retrieve
7942 the user's home share, which is used to search for profiles. Since the
7943 response to the NetUserGetInfo request does not contain much more
7944 the user's home share, profiles for Win9X clients MUST reside in the user
7945 home directory.
7947 ></LI
7948 ><LI
7950 > The client then connects to the user's home share and searches for the
7951 user's profile. As it turns out, you can specify the user's home share as
7952 a sharename and path. For example, \\server\fred\.profile.
7953 If the profiles are found, they are implemented.
7955 ></LI
7956 ><LI
7958 > The client then disconnects from the user's home share, and reconnects to
7959 the NetLogon share and looks for CONFIG.POL, the policies file. If this is
7960 found, it is read and implemented.
7962 ></LI
7963 ></OL
7964 ><DIV
7965 CLASS="SECT2"
7966 ><HR><H2
7967 CLASS="SECT2"
7969 NAME="AEN1619"
7970 >9.8.1. Configuration Instructions: Network Logons</A
7971 ></H2
7973 >The main difference between a PDC and a Windows 9x logon
7974 server configuration is that</P
7976 ></P
7977 ><UL
7978 ><LI
7980 >Password encryption is not required for a Windows 9x logon server.</P
7981 ></LI
7982 ><LI
7984 >Windows 9x/ME clients do not possess machine trust accounts.</P
7985 ></LI
7986 ></UL
7988 >Therefore, a Samba PDC will also act as a Windows 9x logon
7989 server.</P
7990 ><DIV
7991 CLASS="WARNING"
7993 ></P
7994 ><TABLE
7995 CLASS="WARNING"
7996 BORDER="1"
7997 WIDTH="100%"
7998 ><TR
7999 ><TD
8000 ALIGN="CENTER"
8002 >security mode and master browsers</B
8003 ></TD
8004 ></TR
8005 ><TR
8006 ><TD
8007 ALIGN="LEFT"
8009 >There are a few comments to make in order to tie up some
8010 loose ends. There has been much debate over the issue of whether
8011 or not it is ok to configure Samba as a Domain Controller in security
8012 modes other than <TT
8013 CLASS="CONSTANT"
8014 >USER</TT
8015 >. The only security mode
8016 which will not work due to technical reasons is <TT
8017 CLASS="CONSTANT"
8018 >SHARE</TT
8020 mode security. <TT
8021 CLASS="CONSTANT"
8022 >DOMAIN</TT
8023 > and <TT
8024 CLASS="CONSTANT"
8025 >SERVER</TT
8027 mode security is really just a variation on SMB user level security.</P
8029 >Actually, this issue is also closely tied to the debate on whether
8030 or not Samba must be the domain master browser for its workgroup
8031 when operating as a DC. While it may technically be possible
8032 to configure a server as such (after all, browsing and domain logons
8033 are two distinctly different functions), it is not a good idea to
8034 so. You should remember that the DC must register the DOMAIN#1b NetBIOS
8035 name. This is the name used by Windows clients to locate the DC.
8036 Windows clients do not distinguish between the DC and the DMB.
8037 For this reason, it is very wise to configure the Samba DC as the DMB.</P
8039 >Now back to the issue of configuring a Samba DC to use a mode other
8040 than "security = user". If a Samba host is configured to use
8041 another SMB server or DC in order to validate user connection
8042 requests, then it is a fact that some other machine on the network
8043 (the "password server") knows more about user than the Samba host.
8044 99% of the time, this other host is a domain controller. Now
8045 in order to operate in domain mode security, the "workgroup" parameter
8046 must be set to the name of the Windows NT domain (which already
8047 has a domain controller, right?)</P
8049 >Therefore configuring a Samba box as a DC for a domain that
8050 already by definition has a PDC is asking for trouble.
8051 Therefore, you should always configure the Samba DC to be the DMB
8052 for its domain.</P
8053 ></TD
8054 ></TR
8055 ></TABLE
8056 ></DIV
8057 ></DIV
8058 ><DIV
8059 CLASS="SECT2"
8060 ><HR><H2
8061 CLASS="SECT2"
8063 NAME="AEN1638"
8064 >9.8.2. Configuration Instructions: Setting up Roaming User Profiles</A
8065 ></H2
8066 ><DIV
8067 CLASS="WARNING"
8069 ></P
8070 ><TABLE
8071 CLASS="WARNING"
8072 BORDER="1"
8073 WIDTH="100%"
8074 ><TR
8075 ><TD
8076 ALIGN="CENTER"
8078 >Warning</B
8079 ></TD
8080 ></TR
8081 ><TR
8082 ><TD
8083 ALIGN="LEFT"
8085 ><EM
8086 >NOTE!</EM
8087 > Roaming profiles support is different
8088 for Win9X and WinNT.</P
8089 ></TD
8090 ></TR
8091 ></TABLE
8092 ></DIV
8094 >Before discussing how to configure roaming profiles, it is useful to see how
8095 Win9X and WinNT clients implement these features.</P
8097 >Win9X clients send a NetUserGetInfo request to the server to get the user's
8098 profiles location. However, the response does not have room for a separate
8099 profiles location field, only the user's home share. This means that Win9X
8100 profiles are restricted to being in the user's home directory.</P
8102 >WinNT clients send a NetSAMLogon RPC request, which contains many fields,
8103 including a separate field for the location of the user's profiles.
8104 This means that support for profiles is different for Win9X and WinNT.</P
8105 ><DIV
8106 CLASS="SECT3"
8107 ><HR><H3
8108 CLASS="SECT3"
8110 NAME="AEN1646"
8111 >9.8.2.1. Windows NT Configuration</A
8112 ></H3
8114 >To support WinNT clients, in the [global] section of smb.conf set the
8115 following (for example):</P
8117 ><TABLE
8118 BORDER="0"
8119 BGCOLOR="#E0E0E0"
8120 WIDTH="100%"
8121 ><TR
8122 ><TD
8123 ><PRE
8124 CLASS="PROGRAMLISTING"
8125 >logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath</PRE
8126 ></TD
8127 ></TR
8128 ></TABLE
8129 ></P
8131 >The default for this option is \\%N\%U\profile, namely
8132 \\sambaserver\username\profile. The \\N%\%U service is created
8133 automatically by the [homes] service.
8134 If you are using a samba server for the profiles, you _must_ make the
8135 share specified in the logon path browseable. </P
8136 ><DIV
8137 CLASS="NOTE"
8138 ><BLOCKQUOTE
8139 CLASS="NOTE"
8142 >Note: </B
8143 >[lkcl 26aug96 - we have discovered a problem where Windows clients can
8144 maintain a connection to the [homes] share in between logins. The
8145 [homes] share must NOT therefore be used in a profile path.]</P
8146 ></BLOCKQUOTE
8147 ></DIV
8148 ></DIV
8149 ><DIV
8150 CLASS="SECT3"
8151 ><HR><H3
8152 CLASS="SECT3"
8154 NAME="AEN1654"
8155 >9.8.2.2. Windows 9X Configuration</A
8156 ></H3
8158 >To support Win9X clients, you must use the "logon home" parameter. Samba has
8159 now been fixed so that "net use/home" now works as well, and it, too, relies
8160 on the "logon home" parameter.</P
8162 >By using the logon home parameter, you are restricted to putting Win9X
8163 profiles in the user's home directory. But wait! There is a trick you
8164 can use. If you set the following in the [global] section of your
8165 smb.conf file:</P
8167 ><TABLE
8168 BORDER="0"
8169 BGCOLOR="#E0E0E0"
8170 WIDTH="100%"
8171 ><TR
8172 ><TD
8173 ><PRE
8174 CLASS="PROGRAMLISTING"
8175 >logon home = \\%L\%U\.profiles</PRE
8176 ></TD
8177 ></TR
8178 ></TABLE
8179 ></P
8181 >then your Win9X clients will dutifully put their clients in a subdirectory
8182 of your home directory called .profiles (thus making them hidden).</P
8184 >Not only that, but 'net use/home' will also work, because of a feature in
8185 Win9X. It removes any directory stuff off the end of the home directory area
8186 and only uses the server and share portion. That is, it looks like you
8187 specified \\%L\%U for "logon home".</P
8188 ></DIV
8189 ><DIV
8190 CLASS="SECT3"
8191 ><HR><H3
8192 CLASS="SECT3"
8194 NAME="AEN1662"
8195 >9.8.2.3. Win9X and WinNT Configuration</A
8196 ></H3
8198 >You can support profiles for both Win9X and WinNT clients by setting both the
8199 "logon home" and "logon path" parameters. For example:</P
8201 ><TABLE
8202 BORDER="0"
8203 BGCOLOR="#E0E0E0"
8204 WIDTH="100%"
8205 ><TR
8206 ><TD
8207 ><PRE
8208 CLASS="PROGRAMLISTING"
8209 >logon home = \\%L\%U\.profiles
8210 logon path = \\%L\profiles\%U</PRE
8211 ></TD
8212 ></TR
8213 ></TABLE
8214 ></P
8215 ><DIV
8216 CLASS="NOTE"
8217 ><BLOCKQUOTE
8218 CLASS="NOTE"
8221 >Note: </B
8222 >I have not checked what 'net use /home' does on NT when "logon home" is
8223 set as above.</P
8224 ></BLOCKQUOTE
8225 ></DIV
8226 ></DIV
8227 ><DIV
8228 CLASS="SECT3"
8229 ><HR><H3
8230 CLASS="SECT3"
8232 NAME="AEN1669"
8233 >9.8.2.4. Windows 9X Profile Setup</A
8234 ></H3
8236 >When a user first logs in on Windows 9X, the file user.DAT is created,
8237 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".
8238 These directories and their contents will be merged with the local
8239 versions stored in c:\windows\profiles\username on subsequent logins,
8240 taking the most recent from each. You will need to use the [global]
8241 options "preserve case = yes", "short preserve case = yes" and
8242 "case sensitive = no" in order to maintain capital letters in shortcuts
8243 in any of the profile folders.</P
8245 >The user.DAT file contains all the user's preferences. If you wish to
8246 enforce a set of preferences, rename their user.DAT file to user.MAN,
8247 and deny them write access to this file.</P
8249 ></P
8250 ><OL
8251 TYPE="1"
8252 ><LI
8254 > On the Windows 95 machine, go to Control Panel | Passwords and
8255 select the User Profiles tab. Select the required level of
8256 roaming preferences. Press OK, but do _not_ allow the computer
8257 to reboot.
8259 ></LI
8260 ><LI
8262 > On the Windows 95 machine, go to Control Panel | Network |
8263 Client for Microsoft Networks | Preferences. Select 'Log on to
8264 NT Domain'. Then, ensure that the Primary Logon is 'Client for
8265 Microsoft Networks'. Press OK, and this time allow the computer
8266 to reboot.
8268 ></LI
8269 ></OL
8271 >Under Windows 95, Profiles are downloaded from the Primary Logon.
8272 If you have the Primary Logon as 'Client for Novell Networks', then
8273 the profiles and logon script will be downloaded from your Novell
8274 Server. If you have the Primary Logon as 'Windows Logon', then the
8275 profiles will be loaded from the local machine - a bit against the
8276 concept of roaming profiles, if you ask me.</P
8278 >You will now find that the Microsoft Networks Login box contains
8279 [user, password, domain] instead of just [user, password]. Type in
8280 the samba server's domain name (or any other domain known to exist,
8281 but bear in mind that the user will be authenticated against this
8282 domain and profiles downloaded from it, if that domain logon server
8283 supports it), user name and user's password.</P
8285 >Once the user has been successfully validated, the Windows 95 machine
8286 will inform you that 'The user has not logged on before' and asks you
8287 if you wish to save the user's preferences? Select 'yes'.</P
8289 >Once the Windows 95 client comes up with the desktop, you should be able
8290 to examine the contents of the directory specified in the "logon path"
8291 on the samba server and verify that the "Desktop", "Start Menu",
8292 "Programs" and "Nethood" folders have been created.</P
8294 >These folders will be cached locally on the client, and updated when
8295 the user logs off (if you haven't made them read-only by then :-).
8296 You will find that if the user creates further folders or short-cuts,
8297 that the client will merge the profile contents downloaded with the
8298 contents of the profile directory already on the local client, taking
8299 the newest folders and short-cuts from each set.</P
8301 >If you have made the folders / files read-only on the samba server,
8302 then you will get errors from the w95 machine on logon and logout, as
8303 it attempts to merge the local and the remote profile. Basically, if
8304 you have any errors reported by the w95 machine, check the Unix file
8305 permissions and ownership rights on the profile directory contents,
8306 on the samba server.</P
8308 >If you have problems creating user profiles, you can reset the user's
8309 local desktop cache, as shown below. When this user then next logs in,
8310 they will be told that they are logging in "for the first time".</P
8312 ></P
8313 ><OL
8314 TYPE="1"
8315 ><LI
8317 > instead of logging in under the [user, password, domain] dialog,
8318 press escape.
8320 ></LI
8321 ><LI
8323 > run the regedit.exe program, and look in:
8326 > HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
8329 > you will find an entry, for each user, of ProfilePath. Note the
8330 contents of this key (likely to be c:\windows\profiles\username),
8331 then delete the key ProfilePath for the required user.
8334 > [Exit the registry editor].
8336 ></LI
8337 ><LI
8339 > <EM
8340 >WARNING</EM
8341 > - before deleting the contents of the
8342 directory listed in
8343 the ProfilePath (this is likely to be c:\windows\profiles\username),
8344 ask them if they have any important files stored on their desktop
8345 or in their start menu. delete the contents of the directory
8346 ProfilePath (making a backup if any of the files are needed).
8349 > This will have the effect of removing the local (read-only hidden
8350 system file) user.DAT in their profile directory, as well as the
8351 local "desktop", "nethood", "start menu" and "programs" folders.
8353 ></LI
8354 ><LI
8356 > search for the user's .PWL password-caching file in the c:\windows
8357 directory, and delete it.
8359 ></LI
8360 ><LI
8362 > log off the windows 95 client.
8364 ></LI
8365 ><LI
8367 > check the contents of the profile path (see "logon path" described
8368 above), and delete the user.DAT or user.MAN file for the user,
8369 making a backup if required.
8371 ></LI
8372 ></OL
8374 >If all else fails, increase samba's debug log levels to between 3 and 10,
8375 and / or run a packet trace program such as tcpdump or netmon.exe, and
8376 look for any error reports.</P
8378 >If you have access to an NT server, then first set up roaming profiles
8379 and / or netlogons on the NT server. Make a packet trace, or examine
8380 the example packet traces provided with NT server, and see what the
8381 differences are with the equivalent samba trace.</P
8382 ></DIV
8383 ><DIV
8384 CLASS="SECT3"
8385 ><HR><H3
8386 CLASS="SECT3"
8388 NAME="AEN1705"
8389 >9.8.2.5. Windows NT Workstation 4.0</A
8390 ></H3
8392 >When a user first logs in to a Windows NT Workstation, the profile
8393 NTuser.DAT is created. The profile location can be now specified
8394 through the "logon path" parameter. </P
8395 ><DIV
8396 CLASS="NOTE"
8397 ><BLOCKQUOTE
8398 CLASS="NOTE"
8401 >Note: </B
8402 >[lkcl 10aug97 - i tried setting the path to
8403 \\samba-server\homes\profile, and discovered that this fails because
8404 a background process maintains the connection to the [homes] share
8405 which does _not_ close down in between user logins. you have to
8406 have \\samba-server\%L\profile, where user is the username created
8407 from the [homes] share].</P
8408 ></BLOCKQUOTE
8409 ></DIV
8411 >There is a parameter that is now available for use with NT Profiles:
8412 "logon drive". This should be set to "h:" or any other drive, and
8413 should be used in conjunction with the new "logon home" parameter.</P
8415 >The entry for the NT 4.0 profile is a _directory_ not a file. The NT
8416 help on profiles mentions that a directory is also created with a .PDS
8417 extension. The user, while logging in, must have write permission to
8418 create the full profile path (and the folder with the .PDS extension)
8419 [lkcl 10aug97 - i found that the creation of the .PDS directory failed,
8420 and had to create these manually for each user, with a shell script.
8421 also, i presume, but have not tested, that the full profile path must
8422 be browseable just as it is for w95, due to the manner in which they
8423 attempt to create the full profile path: test existence of each path
8424 component; create path component].</P
8426 >In the profile directory, NT creates more folders than 95. It creates
8427 "Application Data" and others, as well as "Desktop", "Nethood",
8428 "Start Menu" and "Programs". The profile itself is stored in a file
8429 NTuser.DAT. Nothing appears to be stored in the .PDS directory, and
8430 its purpose is currently unknown.</P
8432 >You can use the System Control Panel to copy a local profile onto
8433 a samba server (see NT Help on profiles: it is also capable of firing
8434 up the correct location in the System Control Panel for you). The
8435 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
8436 turns a profile into a mandatory one.</P
8437 ><DIV
8438 CLASS="NOTE"
8439 ><BLOCKQUOTE
8440 CLASS="NOTE"
8443 >Note: </B
8444 >[lkcl 10aug97 - i notice that NT Workstation tells me that it is
8445 downloading a profile from a slow link. whether this is actually the
8446 case, or whether there is some configuration issue, as yet unknown,
8447 that makes NT Workstation _think_ that the link is a slow one is a
8448 matter to be resolved].</P
8450 >[lkcl 20aug97 - after samba digest correspondence, one user found, and
8451 another confirmed, that profiles cannot be loaded from a samba server
8452 unless "security = user" and "encrypt passwords = yes" (see the file
8453 ENCRYPTION.txt) or "security = server" and "password server = ip.address.
8454 of.yourNTserver" are used. Either of these options will allow the NT
8455 workstation to access the samba server using LAN manager encrypted
8456 passwords, without the user intervention normally required by NT
8457 workstation for clear-text passwords].</P
8459 >[lkcl 25aug97 - more comments received about NT profiles: the case of
8460 the profile _matters_. the file _must_ be called NTuser.DAT or, for
8461 a mandatory profile, NTuser.MAN].</P
8462 ></BLOCKQUOTE
8463 ></DIV
8464 ></DIV
8465 ><DIV
8466 CLASS="SECT3"
8467 ><HR><H3
8468 CLASS="SECT3"
8470 NAME="AEN1718"
8471 >9.8.2.6. Windows NT Server</A
8472 ></H3
8474 >There is nothing to stop you specifying any path that you like for the
8475 location of users' profiles. Therefore, you could specify that the
8476 profile be stored on a samba server, or any other SMB server, as long as
8477 that SMB server supports encrypted passwords.</P
8478 ></DIV
8479 ><DIV
8480 CLASS="SECT3"
8481 ><HR><H3
8482 CLASS="SECT3"
8484 NAME="AEN1721"
8485 >9.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0</A
8486 ></H3
8487 ><DIV
8488 CLASS="WARNING"
8490 ></P
8491 ><TABLE
8492 CLASS="WARNING"
8493 BORDER="1"
8494 WIDTH="100%"
8495 ><TR
8496 ><TD
8497 ALIGN="CENTER"
8499 >Potentially outdated or incorrect material follows</B
8500 ></TD
8501 ></TR
8502 ><TR
8503 ><TD
8504 ALIGN="LEFT"
8506 >I think this is all bogus, but have not deleted it. (Richard Sharpe)</P
8507 ></TD
8508 ></TR
8509 ></TABLE
8510 ></DIV
8512 >The default logon path is \\%N\U%. NT Workstation will attempt to create
8513 a directory "\\samba-server\username.PDS" if you specify the logon path
8514 as "\\samba-server\username" with the NT User Manager. Therefore, you
8515 will need to specify (for example) "\\samba-server\username\profile".
8516 NT 4.0 will attempt to create "\\samba-server\username\profile.PDS", which
8517 is more likely to succeed.</P
8519 >If you then want to share the same Start Menu / Desktop with W95, you will
8520 need to specify "logon path = \\samba-server\username\profile" [lkcl 10aug97
8521 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
8522 to run from the c:\winnt\system32 directory. this directory is obviously
8523 unlikely to exist on a Win95-only host].</P
8525 >&#13;If you have this set up correctly, you will find separate user.DAT and
8526 NTuser.DAT files in the same profile directory.</P
8527 ><DIV
8528 CLASS="NOTE"
8529 ><BLOCKQUOTE
8530 CLASS="NOTE"
8533 >Note: </B
8534 >[lkcl 25aug97 - there are some issues to resolve with downloading of
8535 NT profiles, probably to do with time/date stamps. i have found that
8536 NTuser.DAT is never updated on the workstation after the first time that
8537 it is copied to the local workstation profile directory. this is in
8538 contrast to w95, where it _does_ transfer / update profiles correctly].</P
8539 ></BLOCKQUOTE
8540 ></DIV
8541 ></DIV
8542 ></DIV
8543 ></DIV
8544 ><DIV
8545 CLASS="SECT1"
8546 ><HR><H1
8547 CLASS="SECT1"
8549 NAME="AEN1731"
8550 >9.9. DOMAIN_CONTROL.txt : Windows NT Domain Control &#38; Samba</A
8551 ></H1
8552 ><DIV
8553 CLASS="WARNING"
8555 ></P
8556 ><TABLE
8557 CLASS="WARNING"
8558 BORDER="1"
8559 WIDTH="100%"
8560 ><TR
8561 ><TD
8562 ALIGN="CENTER"
8564 >Possibly Outdated Material</B
8565 ></TD
8566 ></TR
8567 ><TR
8568 ><TD
8569 ALIGN="LEFT"
8571 > This appendix was originally authored by John H Terpstra of
8572 the Samba Team and is included here for posterity.
8574 ></TD
8575 ></TR
8576 ></TABLE
8577 ></DIV
8579 ><EM
8580 >NOTE :</EM
8582 The term "Domain Controller" and those related to it refer to one specific
8583 method of authentication that can underly an SMB domain. Domain Controllers
8584 prior to Windows NT Server 3.1 were sold by various companies and based on
8585 private extensions to the LAN Manager 2.1 protocol. Windows NT introduced
8586 Microsoft-specific ways of distributing the user authentication database.
8587 See DOMAIN.txt for examples of how Samba can participate in or create
8588 SMB domains based on shared authentication database schemes other than the
8589 Windows NT SAM.</P
8591 >Windows NT Server can be installed as either a plain file and print server
8592 (WORKGROUP workstation or server) or as a server that participates in Domain
8593 Control (DOMAIN member, Primary Domain controller or Backup Domain controller).
8594 The same is true for OS/2 Warp Server, Digital Pathworks and other similar
8595 products, all of which can participate in Domain Control along with Windows NT.</P
8597 >To many people these terms can be confusing, so let's try to clear the air.</P
8599 >Every Windows NT system (workstation or server) has a registry database.
8600 The registry contains entries that describe the initialization information
8601 for all services (the equivalent of Unix Daemons) that run within the Windows
8602 NT environment. The registry also contains entries that tell application
8603 software where to find dynamically loadable libraries that they depend upon.
8604 In fact, the registry contains entries that describes everything that anything
8605 may need to know to interact with the rest of the system.</P
8607 >The registry files can be located on any Windows NT machine by opening a
8608 command prompt and typing:</P
8610 ><TT
8611 CLASS="PROMPT"
8612 >C:\WINNT\&#62;</TT
8613 > dir %SystemRoot%\System32\config</P
8615 >The environment variable %SystemRoot% value can be obtained by typing:</P
8617 ><TT
8618 CLASS="PROMPT"
8619 >C:\WINNT&#62;</TT
8620 >echo %SystemRoot%</P
8622 >The active parts of the registry that you may want to be familiar with are
8623 the files called: default, system, software, sam and security.</P
8625 >In a domain environment, Microsoft Windows NT domain controllers participate
8626 in replication of the SAM and SECURITY files so that all controllers within
8627 the domain have an exactly identical copy of each.</P
8629 >The Microsoft Windows NT system is structured within a security model that
8630 says that all applications and services must authenticate themselves before
8631 they can obtain permission from the security manager to do what they set out
8632 to do.</P
8634 >The Windows NT User database also resides within the registry. This part of
8635 the registry contains the user's security identifier, home directory, group
8636 memberships, desktop profile, and so on.</P
8638 >Every Windows NT system (workstation as well as server) will have its own
8639 registry. Windows NT Servers that participate in Domain Security control
8640 have a database that they share in common - thus they do NOT own an
8641 independent full registry database of their own, as do Workstations and
8642 plain Servers.</P
8644 >The User database is called the SAM (Security Access Manager) database and
8645 is used for all user authentication as well as for authentication of inter-
8646 process authentication (i.e. to ensure that the service action a user has
8647 requested is permitted within the limits of that user's privileges).</P
8649 >The Samba team have produced a utility that can dump the Windows NT SAM into
8650 smbpasswd format: see ENCRYPTION.txt for information on smbpasswd and
8651 /pub/samba/pwdump on your nearest Samba mirror for the utility. This
8652 facility is useful but cannot be easily used to implement SAM replication
8653 to Samba systems.</P
8655 >Windows for Workgroups, Windows 95, and Windows NT Workstations and Servers
8656 can participate in a Domain security system that is controlled by Windows NT
8657 servers that have been correctly configured. Almost every domain will have
8658 ONE Primary Domain Controller (PDC). It is desirable that each domain will
8659 have at least one Backup Domain Controller (BDC).</P
8661 >The PDC and BDCs then participate in replication of the SAM database so that
8662 each Domain Controlling participant will have an up to date SAM component
8663 within its registry.</P
8664 ></DIV
8665 ></DIV
8666 ><DIV
8667 CLASS="CHAPTER"
8668 ><HR><H1
8670 NAME="SAMBA-BDC"
8671 >Chapter 10. How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</A
8672 ></H1
8673 ><DIV
8674 CLASS="SECT1"
8675 ><H1
8676 CLASS="SECT1"
8678 NAME="AEN1767"
8679 >10.1. Prerequisite Reading</A
8680 ></H1
8682 >Before you continue reading in this chapter, please make sure
8683 that you are comfortable with configuring a Samba PDC
8684 as described in the <A
8685 HREF="Samba-PDC-HOWTO.html"
8686 TARGET="_top"
8687 >Samba-PDC-HOWTO</A
8688 >.</P
8689 ></DIV
8690 ><DIV
8691 CLASS="SECT1"
8692 ><HR><H1
8693 CLASS="SECT1"
8695 NAME="AEN1771"
8696 >10.2. Background</A
8697 ></H1
8699 >What is a Domain Controller? It is a machine that is able to answer
8700 logon requests from workstations in a Windows NT Domain. Whenever a
8701 user logs into a Windows NT Workstation, the workstation connects to a
8702 Domain Controller and asks him whether the username and password the
8703 user typed in is correct. The Domain Controller replies with a lot of
8704 information about the user, for example the place where the users
8705 profile is stored, the users full name of the user. All this
8706 information is stored in the NT user database, the so-called SAM.</P
8708 >There are two kinds of Domain Controller in a NT 4 compatible Domain:
8709 A Primary Domain Controller (PDC) and one or more Backup Domain
8710 Controllers (BDC). The PDC contains the master copy of the
8711 SAM. Whenever the SAM has to change, for example when a user changes
8712 his password, this change has to be done on the PDC. A Backup Domain
8713 Controller is a machine that maintains a read-only copy of the
8714 SAM. This way it is able to reply to logon requests and authenticate
8715 users in case the PDC is not available. During this time no changes to
8716 the SAM are possible. Whenever changes to the SAM are done on the PDC,
8717 all BDC receive the changes from the PDC.</P
8719 >Since version 2.2 Samba officially supports domain logons for all
8720 current Windows Clients, including Windows 2000 and XP. This text
8721 assumes the domain to be named SAMBA. To be able to act as a PDC, some
8722 parameters in the [global]-section of the smb.conf have to be set:</P
8724 ><TABLE
8725 BORDER="0"
8726 BGCOLOR="#E0E0E0"
8727 WIDTH="100%"
8728 ><TR
8729 ><TD
8730 ><PRE
8731 CLASS="PROGRAMLISTING"
8732 >workgroup = SAMBA
8733 domain master = yes
8734 domain logons = yes</PRE
8735 ></TD
8736 ></TR
8737 ></TABLE
8738 ></P
8740 >Several other things like a [homes] and a [netlogon] share also may be
8741 set along with settings for the profile path, the users home drive and
8742 others. This will not be covered in this document.</P
8743 ></DIV
8744 ><DIV
8745 CLASS="SECT1"
8746 ><HR><H1
8747 CLASS="SECT1"
8749 NAME="AEN1779"
8750 >10.3. What qualifies a Domain Controller on the network?</A
8751 ></H1
8753 >Every machine that is a Domain Controller for the domain SAMBA has to
8754 register the NetBIOS group name SAMBA#1c with the WINS server and/or
8755 by broadcast on the local network. The PDC also registers the unique
8756 NetBIOS name SAMBA#1b with the WINS server. The name type #1b is
8757 normally reserved for the domain master browser, a role that has
8758 nothing to do with anything related to authentication, but the
8759 Microsoft Domain implementation requires the domain master browser to
8760 be on the same machine as the PDC.</P
8761 ><DIV
8762 CLASS="SECT2"
8763 ><HR><H2
8764 CLASS="SECT2"
8766 NAME="AEN1782"
8767 >10.3.1. How does a Workstation find its domain controller?</A
8768 ></H2
8770 >A NT workstation in the domain SAMBA that wants a local user to be
8771 authenticated has to find the domain controller for SAMBA. It does
8772 this by doing a NetBIOS name query for the group name SAMBA#1c. It
8773 assumes that each of the machines it gets back from the queries is a
8774 domain controller and can answer logon requests. To not open security
8775 holes both the workstation and the selected (TODO: How is the DC
8776 chosen) domain controller authenticate each other. After that the
8777 workstation sends the user's credentials (his name and password) to
8778 the domain controller, asking for approval.</P
8779 ></DIV
8780 ><DIV
8781 CLASS="SECT2"
8782 ><HR><H2
8783 CLASS="SECT2"
8785 NAME="AEN1785"
8786 >10.3.2. When is the PDC needed?</A
8787 ></H2
8789 >Whenever a user wants to change his password, this has to be done on
8790 the PDC. To find the PDC, the workstation does a NetBIOS name query
8791 for SAMBA#1b, assuming this machine maintains the master copy of the
8792 SAM. The workstation contacts the PDC, both mutually authenticate and
8793 the password change is done.</P
8794 ></DIV
8795 ></DIV
8796 ><DIV
8797 CLASS="SECT1"
8798 ><HR><H1
8799 CLASS="SECT1"
8801 NAME="AEN1788"
8802 >10.4. Can Samba be a Backup Domain Controller?</A
8803 ></H1
8805 >With version 2.2, no. The native NT SAM replication protocols have
8806 not yet been fully implemented. The Samba Team is working on
8807 understanding and implementing the protocols, but this work has not
8808 been finished for version 2.2.</P
8810 >Can I get the benefits of a BDC with Samba? Yes. The main reason for
8811 implementing a BDC is availability. If the PDC is a Samba machine,
8812 a second Samba machine can be set up to
8813 service logon requests whenever the PDC is down.</P
8814 ></DIV
8815 ><DIV
8816 CLASS="SECT1"
8817 ><HR><H1
8818 CLASS="SECT1"
8820 NAME="AEN1792"
8821 >10.5. How do I set up a Samba BDC?</A
8822 ></H1
8824 >Several things have to be done:</P
8826 ></P
8827 ><UL
8828 ><LI
8830 >The file private/MACHINE.SID identifies the domain. When a samba
8831 server is first started, it is created on the fly and must never be
8832 changed again. This file has to be the same on the PDC and the BDC,
8833 so the MACHINE.SID has to be copied from the PDC to the BDC.</P
8834 ></LI
8835 ><LI
8837 >The Unix user database has to be synchronized from the PDC to the
8838 BDC. This means that both the /etc/passwd and /etc/group have to be
8839 replicated from the PDC to the BDC. This can be done manually
8840 whenever changes are made, or the PDC is set up as a NIS master
8841 server and the BDC as a NIS slave server. To set up the BDC as a
8842 mere NIS client would not be enough, as the BDC would not be able to
8843 access its user database in case of a PDC failure.</P
8844 ></LI
8845 ><LI
8847 >The Samba password database in the file private/smbpasswd has to be
8848 replicated from the PDC to the BDC. This is a bit tricky, see the
8849 next section.</P
8850 ></LI
8851 ><LI
8853 >Any netlogon share has to be replicated from the PDC to the
8854 BDC. This can be done manually whenever login scripts are changed,
8855 or it can be done automatically together with the smbpasswd
8856 synchronization.</P
8857 ></LI
8858 ></UL
8860 >Finally, the BDC has to be found by the workstations. This can be done
8861 by setting</P
8863 ><TABLE
8864 BORDER="0"
8865 BGCOLOR="#E0E0E0"
8866 WIDTH="100%"
8867 ><TR
8868 ><TD
8869 ><PRE
8870 CLASS="PROGRAMLISTING"
8871 >workgroup = samba
8872 domain master = no
8873 domain logons = yes</PRE
8874 ></TD
8875 ></TR
8876 ></TABLE
8877 ></P
8879 >in the [global]-section of the smb.conf of the BDC. This makes the BDC
8880 only register the name SAMBA#1c with the WINS server. This is no
8881 problem as the name SAMBA#1c is a NetBIOS group name that is meant to
8882 be registered by more than one machine. The parameter 'domain master =
8883 no' forces the BDC not to register SAMBA#1b which as a unique NetBIOS
8884 name is reserved for the Primary Domain Controller.</P
8885 ><DIV
8886 CLASS="SECT2"
8887 ><HR><H2
8888 CLASS="SECT2"
8890 NAME="AEN1808"
8891 >10.5.1. How do I replicate the smbpasswd file?</A
8892 ></H2
8894 >Replication of the smbpasswd file is sensitive. It has to be done
8895 whenever changes to the SAM are made. Every user's password change is
8896 done in the smbpasswd file and has to be replicated to the BDC. So
8897 replicating the smbpasswd file very often is necessary.</P
8899 >As the smbpasswd file contains plain text password equivalents, it
8900 must not be sent unencrypted over the wire. The best way to set up
8901 smbpasswd replication from the PDC to the BDC is to use the utility
8902 rsync. rsync can use ssh as a transport. ssh itself can be set up to
8903 accept *only* rsync transfer without requiring the user to type a
8904 password.</P
8905 ></DIV
8906 ></DIV
8907 ></DIV
8908 ><DIV
8909 CLASS="CHAPTER"
8910 ><HR><H1
8912 NAME="SAMBA-LDAP-HOWTO"
8913 >Chapter 11. Storing Samba's User/Machine Account information in an LDAP Directory</A
8914 ></H1
8915 ><DIV
8916 CLASS="SECT1"
8917 ><H1
8918 CLASS="SECT1"
8920 NAME="AEN1829"
8921 >11.1. Purpose</A
8922 ></H1
8924 >This document describes how to use an LDAP directory for storing Samba user
8925 account information traditionally stored in the smbpasswd(5) file. It is
8926 assumed that the reader already has a basic understanding of LDAP concepts
8927 and has a working directory server already installed. For more information
8928 on LDAP architectures and Directories, please refer to the following sites.</P
8930 ></P
8931 ><UL
8932 ><LI
8934 >OpenLDAP - <A
8935 HREF="http://www.openldap.org/"
8936 TARGET="_top"
8937 >http://www.openldap.org/</A
8938 ></P
8939 ></LI
8940 ><LI
8942 >iPlanet Directory Server - <A
8943 HREF="http://iplanet.netscape.com/directory"
8944 TARGET="_top"
8945 >http://iplanet.netscape.com/directory</A
8946 ></P
8947 ></LI
8948 ></UL
8950 >Note that <A
8951 HREF="http://www.ora.com/"
8952 TARGET="_top"
8953 >O'Reilly Publishing</A
8954 > is working on
8955 a guide to LDAP for System Administrators which has a planned release date of
8956 early summer, 2002.</P
8958 >Two additional Samba resources which may prove to be helpful are</P
8960 ></P
8961 ><UL
8962 ><LI
8964 >The <A
8965 HREF="http://www.unav.es/cti/ldap-smb/ldap-smb-2_2-howto.html"
8966 TARGET="_top"
8967 >Samba-PDC-LDAP-HOWTO</A
8969 maintained by Ignacio Coupeau.</P
8970 ></LI
8971 ><LI
8973 >The NT migration scripts from <A
8974 HREF="http://samba.idealx.org/"
8975 TARGET="_top"
8976 >IDEALX</A
8977 > that are
8978 geared to manage users and group in such a Samba-LDAP Domain Controller configuration.
8980 ></LI
8981 ></UL
8982 ></DIV
8983 ><DIV
8984 CLASS="SECT1"
8985 ><HR><H1
8986 CLASS="SECT1"
8988 NAME="AEN1849"
8989 >11.2. Introduction</A
8990 ></H1
8992 >Traditionally, when configuring <A
8993 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
8994 TARGET="_top"
8995 >"encrypt
8996 passwords = yes"</A
8997 > in Samba's <TT
8998 CLASS="FILENAME"
8999 >smb.conf</TT
9000 > file, user account
9001 information such as username, LM/NT password hashes, password change times, and account
9002 flags have been stored in the <TT
9003 CLASS="FILENAME"
9004 >smbpasswd(5)</TT
9005 > file. There are several
9006 disadvantages to this approach for sites with very large numbers of users (counted
9007 in the thousands).</P
9009 ></P
9010 ><UL
9011 ><LI
9013 >The first is that all lookups must be performed sequentially. Given that
9014 there are approximately two lookups per domain logon (one for a normal
9015 session connection such as when mapping a network drive or printer), this
9016 is a performance bottleneck for lareg sites. What is needed is an indexed approach
9017 such as is used in databases.</P
9018 ></LI
9019 ><LI
9021 >The second problem is that administrators who desired to replicate a
9022 smbpasswd file to more than one Samba server were left to use external
9023 tools such as <B
9024 CLASS="COMMAND"
9025 >rsync(1)</B
9026 > and <B
9027 CLASS="COMMAND"
9028 >ssh(1)</B
9030 and wrote custom, in-house scripts.</P
9031 ></LI
9032 ><LI
9034 >And finally, the amount of information which is stored in an
9035 smbpasswd entry leaves no room for additional attributes such as
9036 a home directory, password expiration time, or even a Relative
9037 Identified (RID).</P
9038 ></LI
9039 ></UL
9041 >As a result of these defeciencies, a more robust means of storing user attributes
9042 used by smbd was developed. The API which defines access to user accounts
9043 is commonly referred to as the samdb interface (previously this was called the passdb
9044 API, and is still so named in the CVS trees). In Samba 2.2.3, enabling support
9045 for a samdb backend (e.g. <TT
9046 CLASS="PARAMETER"
9048 >--with-ldapsam</I
9049 ></TT
9050 > or
9052 CLASS="PARAMETER"
9054 >--with-tdbsam</I
9055 ></TT
9056 >) requires compile time support.</P
9058 >When compiling Samba to include the <TT
9059 CLASS="PARAMETER"
9061 >--with-ldapsam</I
9062 ></TT
9063 > autoconf
9064 option, smbd (and associated tools) will store and lookup user accounts in
9065 an LDAP directory. In reality, this is very easy to understand. If you are
9066 comfortable with using an smbpasswd file, simply replace "smbpasswd" with
9067 "LDAP directory" in all the documentation.</P
9069 >There are a few points to stress about what the <TT
9070 CLASS="PARAMETER"
9072 >--with-ldapsam</I
9073 ></TT
9075 does not provide. The LDAP support referred to in the this documentation does not
9076 include:</P
9078 ></P
9079 ><UL
9080 ><LI
9082 >A means of retrieving user account information from
9083 an Windows 2000 Active Directory server.</P
9084 ></LI
9085 ><LI
9087 >A means of replacing /etc/passwd.</P
9088 ></LI
9089 ></UL
9091 >The second item can be accomplished by using LDAP NSS and PAM modules. LGPL
9092 versions of these libraries can be obtained from PADL Software
9094 HREF="http://www.padl.com/"
9095 TARGET="_top"
9096 >http://www.padl.com/</A
9097 >). However,
9098 the details of configuring these packages are beyond the scope of this document.</P
9099 ></DIV
9100 ><DIV
9101 CLASS="SECT1"
9102 ><HR><H1
9103 CLASS="SECT1"
9105 NAME="AEN1878"
9106 >11.3. Supported LDAP Servers</A
9107 ></H1
9109 >The LDAP samdb code in 2.2.3 has been developed and tested using the OpenLDAP
9110 2.0 server and client libraries. The same code should be able to work with
9111 Netscape's Directory Server and client SDK. However, due to lack of testing
9112 so far, there are bound to be compile errors and bugs. These should not be
9113 hard to fix. If you are so inclined, please be sure to forward all patches to
9115 HREF="samba-patches@samba.org"
9116 TARGET="_top"
9117 >samba-patches@samba.org</A
9118 > and
9120 HREF="jerry@samba.org"
9121 TARGET="_top"
9122 >jerry@samba.org</A
9123 >.</P
9124 ></DIV
9125 ><DIV
9126 CLASS="SECT1"
9127 ><HR><H1
9128 CLASS="SECT1"
9130 NAME="AEN1883"
9131 >11.4. Schema and Relationship to the RFC 2307 posixAccount</A
9132 ></H1
9134 >Samba 2.2.3 includes the necessary schema file for OpenLDAP 2.0 in
9136 CLASS="FILENAME"
9137 >examples/LDAP/samba.schema</TT
9138 >. (Note that this schema
9139 file has been modified since the experimental support initially included
9140 in 2.2.2). The sambaAccount objectclass is given here:</P
9142 ><TABLE
9143 BORDER="0"
9144 BGCOLOR="#E0E0E0"
9145 WIDTH="100%"
9146 ><TR
9147 ><TD
9148 ><PRE
9149 CLASS="PROGRAMLISTING"
9150 >objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL
9151 DESC 'Samba Account'
9152 MUST ( uid $ rid )
9153 MAY ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $
9154 logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $
9155 displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $
9156 description $ userWorkstations $ primaryGroupID $ domain ))</PRE
9157 ></TD
9158 ></TR
9159 ></TABLE
9160 ></P
9162 >The samba.schema file has been formatted for OpenLDAP 2.0. The OID's are
9163 owned by the Samba Team and as such is legal to be openly published.
9164 If you translate the schema to be used with Netscape DS, please
9165 submit the modified schema file as a patch to <A
9166 HREF="jerry@samba.org"
9167 TARGET="_top"
9168 >jerry@samba.org</A
9169 ></P
9171 >Just as the smbpasswd file is mean to store information which supplements a
9172 user's <TT
9173 CLASS="FILENAME"
9174 >/etc/passwd</TT
9175 > entry, so is the sambaAccount object
9176 meant to supplement the UNIX user account information. A sambaAccount is a
9178 CLASS="CONSTANT"
9179 >STRUCTURAL</TT
9180 > objectclass so it can be stored individually
9181 in the directory. However, there are several fields (e.g. uid) which overlap
9182 with the posixAccount objectclass outlined in RFC2307. This is by design.</P
9184 >In order to store all user account information (UNIX and Samba) in the directory,
9185 it is necessary to use the sambaAccount and posixAccount objectclasses in
9186 combination. However, smbd will still obtain the user's UNIX account
9187 information via the standard C library calls (e.g. getpwnam(), et. al.).
9188 This means that the Samba server must also have the LDAP NSS library installed
9189 and functioning correctly. This division of information makes it possible to
9190 store all Samba account information in LDAP, but still maintain UNIX account
9191 information in NIS while the network is transitioning to a full LDAP infrastructure.</P
9192 ></DIV
9193 ><DIV
9194 CLASS="SECT1"
9195 ><HR><H1
9196 CLASS="SECT1"
9198 NAME="AEN1895"
9199 >11.5. Configuring Samba with LDAP</A
9200 ></H1
9201 ><DIV
9202 CLASS="SECT2"
9203 ><H2
9204 CLASS="SECT2"
9206 NAME="AEN1897"
9207 >11.5.1. OpenLDAP configuration</A
9208 ></H2
9210 >To include support for the sambaAccount object in an OpenLDAP directory
9211 server, first copy the samba.schema file to slapd's configuration directory.</P
9213 ><TT
9214 CLASS="PROMPT"
9215 >root# </TT
9217 CLASS="COMMAND"
9218 >cp samba.schema /etc/openldap/schema/</B
9219 ></P
9221 >Next, include the <TT
9222 CLASS="FILENAME"
9223 >samba.schema</TT
9224 > file in <TT
9225 CLASS="FILENAME"
9226 >slapd.conf</TT
9228 The sambaAccount object contains two attributes which depend upon other schema
9229 files. The 'uid' attribute is defined in <TT
9230 CLASS="FILENAME"
9231 >cosine.schema</TT
9232 > and
9233 the 'displayName' attribute is defined in the <TT
9234 CLASS="FILENAME"
9235 >inetorgperson.schema</TT
9237 file. Both of these must be included before the <TT
9238 CLASS="FILENAME"
9239 >samba.schema</TT
9240 > file.</P
9242 ><TABLE
9243 BORDER="0"
9244 BGCOLOR="#E0E0E0"
9245 WIDTH="100%"
9246 ><TR
9247 ><TD
9248 ><PRE
9249 CLASS="PROGRAMLISTING"
9250 >## /etc/openldap/slapd.conf
9252 ## schema files (core.schema is required by default)
9253 include /etc/openldap/schema/core.schema
9255 ## needed for sambaAccount
9256 include /etc/openldap/schema/cosine.schema
9257 include /etc/openldap/schema/inetorgperson.schema
9258 include /etc/openldap/schema/samba.schema
9260 ## uncomment this line if you want to support the RFC2307 (NIS) schema
9261 ## include /etc/openldap/schema/nis.schema
9263 ....</PRE
9264 ></TD
9265 ></TR
9266 ></TABLE
9267 ></P
9269 >It is recommended that you maintain some indices on some of the most usefull attributes,
9270 like in the following example, to speed up searches made on sambaAccount objectclasses
9271 (and possibly posixAccount and posixGroup as well).</P
9273 ><TABLE
9274 BORDER="0"
9275 BGCOLOR="#E0E0E0"
9276 WIDTH="100%"
9277 ><TR
9278 ><TD
9279 ><PRE
9280 CLASS="PROGRAMLISTING"
9281 ># Indices to maintain
9282 ## required by OpenLDAP 2.0
9283 index objectclass eq
9285 ## support pb_getsampwnam()
9286 index uid pres,eq
9287 ## support pdb_getsambapwrid()
9288 index rid eq
9290 ## uncomment these if you are storing posixAccount and
9291 ## posixGroup entries in the directory as well
9292 ##index uidNumber eq
9293 ##index gidNumber eq
9294 ##index cn eq
9295 ##index memberUid eq</PRE
9296 ></TD
9297 ></TR
9298 ></TABLE
9299 ></P
9300 ></DIV
9301 ><DIV
9302 CLASS="SECT2"
9303 ><HR><H2
9304 CLASS="SECT2"
9306 NAME="AEN1914"
9307 >11.5.2. Configuring Samba</A
9308 ></H2
9310 >The following parameters are available in smb.conf only with <TT
9311 CLASS="PARAMETER"
9313 >--with-ldapsam</I
9314 ></TT
9316 was included with compiling Samba.</P
9318 ></P
9319 ><UL
9320 ><LI
9323 HREF="smb.conf.5.html#LDAPSSL"
9324 TARGET="_top"
9325 >ldap ssl</A
9326 ></P
9327 ></LI
9328 ><LI
9331 HREF="smb.conf.5.html#LDAPSERVER"
9332 TARGET="_top"
9333 >ldap server</A
9334 ></P
9335 ></LI
9336 ><LI
9339 HREF="smb.conf.5.html#LDAPADMINDN"
9340 TARGET="_top"
9341 >ldap admin dn</A
9342 ></P
9343 ></LI
9344 ><LI
9347 HREF="smb.conf.5.html#LDAPSUFFIX"
9348 TARGET="_top"
9349 >ldap suffix</A
9350 ></P
9351 ></LI
9352 ><LI
9355 HREF="smb.conf.5.html#LDAPFILTER"
9356 TARGET="_top"
9357 >ldap filter</A
9358 ></P
9359 ></LI
9360 ><LI
9363 HREF="smb.conf.5.html#LDAPPORT"
9364 TARGET="_top"
9365 >ldap port</A
9366 ></P
9367 ></LI
9368 ></UL
9370 >These are described in the <A
9371 HREF="smb.conf.5.html"
9372 TARGET="_top"
9373 >smb.conf(5)</A
9374 > man
9375 page and so will not be repeated here. However, a sample smb.conf file for
9376 use with an LDAP directory could appear as</P
9378 ><TABLE
9379 BORDER="0"
9380 BGCOLOR="#E0E0E0"
9381 WIDTH="100%"
9382 ><TR
9383 ><TD
9384 ><PRE
9385 CLASS="PROGRAMLISTING"
9386 >## /usr/local/samba/lib/smb.conf
9387 [global]
9388 security = user
9389 encrypt passwords = yes
9391 netbios name = TASHTEGO
9392 workgroup = NARNIA
9394 # ldap related parameters
9396 # define the DN to use when binding to the directory servers
9397 # The password for this DN is not stored in smb.conf. Rather it
9398 # must be set by using 'smbpasswd -w <TT
9399 CLASS="REPLACEABLE"
9401 >secretpw</I
9402 ></TT
9403 >' to store the
9404 # passphrase in the secrets.tdb file. If the "ldap admin dn" values
9405 # changes, this password will need to be reset.
9406 ldap admin dn = "cn=Samba Manager,ou=people,dc=samba,dc=org"
9408 # specify the LDAP server's hostname (defaults to locahost)
9409 ldap server = ahab.samba.org
9411 # Define the SSL option when connecting to the directory
9412 # ('off', 'start tls', or 'on' (default))
9413 ldap ssl = start tls
9415 # define the port to use in the LDAP session (defaults to 636 when
9416 # "ldap ssl = on")
9417 ldap port = 389
9419 # specify the base DN to use when searching the directory
9420 ldap suffix = "ou=people,dc=samba,dc=org"
9422 # generally the default ldap search filter is ok
9423 # ldap filter = "(&#38;(uid=%u)(objectclass=sambaAccount))"</PRE
9424 ></TD
9425 ></TR
9426 ></TABLE
9427 ></P
9428 ></DIV
9429 ></DIV
9430 ><DIV
9431 CLASS="SECT1"
9432 ><HR><H1
9433 CLASS="SECT1"
9435 NAME="AEN1942"
9436 >11.6. Accounts and Groups management</A
9437 ></H1
9439 >As users accounts are managed thru the sambaAccount objectclass, you should
9440 modify you existing administration tools to deal with sambaAccount attributes.</P
9442 >Machines accounts are managed with the sambaAccount objectclass, just
9443 like users accounts. However, it's up to you to stored thoses accounts
9444 in a different tree of you LDAP namespace: you should use
9445 "ou=Groups,dc=plainjoe,dc=org" to store groups and
9446 "ou=People,dc=plainjoe,dc=org" to store users. Just configure your
9447 NSS and PAM accordingly (usually, in the /etc/ldap.conf configuration
9448 file).</P
9450 >In Samba release 2.2.3, the group management system is based on posix
9451 groups. This meand that Samba make usage of the posixGroup objectclass.
9452 For now, there is no NT-like group system management (global and local
9453 groups).</P
9454 ></DIV
9455 ><DIV
9456 CLASS="SECT1"
9457 ><HR><H1
9458 CLASS="SECT1"
9460 NAME="AEN1947"
9461 >11.7. Security and sambaAccount</A
9462 ></H1
9464 >There are two important points to remember when discussing the security
9465 of sambaAccount entries in the directory.</P
9467 ></P
9468 ><UL
9469 ><LI
9471 ><EM
9472 >Never</EM
9473 > retrieve the lmPassword or
9474 ntPassword attribute values over an unencrypted LDAP session.</P
9475 ></LI
9476 ><LI
9478 ><EM
9479 >Never</EM
9480 > allow non-admin users to
9481 view the lmPassword or ntPassword attribute values.</P
9482 ></LI
9483 ></UL
9485 >These password hashes are clear text equivalents and can be used to impersonate
9486 the user without deriving the original clear text strings. For more information
9487 on the details of LM/NT password hashes, refer to the <A
9488 HREF="ENCRYPTION.html"
9489 TARGET="_top"
9490 >ENCRYPTION chapter</A
9491 > of the Samba-HOWTO-Collection.</P
9493 >To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults
9494 to require an encrypted session (<B
9495 CLASS="COMMAND"
9496 >ldap ssl = on</B
9497 >) using
9498 the default port of 636
9499 when contacting the directory server. When using an OpenLDAP 2.0 server, it
9500 is possible to use the use the StartTLS LDAP extended operation in the place of
9501 LDAPS. In either case, you are strongly discouraged to disable this security
9503 CLASS="COMMAND"
9504 >ldap ssl = off</B
9505 >).</P
9507 >Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS
9508 extended operation. However, the OpenLDAP library still provides support for
9509 the older method of securing communication between clients and servers.</P
9511 >The second security precaution is to prevent non-administrative users from
9512 harvesting password hashes from the directory. This can be done using the
9513 following ACL in <TT
9514 CLASS="FILENAME"
9515 >slapd.conf</TT
9516 >:</P
9518 ><TABLE
9519 BORDER="0"
9520 BGCOLOR="#E0E0E0"
9521 WIDTH="100%"
9522 ><TR
9523 ><TD
9524 ><PRE
9525 CLASS="PROGRAMLISTING"
9526 >## allow the "ldap admin dn" access, but deny everyone else
9527 access to attrs=lmPassword,ntPassword
9528 by dn="cn=Samba Admin,ou=people,dc=plainjoe,dc=org" write
9529 by * none</PRE
9530 ></TD
9531 ></TR
9532 ></TABLE
9533 ></P
9534 ></DIV
9535 ><DIV
9536 CLASS="SECT1"
9537 ><HR><H1
9538 CLASS="SECT1"
9540 NAME="AEN1967"
9541 >11.8. LDAP specials attributes for sambaAccounts</A
9542 ></H1
9544 >The sambaAccount objectclass is composed of the following attributes:</P
9546 ></P
9547 ><UL
9548 ><LI
9550 ><TT
9551 CLASS="CONSTANT"
9552 >lmPassword</TT
9553 >: the LANMAN password 16-byte hash stored as a character
9554 representation of a hexidecimal string.</P
9555 ></LI
9556 ><LI
9558 ><TT
9559 CLASS="CONSTANT"
9560 >ntPassword</TT
9561 >: the NT password hash 16-byte stored as a character
9562 representation of a hexidecimal string.</P
9563 ></LI
9564 ><LI
9566 ><TT
9567 CLASS="CONSTANT"
9568 >pwdLastSet</TT
9569 >: The integer time in seconds since 1970 when the
9571 CLASS="CONSTANT"
9572 >lmPassword</TT
9573 > and <TT
9574 CLASS="CONSTANT"
9575 >ntPassword</TT
9576 > attributes were last set.
9578 ></LI
9579 ><LI
9581 ><TT
9582 CLASS="CONSTANT"
9583 >acctFlags</TT
9584 >: string of 11 characters surrounded by square brackets []
9585 representing account flags such as U (user), W(workstation), X(no password expiration), and
9586 D(disabled).</P
9587 ></LI
9588 ><LI
9590 ><TT
9591 CLASS="CONSTANT"
9592 >logonTime</TT
9593 >: Integer value currently unused</P
9594 ></LI
9595 ><LI
9597 ><TT
9598 CLASS="CONSTANT"
9599 >logoffTime</TT
9600 >: Integer value currently unused</P
9601 ></LI
9602 ><LI
9604 ><TT
9605 CLASS="CONSTANT"
9606 >kickoffTime</TT
9607 >: Integer value currently unused</P
9608 ></LI
9609 ><LI
9611 ><TT
9612 CLASS="CONSTANT"
9613 >pwdCanChange</TT
9614 >: Integer value currently unused</P
9615 ></LI
9616 ><LI
9618 ><TT
9619 CLASS="CONSTANT"
9620 >pwdMustChange</TT
9621 >: Integer value currently unused</P
9622 ></LI
9623 ><LI
9625 ><TT
9626 CLASS="CONSTANT"
9627 >homeDrive</TT
9628 >: specifies the drive letter to which to map the
9629 UNC path specified by homeDirectory. The drive letter must be specified in the form "X:"
9630 where X is the letter of the drive to map. Refer to the "logon drive" parameter in the
9631 smb.conf(5) man page for more information.</P
9632 ></LI
9633 ><LI
9635 ><TT
9636 CLASS="CONSTANT"
9637 >scriptPath</TT
9638 >: The scriptPath property specifies the path of
9639 the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path
9640 is relative to the netlogon share. Refer to the "logon script" parameter in the
9641 smb.conf(5) man page for more information.</P
9642 ></LI
9643 ><LI
9645 ><TT
9646 CLASS="CONSTANT"
9647 >profilePath</TT
9648 >: specifies a path to the user's profile.
9649 This value can be a null string, a local absolute path, or a UNC path. Refer to the
9650 "logon path" parameter in the smb.conf(5) man page for more information.</P
9651 ></LI
9652 ><LI
9654 ><TT
9655 CLASS="CONSTANT"
9656 >smbHome</TT
9657 >: The homeDirectory property specifies the path of
9658 the home directory for the user. The string can be null. If homeDrive is set and specifies
9659 a drive letter, homeDirectory should be a UNC path. The path must be a network
9660 UNC path of the form \\server\share\directory. This value can be a null string.
9661 Refer to the "logon home" parameter in the smb.conf(5) man page for more information.
9663 ></LI
9664 ><LI
9666 ><TT
9667 CLASS="CONSTANT"
9668 >userWorkstation</TT
9669 >: character string value currently unused.
9671 ></LI
9672 ><LI
9674 ><TT
9675 CLASS="CONSTANT"
9676 >rid</TT
9677 >: the integer representation of the user's relative identifier
9678 (RID).</P
9679 ></LI
9680 ><LI
9682 ><TT
9683 CLASS="CONSTANT"
9684 >primaryGroupID</TT
9685 >: the relative identifier (RID) of the primary group
9686 of the user.</P
9687 ></LI
9688 ></UL
9690 >The majority of these parameters are only used when Samba is acting as a PDC of
9691 a domain (refer to the <A
9692 HREF="Samba-PDC-HOWTO.html"
9693 TARGET="_top"
9694 >Samba-PDC-HOWTO</A
9695 > for details on
9696 how to configure Samba as a Primary Domain Controller). The following four attributes
9697 are only stored with the sambaAccount entry if the values are non-default values:</P
9699 ></P
9700 ><UL
9701 ><LI
9703 >smbHome</P
9704 ></LI
9705 ><LI
9707 >scriptPath</P
9708 ></LI
9709 ><LI
9711 >logonPath</P
9712 ></LI
9713 ><LI
9715 >homeDrive</P
9716 ></LI
9717 ></UL
9719 >These attributes are only stored with the sambaAccount entry if
9720 the values are non-default values. For example, assume TASHTEGO has now been
9721 configured as a PDC and that <B
9722 CLASS="COMMAND"
9723 >logon home = \\%L\%u</B
9724 > was defined in
9725 its <TT
9726 CLASS="FILENAME"
9727 >smb.conf</TT
9728 > file. When a user named "becky" logons to the domain,
9729 the <TT
9730 CLASS="PARAMETER"
9732 >logon home</I
9733 ></TT
9734 > string is expanded to \\TASHTEGO\becky.
9735 If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org",
9736 this value is used. However, if this attribute does not exist, then the value
9737 of the <TT
9738 CLASS="PARAMETER"
9740 >logon home</I
9741 ></TT
9742 > parameter is used in its place. Samba
9743 will only write the attribute value to the directory entry is the value is
9744 something other than the default (e.g. \\MOBY\becky).</P
9745 ></DIV
9746 ><DIV
9747 CLASS="SECT1"
9748 ><HR><H1
9749 CLASS="SECT1"
9751 NAME="AEN2037"
9752 >11.9. Example LDIF Entries for a sambaAccount</A
9753 ></H1
9755 >The following is a working LDIF with the inclusion of the posixAccount objectclass:</P
9757 ><TABLE
9758 BORDER="0"
9759 BGCOLOR="#E0E0E0"
9760 WIDTH="100%"
9761 ><TR
9762 ><TD
9763 ><PRE
9764 CLASS="PROGRAMLISTING"
9765 >dn: uid=guest2, ou=people,dc=plainjoe,dc=org
9766 ntPassword: 878D8014606CDA29677A44EFA1353FC7
9767 pwdMustChange: 2147483647
9768 primaryGroupID: 1201
9769 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
9770 pwdLastSet: 1010179124
9771 logonTime: 0
9772 objectClass: sambaAccount
9773 uid: guest2
9774 kickoffTime: 2147483647
9775 acctFlags: [UX ]
9776 logoffTime: 2147483647
9777 rid: 19006
9778 pwdCanChange: 0</PRE
9779 ></TD
9780 ></TR
9781 ></TABLE
9782 ></P
9784 >The following is an LDIF entry for using both the sambaAccount and
9785 posixAccount objectclasses:</P
9787 ><TABLE
9788 BORDER="0"
9789 BGCOLOR="#E0E0E0"
9790 WIDTH="100%"
9791 ><TR
9792 ><TD
9793 ><PRE
9794 CLASS="PROGRAMLISTING"
9795 >dn: uid=gcarter, ou=people,dc=plainjoe,dc=org
9796 logonTime: 0
9797 displayName: Gerald Carter
9798 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
9799 primaryGroupID: 1201
9800 objectClass: posixAccount
9801 objectClass: sambaAccount
9802 acctFlags: [UX ]
9803 userPassword: {crypt}BpM2ej8Rkzogo
9804 uid: gcarter
9805 uidNumber: 9000
9806 cn: Gerald Carter
9807 loginShell: /bin/bash
9808 logoffTime: 2147483647
9809 gidNumber: 100
9810 kickoffTime: 2147483647
9811 pwdLastSet: 1010179230
9812 rid: 19000
9813 homeDirectory: /home/tashtego/gcarter
9814 pwdCanChange: 0
9815 pwdMustChange: 2147483647
9816 ntPassword: 878D8014606CDA29677A44EFA1353FC7</PRE
9817 ></TD
9818 ></TR
9819 ></TABLE
9820 ></P
9821 ></DIV
9822 ><DIV
9823 CLASS="SECT1"
9824 ><HR><H1
9825 CLASS="SECT1"
9827 NAME="AEN2045"
9828 >11.10. Comments</A
9829 ></H1
9831 >Please mail all comments regarding this HOWTO to <A
9832 HREF="mailto:jerry@samba.org"
9833 TARGET="_top"
9834 >jerry@samba.org</A
9835 >. This documents was
9836 last updated to reflect the Samba 2.2.3 release.&#13;</P
9837 ></DIV
9838 ></DIV
9839 ><DIV
9840 CLASS="CHAPTER"
9841 ><HR><H1
9843 NAME="WINBIND"
9844 >Chapter 12. Unified Logons between Windows NT and UNIX using Winbind</A
9845 ></H1
9846 ><DIV
9847 CLASS="SECT1"
9848 ><H1
9849 CLASS="SECT1"
9851 NAME="AEN2074"
9852 >12.1. Abstract</A
9853 ></H1
9855 >Integration of UNIX and Microsoft Windows NT through
9856 a unified logon has been considered a "holy grail" in heterogeneous
9857 computing environments for a long time. We present
9859 >winbind</EM
9860 >, a component of the Samba suite
9861 of programs as a solution to the unified logon problem. Winbind
9862 uses a UNIX implementation
9863 of Microsoft RPC calls, Pluggable Authentication Modules, and the Name
9864 Service Switch to allow Windows NT domain users to appear and operate
9865 as UNIX users on a UNIX machine. This paper describes the winbind
9866 system, explaining the functionality it provides, how it is configured,
9867 and how it works internally.</P
9868 ></DIV
9869 ><DIV
9870 CLASS="SECT1"
9871 ><HR><H1
9872 CLASS="SECT1"
9874 NAME="AEN2078"
9875 >12.2. Introduction</A
9876 ></H1
9878 >It is well known that UNIX and Microsoft Windows NT have
9879 different models for representing user and group information and
9880 use different technologies for implementing them. This fact has
9881 made it difficult to integrate the two systems in a satisfactory
9882 manner.</P
9884 >One common solution in use today has been to create
9885 identically named user accounts on both the UNIX and Windows systems
9886 and use the Samba suite of programs to provide file and print services
9887 between the two. This solution is far from perfect however, as
9888 adding and deleting users on both sets of machines becomes a chore
9889 and two sets of passwords are required both of which
9890 can lead to synchronization problems between the UNIX and Windows
9891 systems and confusion for users.</P
9893 >We divide the unified logon problem for UNIX machines into
9894 three smaller problems:</P
9896 ></P
9897 ><UL
9898 ><LI
9900 >Obtaining Windows NT user and group information
9902 ></LI
9903 ><LI
9905 >Authenticating Windows NT users
9907 ></LI
9908 ><LI
9910 >Password changing for Windows NT users
9912 ></LI
9913 ></UL
9915 >Ideally, a prospective solution to the unified logon problem
9916 would satisfy all the above components without duplication of
9917 information on the UNIX machines and without creating additional
9918 tasks for the system administrator when maintaining users and
9919 groups on either system. The winbind system provides a simple
9920 and elegant solution to all three components of the unified logon
9921 problem.</P
9922 ></DIV
9923 ><DIV
9924 CLASS="SECT1"
9925 ><HR><H1
9926 CLASS="SECT1"
9928 NAME="AEN2091"
9929 >12.3. What Winbind Provides</A
9930 ></H1
9932 >Winbind unifies UNIX and Windows NT account management by
9933 allowing a UNIX box to become a full member of a NT domain. Once
9934 this is done the UNIX box will see NT users and groups as if
9935 they were native UNIX users and groups, allowing the NT domain
9936 to be used in much the same manner that NIS+ is used within
9937 UNIX-only environments.</P
9939 >The end result is that whenever any
9940 program on the UNIX machine asks the operating system to lookup
9941 a user or group name, the query will be resolved by asking the
9942 NT domain controller for the specified domain to do the lookup.
9943 Because Winbind hooks into the operating system at a low level
9944 (via the NSS name resolution modules in the C library) this
9945 redirection to the NT domain controller is completely
9946 transparent.</P
9948 >Users on the UNIX machine can then use NT user and group
9949 names as they would use "native" UNIX names. They can chown files
9950 so that they are owned by NT domain users or even login to the
9951 UNIX machine and run a UNIX X-Window session as a domain user.</P
9953 >The only obvious indication that Winbind is being used is
9954 that user and group names take the form DOMAIN\user and
9955 DOMAIN\group. This is necessary as it allows Winbind to determine
9956 that redirection to a domain controller is wanted for a particular
9957 lookup and which trusted domain is being referenced.</P
9959 >Additionally, Winbind provides an authentication service
9960 that hooks into the Pluggable Authentication Modules (PAM) system
9961 to provide authentication via a NT domain to any PAM enabled
9962 applications. This capability solves the problem of synchronizing
9963 passwords between systems since all passwords are stored in a single
9964 location (on the domain controller).</P
9965 ><DIV
9966 CLASS="SECT2"
9967 ><HR><H2
9968 CLASS="SECT2"
9970 NAME="AEN2098"
9971 >12.3.1. Target Uses</A
9972 ></H2
9974 >Winbind is targeted at organizations that have an
9975 existing NT based domain infrastructure into which they wish
9976 to put UNIX workstations or servers. Winbind will allow these
9977 organizations to deploy UNIX workstations without having to
9978 maintain a separate account infrastructure. This greatly
9979 simplifies the administrative overhead of deploying UNIX
9980 workstations into a NT based organization.</P
9982 >Another interesting way in which we expect Winbind to
9983 be used is as a central part of UNIX based appliances. Appliances
9984 that provide file and print services to Microsoft based networks
9985 will be able to use Winbind to provide seamless integration of
9986 the appliance into the domain.</P
9987 ></DIV
9988 ></DIV
9989 ><DIV
9990 CLASS="SECT1"
9991 ><HR><H1
9992 CLASS="SECT1"
9994 NAME="AEN2102"
9995 >12.4. How Winbind Works</A
9996 ></H1
9998 >The winbind system is designed around a client/server
9999 architecture. A long running <B
10000 CLASS="COMMAND"
10001 >winbindd</B
10002 > daemon
10003 listens on a UNIX domain socket waiting for requests
10004 to arrive. These requests are generated by the NSS and PAM
10005 clients and processed sequentially.</P
10007 >The technologies used to implement winbind are described
10008 in detail below.</P
10009 ><DIV
10010 CLASS="SECT2"
10011 ><HR><H2
10012 CLASS="SECT2"
10014 NAME="AEN2107"
10015 >12.4.1. Microsoft Remote Procedure Calls</A
10016 ></H2
10018 >Over the last two years, efforts have been underway
10019 by various Samba Team members to decode various aspects of
10020 the Microsoft Remote Procedure Call (MSRPC) system. This
10021 system is used for most network related operations between
10022 Windows NT machines including remote management, user authentication
10023 and print spooling. Although initially this work was done
10024 to aid the implementation of Primary Domain Controller (PDC)
10025 functionality in Samba, it has also yielded a body of code which
10026 can be used for other purposes.</P
10028 >Winbind uses various MSRPC calls to enumerate domain users
10029 and groups and to obtain detailed information about individual
10030 users or groups. Other MSRPC calls can be used to authenticate
10031 NT domain users and to change user passwords. By directly querying
10032 a Windows PDC for user and group information, winbind maps the
10033 NT account information onto UNIX user and group names.</P
10034 ></DIV
10035 ><DIV
10036 CLASS="SECT2"
10037 ><HR><H2
10038 CLASS="SECT2"
10040 NAME="AEN2111"
10041 >12.4.2. Name Service Switch</A
10042 ></H2
10044 >The Name Service Switch, or NSS, is a feature that is
10045 present in many UNIX operating systems. It allows system
10046 information such as hostnames, mail aliases and user information
10047 to be resolved from different sources. For example, a standalone
10048 UNIX workstation may resolve system information from a series of
10049 flat files stored on the local filesystem. A networked workstation
10050 may first attempt to resolve system information from local files,
10051 and then consult a NIS database for user information or a DNS server
10052 for hostname information.</P
10054 >The NSS application programming interface allows winbind
10055 to present itself as a source of system information when
10056 resolving UNIX usernames and groups. Winbind uses this interface,
10057 and information obtained from a Windows NT server using MSRPC
10058 calls to provide a new source of account enumeration. Using standard
10059 UNIX library calls, one can enumerate the users and groups on
10060 a UNIX machine running winbind and see all users and groups in
10061 a NT domain plus any trusted domain as though they were local
10062 users and groups.</P
10064 >The primary control file for NSS is
10066 CLASS="FILENAME"
10067 >/etc/nsswitch.conf</TT
10069 When a UNIX application makes a request to do a lookup
10070 the C library looks in <TT
10071 CLASS="FILENAME"
10072 >/etc/nsswitch.conf</TT
10074 for a line which matches the service type being requested, for
10075 example the "passwd" service type is used when user or group names
10076 are looked up. This config line species which implementations
10077 of that service should be tried and in what order. If the passwd
10078 config line is:</P
10081 CLASS="COMMAND"
10082 >passwd: files example</B
10083 ></P
10085 >then the C library will first load a module called
10087 CLASS="FILENAME"
10088 >/lib/libnss_files.so</TT
10089 > followed by
10090 the module <TT
10091 CLASS="FILENAME"
10092 >/lib/libnss_example.so</TT
10093 >. The
10094 C library will dynamically load each of these modules in turn
10095 and call resolver functions within the modules to try to resolve
10096 the request. Once the request is resolved the C library returns the
10097 result to the application.</P
10099 >This NSS interface provides a very easy way for Winbind
10100 to hook into the operating system. All that needs to be done
10101 is to put <TT
10102 CLASS="FILENAME"
10103 >libnss_winbind.so</TT
10104 > in <TT
10105 CLASS="FILENAME"
10106 >/lib/</TT
10108 then add "winbind" into <TT
10109 CLASS="FILENAME"
10110 >/etc/nsswitch.conf</TT
10111 > at
10112 the appropriate place. The C library will then call Winbind to
10113 resolve user and group names.</P
10114 ></DIV
10115 ><DIV
10116 CLASS="SECT2"
10117 ><HR><H2
10118 CLASS="SECT2"
10120 NAME="AEN2127"
10121 >12.4.3. Pluggable Authentication Modules</A
10122 ></H2
10124 >Pluggable Authentication Modules, also known as PAM,
10125 is a system for abstracting authentication and authorization
10126 technologies. With a PAM module it is possible to specify different
10127 authentication methods for different system applications without
10128 having to recompile these applications. PAM is also useful
10129 for implementing a particular policy for authorization. For example,
10130 a system administrator may only allow console logins from users
10131 stored in the local password file but only allow users resolved from
10132 a NIS database to log in over the network.</P
10134 >Winbind uses the authentication management and password
10135 management PAM interface to integrate Windows NT users into a
10136 UNIX system. This allows Windows NT users to log in to a UNIX
10137 machine and be authenticated against a suitable Primary Domain
10138 Controller. These users can also change their passwords and have
10139 this change take effect directly on the Primary Domain Controller.
10142 >PAM is configured by providing control files in the directory
10144 CLASS="FILENAME"
10145 >/etc/pam.d/</TT
10146 > for each of the services that
10147 require authentication. When an authentication request is made
10148 by an application the PAM code in the C library looks up this
10149 control file to determine what modules to load to do the
10150 authentication check and in what order. This interface makes adding
10151 a new authentication service for Winbind very easy, all that needs
10152 to be done is that the <TT
10153 CLASS="FILENAME"
10154 >pam_winbind.so</TT
10155 > module
10156 is copied to <TT
10157 CLASS="FILENAME"
10158 >/lib/security/</TT
10159 > and the PAM
10160 control files for relevant services are updated to allow
10161 authentication via winbind. See the PAM documentation
10162 for more details.</P
10163 ></DIV
10164 ><DIV
10165 CLASS="SECT2"
10166 ><HR><H2
10167 CLASS="SECT2"
10169 NAME="AEN2135"
10170 >12.4.4. User and Group ID Allocation</A
10171 ></H2
10173 >When a user or group is created under Windows NT
10174 is it allocated a numerical relative identifier (RID). This is
10175 slightly different to UNIX which has a range of numbers that are
10176 used to identify users, and the same range in which to identify
10177 groups. It is winbind's job to convert RIDs to UNIX id numbers and
10178 vice versa. When winbind is configured it is given part of the UNIX
10179 user id space and a part of the UNIX group id space in which to
10180 store Windows NT users and groups. If a Windows NT user is
10181 resolved for the first time, it is allocated the next UNIX id from
10182 the range. The same process applies for Windows NT groups. Over
10183 time, winbind will have mapped all Windows NT users and groups
10184 to UNIX user ids and group ids.</P
10186 >The results of this mapping are stored persistently in
10187 an ID mapping database held in a tdb database). This ensures that
10188 RIDs are mapped to UNIX IDs in a consistent way.</P
10189 ></DIV
10190 ><DIV
10191 CLASS="SECT2"
10192 ><HR><H2
10193 CLASS="SECT2"
10195 NAME="AEN2139"
10196 >12.4.5. Result Caching</A
10197 ></H2
10199 >An active system can generate a lot of user and group
10200 name lookups. To reduce the network cost of these lookups winbind
10201 uses a caching scheme based on the SAM sequence number supplied
10202 by NT domain controllers. User or group information returned
10203 by a PDC is cached by winbind along with a sequence number also
10204 returned by the PDC. This sequence number is incremented by
10205 Windows NT whenever any user or group information is modified. If
10206 a cached entry has expired, the sequence number is requested from
10207 the PDC and compared against the sequence number of the cached entry.
10208 If the sequence numbers do not match, then the cached information
10209 is discarded and up to date information is requested directly
10210 from the PDC.</P
10211 ></DIV
10212 ></DIV
10213 ><DIV
10214 CLASS="SECT1"
10215 ><HR><H1
10216 CLASS="SECT1"
10218 NAME="AEN2142"
10219 >12.5. Installation and Configuration</A
10220 ></H1
10222 >Many thanks to John Trostel <A
10223 HREF="mailto:jtrostel@snapserver.com"
10224 TARGET="_top"
10225 >jtrostel@snapserver.com</A
10227 for providing the HOWTO for this section.</P
10229 >This HOWTO describes how to get winbind services up and running
10230 to control access and authenticate users on your Linux box using
10231 the winbind services which come with SAMBA 2.2.2.</P
10233 >There is also some Solaris specific information in
10235 CLASS="FILENAME"
10236 >docs/textdocs/Solaris-Winbind-HOWTO.txt</TT
10238 Future revisions of this document will incorporate that
10239 information.</P
10240 ><DIV
10241 CLASS="SECT2"
10242 ><HR><H2
10243 CLASS="SECT2"
10245 NAME="AEN2149"
10246 >12.5.1. Introduction</A
10247 ></H2
10249 >This HOWTO describes the procedures used to get winbind up and
10250 running on my RedHat 7.1 system. Winbind is capable of providing access
10251 and authentication control for Windows Domain users through an NT
10252 or Win2K PDC for 'regular' services, such as telnet a nd ftp, as
10253 well for SAMBA services.</P
10255 >This HOWTO has been written from a 'RedHat-centric' perspective, so if
10256 you are using another distribution, you may have to modify the instructions
10257 somewhat to fit the way your distribution works.</P
10259 ></P
10260 ><UL
10261 ><LI
10263 > <EM
10264 >Why should I to this?</EM
10268 >This allows the SAMBA administrator to rely on the
10269 authentication mechanisms on the NT/Win2K PDC for the authentication
10270 of domain members. NT/Win2K users no longer need to have separate
10271 accounts on the SAMBA server.
10273 ></LI
10274 ><LI
10276 > <EM
10277 >Who should be reading this document?</EM
10281 > This HOWTO is designed for system administrators. If you are
10282 implementing SAMBA on a file server and wish to (fairly easily)
10283 integrate existing NT/Win2K users from your PDC onto the
10284 SAMBA server, this HOWTO is for you. That said, I am no NT or PAM
10285 expert, so you may find a better or easier way to accomplish
10286 these tasks.
10288 ></LI
10289 ></UL
10290 ></DIV
10291 ><DIV
10292 CLASS="SECT2"
10293 ><HR><H2
10294 CLASS="SECT2"
10296 NAME="AEN2162"
10297 >12.5.2. Requirements</A
10298 ></H2
10300 >If you have a samba configuration file that you are currently
10301 using... <EM
10302 >BACK IT UP!</EM
10303 > If your system already uses PAM,
10305 >back up the <TT
10306 CLASS="FILENAME"
10307 >/etc/pam.d</TT
10308 > directory
10309 contents!</EM
10310 > If you haven't already made a boot disk,
10312 >MAKE ONE NOW!</EM
10313 ></P
10315 >Messing with the pam configuration files can make it nearly impossible
10316 to log in to yourmachine. That's why you want to be able to boot back
10317 into your machine in single user mode and restore your
10319 CLASS="FILENAME"
10320 >/etc/pam.d</TT
10321 > back to the original state they were in if
10322 you get frustrated with the way things are going. ;-)</P
10324 >The latest version of SAMBA (version 2.2.2 as of this writing), now
10325 includes a functioning winbindd daemon. Please refer to the
10327 HREF="http://samba.org/"
10328 TARGET="_top"
10329 >main SAMBA web page</A
10330 > or,
10331 better yet, your closest SAMBA mirror site for instructions on
10332 downloading the source code.</P
10334 >To allow Domain users the ability to access SAMBA shares and
10335 files, as well as potentially other services provided by your
10336 SAMBA machine, PAM (pluggable authentication modules) must
10337 be setup properly on your machine. In order to compile the
10338 winbind modules, you should have at least the pam libraries resident
10339 on your system. For recent RedHat systems (7.1, for instance), that
10340 means <TT
10341 CLASS="FILENAME"
10342 >pam-0.74-22</TT
10343 >. For best results, it is helpful to also
10344 install the development packages in <TT
10345 CLASS="FILENAME"
10346 >pam-devel-0.74-22</TT
10347 >.</P
10348 ></DIV
10349 ><DIV
10350 CLASS="SECT2"
10351 ><HR><H2
10352 CLASS="SECT2"
10354 NAME="AEN2176"
10355 >12.5.3. Testing Things Out</A
10356 ></H2
10358 >Before starting, it is probably best to kill off all the SAMBA
10359 related daemons running on your server. Kill off all <B
10360 CLASS="COMMAND"
10361 >smbd</B
10364 CLASS="COMMAND"
10365 >nmbd</B
10366 >, and <B
10367 CLASS="COMMAND"
10368 >winbindd</B
10369 > processes that may
10370 be running. To use PAM, you will want to make sure that you have the
10371 standard PAM package (for RedHat) which supplies the <TT
10372 CLASS="FILENAME"
10373 >/etc/pam.d</TT
10375 directory structure, including the pam modules are used by pam-aware
10376 services, several pam libraries, and the <TT
10377 CLASS="FILENAME"
10378 >/usr/doc</TT
10380 and <TT
10381 CLASS="FILENAME"
10382 >/usr/man</TT
10383 > entries for pam. Winbind built better
10384 in SAMBA if the pam-devel package was also installed. This package includes
10385 the header files needed to compile pam-aware applications. For instance,
10386 my RedHat system has both <TT
10387 CLASS="FILENAME"
10388 >pam-0.74-22</TT
10389 > and
10391 CLASS="FILENAME"
10392 >pam-devel-0.74-22</TT
10393 > RPMs installed.</P
10394 ><DIV
10395 CLASS="SECT3"
10396 ><HR><H3
10397 CLASS="SECT3"
10399 NAME="AEN2187"
10400 >12.5.3.1. Configure and compile SAMBA</A
10401 ></H3
10403 >The configuration and compilation of SAMBA is pretty straightforward.
10404 The first three steps may not be necessary depending upon
10405 whether or not you have previously built the Samba binaries.</P
10407 ><TABLE
10408 BORDER="0"
10409 BGCOLOR="#E0E0E0"
10410 WIDTH="100%"
10411 ><TR
10412 ><TD
10413 ><PRE
10414 CLASS="PROGRAMLISTING"
10415 ><TT
10416 CLASS="PROMPT"
10417 >root#</TT
10418 > <B
10419 CLASS="COMMAND"
10420 >autoconf</B
10423 CLASS="PROMPT"
10424 >root#</TT
10425 > <B
10426 CLASS="COMMAND"
10427 >make clean</B
10430 CLASS="PROMPT"
10431 >root#</TT
10432 > <B
10433 CLASS="COMMAND"
10434 >rm config.cache</B
10437 CLASS="PROMPT"
10438 >root#</TT
10439 > <B
10440 CLASS="COMMAND"
10441 >./configure --with-winbind</B
10444 CLASS="PROMPT"
10445 >root#</TT
10446 > <B
10447 CLASS="COMMAND"
10448 >make</B
10451 CLASS="PROMPT"
10452 >root#</TT
10453 > <B
10454 CLASS="COMMAND"
10455 >make install</B
10456 ></PRE
10457 ></TD
10458 ></TR
10459 ></TABLE
10460 ></P
10462 >This will, by default, install SAMBA in <TT
10463 CLASS="FILENAME"
10464 >/usr/local/samba</TT
10466 See the main SAMBA documentation if you want to install SAMBA somewhere else.
10467 It will also build the winbindd executable and libraries. </P
10468 ></DIV
10469 ><DIV
10470 CLASS="SECT3"
10471 ><HR><H3
10472 CLASS="SECT3"
10474 NAME="AEN2206"
10475 >12.5.3.2. Configure <TT
10476 CLASS="FILENAME"
10477 >nsswitch.conf</TT
10478 > and the
10479 winbind libraries</A
10480 ></H3
10482 >The libraries needed to run the <B
10483 CLASS="COMMAND"
10484 >winbindd</B
10485 > daemon
10486 through nsswitch need to be copied to their proper locations, so</P
10488 ><TT
10489 CLASS="PROMPT"
10490 >root#</TT
10491 > <B
10492 CLASS="COMMAND"
10493 >cp ../samba/source/nsswitch/libnss_winbind.so /lib</B
10494 ></P
10496 >I also found it necessary to make the following symbolic link:</P
10498 ><TT
10499 CLASS="PROMPT"
10500 >root#</TT
10501 > <B
10502 CLASS="COMMAND"
10503 >ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2</B
10504 ></P
10506 >Now, as root you need to edit <TT
10507 CLASS="FILENAME"
10508 >/etc/nsswitch.conf</TT
10509 > to
10510 allow user and group entries to be visible from the <B
10511 CLASS="COMMAND"
10512 >winbindd</B
10514 daemon. My <TT
10515 CLASS="FILENAME"
10516 >/etc/nsswitch.conf</TT
10517 > file look like
10518 this after editing:</P
10520 ><TABLE
10521 BORDER="0"
10522 BGCOLOR="#E0E0E0"
10523 WIDTH="100%"
10524 ><TR
10525 ><TD
10526 ><PRE
10527 CLASS="PROGRAMLISTING"
10528 > passwd: files winbind
10529 shadow: files
10530 group: files winbind</PRE
10531 ></TD
10532 ></TR
10533 ></TABLE
10534 ></P
10537 The libraries needed by the winbind daemon will be automatically
10538 entered into the <B
10539 CLASS="COMMAND"
10540 >ldconfig</B
10541 > cache the next time
10542 your system reboots, but it
10543 is faster (and you don't need to reboot) if you do it manually:</P
10545 ><TT
10546 CLASS="PROMPT"
10547 >root#</TT
10548 > <B
10549 CLASS="COMMAND"
10550 >/sbin/ldconfig -v | grep winbind</B
10551 ></P
10553 >This makes <TT
10554 CLASS="FILENAME"
10555 >libnss_winbind</TT
10556 > available to winbindd
10557 and echos back a check to you.</P
10558 ></DIV
10559 ><DIV
10560 CLASS="SECT3"
10561 ><HR><H3
10562 CLASS="SECT3"
10564 NAME="AEN2231"
10565 >12.5.3.3. Configure smb.conf</A
10566 ></H3
10568 >Several parameters are needed in the smb.conf file to control
10569 the behavior of <B
10570 CLASS="COMMAND"
10571 >winbindd</B
10572 >. Configure
10574 CLASS="FILENAME"
10575 >smb.conf</TT
10576 > These are described in more detail in
10577 the <A
10578 HREF="winbindd.8.html"
10579 TARGET="_top"
10580 >winbindd(8)</A
10581 > man page. My
10583 CLASS="FILENAME"
10584 >smb.conf</TT
10585 > file was modified to
10586 include the following entries in the [global] section:</P
10588 ><TABLE
10589 BORDER="0"
10590 BGCOLOR="#E0E0E0"
10591 WIDTH="100%"
10592 ><TR
10593 ><TD
10594 ><PRE
10595 CLASS="PROGRAMLISTING"
10596 >[global]
10597 &#60;...&#62;
10598 # separate domain and username with '+', like DOMAIN+username
10600 HREF="winbindd.8.html#WINBINDSEPARATOR"
10601 TARGET="_top"
10602 >winbind separator</A
10603 > = +
10604 # use uids from 10000 to 20000 for domain users
10606 HREF="winbindd.8.html#WINBINDUID"
10607 TARGET="_top"
10608 >winbind uid</A
10609 > = 10000-20000
10610 # use gids from 10000 to 20000 for domain groups
10612 HREF="winbindd.8.html#WINBINDGID"
10613 TARGET="_top"
10614 >winbind gid</A
10615 > = 10000-20000
10616 # allow enumeration of winbind users and groups
10618 HREF="winbindd.8.html#WINBINDENUMUSERS"
10619 TARGET="_top"
10620 >winbind enum users</A
10621 > = yes
10623 HREF="winbindd.8.html#WINBINDENUMGROUP"
10624 TARGET="_top"
10625 >winbind enum groups</A
10626 > = yes
10627 # give winbind users a real shell (only needed if they have telnet access)
10629 HREF="winbindd.8.html#TEMPLATEHOMEDIR"
10630 TARGET="_top"
10631 >template homedir</A
10632 > = /home/winnt/%D/%U
10634 HREF="winbindd.8.html#TEMPLATESHELL"
10635 TARGET="_top"
10636 >template shell</A
10637 > = /bin/bash</PRE
10638 ></TD
10639 ></TR
10640 ></TABLE
10641 ></P
10642 ></DIV
10643 ><DIV
10644 CLASS="SECT3"
10645 ><HR><H3
10646 CLASS="SECT3"
10648 NAME="AEN2247"
10649 >12.5.3.4. Join the SAMBA server to the PDC domain</A
10650 ></H3
10652 >Enter the following command to make the SAMBA server join the
10653 PDC domain, where <TT
10654 CLASS="REPLACEABLE"
10656 >DOMAIN</I
10657 ></TT
10658 > is the name of
10659 your Windows domain and <TT
10660 CLASS="REPLACEABLE"
10662 >Administrator</I
10663 ></TT
10664 > is
10665 a domain user who has administrative privileges in the domain.</P
10667 ><TT
10668 CLASS="PROMPT"
10669 >root#</TT
10670 > <B
10671 CLASS="COMMAND"
10672 >/usr/local/samba/bin/smbpasswd -j DOMAIN -r PDC -U Administrator</B
10673 ></P
10675 >The proper response to the command should be: "Joined the domain
10677 CLASS="REPLACEABLE"
10679 >DOMAIN</I
10680 ></TT
10681 >" where <TT
10682 CLASS="REPLACEABLE"
10684 >DOMAIN</I
10685 ></TT
10687 is your DOMAIN name.</P
10688 ></DIV
10689 ><DIV
10690 CLASS="SECT3"
10691 ><HR><H3
10692 CLASS="SECT3"
10694 NAME="AEN2258"
10695 >12.5.3.5. Start up the winbindd daemon and test it!</A
10696 ></H3
10698 >Eventually, you will want to modify your smb startup script to
10699 automatically invoke the winbindd daemon when the other parts of
10700 SAMBA start, but it is possible to test out just the winbind
10701 portion first. To start up winbind services, enter the following
10702 command as root:</P
10704 ><TT
10705 CLASS="PROMPT"
10706 >root#</TT
10707 > <B
10708 CLASS="COMMAND"
10709 >/usr/local/samba/bin/winbindd</B
10710 ></P
10712 >I'm always paranoid and like to make sure the daemon
10713 is really running...</P
10715 ><TT
10716 CLASS="PROMPT"
10717 >root#</TT
10718 > <B
10719 CLASS="COMMAND"
10720 >ps -ae | grep winbindd</B
10721 ></P
10723 >This command should produce output like this, if the daemon is running</P
10725 >3025 ? 00:00:00 winbindd</P
10727 >Now... for the real test, try to get some information about the
10728 users on your PDC</P
10730 ><TT
10731 CLASS="PROMPT"
10732 >root#</TT
10733 > <B
10734 CLASS="COMMAND"
10735 >/usr/local/samba/bin/wbinfo -u</B
10736 ></P
10739 This should echo back a list of users on your Windows users on
10740 your PDC. For example, I get the following response:</P
10742 ><TABLE
10743 BORDER="0"
10744 BGCOLOR="#E0E0E0"
10745 WIDTH="100%"
10746 ><TR
10747 ><TD
10748 ><PRE
10749 CLASS="PROGRAMLISTING"
10750 >CEO+Administrator
10751 CEO+burdell
10752 CEO+Guest
10753 CEO+jt-ad
10754 CEO+krbtgt
10755 CEO+TsInternetUser</PRE
10756 ></TD
10757 ></TR
10758 ></TABLE
10759 ></P
10761 >Obviously, I have named my domain 'CEO' and my <TT
10762 CLASS="PARAMETER"
10764 >winbind
10765 separator</I
10766 ></TT
10767 > is '+'.</P
10769 >You can do the same sort of thing to get group information from
10770 the PDC:</P
10772 ><TABLE
10773 BORDER="0"
10774 BGCOLOR="#E0E0E0"
10775 WIDTH="100%"
10776 ><TR
10777 ><TD
10778 ><PRE
10779 CLASS="PROGRAMLISTING"
10780 ><TT
10781 CLASS="PROMPT"
10782 >root#</TT
10783 > <B
10784 CLASS="COMMAND"
10785 >/usr/local/samba/bin/wbinfo -g</B
10787 CEO+Domain Admins
10788 CEO+Domain Users
10789 CEO+Domain Guests
10790 CEO+Domain Computers
10791 CEO+Domain Controllers
10792 CEO+Cert Publishers
10793 CEO+Schema Admins
10794 CEO+Enterprise Admins
10795 CEO+Group Policy Creator Owners</PRE
10796 ></TD
10797 ></TR
10798 ></TABLE
10799 ></P
10801 >The function 'getent' can now be used to get unified
10802 lists of both local and PDC users and groups.
10803 Try the following command:</P
10805 ><TT
10806 CLASS="PROMPT"
10807 >root#</TT
10808 > <B
10809 CLASS="COMMAND"
10810 >getent passwd</B
10811 ></P
10813 >You should get a list that looks like your <TT
10814 CLASS="FILENAME"
10815 >/etc/passwd</TT
10817 list followed by the domain users with their new uids, gids, home
10818 directories and default shells.</P
10820 >The same thing can be done for groups with the command</P
10822 ><TT
10823 CLASS="PROMPT"
10824 >root#</TT
10825 > <B
10826 CLASS="COMMAND"
10827 >getent group</B
10828 ></P
10829 ></DIV
10830 ><DIV
10831 CLASS="SECT3"
10832 ><HR><H3
10833 CLASS="SECT3"
10835 NAME="AEN2294"
10836 >12.5.3.6. Fix the <TT
10837 CLASS="FILENAME"
10838 >/etc/rc.d/init.d/smb</TT
10839 > startup files</A
10840 ></H3
10842 >The <B
10843 CLASS="COMMAND"
10844 >winbindd</B
10845 > daemon needs to start up after the
10847 CLASS="COMMAND"
10848 >smbd</B
10849 > and <B
10850 CLASS="COMMAND"
10851 >nmbd</B
10852 > daemons are running.
10853 To accomplish this task, you need to modify the <TT
10854 CLASS="FILENAME"
10855 >/etc/init.d/smb</TT
10857 script to add commands to invoke this daemon in the proper sequence. My
10859 CLASS="FILENAME"
10860 >/etc/init.d/smb</TT
10861 > file starts up <B
10862 CLASS="COMMAND"
10863 >smbd</B
10866 CLASS="COMMAND"
10867 >nmbd</B
10868 >, and <B
10869 CLASS="COMMAND"
10870 >winbindd</B
10871 > from the
10873 CLASS="FILENAME"
10874 >/usr/local/samba/bin</TT
10875 > directory directly. The 'start'
10876 function in the script looks like this:</P
10878 ><TABLE
10879 BORDER="0"
10880 BGCOLOR="#E0E0E0"
10881 WIDTH="100%"
10882 ><TR
10883 ><TD
10884 ><PRE
10885 CLASS="PROGRAMLISTING"
10886 >start() {
10887 KIND="SMB"
10888 echo -n $"Starting $KIND services: "
10889 daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
10890 RETVAL=$?
10891 echo
10892 KIND="NMB"
10893 echo -n $"Starting $KIND services: "
10894 daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
10895 RETVAL2=$?
10896 echo
10897 KIND="Winbind"
10898 echo -n $"Starting $KIND services: "
10899 daemon /usr/local/samba/bin/winbindd
10900 RETVAL3=$?
10901 echo
10902 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; touch /var/lock/subsys/smb || \
10903 RETVAL=1
10904 return $RETVAL
10905 }</PRE
10906 ></TD
10907 ></TR
10908 ></TABLE
10909 ></P
10911 >The 'stop' function has a corresponding entry to shut down the
10912 services and look s like this:</P
10914 ><TABLE
10915 BORDER="0"
10916 BGCOLOR="#E0E0E0"
10917 WIDTH="100%"
10918 ><TR
10919 ><TD
10920 ><PRE
10921 CLASS="PROGRAMLISTING"
10922 >stop() {
10923 KIND="SMB"
10924 echo -n $"Shutting down $KIND services: "
10925 killproc smbd
10926 RETVAL=$?
10927 echo
10928 KIND="NMB"
10929 echo -n $"Shutting down $KIND services: "
10930 killproc nmbd
10931 RETVAL2=$?
10932 echo
10933 KIND="Winbind"
10934 echo -n $"Shutting down $KIND services: "
10935 killproc winbindd
10936 RETVAL3=$?
10937 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; rm -f /var/lock/subsys/smb
10938 echo ""
10939 return $RETVAL
10940 }</PRE
10941 ></TD
10942 ></TR
10943 ></TABLE
10944 ></P
10946 >If you restart the <B
10947 CLASS="COMMAND"
10948 >smbd</B
10949 >, <B
10950 CLASS="COMMAND"
10951 >nmbd</B
10953 and <B
10954 CLASS="COMMAND"
10955 >winbindd</B
10956 > daemons at this point, you
10957 should be able to connect to the samba server as a domain member just as
10958 if you were a local user.</P
10959 ></DIV
10960 ><DIV
10961 CLASS="SECT3"
10962 ><HR><H3
10963 CLASS="SECT3"
10965 NAME="AEN2316"
10966 >12.5.3.7. Configure Winbind and PAM</A
10967 ></H3
10969 >If you have made it this far, you know that winbindd and samba are working
10970 together. If you want to use winbind to provide authentication for other
10971 services, keep reading. The pam configuration files need to be altered in
10972 this step. (Did you remember to make backups of your original
10974 CLASS="FILENAME"
10975 >/etc/pam.d</TT
10976 > files? If not, do it now.)</P
10978 >You will need a pam module to use winbindd with these other services. This
10979 module will be compiled in the <TT
10980 CLASS="FILENAME"
10981 >../source/nsswitch</TT
10982 > directory
10983 by invoking the command</P
10985 ><TT
10986 CLASS="PROMPT"
10987 >root#</TT
10988 > <B
10989 CLASS="COMMAND"
10990 >make nsswitch/pam_winbind.so</B
10991 ></P
10993 >from the <TT
10994 CLASS="FILENAME"
10995 >../source</TT
10996 > directory. The
10998 CLASS="FILENAME"
10999 >pam_winbind.so</TT
11000 > file should be copied to the location of
11001 your other pam security modules. On my RedHat system, this was the
11003 CLASS="FILENAME"
11004 >/lib/security</TT
11005 > directory.</P
11007 ><TT
11008 CLASS="PROMPT"
11009 >root#</TT
11010 > <B
11011 CLASS="COMMAND"
11012 >cp ../samba/source/nsswitch/pam_winbind.so /lib/security</B
11013 ></P
11015 >The <TT
11016 CLASS="FILENAME"
11017 >/etc/pam.d/samba</TT
11018 > file does not need to be changed. I
11019 just left this fileas it was:</P
11021 ><TABLE
11022 BORDER="0"
11023 BGCOLOR="#E0E0E0"
11024 WIDTH="100%"
11025 ><TR
11026 ><TD
11027 ><PRE
11028 CLASS="PROGRAMLISTING"
11029 >auth required /lib/security/pam_stack.so service=system-auth
11030 account required /lib/security/pam_stack.so service=system-auth</PRE
11031 ></TD
11032 ></TR
11033 ></TABLE
11034 ></P
11036 >The other services that I modified to allow the use of winbind
11037 as an authentication service were the normal login on the console (or a terminal
11038 session), telnet logins, and ftp service. In order to enable these
11039 services, you may first need to change the entries in
11041 CLASS="FILENAME"
11042 >/etc/xinetd.d</TT
11043 > (or <TT
11044 CLASS="FILENAME"
11045 >/etc/inetd.conf</TT
11046 >).
11047 RedHat 7.1 uses the new xinetd.d structure, in this case you need
11048 to change the lines in <TT
11049 CLASS="FILENAME"
11050 >/etc/xinetd.d/telnet</TT
11052 and <TT
11053 CLASS="FILENAME"
11054 >/etc/xinetd.d/wu-ftp</TT
11055 > from </P
11057 ><TABLE
11058 BORDER="0"
11059 BGCOLOR="#E0E0E0"
11060 WIDTH="100%"
11061 ><TR
11062 ><TD
11063 ><PRE
11064 CLASS="PROGRAMLISTING"
11065 >enable = no</PRE
11066 ></TD
11067 ></TR
11068 ></TABLE
11069 ></P
11071 >to</P
11073 ><TABLE
11074 BORDER="0"
11075 BGCOLOR="#E0E0E0"
11076 WIDTH="100%"
11077 ><TR
11078 ><TD
11079 ><PRE
11080 CLASS="PROGRAMLISTING"
11081 >enable = yes</PRE
11082 ></TD
11083 ></TR
11084 ></TABLE
11085 ></P
11088 For ftp services to work properly, you will also need to either
11089 have individual directories for the domain users already present on
11090 the server, or change the home directory template to a general
11091 directory for all domain users. These can be easily set using
11092 the <TT
11093 CLASS="FILENAME"
11094 >smb.conf</TT
11095 > global entry
11097 CLASS="COMMAND"
11098 >template homedir</B
11099 >.</P
11101 >The <TT
11102 CLASS="FILENAME"
11103 >/etc/pam.d/ftp</TT
11104 > file can be changed
11105 to allow winbind ftp access in a manner similar to the
11106 samba file. My <TT
11107 CLASS="FILENAME"
11108 >/etc/pam.d/ftp</TT
11109 > file was
11110 changed to look like this:</P
11112 ><TABLE
11113 BORDER="0"
11114 BGCOLOR="#E0E0E0"
11115 WIDTH="100%"
11116 ><TR
11117 ><TD
11118 ><PRE
11119 CLASS="PROGRAMLISTING"
11120 >auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
11121 auth sufficient /lib/security/pam_winbind.so
11122 auth required /lib/security/pam_stack.so service=system-auth
11123 auth required /lib/security/pam_shells.so
11124 account sufficient /lib/security/pam_winbind.so
11125 account required /lib/security/pam_stack.so service=system-auth
11126 session required /lib/security/pam_stack.so service=system-auth</PRE
11127 ></TD
11128 ></TR
11129 ></TABLE
11130 ></P
11132 >The <TT
11133 CLASS="FILENAME"
11134 >/etc/pam.d/login</TT
11135 > file can be changed nearly the
11136 same way. It now looks like this:</P
11138 ><TABLE
11139 BORDER="0"
11140 BGCOLOR="#E0E0E0"
11141 WIDTH="100%"
11142 ><TR
11143 ><TD
11144 ><PRE
11145 CLASS="PROGRAMLISTING"
11146 >auth required /lib/security/pam_securetty.so
11147 auth sufficient /lib/security/pam_winbind.so
11148 auth sufficient /lib/security/pam_unix.so use_first_pass
11149 auth required /lib/security/pam_stack.so service=system-auth
11150 auth required /lib/security/pam_nologin.so
11151 account sufficient /lib/security/pam_winbind.so
11152 account required /lib/security/pam_stack.so service=system-auth
11153 password required /lib/security/pam_stack.so service=system-auth
11154 session required /lib/security/pam_stack.so service=system-auth
11155 session optional /lib/security/pam_console.so</PRE
11156 ></TD
11157 ></TR
11158 ></TABLE
11159 ></P
11161 >In this case, I added the <B
11162 CLASS="COMMAND"
11163 >auth sufficient /lib/security/pam_winbind.so</B
11165 lines as before, but also added the <B
11166 CLASS="COMMAND"
11167 >required pam_securetty.so</B
11169 above it, to disallow root logins over the network. I also added a
11171 CLASS="COMMAND"
11172 >sufficient /lib/security/pam_unix.so use_first_pass</B
11174 line after the <B
11175 CLASS="COMMAND"
11176 >winbind.so</B
11177 > line to get rid of annoying
11178 double prompts for passwords.</P
11179 ></DIV
11180 ></DIV
11181 ></DIV
11182 ><DIV
11183 CLASS="SECT1"
11184 ><HR><H1
11185 CLASS="SECT1"
11187 NAME="AEN2363"
11188 >12.6. Limitations</A
11189 ></H1
11191 >Winbind has a number of limitations in its current
11192 released version that we hope to overcome in future
11193 releases:</P
11195 ></P
11196 ><UL
11197 ><LI
11199 >Winbind is currently only available for
11200 the Linux operating system, although ports to other operating
11201 systems are certainly possible. For such ports to be feasible,
11202 we require the C library of the target operating system to
11203 support the Name Service Switch and Pluggable Authentication
11204 Modules systems. This is becoming more common as NSS and
11205 PAM gain support among UNIX vendors.</P
11206 ></LI
11207 ><LI
11209 >The mappings of Windows NT RIDs to UNIX ids
11210 is not made algorithmically and depends on the order in which
11211 unmapped users or groups are seen by winbind. It may be difficult
11212 to recover the mappings of rid to UNIX id mapping if the file
11213 containing this information is corrupted or destroyed.</P
11214 ></LI
11215 ><LI
11217 >Currently the winbind PAM module does not take
11218 into account possible workstation and logon time restrictions
11219 that may be been set for Windows NT users.</P
11220 ></LI
11221 ></UL
11222 ></DIV
11223 ><DIV
11224 CLASS="SECT1"
11225 ><HR><H1
11226 CLASS="SECT1"
11228 NAME="AEN2373"
11229 >12.7. Conclusion</A
11230 ></H1
11232 >The winbind system, through the use of the Name Service
11233 Switch, Pluggable Authentication Modules, and appropriate
11234 Microsoft RPC calls have allowed us to provide seamless
11235 integration of Microsoft Windows NT domain users on a
11236 UNIX system. The result is a great reduction in the administrative
11237 cost of running a mixed UNIX and NT network.</P
11238 ></DIV
11239 ></DIV
11240 ><DIV
11241 CLASS="CHAPTER"
11242 ><HR><H1
11244 NAME="OS2"
11245 >Chapter 13. OS2 Client HOWTO</A
11246 ></H1
11247 ><DIV
11248 CLASS="SECT1"
11249 ><H1
11250 CLASS="SECT1"
11252 NAME="AEN2387"
11253 >13.1. FAQs</A
11254 ></H1
11255 ><DIV
11256 CLASS="SECT2"
11257 ><H2
11258 CLASS="SECT2"
11260 NAME="AEN2389"
11261 >13.1.1. How can I configure OS/2 Warp Connect or
11262 OS/2 Warp 4 as a client for Samba?</A
11263 ></H2
11265 >A more complete answer to this question can be
11266 found on <A
11267 HREF="http://carol.wins.uva.nl/~leeuw/samba/warp.html"
11268 TARGET="_top"
11269 > http://carol.wins.uva.nl/~leeuw/samba/warp.html</A
11270 >.</P
11272 >Basically, you need three components:</P
11274 ></P
11275 ><UL
11276 ><LI
11278 >The File and Print Client ('IBM Peer')
11280 ></LI
11281 ><LI
11283 >TCP/IP ('Internet support')
11285 ></LI
11286 ><LI
11288 >The "NetBIOS over TCP/IP" driver ('TCPBEUI')
11290 ></LI
11291 ></UL
11293 >Installing the first two together with the base operating
11294 system on a blank system is explained in the Warp manual. If Warp
11295 has already been installed, but you now want to install the
11296 networking support, use the "Selective Install for Networking"
11297 object in the "System Setup" folder.</P
11299 >Adding the "NetBIOS over TCP/IP" driver is not described
11300 in the manual and just barely in the online documentation. Start
11301 MPTS.EXE, click on OK, click on "Configure LAPS" and click
11302 on "IBM OS/2 NETBIOS OVER TCP/IP" in 'Protocols'. This line
11303 is then moved to 'Current Configuration'. Select that line,
11304 click on "Change number" and increase it from 0 to 1. Save this
11305 configuration.</P
11307 >If the Samba server(s) is not on your local subnet, you
11308 can optionally add IP names and addresses of these servers
11309 to the "Names List", or specify a WINS server ('NetBIOS
11310 Nameserver' in IBM and RFC terminology). For Warp Connect you
11311 may need to download an update for 'IBM Peer' to bring it on
11312 the same level as Warp 4. See the webpage mentioned above.</P
11313 ></DIV
11314 ><DIV
11315 CLASS="SECT2"
11316 ><HR><H2
11317 CLASS="SECT2"
11319 NAME="AEN2404"
11320 >13.1.2. How can I configure OS/2 Warp 3 (not Connect),
11321 OS/2 1.2, 1.3 or 2.x for Samba?</A
11322 ></H2
11324 >You can use the free Microsoft LAN Manager 2.2c Client
11325 for OS/2 from
11327 HREF="ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/"
11328 TARGET="_top"
11329 > ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/</A
11331 See <A
11332 HREF="http://carol.wins.uva.nl/~leeuw/lanman.html"
11333 TARGET="_top"
11334 > http://carol.wins.uva.nl/~leeuw/lanman.html</A
11335 > for
11336 more information on how to install and use this client. In
11337 a nutshell, edit the file \OS2VER in the root directory of
11338 the OS/2 boot partition and add the lines:</P
11340 ><TABLE
11341 BORDER="0"
11342 BGCOLOR="#E0E0E0"
11343 WIDTH="100%"
11344 ><TR
11345 ><TD
11346 ><PRE
11347 CLASS="PROGRAMLISTING"
11348 > 20=setup.exe
11349 20=netwksta.sys
11350 20=netvdd.sys
11351 </PRE
11352 ></TD
11353 ></TR
11354 ></TABLE
11355 ></P
11357 >before you install the client. Also, don't use the
11358 included NE2000 driver because it is buggy. Try the NE2000
11359 or NS2000 driver from
11361 HREF="ftp://ftp.cdrom.com/pub/os2/network/ndis/"
11362 TARGET="_top"
11363 > ftp://ftp.cdrom.com/pub/os2/network/ndis/</A
11364 > instead.
11366 ></DIV
11367 ><DIV
11368 CLASS="SECT2"
11369 ><HR><H2
11370 CLASS="SECT2"
11372 NAME="AEN2413"
11373 >13.1.3. Are there any other issues when OS/2 (any version)
11374 is used as a client?</A
11375 ></H2
11377 >When you do a NET VIEW or use the "File and Print
11378 Client Resource Browser", no Samba servers show up. This can
11379 be fixed by a patch from <A
11380 HREF="http://carol.wins.uva.nl/~leeuw/samba/fix.html"
11381 TARGET="_top"
11382 > http://carol.wins.uva.nl/~leeuw/samba/fix.html</A
11384 The patch will be included in a later version of Samba. It also
11385 fixes a couple of other problems, such as preserving long
11386 filenames when objects are dragged from the Workplace Shell
11387 to the Samba server. </P
11388 ></DIV
11389 ><DIV
11390 CLASS="SECT2"
11391 ><HR><H2
11392 CLASS="SECT2"
11394 NAME="AEN2417"
11395 >13.1.4. How do I get printer driver download working
11396 for OS/2 clients?</A
11397 ></H2
11399 >First, create a share called [PRINTDRV] that is
11400 world-readable. Copy your OS/2 driver files there. Note
11401 that the .EA_ files must still be separate, so you will need
11402 to use the original install files, and not copy an installed
11403 driver from an OS/2 system.</P
11405 >Install the NT driver first for that printer. Then,
11406 add to your smb.conf a parameter, "os2 driver map =
11408 CLASS="REPLACEABLE"
11410 >filename</I
11411 ></TT
11412 >". Then, in the file
11413 specified by <TT
11414 CLASS="REPLACEABLE"
11416 >filename</I
11417 ></TT
11418 >, map the
11419 name of the NT driver name to the OS/2 driver name as
11420 follows:</P
11422 >&#60;nt driver name&#62; = &#60;os2 driver
11423 name&#62;.&#60;device name&#62;, e.g.:
11424 HP LaserJet 5L = LASERJET.HP LaserJet 5L</P
11426 >You can have multiple drivers mapped in this file.</P
11428 >If you only specify the OS/2 driver name, and not the
11429 device name, the first attempt to download the driver will
11430 actually download the files, but the OS/2 client will tell
11431 you the driver is not available. On the second attempt, it
11432 will work. This is fixed simply by adding the device name
11433 to the mapping, after which it will work on the first attempt.
11435 ></DIV
11436 ></DIV
11437 ></DIV
11438 ><DIV
11439 CLASS="CHAPTER"
11440 ><HR><H1
11442 NAME="CVS-ACCESS"
11443 >Chapter 14. HOWTO Access Samba source code via CVS</A
11444 ></H1
11445 ><DIV
11446 CLASS="SECT1"
11447 ><H1
11448 CLASS="SECT1"
11450 NAME="AEN2433"
11451 >14.1. Introduction</A
11452 ></H1
11454 >Samba is developed in an open environment. Developers use CVS
11455 (Concurrent Versioning System) to "checkin" (also known as
11456 "commit") new source code. Samba's various CVS branches can
11457 be accessed via anonymous CVS using the instructions
11458 detailed in this chapter.</P
11460 >This document is a modified version of the instructions found at
11462 HREF="http://samba.org/samba/cvs.html"
11463 TARGET="_top"
11464 >http://samba.org/samba/cvs.html</A
11465 ></P
11466 ></DIV
11467 ><DIV
11468 CLASS="SECT1"
11469 ><HR><H1
11470 CLASS="SECT1"
11472 NAME="AEN2438"
11473 >14.2. CVS Access to samba.org</A
11474 ></H1
11476 >The machine samba.org runs a publicly accessible CVS
11477 repository for access to the source code of several packages,
11478 including samba, rsync and jitterbug. There are two main ways of
11479 accessing the CVS server on this host.</P
11480 ><DIV
11481 CLASS="SECT2"
11482 ><HR><H2
11483 CLASS="SECT2"
11485 NAME="AEN2441"
11486 >14.2.1. Access via CVSweb</A
11487 ></H2
11489 >You can access the source code via your
11490 favourite WWW browser. This allows you to access the contents of
11491 individual files in the repository and also to look at the revision
11492 history and commit logs of individual files. You can also ask for a diff
11493 listing between any two versions on the repository.</P
11495 >Use the URL : <A
11496 HREF="http://samba.org/cgi-bin/cvsweb"
11497 TARGET="_top"
11498 >http://samba.org/cgi-bin/cvsweb</A
11499 ></P
11500 ></DIV
11501 ><DIV
11502 CLASS="SECT2"
11503 ><HR><H2
11504 CLASS="SECT2"
11506 NAME="AEN2446"
11507 >14.2.2. Access via cvs</A
11508 ></H2
11510 >You can also access the source code via a
11511 normal cvs client. This gives you much more control over you can
11512 do with the repository and allows you to checkout whole source trees
11513 and keep them up to date via normal cvs commands. This is the
11514 preferred method of access if you are a developer and not
11515 just a casual browser.</P
11517 >To download the latest cvs source code, point your
11518 browser at the URL : <A
11519 HREF="http://www.cyclic.com/"
11520 TARGET="_top"
11521 >http://www.cyclic.com/</A
11523 and click on the 'How to get cvs' link. CVS is free software under
11524 the GNU GPL (as is Samba). Note that there are several graphical CVS clients
11525 which provide a graphical interface to the sometimes mundane CVS commands.
11526 Links to theses clients are also available from http://www.cyclic.com.</P
11528 >To gain access via anonymous cvs use the following steps.
11529 For this example it is assumed that you want a copy of the
11530 samba source code. For the other source code repositories
11531 on this system just substitute the correct package name</P
11533 ></P
11534 ><OL
11535 TYPE="1"
11536 ><LI
11538 > Install a recent copy of cvs. All you really need is a
11539 copy of the cvs client binary.
11541 ></LI
11542 ><LI
11544 > Run the command
11547 > <B
11548 CLASS="COMMAND"
11549 >cvs -d :pserver:cvs@samba.org:/cvsroot login</B
11553 > When it asks you for a password type <TT
11554 CLASS="USERINPUT"
11556 >cvs</B
11557 ></TT
11560 ></LI
11561 ><LI
11563 > Run the command
11566 > <B
11567 CLASS="COMMAND"
11568 >cvs -d :pserver:cvs@samba.org:/cvsroot co samba</B
11572 > This will create a directory called samba containing the
11573 latest samba source code (i.e. the HEAD tagged cvs branch). This
11574 currently corresponds to the 3.0 development tree.
11577 > CVS branches other HEAD can be obtained by using the <TT
11578 CLASS="PARAMETER"
11580 >-r</I
11581 ></TT
11583 and defining a tag name. A list of branch tag names can be found on the
11584 "Development" page of the samba web site. A common request is to obtain the
11585 latest 2.2 release code. This could be done by using the following command.
11588 > <B
11589 CLASS="COMMAND"
11590 >cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_2_2 samba</B
11593 ></LI
11594 ><LI
11596 > Whenever you want to merge in the latest code changes use
11597 the following command from within the samba directory:
11600 > <B
11601 CLASS="COMMAND"
11602 >cvs update -d -P</B
11605 ></LI
11606 ></OL
11607 ></DIV
11608 ></DIV
11609 ></DIV
11610 ><HR><H1
11612 NAME="AEN2474"
11613 >Index</A
11614 ></H1
11615 ><DL
11616 ><DT
11617 >Primary Domain Controller,
11619 HREF="x1227.htm"
11620 >Background</A
11622 </DT
11623 ></DL
11624 ></DIV
11625 ></BODY
11626 ></HTML