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