Merge from Subversion r50.
[ira/wip.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="Integrating MS Windows networks with Samba"
20 HREF="integrate-ms-networks.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="integrate-ms-networks.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 16. Unified Logons between Windows NT and UNIX using Winbind</H1
78 ><DIV
79 CLASS="SECT1"
80 ><H1
81 CLASS="SECT1"
82 ><A
83 NAME="AEN2573"
84 >16.1. Abstract</A
85 ></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="AEN2577"
111 >16.2. Introduction</A
112 ></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="AEN2590"
165 >16.3. What Winbind Provides</A
166 ></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="AEN2597"
207 >16.3.1. Target Uses</A
208 ></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="AEN2601"
231 >16.4. How Winbind Works</A
232 ></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="AEN2606"
251 >16.4.1. Microsoft Remote Procedure Calls</A
252 ></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="AEN2610"
277 >16.4.2. Microsoft Active Directory Services</A
278 ></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="AEN2613"
296 >16.4.3. Name Service Switch</A
297 ></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="AEN2629"
376 >16.4.4. Pluggable Authentication Modules</A
377 ></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="AEN2637"
425 >16.4.5. User and Group ID Allocation</A
426 ></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="AEN2641"
451 >16.4.6. Result Caching</A
452 ></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="AEN2644"
474 >16.5. Installation and Configuration</A
475 ></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 ><DIV
488 CLASS="SECT2"
489 ><H2
490 CLASS="SECT2"
491 ><A
492 NAME="AEN2649"
493 >16.5.1. Introduction</A
494 ></H2
495 ><P
496 >This HOWTO describes the procedures used to get winbind up and 
497 running on my RedHat 7.1 system.  Winbind is capable of providing access 
498 and authentication control for Windows Domain users through an NT 
499 or Win2K PDC for 'regular' services, such as telnet a nd ftp, as
500 well for SAMBA services.</P
501 ><P
502 >This HOWTO has been written from a 'RedHat-centric' perspective, so if 
503 you are using another distribution, you may have to modify the instructions 
504 somewhat to fit the way your distribution works.</P
505 ><P
506 ></P
507 ><UL
508 ><LI
509 ><P
510 >       <SPAN
511 CLASS="emphasis"
512 ><I
513 CLASS="EMPHASIS"
514 >Why should I to this?</I
515 ></SPAN
516 >
517         </P
518 ><P
519 >This allows the SAMBA administrator to rely on the 
520         authentication mechanisms on the NT/Win2K PDC for the authentication 
521         of domain members.  NT/Win2K users no longer need to have separate 
522         accounts on the SAMBA server.
523         </P
524 ></LI
525 ><LI
526 ><P
527 >       <SPAN
528 CLASS="emphasis"
529 ><I
530 CLASS="EMPHASIS"
531 >Who should be reading this document?</I
532 ></SPAN
533 >
534         </P
535 ><P
536 >       This HOWTO is designed for system administrators.  If you are 
537         implementing SAMBA on a file server and wish to (fairly easily) 
538         integrate existing NT/Win2K users from your PDC onto the
539         SAMBA server, this HOWTO is for you.  That said, I am no NT or PAM 
540         expert, so you may find a better or easier way to accomplish 
541         these tasks.
542         </P
543 ></LI
544 ></UL
545 ></DIV
546 ><DIV
547 CLASS="SECT2"
548 ><H2
549 CLASS="SECT2"
550 ><A
551 NAME="AEN2662"
552 >16.5.2. Requirements</A
553 ></H2
554 ><P
555 >If you have a samba configuration file that you are currently 
556 using... <SPAN
557 CLASS="emphasis"
558 ><I
559 CLASS="EMPHASIS"
560 >BACK IT UP!</I
561 ></SPAN
562 >  If your system already uses PAM, 
563 <SPAN
564 CLASS="emphasis"
565 ><I
566 CLASS="EMPHASIS"
567 >back up the <TT
568 CLASS="FILENAME"
569 >/etc/pam.d</TT
570 > directory 
571 contents!</I
572 ></SPAN
573 > If you haven't already made a boot disk, 
574 <SPAN
575 CLASS="emphasis"
576 ><I
577 CLASS="EMPHASIS"
578 >MAKE ONE NOW!</I
579 ></SPAN
580 ></P
581 ><P
582 >Messing with the pam configuration files can make it nearly impossible 
583 to log in to yourmachine. That's why you want to be able to boot back 
584 into your machine in single user mode and restore your 
585 <TT
586 CLASS="FILENAME"
587 >/etc/pam.d</TT
588 > back to the original state they were in if 
589 you get frustrated with the way things are going.  ;-)</P
590 ><P
591 >The latest version of SAMBA (version 3.0 as of this writing), now 
592 includes a functioning winbindd daemon.  Please refer to the 
593 <A
594 HREF="http://samba.org/"
595 TARGET="_top"
596 >main SAMBA web page</A
597 > or, 
598 better yet, your closest SAMBA mirror site for instructions on 
599 downloading the source code.</P
600 ><P
601 >To allow Domain users the ability to access SAMBA shares and 
602 files, as well as potentially other services provided by your 
603 SAMBA machine, PAM (pluggable authentication modules) must
604 be setup properly on your machine.  In order to compile the 
605 winbind modules, you should have at least the pam libraries resident 
606 on your system.  For recent RedHat systems (7.1, for instance), that 
607 means <TT
608 CLASS="FILENAME"
609 >pam-0.74-22</TT
610 >.  For best results, it is helpful to also
611 install the development packages in <TT
612 CLASS="FILENAME"
613 >pam-devel-0.74-22</TT
614 >.</P
615 ></DIV
616 ><DIV
617 CLASS="SECT2"
618 ><H2
619 CLASS="SECT2"
620 ><A
621 NAME="AEN2676"
622 >16.5.3. Testing Things Out</A
623 ></H2
624 ><P
625 >Before starting, it is probably best to kill off all the SAMBA 
626 related daemons running on your server.  Kill off all <B
627 CLASS="COMMAND"
628 >smbd</B
629 >, 
630 <B
631 CLASS="COMMAND"
632 >nmbd</B
633 >, and <B
634 CLASS="COMMAND"
635 >winbindd</B
636 > processes that may 
637 be running.  To use PAM, you will want to make sure that you have the 
638 standard PAM package (for RedHat) which supplies the <TT
639 CLASS="FILENAME"
640 >/etc/pam.d</TT
641
642 directory structure, including the pam modules are used by pam-aware 
643 services, several pam libraries, and the <TT
644 CLASS="FILENAME"
645 >/usr/doc</TT
646
647 and <TT
648 CLASS="FILENAME"
649 >/usr/man</TT
650 > entries for pam.  Winbind built better 
651 in SAMBA if the pam-devel package was also installed.  This package includes 
652 the header files needed to compile pam-aware applications. For instance, 
653 my RedHat system has both <TT
654 CLASS="FILENAME"
655 >pam-0.74-22</TT
656 > and
657 <TT
658 CLASS="FILENAME"
659 >pam-devel-0.74-22</TT
660 > RPMs installed.</P
661 ><DIV
662 CLASS="SECT3"
663 ><H3
664 CLASS="SECT3"
665 ><A
666 NAME="AEN2687"
667 >16.5.3.1. Configure and compile SAMBA</A
668 ></H3
669 ><P
670 >The configuration and compilation of SAMBA is pretty straightforward.
671 The first three steps may not be necessary depending upon
672 whether or not you have previously built the Samba binaries.</P
673 ><P
674 ><PRE
675 CLASS="PROGRAMLISTING"
676 ><SAMP
677 CLASS="PROMPT"
678 >root#</SAMP
679 > <B
680 CLASS="COMMAND"
681 >autoconf</B
682 >
683 <SAMP
684 CLASS="PROMPT"
685 >root#</SAMP
686 > <B
687 CLASS="COMMAND"
688 >make clean</B
689 >
690 <SAMP
691 CLASS="PROMPT"
692 >root#</SAMP
693 > <B
694 CLASS="COMMAND"
695 >rm config.cache</B
696 >
697 <SAMP
698 CLASS="PROMPT"
699 >root#</SAMP
700 > <B
701 CLASS="COMMAND"
702 >./configure</B
703 >
704 <SAMP
705 CLASS="PROMPT"
706 >root#</SAMP
707 > <B
708 CLASS="COMMAND"
709 >make</B
710 >
711 <SAMP
712 CLASS="PROMPT"
713 >root#</SAMP
714 > <B
715 CLASS="COMMAND"
716 >make install</B
717 ></PRE
718 ></P
719 ><P
720 >This will, by default, install SAMBA in <TT
721 CLASS="FILENAME"
722 >/usr/local/samba</TT
723 >.
724 See the main SAMBA documentation if you want to install SAMBA somewhere else.
725 It will also build the winbindd executable and libraries. </P
726 ></DIV
727 ><DIV
728 CLASS="SECT3"
729 ><H3
730 CLASS="SECT3"
731 ><A
732 NAME="AEN2706"
733 >16.5.3.2. Configure <TT
734 CLASS="FILENAME"
735 >nsswitch.conf</TT
736 > and the 
737 winbind libraries</A
738 ></H3
739 ><P
740 >The libraries needed to run the <B
741 CLASS="COMMAND"
742 >winbindd</B
743 > daemon 
744 through nsswitch need to be copied to their proper locations, so</P
745 ><P
746 ><SAMP
747 CLASS="PROMPT"
748 >root#</SAMP
749 > <B
750 CLASS="COMMAND"
751 >cp ../samba/source/nsswitch/libnss_winbind.so /lib</B
752 ></P
753 ><P
754 >I also found it necessary to make the following symbolic link:</P
755 ><P
756 ><SAMP
757 CLASS="PROMPT"
758 >root#</SAMP
759 > <B
760 CLASS="COMMAND"
761 >ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2</B
762 ></P
763 ><P
764 >And, in the case of Sun solaris:</P
765 ><P
766 ><SAMP
767 CLASS="PROMPT"
768 >root#</SAMP
769 > <B
770 CLASS="COMMAND"
771 >ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1</B
772 >
773 <SAMP
774 CLASS="PROMPT"
775 >root#</SAMP
776 > <B
777 CLASS="COMMAND"
778 >ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.1</B
779 >
780 <SAMP
781 CLASS="PROMPT"
782 >root#</SAMP
783 > <B
784 CLASS="COMMAND"
785 >ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.2</B
786 ></P
787 ><P
788 >Now, as root you need to edit <TT
789 CLASS="FILENAME"
790 >/etc/nsswitch.conf</TT
791 > to 
792 allow user and group entries to be visible from the <B
793 CLASS="COMMAND"
794 >winbindd</B
795
796 daemon.  My <TT
797 CLASS="FILENAME"
798 >/etc/nsswitch.conf</TT
799 > file look like 
800 this after editing:</P
801 ><P
802 ><PRE
803 CLASS="PROGRAMLISTING"
804 >       passwd:     files winbind
805         shadow:     files 
806         group:      files winbind</PRE
807 ></P
808 ><P
809 >       
810 The libraries needed by the winbind daemon will be automatically 
811 entered into the <B
812 CLASS="COMMAND"
813 >ldconfig</B
814 > cache the next time 
815 your system reboots, but it 
816 is faster (and you don't need to reboot) if you do it manually:</P
817 ><P
818 ><SAMP
819 CLASS="PROMPT"
820 >root#</SAMP
821 > <B
822 CLASS="COMMAND"
823 >/sbin/ldconfig -v | grep winbind</B
824 ></P
825 ><P
826 >This makes <TT
827 CLASS="FILENAME"
828 >libnss_winbind</TT
829 > available to winbindd 
830 and echos back a check to you.</P
831 ></DIV
832 ><DIV
833 CLASS="SECT3"
834 ><H3
835 CLASS="SECT3"
836 ><A
837 NAME="AEN2739"
838 >16.5.3.3. Configure smb.conf</A
839 ></H3
840 ><P
841 >Several parameters are needed in the smb.conf file to control 
842 the behavior of <B
843 CLASS="COMMAND"
844 >winbindd</B
845 >. Configure 
846 <TT
847 CLASS="FILENAME"
848 >smb.conf</TT
849 > These are described in more detail in 
850 the <A
851 HREF="winbindd.8.html"
852 TARGET="_top"
853 >winbindd(8)</A
854 > man page.  My 
855 <TT
856 CLASS="FILENAME"
857 >smb.conf</TT
858 > file was modified to
859 include the following entries in the [global] section:</P
860 ><P
861 ><PRE
862 CLASS="PROGRAMLISTING"
863 >[global]
864      &#60;...&#62;
865      # separate domain and username with '+', like DOMAIN+username
866      <A
867 HREF="winbindd.8.html#WINBINDSEPARATOR"
868 TARGET="_top"
869 >winbind separator</A
870 > = +
871      # use uids from 10000 to 20000 for domain users
872      <A
873 HREF="winbindd.8.html#WINBINDUID"
874 TARGET="_top"
875 >winbind uid</A
876 > = 10000-20000
877      # use gids from 10000 to 20000 for domain groups
878      <A
879 HREF="winbindd.8.html#WINBINDGID"
880 TARGET="_top"
881 >winbind gid</A
882 > = 10000-20000
883      # allow enumeration of winbind users and groups
884      <A
885 HREF="winbindd.8.html#WINBINDENUMUSERS"
886 TARGET="_top"
887 >winbind enum users</A
888 > = yes
889      <A
890 HREF="winbindd.8.html#WINBINDENUMGROUP"
891 TARGET="_top"
892 >winbind enum groups</A
893 > = yes
894      # give winbind users a real shell (only needed if they have telnet access)
895      <A
896 HREF="winbindd.8.html#TEMPLATEHOMEDIR"
897 TARGET="_top"
898 >template homedir</A
899 > = /home/winnt/%D/%U
900      <A
901 HREF="winbindd.8.html#TEMPLATESHELL"
902 TARGET="_top"
903 >template shell</A
904 > = /bin/bash</PRE
905 ></P
906 ></DIV
907 ><DIV
908 CLASS="SECT3"
909 ><H3
910 CLASS="SECT3"
911 ><A
912 NAME="AEN2755"
913 >16.5.3.4. Join the SAMBA server to the PDC domain</A
914 ></H3
915 ><P
916 >Enter the following command to make the SAMBA server join the 
917 PDC domain, where <VAR
918 CLASS="REPLACEABLE"
919 >DOMAIN</VAR
920 > is the name of 
921 your Windows domain and <VAR
922 CLASS="REPLACEABLE"
923 >Administrator</VAR
924 > is 
925 a domain user who has administrative privileges in the domain.</P
926 ><P
927 ><SAMP
928 CLASS="PROMPT"
929 >root#</SAMP
930 > <B
931 CLASS="COMMAND"
932 >/usr/local/samba/bin/net join -S PDC -U Administrator</B
933 ></P
934 ><P
935 >The proper response to the command should be: "Joined the domain 
936 <VAR
937 CLASS="REPLACEABLE"
938 >DOMAIN</VAR
939 >" where <VAR
940 CLASS="REPLACEABLE"
941 >DOMAIN</VAR
942
943 is your DOMAIN name.</P
944 ></DIV
945 ><DIV
946 CLASS="SECT3"
947 ><H3
948 CLASS="SECT3"
949 ><A
950 NAME="AEN2766"
951 >16.5.3.5. Start up the winbindd daemon and test it!</A
952 ></H3
953 ><P
954 >Eventually, you will want to modify your smb startup script to 
955 automatically invoke the winbindd daemon when the other parts of 
956 SAMBA start, but it is possible to test out just the winbind
957 portion first.  To start up winbind services, enter the following 
958 command as root:</P
959 ><P
960 ><SAMP
961 CLASS="PROMPT"
962 >root#</SAMP
963 > <B
964 CLASS="COMMAND"
965 >/usr/local/samba/bin/winbindd</B
966 ></P
967 ><P
968 >Winbindd can now also run in 'dual daemon mode'. This will make it 
969 run as 2 processes. The first will answer all requests from the cache,
970 thus making responses to clients faster. The other will
971 update the cache for the query that the first has just responded.
972 Advantage of this is that responses stay accurate and are faster. 
973 You can enable dual daemon mode by adding '-B' to the commandline:</P
974 ><P
975 ><SAMP
976 CLASS="PROMPT"
977 >root#</SAMP
978 > <B
979 CLASS="COMMAND"
980 >/usr/local/samba/bin/winbindd -B</B
981 ></P
982 ><P
983 >I'm always paranoid and like to make sure the daemon 
984 is really running...</P
985 ><P
986 ><SAMP
987 CLASS="PROMPT"
988 >root#</SAMP
989 > <B
990 CLASS="COMMAND"
991 >ps -ae | grep winbindd</B
992 ></P
993 ><P
994 >This command should produce output like this, if the daemon is running</P
995 ><P
996 >3025 ?        00:00:00 winbindd</P
997 ><P
998 >Now... for the real test, try to get some information about the 
999 users on your PDC</P
1000 ><P
1001 ><SAMP
1002 CLASS="PROMPT"
1003 >root#</SAMP
1004 > <B
1005 CLASS="COMMAND"
1006 >/usr/local/samba/bin/wbinfo -u</B
1007 ></P
1008 ><P
1009 >       
1010 This should echo back a list of users on your Windows users on 
1011 your PDC.  For example, I get the following response:</P
1012 ><P
1013 ><PRE
1014 CLASS="PROGRAMLISTING"
1015 >CEO+Administrator
1016 CEO+burdell
1017 CEO+Guest
1018 CEO+jt-ad
1019 CEO+krbtgt
1020 CEO+TsInternetUser</PRE
1021 ></P
1022 ><P
1023 >Obviously, I have named my domain 'CEO' and my <VAR
1024 CLASS="PARAMETER"
1025 >winbind
1026 separator</VAR
1027 > is '+'.</P
1028 ><P
1029 >You can do the same sort of thing to get group information from 
1030 the PDC:</P
1031 ><P
1032 ><PRE
1033 CLASS="PROGRAMLISTING"
1034 ><SAMP
1035 CLASS="PROMPT"
1036 >root#</SAMP
1037 > <B
1038 CLASS="COMMAND"
1039 >/usr/local/samba/bin/wbinfo -g</B
1040 >
1041 CEO+Domain Admins
1042 CEO+Domain Users
1043 CEO+Domain Guests
1044 CEO+Domain Computers
1045 CEO+Domain Controllers
1046 CEO+Cert Publishers
1047 CEO+Schema Admins
1048 CEO+Enterprise Admins
1049 CEO+Group Policy Creator Owners</PRE
1050 ></P
1051 ><P
1052 >The function 'getent' can now be used to get unified 
1053 lists of both local and PDC users and groups.
1054 Try the following command:</P
1055 ><P
1056 ><SAMP
1057 CLASS="PROMPT"
1058 >root#</SAMP
1059 > <B
1060 CLASS="COMMAND"
1061 >getent passwd</B
1062 ></P
1063 ><P
1064 >You should get a list that looks like your <TT
1065 CLASS="FILENAME"
1066 >/etc/passwd</TT
1067
1068 list followed by the domain users with their new uids, gids, home 
1069 directories and default shells.</P
1070 ><P
1071 >The same thing can be done for groups with the command</P
1072 ><P
1073 ><SAMP
1074 CLASS="PROMPT"
1075 >root#</SAMP
1076 > <B
1077 CLASS="COMMAND"
1078 >getent group</B
1079 ></P
1080 ></DIV
1081 ><DIV
1082 CLASS="SECT3"
1083 ><H3
1084 CLASS="SECT3"
1085 ><A
1086 NAME="AEN2806"
1087 >16.5.3.6. Fix the init.d startup scripts</A
1088 ></H3
1089 ><DIV
1090 CLASS="SECT4"
1091 ><H4
1092 CLASS="SECT4"
1093 ><A
1094 NAME="AEN2808"
1095 >16.5.3.6.1. Linux</A
1096 ></H4
1097 ><P
1098 >The <B
1099 CLASS="COMMAND"
1100 >winbindd</B
1101 > daemon needs to start up after the 
1102 <B
1103 CLASS="COMMAND"
1104 >smbd</B
1105 > and <B
1106 CLASS="COMMAND"
1107 >nmbd</B
1108 > daemons are running.  
1109 To accomplish this task, you need to modify the startup scripts of your system. They are located at <TT
1110 CLASS="FILENAME"
1111 >/etc/init.d/smb</TT
1112 > in RedHat and 
1113 <TT
1114 CLASS="FILENAME"
1115 >/etc/init.d/samba</TT
1116 > in Debian.
1117 script to add commands to invoke this daemon in the proper sequence.  My 
1118 startup script starts up <B
1119 CLASS="COMMAND"
1120 >smbd</B
1121 >, 
1122 <B
1123 CLASS="COMMAND"
1124 >nmbd</B
1125 >, and <B
1126 CLASS="COMMAND"
1127 >winbindd</B
1128 > from the 
1129 <TT
1130 CLASS="FILENAME"
1131 >/usr/local/samba/bin</TT
1132 > directory directly.  The 'start' 
1133 function in the script looks like this:</P
1134 ><P
1135 ><PRE
1136 CLASS="PROGRAMLISTING"
1137 >start() {
1138         KIND="SMB"
1139         echo -n $"Starting $KIND services: "
1140         daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
1141         RETVAL=$?
1142         echo
1143         KIND="NMB"
1144         echo -n $"Starting $KIND services: "
1145         daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
1146         RETVAL2=$?
1147         echo
1148         KIND="Winbind"
1149         echo -n $"Starting $KIND services: "
1150         daemon /usr/local/samba/bin/winbindd
1151         RETVAL3=$?
1152         echo
1153         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; touch /var/lock/subsys/smb || \
1154            RETVAL=1
1155         return $RETVAL
1156 }</PRE
1157 ></P
1158 ><P
1159 >If you would like to run winbindd in dual daemon mode, replace 
1160 the line 
1161 <PRE
1162 CLASS="PROGRAMLISTING"
1163 >        daemon /usr/local/samba/bin/winbindd</PRE
1164 >
1165
1166 in the example above with:
1167
1168 <PRE
1169 CLASS="PROGRAMLISTING"
1170 >        daemon /usr/local/samba/bin/winbindd -B</PRE
1171 >.</P
1172 ><P
1173 >The 'stop' function has a corresponding entry to shut down the 
1174 services and looks like this:</P
1175 ><P
1176 ><PRE
1177 CLASS="PROGRAMLISTING"
1178 >stop() {
1179         KIND="SMB"
1180         echo -n $"Shutting down $KIND services: "
1181         killproc smbd
1182         RETVAL=$?
1183         echo
1184         KIND="NMB"
1185         echo -n $"Shutting down $KIND services: "
1186         killproc nmbd
1187         RETVAL2=$?
1188         echo
1189         KIND="Winbind"
1190         echo -n $"Shutting down $KIND services: "
1191         killproc winbindd
1192         RETVAL3=$?
1193         [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] &#38;&#38; rm -f /var/lock/subsys/smb
1194         echo ""
1195         return $RETVAL
1196 }</PRE
1197 ></P
1198 ></DIV
1199 ><DIV
1200 CLASS="SECT4"
1201 ><H4
1202 CLASS="SECT4"
1203 ><A
1204 NAME="AEN2828"
1205 >16.5.3.6.2. Solaris</A
1206 ></H4
1207 ><P
1208 >On solaris, you need to modify the 
1209 <TT
1210 CLASS="FILENAME"
1211 >/etc/init.d/samba.server</TT
1212 > startup script. It usually 
1213 only starts smbd and nmbd but should now start winbindd too. If you 
1214 have samba installed in <TT
1215 CLASS="FILENAME"
1216 >/usr/local/samba/bin</TT
1217 >, 
1218 the file could contains something like this:</P
1219 ><P
1220 ><PRE
1221 CLASS="PROGRAMLISTING"
1222 >##
1223 ## samba.server
1224 ##
1225
1226 if [ ! -d /usr/bin ]
1227 then                    # /usr not mounted
1228         exit
1229 fi
1230
1231 killproc() {            # kill the named process(es)
1232         pid=`/usr/bin/ps -e |
1233              /usr/bin/grep -w $1 |
1234              /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
1235         [ "$pid" != "" ] &#38;&#38; kill $pid
1236 }
1237  
1238 # Start/stop processes required for samba server
1239
1240 case "$1" in
1241
1242 'start')
1243 #
1244 # Edit these lines to suit your installation (paths, workgroup, host)
1245 #
1246 echo Starting SMBD
1247    /usr/local/samba/bin/smbd -D -s \
1248         /usr/local/samba/smb.conf
1249
1250 echo Starting NMBD
1251    /usr/local/samba/bin/nmbd -D -l \
1252         /usr/local/samba/var/log -s /usr/local/samba/smb.conf
1253
1254 echo Starting Winbind Daemon
1255    /usr/local/samba/bin/winbindd
1256    ;;
1257
1258 'stop')
1259    killproc nmbd
1260    killproc smbd
1261    killproc winbindd
1262    ;;
1263
1264 *)
1265    echo "Usage: /etc/init.d/samba.server { start | stop }"
1266    ;;
1267 esac</PRE
1268 ></P
1269 ><P
1270 >Again, if you would like to run samba in dual daemon mode, replace 
1271 <PRE
1272 CLASS="PROGRAMLISTING"
1273 >   /usr/local/samba/bin/winbindd</PRE
1274 >
1275
1276 in the script above with:
1277
1278 <PRE
1279 CLASS="PROGRAMLISTING"
1280 >   /usr/local/samba/bin/winbindd -B</PRE
1281 ></P
1282 ></DIV
1283 ><DIV
1284 CLASS="SECT4"
1285 ><H4
1286 CLASS="SECT4"
1287 ><A
1288 NAME="AEN2838"
1289 >16.5.3.6.3. Restarting</A
1290 ></H4
1291 ><P
1292 >If you restart the <B
1293 CLASS="COMMAND"
1294 >smbd</B
1295 >, <B
1296 CLASS="COMMAND"
1297 >nmbd</B
1298 >, 
1299 and <B
1300 CLASS="COMMAND"
1301 >winbindd</B
1302 > daemons at this point, you
1303 should be able to connect to the samba server as a domain member just as
1304 if you were a local user.</P
1305 ></DIV
1306 ></DIV
1307 ><DIV
1308 CLASS="SECT3"
1309 ><H3
1310 CLASS="SECT3"
1311 ><A
1312 NAME="AEN2844"
1313 >16.5.3.7. Configure Winbind and PAM</A
1314 ></H3
1315 ><P
1316 >If you have made it this far, you know that winbindd and samba are working
1317 together.  If you want to use winbind to provide authentication for other 
1318 services, keep reading.  The pam configuration files need to be altered in
1319 this step.  (Did you remember to make backups of your original 
1320 <TT
1321 CLASS="FILENAME"
1322 >/etc/pam.d</TT
1323 > files? If not, do it now.)</P
1324 ><P
1325 >You will need a pam module to use winbindd with these other services.  This 
1326 module will be compiled in the <TT
1327 CLASS="FILENAME"
1328 >../source/nsswitch</TT
1329 > directory
1330 by invoking the command</P
1331 ><P
1332 ><SAMP
1333 CLASS="PROMPT"
1334 >root#</SAMP
1335 > <B
1336 CLASS="COMMAND"
1337 >make nsswitch/pam_winbind.so</B
1338 ></P
1339 ><P
1340 >from the <TT
1341 CLASS="FILENAME"
1342 >../source</TT
1343 > directory.  The
1344 <TT
1345 CLASS="FILENAME"
1346 >pam_winbind.so</TT
1347 > file should be copied to the location of
1348 your other pam security modules.  On my RedHat system, this was the
1349 <TT
1350 CLASS="FILENAME"
1351 >/lib/security</TT
1352 > directory. On Solaris, the pam security 
1353 modules reside in <TT
1354 CLASS="FILENAME"
1355 >/usr/lib/security</TT
1356 >.</P
1357 ><P
1358 ><SAMP
1359 CLASS="PROMPT"
1360 >root#</SAMP
1361 > <B
1362 CLASS="COMMAND"
1363 >cp ../samba/source/nsswitch/pam_winbind.so /lib/security</B
1364 ></P
1365 ><DIV
1366 CLASS="SECT4"
1367 ><H4
1368 CLASS="SECT4"
1369 ><A
1370 NAME="AEN2861"
1371 >16.5.3.7.1. Linux/FreeBSD-specific PAM configuration</A
1372 ></H4
1373 ><P
1374 >The <TT
1375 CLASS="FILENAME"
1376 >/etc/pam.d/samba</TT
1377 > file does not need to be changed. I 
1378 just left this fileas it was:</P
1379 ><P
1380 ><PRE
1381 CLASS="PROGRAMLISTING"
1382 >auth    required        /lib/security/pam_stack.so service=system-auth
1383 account required        /lib/security/pam_stack.so service=system-auth</PRE
1384 ></P
1385 ><P
1386 >The other services that I modified to allow the use of winbind 
1387 as an authentication service were the normal login on the console (or a terminal 
1388 session), telnet logins, and ftp service.  In order to enable these 
1389 services, you may first need to change the entries in 
1390 <TT
1391 CLASS="FILENAME"
1392 >/etc/xinetd.d</TT
1393 > (or <TT
1394 CLASS="FILENAME"
1395 >/etc/inetd.conf</TT
1396 >).  
1397 RedHat 7.1 uses the new xinetd.d structure, in this case you need 
1398 to change the lines in <TT
1399 CLASS="FILENAME"
1400 >/etc/xinetd.d/telnet</TT
1401
1402 and <TT
1403 CLASS="FILENAME"
1404 >/etc/xinetd.d/wu-ftp</TT
1405 > from </P
1406 ><P
1407 ><PRE
1408 CLASS="PROGRAMLISTING"
1409 >enable = no</PRE
1410 ></P
1411 ><P
1412 >to</P
1413 ><P
1414 ><PRE
1415 CLASS="PROGRAMLISTING"
1416 >enable = yes</PRE
1417 ></P
1418 ><P
1419 >       
1420 For ftp services to work properly, you will also need to either 
1421 have individual directories for the domain users already present on 
1422 the server, or change the home directory template to a general
1423 directory for all domain users.  These can be easily set using 
1424 the <TT
1425 CLASS="FILENAME"
1426 >smb.conf</TT
1427 > global entry 
1428 <B
1429 CLASS="COMMAND"
1430 >template homedir</B
1431 >.</P
1432 ><P
1433 >The <TT
1434 CLASS="FILENAME"
1435 >/etc/pam.d/ftp</TT
1436 > file can be changed 
1437 to allow winbind ftp access in a manner similar to the
1438 samba file.  My <TT
1439 CLASS="FILENAME"
1440 >/etc/pam.d/ftp</TT
1441 > file was 
1442 changed to look like this:</P
1443 ><P
1444 ><PRE
1445 CLASS="PROGRAMLISTING"
1446 >auth       required     /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
1447 auth       sufficient   /lib/security/pam_winbind.so
1448 auth       required     /lib/security/pam_stack.so service=system-auth
1449 auth       required     /lib/security/pam_shells.so
1450 account    sufficient   /lib/security/pam_winbind.so
1451 account    required     /lib/security/pam_stack.so service=system-auth
1452 session    required     /lib/security/pam_stack.so service=system-auth</PRE
1453 ></P
1454 ><P
1455 >The <TT
1456 CLASS="FILENAME"
1457 >/etc/pam.d/login</TT
1458 > file can be changed nearly the 
1459 same way.  It now looks like this:</P
1460 ><P
1461 ><PRE
1462 CLASS="PROGRAMLISTING"
1463 >auth       required     /lib/security/pam_securetty.so
1464 auth       sufficient   /lib/security/pam_winbind.so
1465 auth       sufficient   /lib/security/pam_unix.so use_first_pass
1466 auth       required     /lib/security/pam_stack.so service=system-auth
1467 auth       required     /lib/security/pam_nologin.so
1468 account    sufficient   /lib/security/pam_winbind.so
1469 account    required     /lib/security/pam_stack.so service=system-auth
1470 password   required     /lib/security/pam_stack.so service=system-auth
1471 session    required     /lib/security/pam_stack.so service=system-auth
1472 session    optional     /lib/security/pam_console.so</PRE
1473 ></P
1474 ><P
1475 >In this case, I added the <B
1476 CLASS="COMMAND"
1477 >auth sufficient /lib/security/pam_winbind.so</B
1478
1479 lines as before, but also added the <B
1480 CLASS="COMMAND"
1481 >required pam_securetty.so</B
1482
1483 above it, to disallow root logins over the network.  I also added a 
1484 <B
1485 CLASS="COMMAND"
1486 >sufficient /lib/security/pam_unix.so use_first_pass</B
1487 >
1488 line after the <B
1489 CLASS="COMMAND"
1490 >winbind.so</B
1491 > line to get rid of annoying 
1492 double prompts for passwords.</P
1493 ></DIV
1494 ><DIV
1495 CLASS="SECT4"
1496 ><H4
1497 CLASS="SECT4"
1498 ><A
1499 NAME="AEN2894"
1500 >16.5.3.7.2. Solaris-specific configuration</A
1501 ></H4
1502 ><P
1503 >The /etc/pam.conf needs to be changed. I changed this file so that my Domain
1504 users can logon both locally as well as telnet.The following are the changes
1505 that I made.You can customize the pam.conf file as per your requirements,but
1506 be sure of those changes because in the worst case it will leave your system
1507 nearly impossible to boot.</P
1508 ><P
1509 ><PRE
1510 CLASS="PROGRAMLISTING"
1511 >#
1512 #ident  "@(#)pam.conf   1.14    99/09/16 SMI"
1513 #
1514 # Copyright (c) 1996-1999, Sun Microsystems, Inc.
1515 # All Rights Reserved.
1516 #
1517 # PAM configuration
1518 #
1519 # Authentication management
1520 #
1521 login   auth required   /usr/lib/security/pam_winbind.so
1522 login   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass 
1523 login   auth required   /usr/lib/security/$ISA/pam_dial_auth.so.1 try_first_pass 
1524 #
1525 rlogin  auth sufficient /usr/lib/security/pam_winbind.so
1526 rlogin  auth sufficient /usr/lib/security/$ISA/pam_rhosts_auth.so.1
1527 rlogin  auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
1528 #
1529 dtlogin auth sufficient /usr/lib/security/pam_winbind.so
1530 dtlogin auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
1531 #
1532 rsh     auth required   /usr/lib/security/$ISA/pam_rhosts_auth.so.1
1533 other   auth sufficient /usr/lib/security/pam_winbind.so
1534 other   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
1535 #
1536 # Account management
1537 #
1538 login   account sufficient      /usr/lib/security/pam_winbind.so
1539 login   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
1540 login   account required        /usr/lib/security/$ISA/pam_unix.so.1 
1541 #
1542 dtlogin account sufficient      /usr/lib/security/pam_winbind.so
1543 dtlogin account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
1544 dtlogin account required        /usr/lib/security/$ISA/pam_unix.so.1 
1545 #
1546 other   account sufficient      /usr/lib/security/pam_winbind.so
1547 other   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
1548 other   account required        /usr/lib/security/$ISA/pam_unix.so.1 
1549 #
1550 # Session management
1551 #
1552 other   session required        /usr/lib/security/$ISA/pam_unix.so.1 
1553 #
1554 # Password management
1555 #
1556 #other   password sufficient     /usr/lib/security/pam_winbind.so
1557 other   password required       /usr/lib/security/$ISA/pam_unix.so.1 
1558 dtsession auth required /usr/lib/security/$ISA/pam_unix.so.1
1559 #
1560 # Support for Kerberos V5 authentication (uncomment to use Kerberos)
1561 #
1562 #rlogin auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
1563 #login  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
1564 #dtlogin        auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
1565 #other  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
1566 #dtlogin        account optional /usr/lib/security/$ISA/pam_krb5.so.1
1567 #other  account optional /usr/lib/security/$ISA/pam_krb5.so.1
1568 #other  session optional /usr/lib/security/$ISA/pam_krb5.so.1
1569 #other  password optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass</PRE
1570 ></P
1571 ><P
1572 >I also added a try_first_pass line after the winbind.so line to get rid of
1573 annoying double prompts for passwords.</P
1574 ><P
1575 >Now restart your Samba and try connecting through your application that you
1576 configured in the pam.conf.</P
1577 ></DIV
1578 ></DIV
1579 ></DIV
1580 ></DIV
1581 ><DIV
1582 CLASS="SECT1"
1583 ><H1
1584 CLASS="SECT1"
1585 ><A
1586 NAME="AEN2901"
1587 >16.6. Limitations</A
1588 ></H1
1589 ><P
1590 >Winbind has a number of limitations in its current 
1591         released version that we hope to overcome in future 
1592         releases:</P
1593 ><P
1594 ></P
1595 ><UL
1596 ><LI
1597 ><P
1598 >Winbind is currently only available for 
1599                 the Linux, Solaris and IRIX operating systems, although ports to other operating 
1600                 systems are certainly possible. For such ports to be feasible, 
1601                 we require the C library of the target operating system to 
1602                 support the Name Service Switch and Pluggable Authentication
1603                 Modules systems. This is becoming more common as NSS and 
1604                 PAM gain        support among UNIX vendors.</P
1605 ></LI
1606 ><LI
1607 ><P
1608 >The mappings of Windows NT RIDs to UNIX ids 
1609                 is not made algorithmically and depends on the order in which 
1610                 unmapped users or groups are seen by winbind. It may be difficult 
1611                 to recover the mappings of rid to UNIX id mapping if the file 
1612                 containing this information is corrupted or destroyed.</P
1613 ></LI
1614 ><LI
1615 ><P
1616 >Currently the winbind PAM module does not take 
1617                 into account possible workstation and logon time restrictions 
1618                 that may be been set for Windows NT users, this is
1619                 instead up to the PDC to enforce.</P
1620 ></LI
1621 ></UL
1622 ></DIV
1623 ><DIV
1624 CLASS="SECT1"
1625 ><H1
1626 CLASS="SECT1"
1627 ><A
1628 NAME="AEN2911"
1629 >16.7. Conclusion</A
1630 ></H1
1631 ><P
1632 >The winbind system, through the use of the Name Service 
1633         Switch, Pluggable Authentication Modules, and appropriate 
1634         Microsoft RPC calls have allowed us to provide seamless 
1635         integration of Microsoft Windows NT domain users on a
1636         UNIX system. The result is a great reduction in the administrative 
1637         cost of running a mixed UNIX and NT network.</P
1638 ></DIV
1639 ></DIV
1640 ><DIV
1641 CLASS="NAVFOOTER"
1642 ><HR
1643 ALIGN="LEFT"
1644 WIDTH="100%"><TABLE
1645 SUMMARY="Footer navigation table"
1646 WIDTH="100%"
1647 BORDER="0"
1648 CELLPADDING="0"
1649 CELLSPACING="0"
1650 ><TR
1651 ><TD
1652 WIDTH="33%"
1653 ALIGN="left"
1654 VALIGN="top"
1655 ><A
1656 HREF="cups-printing.html"
1657 ACCESSKEY="P"
1658 >Prev</A
1659 ></TD
1660 ><TD
1661 WIDTH="34%"
1662 ALIGN="center"
1663 VALIGN="top"
1664 ><A
1665 HREF="samba-howto-collection.html"
1666 ACCESSKEY="H"
1667 >Home</A
1668 ></TD
1669 ><TD
1670 WIDTH="33%"
1671 ALIGN="right"
1672 VALIGN="top"
1673 ><A
1674 HREF="integrate-ms-networks.html"
1675 ACCESSKEY="N"
1676 >Next</A
1677 ></TD
1678 ></TR
1679 ><TR
1680 ><TD
1681 WIDTH="33%"
1682 ALIGN="left"
1683 VALIGN="top"
1684 >CUPS Printing Support</TD
1685 ><TD
1686 WIDTH="34%"
1687 ALIGN="center"
1688 VALIGN="top"
1689 ><A
1690 HREF="optional.html"
1691 ACCESSKEY="U"
1692 >Up</A
1693 ></TD
1694 ><TD
1695 WIDTH="33%"
1696 ALIGN="right"
1697 VALIGN="top"
1698 >Integrating MS Windows networks with Samba</TD
1699 ></TR
1700 ></TABLE
1701 ></DIV
1702 ></BODY
1703 ></HTML
1704 >