bd3e6923d45ec56223aad6647670b1c4f4d0bca5
[kamenim/samba-autobuild/.git] / docs / htmldocs / winbind.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Unified Logons between Windows NT and UNIX using Winbind</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
9 REL="HOME"
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
12 REL="UP"
13 TITLE="Advanced Configuration"
14 HREF="optional.html"><LINK
15 REL="PREVIOUS"
16 TITLE="CUPS Printing Support"
17 HREF="cups-printing.html"><LINK
18 REL="NEXT"
19 TITLE="Advanced Network Manangement"
20 HREF="advancednetworkmanagement.html"></HEAD
21 ><BODY
22 CLASS="CHAPTER"
23 BGCOLOR="#FFFFFF"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 SUMMARY="Header navigation table"
32 WIDTH="100%"
33 BORDER="0"
34 CELLPADDING="0"
35 CELLSPACING="0"
36 ><TR
37 ><TH
38 COLSPAN="3"
39 ALIGN="center"
40 >SAMBA Project Documentation</TH
41 ></TR
42 ><TR
43 ><TD
44 WIDTH="10%"
45 ALIGN="left"
46 VALIGN="bottom"
47 ><A
48 HREF="cups-printing.html"
49 ACCESSKEY="P"
50 >Prev</A
51 ></TD
52 ><TD
53 WIDTH="80%"
54 ALIGN="center"
55 VALIGN="bottom"
56 ></TD
57 ><TD
58 WIDTH="10%"
59 ALIGN="right"
60 VALIGN="bottom"
61 ><A
62 HREF="advancednetworkmanagement.html"
63 ACCESSKEY="N"
64 >Next</A
65 ></TD
66 ></TR
67 ></TABLE
68 ><HR
69 ALIGN="LEFT"
70 WIDTH="100%"></DIV
71 ><DIV
72 CLASS="CHAPTER"
73 ><H1
74 ><A
75 NAME="WINBIND"
76 ></A
77 >Chapter 15. Unified Logons between Windows NT and UNIX using Winbind</H1
78 ><DIV
79 CLASS="TOC"
80 ><DL
81 ><DT
82 ><B
83 >Table of Contents</B
84 ></DT
85 ><DT
86 >15.1. <A
87 HREF="winbind.html#AEN2516"
88 >Abstract</A
89 ></DT
90 ><DT
91 >15.2. <A
92 HREF="winbind.html#AEN2520"
93 >Introduction</A
94 ></DT
95 ><DT
96 >15.3. <A
97 HREF="winbind.html#AEN2533"
98 >What Winbind Provides</A
99 ></DT
100 ><DT
101 >15.4. <A
102 HREF="winbind.html#AEN2544"
103 >How Winbind Works</A
104 ></DT
105 ><DD
106 ><DL
107 ><DT
108 >15.4.1. <A
109 HREF="winbind.html#AEN2549"
110 >Microsoft Remote Procedure Calls</A
111 ></DT
112 ><DT
113 >15.4.2. <A
114 HREF="winbind.html#AEN2553"
115 >Microsoft Active Directory Services</A
116 ></DT
117 ><DT
118 >15.4.3. <A
119 HREF="winbind.html#AEN2556"
120 >Name Service Switch</A
121 ></DT
122 ><DT
123 >15.4.4. <A
124 HREF="winbind.html#AEN2572"
125 >Pluggable Authentication Modules</A
126 ></DT
127 ><DT
128 >15.4.5. <A
129 HREF="winbind.html#AEN2580"
130 >User and Group ID Allocation</A
131 ></DT
132 ><DT
133 >15.4.6. <A
134 HREF="winbind.html#AEN2584"
135 >Result Caching</A
136 ></DT
137 ></DL
138 ></DD
139 ><DT
140 >15.5. <A
141 HREF="winbind.html#AEN2587"
142 >Installation and Configuration</A
143 ></DT
144 ><DD
145 ><DL
146 ><DT
147 >15.5.1. <A
148 HREF="winbind.html#AEN2592"
149 >Introduction</A
150 ></DT
151 ><DT
152 >15.5.2. <A
153 HREF="winbind.html#AEN2605"
154 >Requirements</A
155 ></DT
156 ><DT
157 >15.5.3. <A
158 HREF="winbind.html#AEN2619"
159 >Testing Things Out</A
160 ></DT
161 ><DD
162 ><DL
163 ><DT
164 >15.5.3.1. <A
165 HREF="winbind.html#AEN2630"
166 >Configure and compile SAMBA</A
167 ></DT
168 ><DT
169 >15.5.3.2. <A
170 HREF="winbind.html#AEN2649"
171 >Configure <TT
172 CLASS="FILENAME"
173 >nsswitch.conf</TT
174 > and the 
175 winbind libraries</A
176 ></DT
177 ><DT
178 >15.5.3.3. <A
179 HREF="winbind.html#AEN2682"
180 >Configure smb.conf</A
181 ></DT
182 ><DT
183 >15.5.3.4. <A
184 HREF="winbind.html#AEN2698"
185 >Join the SAMBA server to the PDC domain</A
186 ></DT
187 ><DT
188 >15.5.3.5. <A
189 HREF="winbind.html#AEN2709"
190 >Start up the winbindd daemon and test it!</A
191 ></DT
192 ><DT
193 >15.5.3.6. <A
194 HREF="winbind.html#AEN2749"
195 >Fix the init.d startup scripts</A
196 ></DT
197 ><DT
198 >15.5.3.7. <A
199 HREF="winbind.html#AEN2787"
200 >Configure Winbind and PAM</A
201 ></DT
202 ></DL
203 ></DD
204 ></DL
205 ></DD
206 ><DT
207 >15.6. <A
208 HREF="winbind.html#AEN2844"
209 >Limitations</A
210 ></DT
211 ><DT
212 >15.7. <A
213 HREF="winbind.html#AEN2854"
214 >Conclusion</A
215 ></DT
216 ></DL
217 ></DIV
218 ><DIV
219 CLASS="SECT1"
220 ><H1
221 CLASS="SECT1"
222 ><A
223 NAME="AEN2516"
224 >15.1. Abstract</A
225 ></H1
226 ><P
227 >Integration of UNIX and Microsoft Windows NT through 
228         a unified logon has been considered a "holy grail" in heterogeneous 
229         computing environments for a long time. We present 
230         <SPAN
231 CLASS="emphasis"
232 ><I
233 CLASS="EMPHASIS"
234 >winbind</I
235 ></SPAN
236 >, a component of the Samba suite 
237         of programs as a solution to the unified logon problem. Winbind 
238         uses a UNIX implementation 
239         of Microsoft RPC calls, Pluggable Authentication Modules, and the Name 
240         Service Switch to allow Windows NT domain users to appear and operate 
241         as UNIX users on a UNIX machine. This paper describes the winbind 
242         system, explaining the functionality it provides, how it is configured, 
243         and how it works internally.</P
244 ></DIV
245 ><DIV
246 CLASS="SECT1"
247 ><H1
248 CLASS="SECT1"
249 ><A
250 NAME="AEN2520"
251 >15.2. Introduction</A
252 ></H1
253 ><P
254 >It is well known that UNIX and Microsoft Windows NT have 
255         different models for representing user and group information and 
256         use different technologies for implementing them. This fact has 
257         made it difficult to integrate the two systems in a satisfactory 
258         manner.</P
259 ><P
260 >One common solution in use today has been to create 
261         identically named user accounts on both the UNIX and Windows systems 
262         and use the Samba suite of programs to provide file and print services 
263         between the two. This solution is far from perfect however, as 
264         adding and deleting users on both sets of machines becomes a chore 
265         and two sets of passwords are required both of which
266         can lead to synchronization problems between the UNIX and Windows 
267         systems and confusion for users.</P
268 ><P
269 >We divide the unified logon problem for UNIX machines into 
270         three smaller problems:</P
271 ><P
272 ></P
273 ><UL
274 ><LI
275 ><P
276 >Obtaining Windows NT user and group information
277                 </P
278 ></LI
279 ><LI
280 ><P
281 >Authenticating Windows NT users
282                 </P
283 ></LI
284 ><LI
285 ><P
286 >Password changing for Windows NT users
287                 </P
288 ></LI
289 ></UL
290 ><P
291 >Ideally, a prospective solution to the unified logon problem 
292         would satisfy all the above components without duplication of 
293         information on the UNIX machines and without creating additional 
294         tasks for the system administrator when maintaining users and 
295         groups on either system. The winbind system provides a simple 
296         and elegant solution to all three components of the unified logon 
297         problem.</P
298 ></DIV
299 ><DIV
300 CLASS="SECT1"
301 ><H1
302 CLASS="SECT1"
303 ><A
304 NAME="AEN2533"
305 >15.3. What Winbind Provides</A
306 ></H1
307 ><P
308 >Winbind unifies UNIX and Windows NT account management by 
309         allowing a UNIX box to become a full member of a NT domain. Once 
310         this is done the UNIX box will see NT users and groups as if 
311         they were native UNIX users and groups, allowing the NT domain 
312         to be used in much the same manner that NIS+ is used within 
313         UNIX-only environments.</P
314 ><P
315 >The end result is that whenever any 
316         program on the UNIX machine asks the operating system to lookup 
317         a user or group name, the query will be resolved by asking the 
318         NT domain controller for the specified domain to do the lookup.
319         Because Winbind hooks into the operating system at a low level 
320         (via the NSS name resolution modules in the C library) this 
321         redirection to the NT domain controller is completely 
322         transparent.</P
323 ><P
324 >Users on the UNIX machine can then use NT user and group 
325         names as they would use "native" UNIX names. They can chown files 
326         so that they are owned by NT domain users or even login to the 
327         UNIX machine and run a UNIX X-Window session as a domain user.</P
328 ><P
329 >The only obvious indication that Winbind is being used is 
330         that user and group names take the form DOMAIN\user and 
331         DOMAIN\group. This is necessary as it allows Winbind to determine 
332         that redirection to a domain controller is wanted for a particular 
333         lookup and which trusted domain is being referenced.</P
334 ><P
335 >Additionally, Winbind provides an authentication service 
336         that hooks into the Pluggable Authentication Modules (PAM) system 
337         to provide authentication via a NT domain to any PAM enabled 
338         applications. This capability solves the problem of synchronizing 
339         passwords between systems since all passwords are stored in a single 
340         location (on the domain controller).</P
341 ><DIV
342 CLASS="SECT2"
343 ><H2
344 CLASS="SECT2"
345 ><A
346 NAME="AEN2540"
347 >15.3.1. Target Uses</A
348 ></H2
349 ><P
350 >Winbind is targeted at organizations that have an 
351                 existing NT based domain infrastructure into which they wish 
352                 to put UNIX workstations or servers. Winbind will allow these 
353                 organizations to deploy UNIX workstations without having to 
354                 maintain a separate account infrastructure. This greatly 
355                 simplifies the administrative overhead of deploying UNIX 
356                 workstations into a NT based organization.</P
357 ><P
358 >Another interesting way in which we expect Winbind to 
359                 be used is as a central part of UNIX based appliances. Appliances 
360                 that provide file and print services to Microsoft based networks 
361                 will be able to use Winbind to provide seamless integration of 
362                 the appliance into the domain.</P
363 ></DIV
364 ></DIV
365 ><DIV
366 CLASS="SECT1"
367 ><H1
368 CLASS="SECT1"
369 ><A
370 NAME="AEN2544"
371 >15.4. How Winbind Works</A
372 ></H1
373 ><P
374 >The winbind system is designed around a client/server 
375         architecture. A long running <B
376 CLASS="COMMAND"
377 >winbindd</B
378 > daemon 
379         listens on a UNIX domain socket waiting for requests
380         to arrive. These requests are generated by the NSS and PAM 
381         clients and processed sequentially.</P
382 ><P
383 >The technologies used to implement winbind are described 
384         in detail below.</P
385 ><DIV
386 CLASS="SECT2"
387 ><H2
388 CLASS="SECT2"
389 ><A
390 NAME="AEN2549"
391 >15.4.1. Microsoft Remote Procedure Calls</A
392 ></H2
393 ><P
394 >Over the last few years, efforts have been underway 
395                 by various Samba Team members to decode various aspects of 
396                 the Microsoft Remote Procedure Call (MSRPC) system. This 
397                 system is used for most network related operations between 
398                 Windows NT machines including remote management, user authentication
399                 and print spooling. Although initially this work was done 
400                 to aid the implementation of Primary Domain Controller (PDC) 
401                 functionality in Samba, it has also yielded a body of code which 
402                 can be used for other purposes.</P
403 ><P
404 >Winbind uses various MSRPC calls to enumerate domain users 
405                 and groups and to obtain detailed information about individual 
406                 users or groups. Other MSRPC calls can be used to authenticate 
407                 NT domain users and to change user passwords. By directly querying 
408                 a Windows PDC for user and group information, winbind maps the 
409                 NT account information onto UNIX user and group names.</P
410 ></DIV
411 ><DIV
412 CLASS="SECT2"
413 ><H2
414 CLASS="SECT2"
415 ><A
416 NAME="AEN2553"
417 >15.4.2. Microsoft Active Directory Services</A
418 ></H2
419 ><P
420 >                Since late 2001, Samba has gained the ability to
421                 interact with Microsoft Windows 2000 using its 'Native
422                 Mode' protocols, rather than the NT4 RPC services.
423                 Using LDAP and Kerberos, a domain member running
424                 winbind can enumerate users and groups in exactly the
425                 same way as a Win2k client would, and in so doing
426                 provide a much more efficient and
427                 effective winbind implementation.  
428                 </P
429 ></DIV
430 ><DIV
431 CLASS="SECT2"
432 ><H2
433 CLASS="SECT2"
434 ><A
435 NAME="AEN2556"
436 >15.4.3. Name Service Switch</A
437 ></H2
438 ><P
439 >The Name Service Switch, or NSS, is a feature that is 
440                 present in many UNIX operating systems. It allows system 
441                 information such as hostnames, mail aliases and user information 
442                 to be resolved from different sources. For example, a standalone 
443                 UNIX workstation may resolve system information from a series of 
444                 flat files stored on the local filesystem. A networked workstation 
445                 may first attempt to resolve system information from local files, 
446                 and then consult a NIS database for user information or a DNS server 
447                 for hostname information.</P
448 ><P
449 >The NSS application programming interface allows winbind 
450                 to present itself as a source of system information when 
451                 resolving UNIX usernames and groups.  Winbind uses this interface, 
452                 and information obtained from a Windows NT server using MSRPC 
453                 calls to provide a new source of account enumeration.  Using standard 
454                 UNIX library calls, one can enumerate the users and groups on
455                 a UNIX machine running winbind and see all users and groups in 
456                 a NT domain plus any trusted domain as though they were local 
457                 users and groups.</P
458 ><P
459 >The primary control file for NSS is 
460                 <TT
461 CLASS="FILENAME"
462 >/etc/nsswitch.conf</TT
463 >. 
464                 When a UNIX application makes a request to do a lookup 
465                 the C library looks in <TT
466 CLASS="FILENAME"
467 >/etc/nsswitch.conf</TT
468
469                 for a line which matches the service type being requested, for 
470                 example the "passwd" service type is used when user or group names 
471                 are looked up. This     config line species which implementations 
472                 of that service should be tried and in what order. If the passwd 
473                 config line is:</P
474 ><P
475 ><B
476 CLASS="COMMAND"
477 >passwd: files example</B
478 ></P
479 ><P
480 >then the C library will first load a module called 
481                 <TT
482 CLASS="FILENAME"
483 >/lib/libnss_files.so</TT
484 > followed by
485                 the module <TT
486 CLASS="FILENAME"
487 >/lib/libnss_example.so</TT
488 >. The 
489                 C library will dynamically load each of these modules in turn 
490                 and call resolver functions within the modules to try to resolve 
491                 the request. Once the request is resolved the C library returns the
492                 result to the application.</P
493 ><P
494 >This NSS interface provides a very easy way for Winbind 
495                 to hook into the operating system. All that needs to be done 
496                 is to put <TT
497 CLASS="FILENAME"
498 >libnss_winbind.so</TT
499 > in <TT
500 CLASS="FILENAME"
501 >/lib/</TT
502
503                 then add "winbind" into <TT
504 CLASS="FILENAME"
505 >/etc/nsswitch.conf</TT
506 > at 
507                 the appropriate place. The C library will then call Winbind to 
508                 resolve user and group names.</P
509 ></DIV
510 ><DIV
511 CLASS="SECT2"
512 ><H2
513 CLASS="SECT2"
514 ><A
515 NAME="AEN2572"
516 >15.4.4. Pluggable Authentication Modules</A
517 ></H2
518 ><P
519 >Pluggable Authentication Modules, also known as PAM, 
520                 is a system for abstracting authentication and authorization 
521                 technologies. With a PAM module it is possible to specify different 
522                 authentication methods for different system applications without 
523                 having to recompile these applications. PAM is also useful
524                 for implementing a particular policy for authorization. For example, 
525                 a system administrator may only allow console logins from users 
526                 stored in the local password file but only allow users resolved from 
527                 a NIS database to log in over the network.</P
528 ><P
529 >Winbind uses the authentication management and password 
530                 management PAM interface to integrate Windows NT users into a 
531                 UNIX system. This allows Windows NT users to log in to a UNIX 
532                 machine and be authenticated against a suitable Primary Domain 
533                 Controller. These users can also change their passwords and have 
534                 this change take effect directly on the Primary Domain Controller.
535                 </P
536 ><P
537 >PAM is configured by providing control files in the directory 
538                 <TT
539 CLASS="FILENAME"
540 >/etc/pam.d/</TT
541 > for each of the services that 
542                 require authentication. When an authentication request is made 
543                 by an application the PAM code in the C library looks up this
544                 control file to determine what modules to load to do the 
545                 authentication check and in what order. This interface makes adding 
546                 a new authentication service for Winbind very easy, all that needs 
547                 to be done is that the <TT
548 CLASS="FILENAME"
549 >pam_winbind.so</TT
550 > module 
551                 is copied to <TT
552 CLASS="FILENAME"
553 >/lib/security/</TT
554 > and the PAM 
555                 control files for relevant services are updated to allow 
556                 authentication via winbind. See the PAM documentation
557                 for more details.</P
558 ></DIV
559 ><DIV
560 CLASS="SECT2"
561 ><H2
562 CLASS="SECT2"
563 ><A
564 NAME="AEN2580"
565 >15.4.5. User and Group ID Allocation</A
566 ></H2
567 ><P
568 >When a user or group is created under Windows NT 
569                 is it allocated a numerical relative identifier (RID). This is 
570                 slightly different to UNIX which has a range of numbers that are 
571                 used to identify users, and the same range in which to identify 
572                 groups. It is winbind's job to convert RIDs to UNIX id numbers and
573                 vice versa.  When winbind is configured it is given part of the UNIX 
574                 user id space and a part of the UNIX group id space in which to 
575                 store Windows NT users and groups. If a Windows NT user is 
576                 resolved for the first time, it is allocated the next UNIX id from 
577                 the range. The same process applies for Windows NT groups. Over 
578                 time, winbind will have mapped all Windows NT users and groups
579                 to UNIX user ids and group ids.</P
580 ><P
581 >The results of this mapping are stored persistently in 
582                 an ID mapping database held in a tdb database). This ensures that 
583                 RIDs are mapped to UNIX IDs in a consistent way.</P
584 ></DIV
585 ><DIV
586 CLASS="SECT2"
587 ><H2
588 CLASS="SECT2"
589 ><A
590 NAME="AEN2584"
591 >15.4.6. Result Caching</A
592 ></H2
593 ><P
594 >An active system can generate a lot of user and group 
595                 name lookups. To reduce the network cost of these lookups winbind 
596                 uses a caching scheme based on the SAM sequence number supplied 
597                 by NT domain controllers.  User or group information returned 
598                 by a PDC is cached by winbind along with a sequence number also 
599                 returned by the PDC. This sequence number is incremented by 
600                 Windows NT whenever any user or group information is modified. If 
601                 a cached entry has expired, the sequence number is requested from 
602                 the PDC and compared against the sequence number of the cached entry. 
603                 If the sequence numbers do not match, then the cached information 
604                 is discarded and up to date information is requested directly 
605                 from the PDC.</P
606 ></DIV
607 ></DIV
608 ><DIV
609 CLASS="SECT1"
610 ><H1
611 CLASS="SECT1"
612 ><A
613 NAME="AEN2587"
614 >15.5. Installation and Configuration</A
615 ></H1
616 ><P
617 >Many thanks to John Trostel <A
618 HREF="mailto:jtrostel@snapserver.com"
619 TARGET="_top"
620 >jtrostel@snapserver.com</A
621 >
622 for providing the HOWTO for this section.</P
623 ><P
624 >This HOWTO describes how to get winbind services up and running 
625 to control access and authenticate users on your Linux box using 
626 the winbind services which come with SAMBA 2.2.2.</P
627 ><DIV
628 CLASS="SECT2"
629 ><H2
630 CLASS="SECT2"
631 ><A
632 NAME="AEN2592"
633 >15.5.1. Introduction</A
634 ></H2
635 ><P
636 >This HOWTO describes the procedures used to get winbind up and 
637 running on my RedHat 7.1 system.  Winbind is capable of providing access 
638 and authentication control for Windows Domain users through an NT 
639 or Win2K PDC for 'regular' services, such as telnet a nd ftp, as
640 well for SAMBA services.</P
641 ><P
642 >This HOWTO has been written from a 'RedHat-centric' perspective, so if 
643 you are using another distribution, you may have to modify the instructions 
644 somewhat to fit the way your distribution works.</P
645 ><P
646 ></P
647 ><UL
648 ><LI
649 ><P
650 >       <SPAN
651 CLASS="emphasis"
652 ><I
653 CLASS="EMPHASIS"
654 >Why should I to this?</I
655 ></SPAN
656 >
657         </P
658 ><P
659 >This allows the SAMBA administrator to rely on the 
660         authentication mechanisms on the NT/Win2K PDC for the authentication 
661         of domain members.  NT/Win2K users no longer need to have separate 
662         accounts on the SAMBA server.
663         </P
664 ></LI
665 ><LI
666 ><P
667 >       <SPAN
668 CLASS="emphasis"
669 ><I
670 CLASS="EMPHASIS"
671 >Who should be reading this document?</I
672 ></SPAN
673 >
674         </P
675 ><P
676 >       This HOWTO is designed for system administrators.  If you are 
677         implementing SAMBA on a file server and wish to (fairly easily) 
678         integrate existing NT/Win2K users from your PDC onto the
679         SAMBA server, this HOWTO is for you.  That said, I am no NT or PAM 
680         expert, so you may find a better or easier way to accomplish 
681         these tasks.
682         </P
683 ></LI
684 ></UL
685 ></DIV
686 ><DIV
687 CLASS="SECT2"
688 ><H2
689 CLASS="SECT2"
690 ><A
691 NAME="AEN2605"
692 >15.5.2. Requirements</A
693 ></H2
694 ><P
695 >If you have a samba configuration file that you are currently 
696 using... <SPAN
697 CLASS="emphasis"
698 ><I
699 CLASS="EMPHASIS"
700 >BACK IT UP!</I
701 ></SPAN
702 >  If your system already uses PAM, 
703 <SPAN
704 CLASS="emphasis"
705 ><I
706 CLASS="EMPHASIS"
707 >back up the <TT
708 CLASS="FILENAME"
709 >/etc/pam.d</TT
710 > directory 
711 contents!</I
712 ></SPAN
713 > If you haven't already made a boot disk, 
714 <SPAN
715 CLASS="emphasis"
716 ><I
717 CLASS="EMPHASIS"
718 >MAKE ONE NOW!</I
719 ></SPAN
720 ></P
721 ><P
722 >Messing with the pam configuration files can make it nearly impossible 
723 to log in to yourmachine. That's why you want to be able to boot back 
724 into your machine in single user mode and restore your 
725 <TT
726 CLASS="FILENAME"
727 >/etc/pam.d</TT
728 > back to the original state they were in if 
729 you get frustrated with the way things are going.  ;-)</P
730 ><P
731 >The latest version of SAMBA (version 3.0 as of this writing), now 
732 includes a functioning winbindd daemon.  Please refer to the 
733 <A
734 HREF="http://samba.org/"
735 TARGET="_top"
736 >main SAMBA web page</A
737 > or, 
738 better yet, your closest SAMBA mirror site for instructions on 
739 downloading the source code.</P
740 ><P
741 >To allow Domain users the ability to access SAMBA shares and 
742 files, as well as potentially other services provided by your 
743 SAMBA machine, PAM (pluggable authentication modules) must
744 be setup properly on your machine.  In order to compile the 
745 winbind modules, you should have at least the pam libraries resident 
746 on your system.  For recent RedHat systems (7.1, for instance), that 
747 means <TT
748 CLASS="FILENAME"
749 >pam-0.74-22</TT
750 >.  For best results, it is helpful to also
751 install the development packages in <TT
752 CLASS="FILENAME"
753 >pam-devel-0.74-22</TT
754 >.</P
755 ></DIV
756 ><DIV
757 CLASS="SECT2"
758 ><H2
759 CLASS="SECT2"
760 ><A
761 NAME="AEN2619"
762 >15.5.3. Testing Things Out</A
763 ></H2
764 ><P
765 >Before starting, it is probably best to kill off all the SAMBA 
766 related daemons running on your server.  Kill off all <B
767 CLASS="COMMAND"
768 >smbd</B
769 >, 
770 <B
771 CLASS="COMMAND"
772 >nmbd</B
773 >, and <B
774 CLASS="COMMAND"
775 >winbindd</B
776 > processes that may 
777 be running.  To use PAM, you will want to make sure that you have the 
778 standard PAM package (for RedHat) which supplies the <TT
779 CLASS="FILENAME"
780 >/etc/pam.d</TT
781
782 directory structure, including the pam modules are used by pam-aware 
783 services, several pam libraries, and the <TT
784 CLASS="FILENAME"
785 >/usr/doc</TT
786
787 and <TT
788 CLASS="FILENAME"
789 >/usr/man</TT
790 > entries for pam.  Winbind built better 
791 in SAMBA if the pam-devel package was also installed.  This package includes 
792 the header files needed to compile pam-aware applications. For instance, 
793 my RedHat system has both <TT
794 CLASS="FILENAME"
795 >pam-0.74-22</TT
796 > and
797 <TT
798 CLASS="FILENAME"
799 >pam-devel-0.74-22</TT
800 > RPMs installed.</P
801 ><DIV
802 CLASS="SECT3"
803 ><H3
804 CLASS="SECT3"
805 ><A
806 NAME="AEN2630"
807 >15.5.3.1. Configure and compile SAMBA</A
808 ></H3
809 ><P
810 >The configuration and compilation of SAMBA is pretty straightforward.
811 The first three steps may not be necessary depending upon
812 whether or not you have previously built the Samba binaries.</P
813 ><P
814 ><PRE
815 CLASS="PROGRAMLISTING"
816 ><SAMP
817 CLASS="PROMPT"
818 >root#</SAMP
819 > <B
820 CLASS="COMMAND"
821 >autoconf</B
822 >
823 <SAMP
824 CLASS="PROMPT"
825 >root#</SAMP
826 > <B
827 CLASS="COMMAND"
828 >make clean</B
829 >
830 <SAMP
831 CLASS="PROMPT"
832 >root#</SAMP
833 > <B
834 CLASS="COMMAND"
835 >rm config.cache</B
836 >
837 <SAMP
838 CLASS="PROMPT"
839 >root#</SAMP
840 > <B
841 CLASS="COMMAND"
842 >./configure</B
843 >
844 <SAMP
845 CLASS="PROMPT"
846 >root#</SAMP
847 > <B
848 CLASS="COMMAND"
849 >make</B
850 >
851 <SAMP
852 CLASS="PROMPT"
853 >root#</SAMP
854 > <B
855 CLASS="COMMAND"
856 >make install</B
857 ></PRE
858 ></P
859 ><P
860 >This will, by default, install SAMBA in <TT
861 CLASS="FILENAME"
862 >/usr/local/samba</TT
863 >.
864 See the main SAMBA documentation if you want to install SAMBA somewhere else.
865 It will also build the winbindd executable and libraries. </P
866 ></DIV
867 ><DIV
868 CLASS="SECT3"
869 ><H3
870 CLASS="SECT3"
871 ><A
872 NAME="AEN2649"
873 >15.5.3.2. Configure <TT
874 CLASS="FILENAME"
875 >nsswitch.conf</TT
876 > and the 
877 winbind libraries</A
878 ></H3
879 ><P
880 >The libraries needed to run the <B
881 CLASS="COMMAND"
882 >winbindd</B
883 > daemon 
884 through nsswitch need to be copied to their proper locations, so</P
885 ><P
886 ><SAMP
887 CLASS="PROMPT"
888 >root#</SAMP
889 > <B
890 CLASS="COMMAND"
891 >cp ../samba/source/nsswitch/libnss_winbind.so /lib</B
892 ></P
893 ><P
894 >I also found it necessary to make the following symbolic link:</P
895 ><P
896 ><SAMP
897 CLASS="PROMPT"
898 >root#</SAMP
899 > <B
900 CLASS="COMMAND"
901 >ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2</B
902 ></P
903 ><P
904 >And, in the case of Sun solaris:</P
905 ><P
906 ><SAMP
907 CLASS="PROMPT"
908 >root#</SAMP
909 > <B
910 CLASS="COMMAND"
911 >ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1</B
912 >
913 <SAMP
914 CLASS="PROMPT"
915 >root#</SAMP
916 > <B
917 CLASS="COMMAND"
918 >ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.1</B
919 >
920 <SAMP
921 CLASS="PROMPT"
922 >root#</SAMP
923 > <B
924 CLASS="COMMAND"
925 >ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.2</B
926 ></P
927 ><P
928 >Now, as root you need to edit <TT
929 CLASS="FILENAME"
930 >/etc/nsswitch.conf</TT
931 > to 
932 allow user and group entries to be visible from the <B
933 CLASS="COMMAND"
934 >winbindd</B
935
936 daemon.  My <TT
937 CLASS="FILENAME"
938 >/etc/nsswitch.conf</TT
939 > file look like 
940 this after editing:</P
941 ><P
942 ><PRE
943 CLASS="PROGRAMLISTING"
944 >       passwd:     files winbind
945         shadow:     files 
946         group:      files winbind</PRE
947 ></P
948 ><P
949 >       
950 The libraries needed by the winbind daemon will be automatically 
951 entered into the <B
952 CLASS="COMMAND"
953 >ldconfig</B
954 > cache the next time 
955 your system reboots, but it 
956 is faster (and you don't need to reboot) if you do it manually:</P
957 ><P
958 ><SAMP
959 CLASS="PROMPT"
960 >root#</SAMP
961 > <B
962 CLASS="COMMAND"
963 >/sbin/ldconfig -v | grep winbind</B
964 ></P
965 ><P
966 >This makes <TT
967 CLASS="FILENAME"
968 >libnss_winbind</TT
969 > available to winbindd 
970 and echos back a check to you.</P
971 ></DIV
972 ><DIV
973 CLASS="SECT3"
974 ><H3
975 CLASS="SECT3"
976 ><A
977 NAME="AEN2682"
978 >15.5.3.3. Configure smb.conf</A
979 ></H3
980 ><P
981 >Several parameters are needed in the smb.conf file to control 
982 the behavior of <B
983 CLASS="COMMAND"
984 >winbindd</B
985 >. Configure 
986 <TT
987 CLASS="FILENAME"
988 >smb.conf</TT
989 > These are described in more detail in 
990 the <A
991 HREF="winbindd.8.html"
992 TARGET="_top"
993 >winbindd(8)</A
994 > man page.  My 
995 <TT
996 CLASS="FILENAME"
997 >smb.conf</TT
998 > file was modified to
999 include the following entries in the [global] section:</P
1000 ><P
1001 ><PRE
1002 CLASS="PROGRAMLISTING"
1003 >[global]
1004      &#60;...&#62;
1005      # separate domain and username with '+', like DOMAIN+username
1006      <A
1007 HREF="winbindd.8.html#WINBINDSEPARATOR"
1008 TARGET="_top"
1009 >winbind separator</A
1010 > = +
1011      # use uids from 10000 to 20000 for domain users
1012      <A
1013 HREF="winbindd.8.html#WINBINDUID"
1014 TARGET="_top"
1015 >winbind uid</A
1016 > = 10000-20000
1017      # use gids from 10000 to 20000 for domain groups
1018      <A
1019 HREF="winbindd.8.html#WINBINDGID"
1020 TARGET="_top"
1021 >winbind gid</A
1022 > = 10000-20000
1023      # allow enumeration of winbind users and groups
1024      <A
1025 HREF="winbindd.8.html#WINBINDENUMUSERS"
1026 TARGET="_top"
1027 >winbind enum users</A
1028 > = yes
1029      <A
1030 HREF="winbindd.8.html#WINBINDENUMGROUP"
1031 TARGET="_top"
1032 >winbind enum groups</A
1033 > = yes
1034      # give winbind users a real shell (only needed if they have telnet access)
1035      <A
1036 HREF="winbindd.8.html#TEMPLATEHOMEDIR"
1037 TARGET="_top"
1038 >template homedir</A
1039 > = /home/winnt/%D/%U
1040      <A
1041 HREF="winbindd.8.html#TEMPLATESHELL"
1042 TARGET="_top"
1043 >template shell</A
1044 > = /bin/bash</PRE
1045 ></P
1046 ></DIV
1047 ><DIV
1048 CLASS="SECT3"
1049 ><H3
1050 CLASS="SECT3"
1051 ><A
1052 NAME="AEN2698"
1053 >15.5.3.4. Join the SAMBA server to the PDC domain</A
1054 ></H3
1055 ><P
1056 >Enter the following command to make the SAMBA server join the 
1057 PDC domain, where <VAR
1058 CLASS="REPLACEABLE"
1059 >DOMAIN</VAR
1060 > is the name of 
1061 your Windows domain and <VAR
1062 CLASS="REPLACEABLE"
1063 >Administrator</VAR
1064 > is 
1065 a domain user who has administrative privileges in the domain.</P
1066 ><P
1067 ><SAMP
1068 CLASS="PROMPT"
1069 >root#</SAMP
1070 > <B
1071 CLASS="COMMAND"
1072 >/usr/local/samba/bin/net join -S PDC -U Administrator</B
1073 ></P
1074 ><P
1075 >The proper response to the command should be: "Joined the domain 
1076 <VAR
1077 CLASS="REPLACEABLE"
1078 >DOMAIN</VAR
1079 >" where <VAR
1080 CLASS="REPLACEABLE"
1081 >DOMAIN</VAR
1082
1083 is your DOMAIN name.</P
1084 ></DIV
1085 ><DIV
1086 CLASS="SECT3"
1087 ><H3
1088 CLASS="SECT3"
1089 ><A
1090 NAME="AEN2709"
1091 >15.5.3.5. Start up the winbindd daemon and test it!</A
1092 ></H3
1093 ><P
1094 >Eventually, you will want to modify your smb startup script to 
1095 automatically invoke the winbindd daemon when the other parts of 
1096 SAMBA start, but it is possible to test out just the winbind
1097 portion first.  To start up winbind services, enter the following 
1098 command as root:</P
1099 ><P
1100 ><SAMP
1101 CLASS="PROMPT"
1102 >root#</SAMP
1103 > <B
1104 CLASS="COMMAND"
1105 >/usr/local/samba/bin/winbindd</B
1106 ></P
1107 ><P
1108 >Winbindd can now also run in 'dual daemon mode'. This will make it 
1109 run as 2 processes. The first will answer all requests from the cache,
1110 thus making responses to clients faster. The other will
1111 update the cache for the query that the first has just responded.
1112 Advantage of this is that responses stay accurate and are faster. 
1113 You can enable dual daemon mode by adding '-B' to the commandline:</P
1114 ><P
1115 ><SAMP
1116 CLASS="PROMPT"
1117 >root#</SAMP
1118 > <B
1119 CLASS="COMMAND"
1120 >/usr/local/samba/bin/winbindd -B</B
1121 ></P
1122 ><P
1123 >I'm always paranoid and like to make sure the daemon 
1124 is really running...</P
1125 ><P
1126 ><SAMP
1127 CLASS="PROMPT"
1128 >root#</SAMP
1129 > <B
1130 CLASS="COMMAND"
1131 >ps -ae | grep winbindd</B
1132 ></P
1133 ><P
1134 >This command should produce output like this, if the daemon is running</P
1135 ><P
1136 >3025 ?        00:00:00 winbindd</P
1137 ><P
1138 >Now... for the real test, try to get some information about the 
1139 users on your PDC</P
1140 ><P
1141 ><SAMP
1142 CLASS="PROMPT"
1143 >root#</SAMP
1144 > <B
1145 CLASS="COMMAND"
1146 >/usr/local/samba/bin/wbinfo -u</B
1147 ></P
1148 ><P
1149 >       
1150 This should echo back a list of users on your Windows users on 
1151 your PDC.  For example, I get the following response:</P
1152 ><P
1153 ><PRE
1154 CLASS="PROGRAMLISTING"
1155 >CEO+Administrator
1156 CEO+burdell
1157 CEO+Guest
1158 CEO+jt-ad
1159 CEO+krbtgt
1160 CEO+TsInternetUser</PRE
1161 ></P
1162 ><P
1163 >Obviously, I have named my domain 'CEO' and my <VAR
1164 CLASS="PARAMETER"
1165 >winbind
1166 separator</VAR
1167 > is '+'.</P
1168 ><P
1169 >You can do the same sort of thing to get group information from 
1170 the PDC:</P
1171 ><P
1172 ><PRE
1173 CLASS="PROGRAMLISTING"
1174 ><SAMP
1175 CLASS="PROMPT"
1176 >root#</SAMP
1177 > <B
1178 CLASS="COMMAND"
1179 >/usr/local/samba/bin/wbinfo -g</B
1180 >
1181 CEO+Domain Admins
1182 CEO+Domain Users
1183 CEO+Domain Guests
1184 CEO+Domain Computers
1185 CEO+Domain Controllers
1186 CEO+Cert Publishers
1187 CEO+Schema Admins
1188 CEO+Enterprise Admins
1189 CEO+Group Policy Creator Owners</PRE
1190 ></P
1191 ><P
1192 >The function 'getent' can now be used to get unified 
1193 lists of both local and PDC users and groups.
1194 Try the following command:</P
1195 ><P
1196 ><SAMP
1197 CLASS="PROMPT"
1198 >root#</SAMP
1199 > <B
1200 CLASS="COMMAND"
1201 >getent passwd</B
1202 ></P
1203 ><P
1204 >You should get a list that looks like your <TT
1205 CLASS="FILENAME"
1206 >/etc/passwd</TT
1207
1208 list followed by the domain users with their new uids, gids, home 
1209 directories and default shells.</P
1210 ><P
1211 >The same thing can be done for groups with the command</P
1212 ><P
1213 ><SAMP
1214 CLASS="PROMPT"
1215 >root#</SAMP
1216 > <B
1217 CLASS="COMMAND"
1218 >getent group</B
1219 ></P
1220 ></DIV
1221 ><DIV
1222 CLASS="SECT3"
1223 ><H3
1224 CLASS="SECT3"
1225 ><A
1226 NAME="AEN2749"
1227 >15.5.3.6. Fix the init.d startup scripts</A
1228 ></H3
1229 ><DIV
1230 CLASS="SECT4"
1231 ><H4
1232 CLASS="SECT4"
1233 ><A
1234 NAME="AEN2751"
1235 >15.5.3.6.1. Linux</A
1236 ></H4
1237 ><P
1238 >The <B
1239 CLASS="COMMAND"
1240 >winbindd</B
1241 > daemon needs to start up after the 
1242 <B
1243 CLASS="COMMAND"
1244 >smbd</B
1245 > and <B
1246 CLASS="COMMAND"
1247 >nmbd</B
1248 > daemons are running.  
1249 To accomplish this task, you need to modify the startup scripts of your system. They are located at <TT
1250 CLASS="FILENAME"
1251 >/etc/init.d/smb</TT
1252 > in RedHat and 
1253 <TT
1254 CLASS="FILENAME"
1255 >/etc/init.d/samba</TT
1256 > in Debian.
1257 script to add commands to invoke this daemon in the proper sequence.  My 
1258 startup script starts up <B
1259 CLASS="COMMAND"
1260 >smbd</B
1261 >, 
1262 <B
1263 CLASS="COMMAND"
1264 >nmbd</B
1265 >, and <B
1266 CLASS="COMMAND"
1267 >winbindd</B
1268 > from the 
1269 <TT
1270 CLASS="FILENAME"
1271 >/usr/local/samba/bin</TT
1272 > directory directly.  The 'start' 
1273 function in the script looks like this:</P
1274 ><P
1275 ><PRE
1276 CLASS="PROGRAMLISTING"
1277 >start() {
1278         KIND="SMB"
1279         echo -n $"Starting $KIND services: "
1280         daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
1281         RETVAL=$?
1282         echo
1283         KIND="NMB"
1284         echo -n $"Starting $KIND services: "
1285         daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
1286         RETVAL2=$?
1287         echo
1288         KIND="Winbind"
1289         echo -n $"Starting $KIND services: "
1290         daemon /usr/local/samba/bin/winbindd
1291         RETVAL3=$?
1292         echo
1293         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; touch /var/lock/subsys/smb || \
1294            RETVAL=1
1295         return $RETVAL
1296 }</PRE
1297 ></P
1298 ><P
1299 >If you would like to run winbindd in dual daemon mode, replace 
1300 the line 
1301 <PRE
1302 CLASS="PROGRAMLISTING"
1303 >        daemon /usr/local/samba/bin/winbindd</PRE
1304 >
1305
1306 in the example above with:
1307
1308 <PRE
1309 CLASS="PROGRAMLISTING"
1310 >        daemon /usr/local/samba/bin/winbindd -B</PRE
1311 >.</P
1312 ><P
1313 >The 'stop' function has a corresponding entry to shut down the 
1314 services and looks like this:</P
1315 ><P
1316 ><PRE
1317 CLASS="PROGRAMLISTING"
1318 >stop() {
1319         KIND="SMB"
1320         echo -n $"Shutting down $KIND services: "
1321         killproc smbd
1322         RETVAL=$?
1323         echo
1324         KIND="NMB"
1325         echo -n $"Shutting down $KIND services: "
1326         killproc nmbd
1327         RETVAL2=$?
1328         echo
1329         KIND="Winbind"
1330         echo -n $"Shutting down $KIND services: "
1331         killproc winbindd
1332         RETVAL3=$?
1333         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; rm -f /var/lock/subsys/smb
1334         echo ""
1335         return $RETVAL
1336 }</PRE
1337 ></P
1338 ></DIV
1339 ><DIV
1340 CLASS="SECT4"
1341 ><H4
1342 CLASS="SECT4"
1343 ><A
1344 NAME="AEN2771"
1345 >15.5.3.6.2. Solaris</A
1346 ></H4
1347 ><P
1348 >On solaris, you need to modify the 
1349 <TT
1350 CLASS="FILENAME"
1351 >/etc/init.d/samba.server</TT
1352 > startup script. It usually 
1353 only starts smbd and nmbd but should now start winbindd too. If you 
1354 have samba installed in <TT
1355 CLASS="FILENAME"
1356 >/usr/local/samba/bin</TT
1357 >, 
1358 the file could contains something like this:</P
1359 ><P
1360 ><PRE
1361 CLASS="PROGRAMLISTING"
1362 >##
1363 ## samba.server
1364 ##
1365
1366 if [ ! -d /usr/bin ]
1367 then                    # /usr not mounted
1368         exit
1369 fi
1370
1371 killproc() {            # kill the named process(es)
1372         pid=`/usr/bin/ps -e |
1373              /usr/bin/grep -w $1 |
1374              /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
1375         [ "$pid" != "" ] &#38;&#38; kill $pid
1376 }
1377  
1378 # Start/stop processes required for samba server
1379
1380 case "$1" in
1381
1382 'start')
1383 #
1384 # Edit these lines to suit your installation (paths, workgroup, host)
1385 #
1386 echo Starting SMBD
1387    /usr/local/samba/bin/smbd -D -s \
1388         /usr/local/samba/smb.conf
1389
1390 echo Starting NMBD
1391    /usr/local/samba/bin/nmbd -D -l \
1392         /usr/local/samba/var/log -s /usr/local/samba/smb.conf
1393
1394 echo Starting Winbind Daemon
1395    /usr/local/samba/bin/winbindd
1396    ;;
1397
1398 'stop')
1399    killproc nmbd
1400    killproc smbd
1401    killproc winbindd
1402    ;;
1403
1404 *)
1405    echo "Usage: /etc/init.d/samba.server { start | stop }"
1406    ;;
1407 esac</PRE
1408 ></P
1409 ><P
1410 >Again, if you would like to run samba in dual daemon mode, replace 
1411 <PRE
1412 CLASS="PROGRAMLISTING"
1413 >   /usr/local/samba/bin/winbindd</PRE
1414 >
1415
1416 in the script above with:
1417
1418 <PRE
1419 CLASS="PROGRAMLISTING"
1420 >   /usr/local/samba/bin/winbindd -B</PRE
1421 ></P
1422 ></DIV
1423 ><DIV
1424 CLASS="SECT4"
1425 ><H4
1426 CLASS="SECT4"
1427 ><A
1428 NAME="AEN2781"
1429 >15.5.3.6.3. Restarting</A
1430 ></H4
1431 ><P
1432 >If you restart the <B
1433 CLASS="COMMAND"
1434 >smbd</B
1435 >, <B
1436 CLASS="COMMAND"
1437 >nmbd</B
1438 >, 
1439 and <B
1440 CLASS="COMMAND"
1441 >winbindd</B
1442 > daemons at this point, you
1443 should be able to connect to the samba server as a domain member just as
1444 if you were a local user.</P
1445 ></DIV
1446 ></DIV
1447 ><DIV
1448 CLASS="SECT3"
1449 ><H3
1450 CLASS="SECT3"
1451 ><A
1452 NAME="AEN2787"
1453 >15.5.3.7. Configure Winbind and PAM</A
1454 ></H3
1455 ><P
1456 >If you have made it this far, you know that winbindd and samba are working
1457 together.  If you want to use winbind to provide authentication for other 
1458 services, keep reading.  The pam configuration files need to be altered in
1459 this step.  (Did you remember to make backups of your original 
1460 <TT
1461 CLASS="FILENAME"
1462 >/etc/pam.d</TT
1463 > files? If not, do it now.)</P
1464 ><P
1465 >You will need a pam module to use winbindd with these other services.  This 
1466 module will be compiled in the <TT
1467 CLASS="FILENAME"
1468 >../source/nsswitch</TT
1469 > directory
1470 by invoking the command</P
1471 ><P
1472 ><SAMP
1473 CLASS="PROMPT"
1474 >root#</SAMP
1475 > <B
1476 CLASS="COMMAND"
1477 >make nsswitch/pam_winbind.so</B
1478 ></P
1479 ><P
1480 >from the <TT
1481 CLASS="FILENAME"
1482 >../source</TT
1483 > directory.  The
1484 <TT
1485 CLASS="FILENAME"
1486 >pam_winbind.so</TT
1487 > file should be copied to the location of
1488 your other pam security modules.  On my RedHat system, this was the
1489 <TT
1490 CLASS="FILENAME"
1491 >/lib/security</TT
1492 > directory. On Solaris, the pam security 
1493 modules reside in <TT
1494 CLASS="FILENAME"
1495 >/usr/lib/security</TT
1496 >.</P
1497 ><P
1498 ><SAMP
1499 CLASS="PROMPT"
1500 >root#</SAMP
1501 > <B
1502 CLASS="COMMAND"
1503 >cp ../samba/source/nsswitch/pam_winbind.so /lib/security</B
1504 ></P
1505 ><DIV
1506 CLASS="SECT4"
1507 ><H4
1508 CLASS="SECT4"
1509 ><A
1510 NAME="AEN2804"
1511 >15.5.3.7.1. Linux/FreeBSD-specific PAM configuration</A
1512 ></H4
1513 ><P
1514 >The <TT
1515 CLASS="FILENAME"
1516 >/etc/pam.d/samba</TT
1517 > file does not need to be changed. I 
1518 just left this fileas it was:</P
1519 ><P
1520 ><PRE
1521 CLASS="PROGRAMLISTING"
1522 >auth    required        /lib/security/pam_stack.so service=system-auth
1523 account required        /lib/security/pam_stack.so service=system-auth</PRE
1524 ></P
1525 ><P
1526 >The other services that I modified to allow the use of winbind 
1527 as an authentication service were the normal login on the console (or a terminal 
1528 session), telnet logins, and ftp service.  In order to enable these 
1529 services, you may first need to change the entries in 
1530 <TT
1531 CLASS="FILENAME"
1532 >/etc/xinetd.d</TT
1533 > (or <TT
1534 CLASS="FILENAME"
1535 >/etc/inetd.conf</TT
1536 >).  
1537 RedHat 7.1 uses the new xinetd.d structure, in this case you need 
1538 to change the lines in <TT
1539 CLASS="FILENAME"
1540 >/etc/xinetd.d/telnet</TT
1541
1542 and <TT
1543 CLASS="FILENAME"
1544 >/etc/xinetd.d/wu-ftp</TT
1545 > from </P
1546 ><P
1547 ><PRE
1548 CLASS="PROGRAMLISTING"
1549 >enable = no</PRE
1550 ></P
1551 ><P
1552 >to</P
1553 ><P
1554 ><PRE
1555 CLASS="PROGRAMLISTING"
1556 >enable = yes</PRE
1557 ></P
1558 ><P
1559 >       
1560 For ftp services to work properly, you will also need to either 
1561 have individual directories for the domain users already present on 
1562 the server, or change the home directory template to a general
1563 directory for all domain users.  These can be easily set using 
1564 the <TT
1565 CLASS="FILENAME"
1566 >smb.conf</TT
1567 > global entry 
1568 <B
1569 CLASS="COMMAND"
1570 >template homedir</B
1571 >.</P
1572 ><P
1573 >The <TT
1574 CLASS="FILENAME"
1575 >/etc/pam.d/ftp</TT
1576 > file can be changed 
1577 to allow winbind ftp access in a manner similar to the
1578 samba file.  My <TT
1579 CLASS="FILENAME"
1580 >/etc/pam.d/ftp</TT
1581 > file was 
1582 changed to look like this:</P
1583 ><P
1584 ><PRE
1585 CLASS="PROGRAMLISTING"
1586 >auth       required     /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
1587 auth       sufficient   /lib/security/pam_winbind.so
1588 auth       required     /lib/security/pam_stack.so service=system-auth
1589 auth       required     /lib/security/pam_shells.so
1590 account    sufficient   /lib/security/pam_winbind.so
1591 account    required     /lib/security/pam_stack.so service=system-auth
1592 session    required     /lib/security/pam_stack.so service=system-auth</PRE
1593 ></P
1594 ><P
1595 >The <TT
1596 CLASS="FILENAME"
1597 >/etc/pam.d/login</TT
1598 > file can be changed nearly the 
1599 same way.  It now looks like this:</P
1600 ><P
1601 ><PRE
1602 CLASS="PROGRAMLISTING"
1603 >auth       required     /lib/security/pam_securetty.so
1604 auth       sufficient   /lib/security/pam_winbind.so
1605 auth       sufficient   /lib/security/pam_unix.so use_first_pass
1606 auth       required     /lib/security/pam_stack.so service=system-auth
1607 auth       required     /lib/security/pam_nologin.so
1608 account    sufficient   /lib/security/pam_winbind.so
1609 account    required     /lib/security/pam_stack.so service=system-auth
1610 password   required     /lib/security/pam_stack.so service=system-auth
1611 session    required     /lib/security/pam_stack.so service=system-auth
1612 session    optional     /lib/security/pam_console.so</PRE
1613 ></P
1614 ><P
1615 >In this case, I added the <B
1616 CLASS="COMMAND"
1617 >auth sufficient /lib/security/pam_winbind.so</B
1618
1619 lines as before, but also added the <B
1620 CLASS="COMMAND"
1621 >required pam_securetty.so</B
1622
1623 above it, to disallow root logins over the network.  I also added a 
1624 <B
1625 CLASS="COMMAND"
1626 >sufficient /lib/security/pam_unix.so use_first_pass</B
1627 >
1628 line after the <B
1629 CLASS="COMMAND"
1630 >winbind.so</B
1631 > line to get rid of annoying 
1632 double prompts for passwords.</P
1633 ></DIV
1634 ><DIV
1635 CLASS="SECT4"
1636 ><H4
1637 CLASS="SECT4"
1638 ><A
1639 NAME="AEN2837"
1640 >15.5.3.7.2. Solaris-specific configuration</A
1641 ></H4
1642 ><P
1643 >The /etc/pam.conf needs to be changed. I changed this file so that my Domain
1644 users can logon both locally as well as telnet.The following are the changes
1645 that I made.You can customize the pam.conf file as per your requirements,but
1646 be sure of those changes because in the worst case it will leave your system
1647 nearly impossible to boot.</P
1648 ><P
1649 ><PRE
1650 CLASS="PROGRAMLISTING"
1651 >#
1652 #ident  "@(#)pam.conf   1.14    99/09/16 SMI"
1653 #
1654 # Copyright (c) 1996-1999, Sun Microsystems, Inc.
1655 # All Rights Reserved.
1656 #
1657 # PAM configuration
1658 #
1659 # Authentication management
1660 #
1661 login   auth required   /usr/lib/security/pam_winbind.so
1662 login   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass 
1663 login   auth required   /usr/lib/security/$ISA/pam_dial_auth.so.1 try_first_pass 
1664 #
1665 rlogin  auth sufficient /usr/lib/security/pam_winbind.so
1666 rlogin  auth sufficient /usr/lib/security/$ISA/pam_rhosts_auth.so.1
1667 rlogin  auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
1668 #
1669 dtlogin auth sufficient /usr/lib/security/pam_winbind.so
1670 dtlogin auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
1671 #
1672 rsh     auth required   /usr/lib/security/$ISA/pam_rhosts_auth.so.1
1673 other   auth sufficient /usr/lib/security/pam_winbind.so
1674 other   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
1675 #
1676 # Account management
1677 #
1678 login   account sufficient      /usr/lib/security/pam_winbind.so
1679 login   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
1680 login   account required        /usr/lib/security/$ISA/pam_unix.so.1 
1681 #
1682 dtlogin account sufficient      /usr/lib/security/pam_winbind.so
1683 dtlogin account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
1684 dtlogin account required        /usr/lib/security/$ISA/pam_unix.so.1 
1685 #
1686 other   account sufficient      /usr/lib/security/pam_winbind.so
1687 other   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
1688 other   account required        /usr/lib/security/$ISA/pam_unix.so.1 
1689 #
1690 # Session management
1691 #
1692 other   session required        /usr/lib/security/$ISA/pam_unix.so.1 
1693 #
1694 # Password management
1695 #
1696 #other   password sufficient     /usr/lib/security/pam_winbind.so
1697 other   password required       /usr/lib/security/$ISA/pam_unix.so.1 
1698 dtsession auth required /usr/lib/security/$ISA/pam_unix.so.1
1699 #
1700 # Support for Kerberos V5 authentication (uncomment to use Kerberos)
1701 #
1702 #rlogin auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
1703 #login  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
1704 #dtlogin        auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
1705 #other  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
1706 #dtlogin        account optional /usr/lib/security/$ISA/pam_krb5.so.1
1707 #other  account optional /usr/lib/security/$ISA/pam_krb5.so.1
1708 #other  session optional /usr/lib/security/$ISA/pam_krb5.so.1
1709 #other  password optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass</PRE
1710 ></P
1711 ><P
1712 >I also added a try_first_pass line after the winbind.so line to get rid of
1713 annoying double prompts for passwords.</P
1714 ><P
1715 >Now restart your Samba and try connecting through your application that you
1716 configured in the pam.conf.</P
1717 ></DIV
1718 ></DIV
1719 ></DIV
1720 ></DIV
1721 ><DIV
1722 CLASS="SECT1"
1723 ><H1
1724 CLASS="SECT1"
1725 ><A
1726 NAME="AEN2844"
1727 >15.6. Limitations</A
1728 ></H1
1729 ><P
1730 >Winbind has a number of limitations in its current 
1731         released version that we hope to overcome in future 
1732         releases:</P
1733 ><P
1734 ></P
1735 ><UL
1736 ><LI
1737 ><P
1738 >Winbind is currently only available for 
1739                 the Linux, Solaris and IRIX operating systems, although ports to other operating 
1740                 systems are certainly possible. For such ports to be feasible, 
1741                 we require the C library of the target operating system to 
1742                 support the Name Service Switch and Pluggable Authentication
1743                 Modules systems. This is becoming more common as NSS and 
1744                 PAM gain        support among UNIX vendors.</P
1745 ></LI
1746 ><LI
1747 ><P
1748 >The mappings of Windows NT RIDs to UNIX ids 
1749                 is not made algorithmically and depends on the order in which 
1750                 unmapped users or groups are seen by winbind. It may be difficult 
1751                 to recover the mappings of rid to UNIX id mapping if the file 
1752                 containing this information is corrupted or destroyed.</P
1753 ></LI
1754 ><LI
1755 ><P
1756 >Currently the winbind PAM module does not take 
1757                 into account possible workstation and logon time restrictions 
1758                 that may be been set for Windows NT users, this is
1759                 instead up to the PDC to enforce.</P
1760 ></LI
1761 ></UL
1762 ></DIV
1763 ><DIV
1764 CLASS="SECT1"
1765 ><H1
1766 CLASS="SECT1"
1767 ><A
1768 NAME="AEN2854"
1769 >15.7. Conclusion</A
1770 ></H1
1771 ><P
1772 >The winbind system, through the use of the Name Service 
1773         Switch, Pluggable Authentication Modules, and appropriate 
1774         Microsoft RPC calls have allowed us to provide seamless 
1775         integration of Microsoft Windows NT domain users on a
1776         UNIX system. The result is a great reduction in the administrative 
1777         cost of running a mixed UNIX and NT network.</P
1778 ></DIV
1779 ></DIV
1780 ><DIV
1781 CLASS="NAVFOOTER"
1782 ><HR
1783 ALIGN="LEFT"
1784 WIDTH="100%"><TABLE
1785 SUMMARY="Footer navigation table"
1786 WIDTH="100%"
1787 BORDER="0"
1788 CELLPADDING="0"
1789 CELLSPACING="0"
1790 ><TR
1791 ><TD
1792 WIDTH="33%"
1793 ALIGN="left"
1794 VALIGN="top"
1795 ><A
1796 HREF="cups-printing.html"
1797 ACCESSKEY="P"
1798 >Prev</A
1799 ></TD
1800 ><TD
1801 WIDTH="34%"
1802 ALIGN="center"
1803 VALIGN="top"
1804 ><A
1805 HREF="samba-howto-collection.html"
1806 ACCESSKEY="H"
1807 >Home</A
1808 ></TD
1809 ><TD
1810 WIDTH="33%"
1811 ALIGN="right"
1812 VALIGN="top"
1813 ><A
1814 HREF="advancednetworkmanagement.html"
1815 ACCESSKEY="N"
1816 >Next</A
1817 ></TD
1818 ></TR
1819 ><TR
1820 ><TD
1821 WIDTH="33%"
1822 ALIGN="left"
1823 VALIGN="top"
1824 >CUPS Printing Support</TD
1825 ><TD
1826 WIDTH="34%"
1827 ALIGN="center"
1828 VALIGN="top"
1829 ><A
1830 HREF="optional.html"
1831 ACCESSKEY="U"
1832 >Up</A
1833 ></TD
1834 ><TD
1835 WIDTH="33%"
1836 ALIGN="right"
1837 VALIGN="top"
1838 >Advanced Network Manangement</TD
1839 ></TR
1840 ></TABLE
1841 ></DIV
1842 ></BODY
1843 ></HTML
1844 >