add a few more notes to whats new
[Samba.git] / docs / htmldocs / winbind.html
blobbb18545c5b8921738a269eb1b5068d24645be49b
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Unified Logons between Windows NT and UNIX using Winbind</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD
8 ><BODY
9 CLASS="ARTICLE"
10 BGCOLOR="#FFFFFF"
11 TEXT="#000000"
12 LINK="#0000FF"
13 VLINK="#840084"
14 ALINK="#0000FF"
15 ><DIV
16 CLASS="ARTICLE"
17 ><DIV
18 CLASS="TITLEPAGE"
19 ><H1
20 CLASS="TITLE"
21 ><A
22 NAME="WINBIND"
23 >Unified Logons between Windows NT and UNIX using Winbind</A
24 ></H1
25 ><HR></DIV
26 ><DIV
27 CLASS="SECT1"
28 ><H1
29 CLASS="SECT1"
30 ><A
31 NAME="AEN3"
32 >Abstract</A
33 ></H1
34 ><P
35 >Integration of UNIX and Microsoft Windows NT through
36 a unified logon has been considered a "holy grail" in heterogeneous
37 computing environments for a long time. We present
39 CLASS="EMPHASIS"
40 >winbind</I
41 >, a component of the Samba suite
42 of programs as a solution to the unified logon problem. Winbind
43 uses a UNIX implementation
44 of Microsoft RPC calls, Pluggable Authentication Modules, and the Name
45 Service Switch to allow Windows NT domain users to appear and operate
46 as UNIX users on a UNIX machine. This paper describes the winbind
47 system, explaining the functionality it provides, how it is configured,
48 and how it works internally.</P
49 ></DIV
50 ><DIV
51 CLASS="SECT1"
52 ><HR><H1
53 CLASS="SECT1"
54 ><A
55 NAME="AEN7"
56 >Introduction</A
57 ></H1
58 ><P
59 >It is well known that UNIX and Microsoft Windows NT have
60 different models for representing user and group information and
61 use different technologies for implementing them. This fact has
62 made it difficult to integrate the two systems in a satisfactory
63 manner.</P
64 ><P
65 >One common solution in use today has been to create
66 identically named user accounts on both the UNIX and Windows systems
67 and use the Samba suite of programs to provide file and print services
68 between the two. This solution is far from perfect however, as
69 adding and deleting users on both sets of machines becomes a chore
70 and two sets of passwords are required both of which
71 can lead to synchronization problems between the UNIX and Windows
72 systems and confusion for users.</P
73 ><P
74 >We divide the unified logon problem for UNIX machines into
75 three smaller problems:</P
76 ><P
77 ></P
78 ><UL
79 ><LI
80 ><P
81 >Obtaining Windows NT user and group information
82 </P
83 ></LI
84 ><LI
85 ><P
86 >Authenticating Windows NT users
87 </P
88 ></LI
89 ><LI
90 ><P
91 >Password changing for Windows NT users
92 </P
93 ></LI
94 ></UL
95 ><P
96 >Ideally, a prospective solution to the unified logon problem
97 would satisfy all the above components without duplication of
98 information on the UNIX machines and without creating additional
99 tasks for the system administrator when maintaining users and
100 groups on either system. The winbind system provides a simple
101 and elegant solution to all three components of the unified logon
102 problem.</P
103 ></DIV
104 ><DIV
105 CLASS="SECT1"
106 ><HR><H1
107 CLASS="SECT1"
109 NAME="AEN20"
110 >What Winbind Provides</A
111 ></H1
113 >Winbind unifies UNIX and Windows NT account management by
114 allowing a UNIX box to become a full member of a NT domain. Once
115 this is done the UNIX box will see NT users and groups as if
116 they were native UNIX users and groups, allowing the NT domain
117 to be used in much the same manner that NIS+ is used within
118 UNIX-only environments.</P
120 >The end result is that whenever any
121 program on the UNIX machine asks the operating system to lookup
122 a user or group name, the query will be resolved by asking the
123 NT domain controller for the specified domain to do the lookup.
124 Because Winbind hooks into the operating system at a low level
125 (via the NSS name resolution modules in the C library) this
126 redirection to the NT domain controller is completely
127 transparent.</P
129 >Users on the UNIX machine can then use NT user and group
130 names as they would use "native" UNIX names. They can chown files
131 so that they are owned by NT domain users or even login to the
132 UNIX machine and run a UNIX X-Window session as a domain user.</P
134 >The only obvious indication that Winbind is being used is
135 that user and group names take the form DOMAIN\user and
136 DOMAIN\group. This is necessary as it allows Winbind to determine
137 that redirection to a domain controller is wanted for a particular
138 lookup and which trusted domain is being referenced.</P
140 >Additionally, Winbind provides an authentication service
141 that hooks into the Pluggable Authentication Modules (PAM) system
142 to provide authentication via a NT domain to any PAM enabled
143 applications. This capability solves the problem of synchronizing
144 passwords between systems since all passwords are stored in a single
145 location (on the domain controller).</P
146 ><DIV
147 CLASS="SECT2"
148 ><HR><H2
149 CLASS="SECT2"
151 NAME="AEN27"
152 >Target Uses</A
153 ></H2
155 >Winbind is targeted at organizations that have an
156 existing NT based domain infrastructure into which they wish
157 to put UNIX workstations or servers. Winbind will allow these
158 organizations to deploy UNIX workstations without having to
159 maintain a separate account infrastructure. This greatly
160 simplifies the administrative overhead of deploying UNIX
161 workstations into a NT based organization.</P
163 >Another interesting way in which we expect Winbind to
164 be used is as a central part of UNIX based appliances. Appliances
165 that provide file and print services to Microsoft based networks
166 will be able to use Winbind to provide seamless integration of
167 the appliance into the domain.</P
168 ></DIV
169 ></DIV
170 ><DIV
171 CLASS="SECT1"
172 ><HR><H1
173 CLASS="SECT1"
175 NAME="AEN31"
176 >How Winbind Works</A
177 ></H1
179 >The winbind system is designed around a client/server
180 architecture. A long running <B
181 CLASS="COMMAND"
182 >winbindd</B
183 > daemon
184 listens on a UNIX domain socket waiting for requests
185 to arrive. These requests are generated by the NSS and PAM
186 clients and processed sequentially.</P
188 >The technologies used to implement winbind are described
189 in detail below.</P
190 ><DIV
191 CLASS="SECT2"
192 ><HR><H2
193 CLASS="SECT2"
195 NAME="AEN36"
196 >Microsoft Remote Procedure Calls</A
197 ></H2
199 >Over the last two years, efforts have been underway
200 by various Samba Team members to decode various aspects of
201 the Microsoft Remote Procedure Call (MSRPC) system. This
202 system is used for most network related operations between
203 Windows NT machines including remote management, user authentication
204 and print spooling. Although initially this work was done
205 to aid the implementation of Primary Domain Controller (PDC)
206 functionality in Samba, it has also yielded a body of code which
207 can be used for other purposes.</P
209 >Winbind uses various MSRPC calls to enumerate domain users
210 and groups and to obtain detailed information about individual
211 users or groups. Other MSRPC calls can be used to authenticate
212 NT domain users and to change user passwords. By directly querying
213 a Windows PDC for user and group information, winbind maps the
214 NT account information onto UNIX user and group names.</P
215 ></DIV
216 ><DIV
217 CLASS="SECT2"
218 ><HR><H2
219 CLASS="SECT2"
221 NAME="AEN40"
222 >Name Service Switch</A
223 ></H2
225 >The Name Service Switch, or NSS, is a feature that is
226 present in many UNIX operating systems. It allows system
227 information such as hostnames, mail aliases and user information
228 to be resolved from different sources. For example, a standalone
229 UNIX workstation may resolve system information from a series of
230 flat files stored on the local filesystem. A networked workstation
231 may first attempt to resolve system information from local files,
232 and then consult a NIS database for user information or a DNS server
233 for hostname information.</P
235 >The NSS application programming interface allows winbind
236 to present itself as a source of system information when
237 resolving UNIX usernames and groups. Winbind uses this interface,
238 and information obtained from a Windows NT server using MSRPC
239 calls to provide a new source of account enumeration. Using standard
240 UNIX library calls, one can enumerate the users and groups on
241 a UNIX machine running winbind and see all users and groups in
242 a NT domain plus any trusted domain as though they were local
243 users and groups.</P
245 >The primary control file for NSS is
247 CLASS="FILENAME"
248 >/etc/nsswitch.conf</TT
250 When a UNIX application makes a request to do a lookup
251 the C library looks in <TT
252 CLASS="FILENAME"
253 >/etc/nsswitch.conf</TT
255 for a line which matches the service type being requested, for
256 example the "passwd" service type is used when user or group names
257 are looked up. This config line species which implementations
258 of that service should be tried and in what order. If the passwd
259 config line is:</P
262 CLASS="COMMAND"
263 >passwd: files example</B
264 ></P
266 >then the C library will first load a module called
268 CLASS="FILENAME"
269 >/lib/libnss_files.so</TT
270 > followed by
271 the module <TT
272 CLASS="FILENAME"
273 >/lib/libnss_example.so</TT
274 >. The
275 C library will dynamically load each of these modules in turn
276 and call resolver functions within the modules to try to resolve
277 the request. Once the request is resolved the C library returns the
278 result to the application.</P
280 >This NSS interface provides a very easy way for Winbind
281 to hook into the operating system. All that needs to be done
282 is to put <TT
283 CLASS="FILENAME"
284 >libnss_winbind.so</TT
285 > in <TT
286 CLASS="FILENAME"
287 >/lib/</TT
289 then add "winbind" into <TT
290 CLASS="FILENAME"
291 >/etc/nsswitch.conf</TT
292 > at
293 the appropriate place. The C library will then call Winbind to
294 resolve user and group names.</P
295 ></DIV
296 ><DIV
297 CLASS="SECT2"
298 ><HR><H2
299 CLASS="SECT2"
301 NAME="AEN56"
302 >Pluggable Authentication Modules</A
303 ></H2
305 >Pluggable Authentication Modules, also known as PAM,
306 is a system for abstracting authentication and authorization
307 technologies. With a PAM module it is possible to specify different
308 authentication methods for different system applications without
309 having to recompile these applications. PAM is also useful
310 for implementing a particular policy for authorization. For example,
311 a system administrator may only allow console logins from users
312 stored in the local password file but only allow users resolved from
313 a NIS database to log in over the network.</P
315 >Winbind uses the authentication management and password
316 management PAM interface to integrate Windows NT users into a
317 UNIX system. This allows Windows NT users to log in to a UNIX
318 machine and be authenticated against a suitable Primary Domain
319 Controller. These users can also change their passwords and have
320 this change take effect directly on the Primary Domain Controller.
323 >PAM is configured by providing control files in the directory
325 CLASS="FILENAME"
326 >/etc/pam.d/</TT
327 > for each of the services that
328 require authentication. When an authentication request is made
329 by an application the PAM code in the C library looks up this
330 control file to determine what modules to load to do the
331 authentication check and in what order. This interface makes adding
332 a new authentication service for Winbind very easy, all that needs
333 to be done is that the <TT
334 CLASS="FILENAME"
335 >pam_winbind.so</TT
336 > module
337 is copied to <TT
338 CLASS="FILENAME"
339 >/lib/security/</TT
340 > and the PAM
341 control files for relevant services are updated to allow
342 authentication via winbind. See the PAM documentation
343 for more details.</P
344 ></DIV
345 ><DIV
346 CLASS="SECT2"
347 ><HR><H2
348 CLASS="SECT2"
350 NAME="AEN64"
351 >User and Group ID Allocation</A
352 ></H2
354 >When a user or group is created under Windows NT
355 is it allocated a numerical relative identifier (RID). This is
356 slightly different to UNIX which has a range of numbers that are
357 used to identify users, and the same range in which to identify
358 groups. It is winbind's job to convert RIDs to UNIX id numbers and
359 vice versa. When winbind is configured it is given part of the UNIX
360 user id space and a part of the UNIX group id space in which to
361 store Windows NT users and groups. If a Windows NT user is
362 resolved for the first time, it is allocated the next UNIX id from
363 the range. The same process applies for Windows NT groups. Over
364 time, winbind will have mapped all Windows NT users and groups
365 to UNIX user ids and group ids.</P
367 >The results of this mapping are stored persistently in
368 an ID mapping database held in a tdb database). This ensures that
369 RIDs are mapped to UNIX IDs in a consistent way.</P
370 ></DIV
371 ><DIV
372 CLASS="SECT2"
373 ><HR><H2
374 CLASS="SECT2"
376 NAME="AEN68"
377 >Result Caching</A
378 ></H2
380 >An active system can generate a lot of user and group
381 name lookups. To reduce the network cost of these lookups winbind
382 uses a caching scheme based on the SAM sequence number supplied
383 by NT domain controllers. User or group information returned
384 by a PDC is cached by winbind along with a sequence number also
385 returned by the PDC. This sequence number is incremented by
386 Windows NT whenever any user or group information is modified. If
387 a cached entry has expired, the sequence number is requested from
388 the PDC and compared against the sequence number of the cached entry.
389 If the sequence numbers do not match, then the cached information
390 is discarded and up to date information is requested directly
391 from the PDC.</P
392 ></DIV
393 ></DIV
394 ><DIV
395 CLASS="SECT1"
396 ><HR><H1
397 CLASS="SECT1"
399 NAME="AEN71"
400 >Installation and Configuration</A
401 ></H1
403 >Many thanks to John Trostel <A
404 HREF="mailto:jtrostel@snapserver.com"
405 TARGET="_top"
406 >jtrostel@snapserver.com</A
408 for providing the original Linux version of this HOWTO which
409 describes how to get winbind services up and running
410 to control access and authenticate users on your Linux box using
411 the winbind services which are included with the SAMBA 2.2.2 and later
412 releases.</P
413 ><DIV
414 CLASS="SECT2"
415 ><HR><H2
416 CLASS="SECT2"
418 NAME="AEN75"
419 >Introduction</A
420 ></H2
422 >This HOWTO describes the procedures used to get winbind up and
423 running on a RedHat 7.1 system. Winbind is capable of providing access
424 and authentication control for Windows Domain users through an NT
425 or Win2K PDC for 'regular' services, such as telnet and ftp, as
426 well providing dynamic uid/gid allocation for Samba.</P
428 >This HOWTO has been written from a 'RedHat-centric' perspective, so if
429 you are using another distribution (or operating system), you may have
430 to modify the instructions somewhat to fit the way your distribution works.</P
432 ></P
433 ><UL
434 ><LI
436 > <I
437 CLASS="EMPHASIS"
438 >Why should I to this?</I
442 >This allows the SAMBA administrator to rely on the
443 authentication mechanisms on the NT/Win2K PDC for the authentication
444 of domain members. NT/Win2K users no longer need to have separate
445 accounts on the SAMBA server.
447 ></LI
448 ><LI
450 > <I
451 CLASS="EMPHASIS"
452 >Who should be reading this document?</I
456 > This HOWTO is designed for system administrators. If you are
457 implementing SAMBA on a file server and wish to (fairly easily)
458 integrate existing NT/Win2K users from your PDC onto the
459 SAMBA server, this HOWTO is for you.
461 ></LI
462 ></UL
463 ></DIV
464 ><DIV
465 CLASS="SECT2"
466 ><HR><H2
467 CLASS="SECT2"
469 NAME="AEN88"
470 >Requirements</A
471 ></H2
473 >If you have a samba configuration file that you are currently
474 using... <I
475 CLASS="EMPHASIS"
476 >BACK IT UP!</I
477 > If your system already uses PAM,
479 CLASS="EMPHASIS"
480 >back up the <TT
481 CLASS="FILENAME"
482 >/etc/pam.d</TT
483 > (or <TT
484 CLASS="FILENAME"
485 >/etc/pam.conf</TT
487 directory contents!</I
488 > If you haven't already made a boot disk,
490 CLASS="EMPHASIS"
491 >MAKE ONE NOW!</I
492 ></P
494 >Messing with the pam configuration files can make it nearly impossible
495 to log in to your machine. That's why you want to be able to boot back
496 into your machine in single user mode and restore your
498 CLASS="FILENAME"
499 >/etc/pam.d</TT
500 > (or <TT
501 CLASS="FILENAME"
502 >pam.conmf</TT
503 >) back to
504 the original state they were in if
505 you get frustrated with the way things are going.</P
507 >The first SAMBA release to inclue a stable winbindd daemon was 2.2.2. Please refer to the
509 HREF="http://samba.org/"
510 TARGET="_top"
511 >main SAMBA web page</A
512 > or,
513 better yet, your closest SAMBA mirror site for instructions on
514 downloading the source code. it is generally advised to obtain the lates
515 Samba release as bugs are constantly being fixed.</P
517 >To allow Domain users the ability to access SAMBA shares and
518 files, as well as potentially other services provided by your
519 SAMBA machine, PAM (pluggable authentication modules) must
520 be setup properly on your machine. In order to compile the
521 winbind modules, you must have at the PAM libraries and header files resident
522 on your system. For recent RedHat systems (7.x, for instance), that
523 means installing both <TT
524 CLASS="FILENAME"
525 >pam</TT
526 > and <TT
527 CLASS="FILENAME"
528 >pam-devel</TT
529 > RPM.
530 The former is installed by default on all Linux systems of which the author is aware.</P
531 ></DIV
532 ><DIV
533 CLASS="SECT2"
534 ><HR><H2
535 CLASS="SECT2"
537 NAME="AEN104"
538 >Testing Things Out</A
539 ></H2
541 >Before starting, kill off all the SAMBA related daemons running on your server. Kill off
542 all <B
543 CLASS="COMMAND"
544 >smbd</B
545 >, <B
546 CLASS="COMMAND"
547 >nmbd</B
548 >, and <B
549 CLASS="COMMAND"
550 >winbindd</B
551 > processes that may
552 be running (<B
553 CLASS="COMMAND"
554 >winbindd</B
555 > will only be running if you have ao previous Winbind
556 installation...but why would you be reading tis if that were the case?). To use PAM, you will
557 want to make sure that you have the standard PAM package (for RedHat) which supplies the <TT
558 CLASS="FILENAME"
559 >/etc/pam.d</TT
561 directory structure, including the pam modules are used by pam-aware
562 services, several pam libraries, and the <TT
563 CLASS="FILENAME"
564 >/usr/doc</TT
566 and <TT
567 CLASS="FILENAME"
568 >/usr/man</TT
569 > entries for pam. Samba will require
570 the pam-devel package if you plan to build the <TT
571 CLASS="FILENAME"
572 >pam_winbind.so</TT
573 > library or
574 include the <B
575 CLASS="COMMAND"
576 >--with-pam</B
577 > option to the configure script.
578 This package includes the header files needed to compile pam-aware applications.</P
580 >[I have no idea which Solaris packages are quired for PAM libraries and
581 development files. If you know, please mail me the information and I will include
582 it in the next revision of this HOWTO. --jerry@samba.org]</P
583 ><DIV
584 CLASS="SECT3"
585 ><HR><H3
586 CLASS="SECT3"
588 NAME="AEN117"
589 >Configure and Compile SAMBA</A
590 ></H3
592 >The configuration and compilation of SAMBA is straightforward.</P
594 ><PRE
595 CLASS="PROGRAMLISTING"
596 ><TT
597 CLASS="PROMPT"
598 >root#</TT
599 > <B
600 CLASS="COMMAND"
601 >./configure --with-winbind</B
604 CLASS="PROMPT"
605 >root#</TT
606 > <B
607 CLASS="COMMAND"
608 >make</B
611 CLASS="PROMPT"
612 >root#</TT
613 > <B
614 CLASS="COMMAND"
615 >make install</B
616 ></PRE
617 ></P
619 >This will, by default, install SAMBA in <TT
620 CLASS="FILENAME"
621 >/usr/local/samba</TT
623 See the main SAMBA documentation if you want to install SAMBA somewhere else.
624 It will also build the winbindd executable and NSS library.</P
625 ></DIV
626 ><DIV
627 CLASS="SECT3"
628 ><HR><H3
629 CLASS="SECT3"
631 NAME="AEN130"
632 >Configure <TT
633 CLASS="FILENAME"
634 >nsswitch.conf</TT
635 > and the
636 winbind libraries</A
637 ></H3
639 >The libraries needed to run the <B
640 CLASS="COMMAND"
641 >winbindd</B
642 > daemon
643 through nsswitch need to be copied to their proper locations.</P
645 ><TT
646 CLASS="PROMPT"
647 >root#</TT
648 > <B
649 CLASS="COMMAND"
650 >cp nsswitch/libnss_winbind.so /lib</B
653 CLASS="PROMPT"
654 >root#</TT
655 > <B
656 CLASS="COMMAND"
657 >chmod 755 /lib/libnss_winbind.so</B
658 ></P
660 >It necessary to make the following symbolic link:</P
662 ><TT
663 CLASS="PROMPT"
664 >root#</TT
665 > <B
666 CLASS="COMMAND"
667 >ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2</B
668 ></P
670 >The <TT
671 CLASS="FILENAME"
672 >.2</TT
673 > extension is due to the version of glibc used on your Linux host.
674 for most modern systems, the file extension is correct. However, some other operating systems,
675 Solaris 7/8 being the most common, the destination filename should be replaced with
677 CLASS="FILENAME"
678 >/lib/nss_winbind.so.1</TT
679 ></P
681 >Now, as root edit <TT
682 CLASS="FILENAME"
683 >/etc/nsswitch.conf</TT
684 > to
685 allow user and group entries to be visible from the <B
686 CLASS="COMMAND"
687 >winbindd</B
689 daemon. After editing, the file look appear:</P
691 ><PRE
692 CLASS="PROGRAMLISTING"
693 > passwd: files winbind
694 shadow: files
695 group: files winbind</PRE
696 ></P
697 ></DIV
698 ><DIV
699 CLASS="SECT3"
700 ><HR><H3
701 CLASS="SECT3"
703 NAME="AEN152"
704 >Configure <TT
705 CLASS="FILENAME"
706 >smb.conf</TT
707 ></A
708 ></H3
710 >Several parameters are needed in the smb.conf file to control
711 the behavior of <B
712 CLASS="COMMAND"
713 >winbindd</B
714 >. Configure
716 CLASS="FILENAME"
717 >smb.conf</TT
718 > These are described in more detail in
719 the <A
720 HREF="winbindd.8.html"
721 TARGET="_top"
722 >winbindd(8)</A
723 > man page. My
725 CLASS="FILENAME"
726 >smb.conf</TT
727 > file was modified to
728 include the following entries in the [global] section:</P
730 ><PRE
731 CLASS="PROGRAMLISTING"
732 >[global]
733 &#60;...&#62;
734 # separate domain and username with '+', like DOMAIN+username
736 HREF="winbindd.8.html#WINBINDSEPARATOR"
737 TARGET="_top"
738 >winbind separator</A
739 > = +
740 # use uids from 10000 to 20000 for domain users
742 HREF="winbindd.8.html#WINBINDUID"
743 TARGET="_top"
744 >winbind uid</A
745 > = 10000-20000
746 # use gids from 10000 to 20000 for domain groups
748 HREF="winbindd.8.html#WINBINDGID"
749 TARGET="_top"
750 >winbind gid</A
751 > = 10000-20000
752 # allow enumeration of winbind users and groups
753 # might need to disable these next two for performance
754 # reasons on the winbindd host
756 HREF="winbindd.8.html#WINBINDENUMUSERS"
757 TARGET="_top"
758 >winbind enum users</A
759 > = yes
761 HREF="winbindd.8.html#WINBINDENUMGROUP"
762 TARGET="_top"
763 >winbind enum groups</A
764 > = yes
765 # give winbind users a real shell (only needed if they have telnet/sshd/etc... access)
767 HREF="winbindd.8.html#TEMPLATEHOMEDIR"
768 TARGET="_top"
769 >template homedir</A
770 > = /home/winnt/%D/%U
772 HREF="winbindd.8.html#TEMPLATESHELL"
773 TARGET="_top"
774 >template shell</A
775 > = /bin/bash</PRE
776 ></P
777 ></DIV
778 ><DIV
779 CLASS="SECT3"
780 ><HR><H3
781 CLASS="SECT3"
783 NAME="AEN169"
784 >Join the SAMBA server to the PDC domain</A
785 ></H3
787 >Enter the following command to make the SAMBA server join the
788 PDC domain, where <TT
789 CLASS="REPLACEABLE"
791 >DOMAIN</I
792 ></TT
793 > is the name of
794 your Windows domain and <TT
795 CLASS="REPLACEABLE"
797 >Administrator</I
798 ></TT
799 > is
800 a domain user who has administrative privileges in the domain.</P
802 ><TT
803 CLASS="PROMPT"
804 >root#</TT
805 > <B
806 CLASS="COMMAND"
807 >/usr/local/samba/bin/smbpasswd -j DOMAIN -r PDC -U Administrator</B
808 ></P
810 >The proper response to the command should be: "Joined the domain
812 CLASS="REPLACEABLE"
814 >DOMAIN</I
815 ></TT
816 >" where <TT
817 CLASS="REPLACEABLE"
819 >DOMAIN</I
820 ></TT
822 is your DOMAIN name.</P
823 ></DIV
824 ><DIV
825 CLASS="SECT3"
826 ><HR><H3
827 CLASS="SECT3"
829 NAME="AEN180"
830 >Start up the winbindd daemon and test it!</A
831 ></H3
833 >Eventually, you will want to modify your smb startup script to
834 automatically invoke the winbindd daemon when the other parts of
835 SAMBA start, but it is possible to test out just the winbind
836 portion first. To start up winbind services, enter the following
837 command as root:</P
839 ><TT
840 CLASS="PROMPT"
841 >root#</TT
842 > <B
843 CLASS="COMMAND"
844 >export PATH=$PATH:/usr/local/samba/bin</B
847 CLASS="PROMPT"
848 >root#</TT
849 > <B
850 CLASS="COMMAND"
851 >winbindd</B
852 ></P
854 >I'm always paranoid and like to make sure the daemon
855 is really running...</P
857 ><TT
858 CLASS="PROMPT"
859 >root#</TT
860 > <B
861 CLASS="COMMAND"
862 >ps -ae | grep winbindd</B
863 ></P
865 >This command should produce output like this, if the daemon is running</P
867 >3025 ? 00:00:00 winbindd</P
869 >Note that a sample RedHat init script for starting winbindd is included in
870 the SAMBA sourse distribution as <TT
871 CLASS="FILENAME"
872 >packaging/RedHat/winbind.init</TT
873 >.</P
875 >Now... for the real test, try to get some information about the
876 users on your PDC</P
878 ><TT
879 CLASS="PROMPT"
880 >root#</TT
881 > <B
882 CLASS="COMMAND"
883 >wbinfo -u</B
884 ></P
886 >This should echo back a list of users on your Windows users on
887 your PDC. For example, I get the following response:</P
889 ><PRE
890 CLASS="PROGRAMLISTING"
891 >CEO+Administrator
892 CEO+burdell
893 CEO+Guest
894 CEO+jt-ad
895 CEO+krbtgt
896 CEO+TsInternetUser</PRE
897 ></P
899 >Obviously, I have named my domain 'CEO' and my <TT
900 CLASS="PARAMETER"
902 >winbind
903 separator</I
904 ></TT
905 > is '+'.</P
907 >You can do the same sort of thing to get group information from
908 the PDC:</P
910 ><PRE
911 CLASS="PROGRAMLISTING"
912 ><TT
913 CLASS="PROMPT"
914 >root#</TT
915 > <B
916 CLASS="COMMAND"
917 >/usr/local/samba/bin/wbinfo -g</B
919 CEO+Domain Admins
920 CEO+Domain Users
921 CEO+Domain Guests
922 CEO+Domain Computers
923 CEO+Domain Controllers
924 CEO+Cert Publishers
925 CEO+Schema Admins
926 CEO+Enterprise Admins
927 CEO+Group Policy Creator Owners</PRE
928 ></P
930 >The function 'getent' can now be used to get unified
931 lists of both local and PDC users and groups.
932 Try the following command:</P
934 ><TT
935 CLASS="PROMPT"
936 >root#</TT
937 > <B
938 CLASS="COMMAND"
939 >getent passwd</B
940 ></P
942 >You should get a list that looks like your <TT
943 CLASS="FILENAME"
944 >/etc/passwd</TT
946 list followed by the domain users with their new uids, gids, home
947 directories and default shells. If you do not, verify that the permissions on the
948 libnss_winbind.so library are <TT
949 CLASS="FILENAME"
950 >rwxr-xr-x</TT
951 >.</P
953 >The same thing can be done for groups with the command</P
955 ><TT
956 CLASS="PROMPT"
957 >root#</TT
958 > <B
959 CLASS="COMMAND"
960 >getent group</B
961 ></P
962 ></DIV
963 ><DIV
964 CLASS="SECT3"
965 ><HR><H3
966 CLASS="SECT3"
968 NAME="AEN221"
969 >Configure Winbind and PAM</A
970 ></H3
972 >At this point we are assured that <B
973 CLASS="COMMAND"
974 >winbindd</B
975 > and <B
976 CLASS="COMMAND"
977 >smbd</B
979 are working together. If you want to use winbind to provide authentication for other
980 services, keep reading. The pam configuration files need to be altered in
981 this step. (Did you remember to make backups of your original
983 CLASS="FILENAME"
984 >/etc/pam.d</TT
985 > (or <TT
986 CLASS="FILENAME"
987 >/etc/pam.conf</TT
988 >) file[s]? If not, do it now.)</P
990 >You will need a PAM module to use <B
991 CLASS="COMMAND"
992 >winbindd</B
993 > with these other services. This
994 module will be compiled in the <TT
995 CLASS="FILENAME"
996 >../source/nsswitch</TT
997 > directory
998 by invoking the command</P
1000 ><TT
1001 CLASS="PROMPT"
1002 >root#</TT
1003 > <B
1004 CLASS="COMMAND"
1005 >make nsswitch/pam_winbind.so</B
1006 ></P
1008 >from the <TT
1009 CLASS="FILENAME"
1010 >../source</TT
1011 > directory. The
1013 CLASS="FILENAME"
1014 >pam_winbind.so</TT
1015 > file should be copied to the location of
1016 your other pam security modules. On Linux and Solaris systems, this is the
1018 CLASS="FILENAME"
1019 >/lib/security</TT
1020 > directory.</P
1022 ><TT
1023 CLASS="PROMPT"
1024 >root#</TT
1025 > <B
1026 CLASS="COMMAND"
1027 >cp nsswitch/pam_winbind.so /lib/security</B
1030 CLASS="PROMPT"
1031 >root#</TT
1032 > <B
1033 CLASS="COMMAND"
1034 >chmod 755 /lib/security/pam_winbind.so</B
1035 ></P
1037 >Other services, such as the normal login on the console (or a terminal
1038 session), telnet logins, and ftp service, can be modified to allow the use of winbind
1039 as an authentication service. In order to enable these
1040 services, you may first need to change the entries in
1042 CLASS="FILENAME"
1043 >/etc/xinetd.d</TT
1044 > (or <TT
1045 CLASS="FILENAME"
1046 >/etc/inetd.conf</TT
1048 RedHat 7.1 uses the new xinetd.d structure, in this case you need
1049 to change the lines in <TT
1050 CLASS="FILENAME"
1051 >/etc/xinetd.d/telnet</TT
1053 and <TT
1054 CLASS="FILENAME"
1055 >/etc/xinetd.d/wu-ftp</TT
1056 > from</P
1058 ><PRE
1059 CLASS="PROGRAMLISTING"
1060 >enable = no</PRE
1061 ></P
1063 >to</P
1065 ><PRE
1066 CLASS="PROGRAMLISTING"
1067 >enable = yes</PRE
1068 ></P
1070 >For ftp services to work properly, you will also need to either
1071 have individual directories for the domain users already present on
1072 the server, or change the home directory template to a general
1073 directory for all domain users. These can be easily set using
1074 the <TT
1075 CLASS="FILENAME"
1076 >smb.conf</TT
1077 > global entry
1079 CLASS="COMMAND"
1080 >template homedir</B
1081 >.</P
1083 >The <TT
1084 CLASS="FILENAME"
1085 >/etc/pam.d/ftp</TT
1086 > file can be changed
1087 to allow winbind ftp access in a manner similar to the
1088 samba file. My <TT
1089 CLASS="FILENAME"
1090 >/etc/pam.d/ftp</TT
1091 > file was
1092 changed to look like this:</P
1094 ><PRE
1095 CLASS="PROGRAMLISTING"
1096 >auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
1097 auth sufficient /lib/security/pam_winbind.so
1098 auth required /lib/security/pam_stack.so service=system-auth
1099 auth required /lib/security/pam_shells.so
1100 account sufficient /lib/security/pam_winbind.so
1101 account required /lib/security/pam_stack.so service=system-auth
1102 session required /lib/security/pam_stack.so service=system-auth</PRE
1103 ></P
1105 >The <TT
1106 CLASS="FILENAME"
1107 >/etc/pam.d/login</TT
1108 > file can be changed nearly the
1109 same way. It now looks like this:</P
1111 ><PRE
1112 CLASS="PROGRAMLISTING"
1113 >auth required /lib/security/pam_securetty.so
1114 auth sufficient /lib/security/pam_winbind.so
1115 auth sufficient /lib/security/pam_unix.so use_first_pass
1116 auth required /lib/security/pam_stack.so service=system-auth
1117 auth required /lib/security/pam_nologin.so
1118 account sufficient /lib/security/pam_winbind.so
1119 account required /lib/security/pam_stack.so service=system-auth
1120 password required /lib/security/pam_stack.so service=system-auth
1121 session required /lib/security/pam_stack.so service=system-auth
1122 session optional /lib/security/pam_console.so</PRE
1123 ></P
1125 >In this case, I added the <B
1126 CLASS="COMMAND"
1127 >auth sufficient /lib/security/pam_winbind.so</B
1129 lines as before, but also added the <B
1130 CLASS="COMMAND"
1131 >required pam_securetty.so</B
1133 above it, to disallow root logins over the network. I also added a
1135 CLASS="COMMAND"
1136 >sufficient /lib/security/pam_unix.so use_first_pass</B
1138 line after the <B
1139 CLASS="COMMAND"
1140 >winbind.so</B
1141 > line to get rid of annoying
1142 double prompts for passwords.</P
1144 >Note that a Solaris <TT
1145 CLASS="FILENAME"
1146 >/etc/pam.conf</TT
1147 > confiruation file looks
1148 very similar to this except thaty the service name is included as the first entry
1149 per line. An example for the login service is given here.</P
1151 ><PRE
1152 CLASS="PROGRAMLISTING"
1153 >## excerpt from /etc/pam.conf on a Solaris 8 system
1154 login auth required /lib/security/pam_winbind.so
1155 login auth required /lib/security/$ISA/pam_unix.so.1 try_first_pass
1156 login auth required /lib/security/$ISA/pam_dial_auth.so.1 try_first_pass</PRE
1157 ></P
1158 ></DIV
1159 ></DIV
1160 ></DIV
1161 ><DIV
1162 CLASS="SECT1"
1163 ><HR><H1
1164 CLASS="SECT1"
1166 NAME="AEN274"
1167 >Limitations</A
1168 ></H1
1170 >Winbind has a number of limitations in its current
1171 released version that we hope to overcome in future
1172 releases:</P
1174 ></P
1175 ><UL
1176 ><LI
1178 >The mappings of Windows NT RIDs to UNIX ids
1179 is not made algorithmically and depends on the order in which
1180 unmapped users or groups are seen by winbind. It may be difficult
1181 to recover the mappings of rid to UNIX id mapping if the file
1182 containing this information is corrupted or destroyed.</P
1183 ></LI
1184 ><LI
1186 >Currently the winbind PAM module does not take
1187 into account possible workstation and logon time restrictions
1188 that may be been set for Windows NT users.</P
1189 ></LI
1190 ></UL
1191 ></DIV
1192 ><DIV
1193 CLASS="SECT1"
1194 ><HR><H1
1195 CLASS="SECT1"
1197 NAME="AEN282"
1198 >Conclusion</A
1199 ></H1
1201 >The winbind system, through the use of the Name Service
1202 Switch, Pluggable Authentication Modules, and appropriate
1203 Microsoft RPC calls have allowed us to provide seamless
1204 integration of Microsoft Windows NT domain users on a
1205 UNIX system. The result is a great reduction in the administrative
1206 cost of running a mixed UNIX and NT network.</P
1207 ></DIV
1208 ></DIV
1209 ></BODY
1210 ></HTML