7 <firstname>Tim
</firstname><surname>Potter
</surname>
9 <orgname>Samba Team
</orgname>
10 <address><email>tpot@linuxcare.com.au
</email></address>
14 <firstname>Andrew
</firstname><surname>Tridgell
</surname>
16 <orgname>Samba Team
</orgname>
17 <address><email>tridge@linuxcare.com.au
</email></address>
21 <firstname>John
</firstname><surname>Trostel
</surname>
23 <orgname>Snapserver
</orgname>
24 <address><email>jtrostel@snapserver.com
</email></address>
28 <firstname>Naag
</firstname><surname>Mummaneni
</surname>
30 <address><email>getnag@rediffmail.com
</email></address>
34 <firstname>Jelmer
</firstname><surname>Vernooij
</surname>
36 <address><email>jelmer@nl.linux.org
</email></address>
40 <pubdate>27 June
2002</pubdate>
43 <title>Unified Logons between Windows NT and UNIX using Winbind
</title>
46 <title>Abstract
</title>
48 <para>Integration of UNIX and Microsoft Windows NT through
49 a unified logon has been considered a
"holy grail" in heterogeneous
50 computing environments for a long time. We present
51 <emphasis>winbind
</emphasis>, a component of the Samba suite
52 of programs as a solution to the unified logon problem. Winbind
53 uses a UNIX implementation
54 of Microsoft RPC calls, Pluggable Authentication Modules, and the Name
55 Service Switch to allow Windows NT domain users to appear and operate
56 as UNIX users on a UNIX machine. This paper describes the winbind
57 system, explaining the functionality it provides, how it is configured,
58 and how it works internally.
</para>
63 <title>Introduction
</title>
65 <para>It is well known that UNIX and Microsoft Windows NT have
66 different models for representing user and group information and
67 use different technologies for implementing them. This fact has
68 made it difficult to integrate the two systems in a satisfactory
71 <para>One common solution in use today has been to create
72 identically named user accounts on both the UNIX and Windows systems
73 and use the Samba suite of programs to provide file and print services
74 between the two. This solution is far from perfect however, as
75 adding and deleting users on both sets of machines becomes a chore
76 and two sets of passwords are required both of which
77 can lead to synchronization problems between the UNIX and Windows
78 systems and confusion for users.
</para>
80 <para>We divide the unified logon problem for UNIX machines into
81 three smaller problems:
</para>
84 <listitem><para>Obtaining Windows NT user and group information
87 <listitem><para>Authenticating Windows NT users
90 <listitem><para>Password changing for Windows NT users
95 <para>Ideally, a prospective solution to the unified logon problem
96 would satisfy all the above components without duplication of
97 information on the UNIX machines and without creating additional
98 tasks for the system administrator when maintaining users and
99 groups on either system. The winbind system provides a simple
100 and elegant solution to all three components of the unified logon
106 <title>What Winbind Provides
</title>
108 <para>Winbind unifies UNIX and Windows NT account management by
109 allowing a UNIX box to become a full member of a NT domain. Once
110 this is done the UNIX box will see NT users and groups as if
111 they were native UNIX users and groups, allowing the NT domain
112 to be used in much the same manner that NIS+ is used within
113 UNIX-only environments.
</para>
115 <para>The end result is that whenever any
116 program on the UNIX machine asks the operating system to lookup
117 a user or group name, the query will be resolved by asking the
118 NT domain controller for the specified domain to do the lookup.
119 Because Winbind hooks into the operating system at a low level
120 (via the NSS name resolution modules in the C library) this
121 redirection to the NT domain controller is completely
124 <para>Users on the UNIX machine can then use NT user and group
125 names as they would use
"native" UNIX names. They can chown files
126 so that they are owned by NT domain users or even login to the
127 UNIX machine and run a UNIX X-Window session as a domain user.
</para>
129 <para>The only obvious indication that Winbind is being used is
130 that user and group names take the form DOMAIN\user and
131 DOMAIN\group. This is necessary as it allows Winbind to determine
132 that redirection to a domain controller is wanted for a particular
133 lookup and which trusted domain is being referenced.
</para>
135 <para>Additionally, Winbind provides an authentication service
136 that hooks into the Pluggable Authentication Modules (PAM) system
137 to provide authentication via a NT domain to any PAM enabled
138 applications. This capability solves the problem of synchronizing
139 passwords between systems since all passwords are stored in a single
140 location (on the domain controller).
</para>
143 <title>Target Uses
</title>
145 <para>Winbind is targeted at organizations that have an
146 existing NT based domain infrastructure into which they wish
147 to put UNIX workstations or servers. Winbind will allow these
148 organizations to deploy UNIX workstations without having to
149 maintain a separate account infrastructure. This greatly
150 simplifies the administrative overhead of deploying UNIX
151 workstations into a NT based organization.
</para>
153 <para>Another interesting way in which we expect Winbind to
154 be used is as a central part of UNIX based appliances. Appliances
155 that provide file and print services to Microsoft based networks
156 will be able to use Winbind to provide seamless integration of
157 the appliance into the domain.
</para>
164 <title>How Winbind Works
</title>
166 <para>The winbind system is designed around a client/server
167 architecture. A long running
<command>winbindd
</command> daemon
168 listens on a UNIX domain socket waiting for requests
169 to arrive. These requests are generated by the NSS and PAM
170 clients and processed sequentially.
</para>
172 <para>The technologies used to implement winbind are described
173 in detail below.
</para>
176 <title>Microsoft Remote Procedure Calls
</title>
178 <para>Over the last two years, efforts have been underway
179 by various Samba Team members to decode various aspects of
180 the Microsoft Remote Procedure Call (MSRPC) system. This
181 system is used for most network related operations between
182 Windows NT machines including remote management, user authentication
183 and print spooling. Although initially this work was done
184 to aid the implementation of Primary Domain Controller (PDC)
185 functionality in Samba, it has also yielded a body of code which
186 can be used for other purposes.
</para>
188 <para>Winbind uses various MSRPC calls to enumerate domain users
189 and groups and to obtain detailed information about individual
190 users or groups. Other MSRPC calls can be used to authenticate
191 NT domain users and to change user passwords. By directly querying
192 a Windows PDC for user and group information, winbind maps the
193 NT account information onto UNIX user and group names.
</para>
197 <title>Name Service Switch
</title>
199 <para>The Name Service Switch, or NSS, is a feature that is
200 present in many UNIX operating systems. It allows system
201 information such as hostnames, mail aliases and user information
202 to be resolved from different sources. For example, a standalone
203 UNIX workstation may resolve system information from a series of
204 flat files stored on the local filesystem. A networked workstation
205 may first attempt to resolve system information from local files,
206 and then consult a NIS database for user information or a DNS server
207 for hostname information.
</para>
209 <para>The NSS application programming interface allows winbind
210 to present itself as a source of system information when
211 resolving UNIX usernames and groups. Winbind uses this interface,
212 and information obtained from a Windows NT server using MSRPC
213 calls to provide a new source of account enumeration. Using standard
214 UNIX library calls, one can enumerate the users and groups on
215 a UNIX machine running winbind and see all users and groups in
216 a NT domain plus any trusted domain as though they were local
217 users and groups.
</para>
219 <para>The primary control file for NSS is
220 <filename>/etc/nsswitch.conf
</filename>.
221 When a UNIX application makes a request to do a lookup
222 the C library looks in
<filename>/etc/nsswitch.conf
</filename>
223 for a line which matches the service type being requested, for
224 example the
"passwd" service type is used when user or group names
225 are looked up. This config line species which implementations
226 of that service should be tried and in what order. If the passwd
227 config line is:
</para>
229 <para><command>passwd: files example
</command></para>
231 <para>then the C library will first load a module called
232 <filename>/lib/libnss_files.so
</filename> followed by
233 the module
<filename>/lib/libnss_example.so
</filename>. The
234 C library will dynamically load each of these modules in turn
235 and call resolver functions within the modules to try to resolve
236 the request. Once the request is resolved the C library returns the
237 result to the application.
</para>
239 <para>This NSS interface provides a very easy way for Winbind
240 to hook into the operating system. All that needs to be done
241 is to put
<filename>libnss_winbind.so
</filename> in
<filename>/lib/
</filename>
242 then add
"winbind" into
<filename>/etc/nsswitch.conf
</filename> at
243 the appropriate place. The C library will then call Winbind to
244 resolve user and group names.
</para>
248 <title>Pluggable Authentication Modules
</title>
250 <para>Pluggable Authentication Modules, also known as PAM,
251 is a system for abstracting authentication and authorization
252 technologies. With a PAM module it is possible to specify different
253 authentication methods for different system applications without
254 having to recompile these applications. PAM is also useful
255 for implementing a particular policy for authorization. For example,
256 a system administrator may only allow console logins from users
257 stored in the local password file but only allow users resolved from
258 a NIS database to log in over the network.
</para>
260 <para>Winbind uses the authentication management and password
261 management PAM interface to integrate Windows NT users into a
262 UNIX system. This allows Windows NT users to log in to a UNIX
263 machine and be authenticated against a suitable Primary Domain
264 Controller. These users can also change their passwords and have
265 this change take effect directly on the Primary Domain Controller.
268 <para>PAM is configured by providing control files in the directory
269 <filename>/etc/pam.d/
</filename> for each of the services that
270 require authentication. When an authentication request is made
271 by an application the PAM code in the C library looks up this
272 control file to determine what modules to load to do the
273 authentication check and in what order. This interface makes adding
274 a new authentication service for Winbind very easy, all that needs
275 to be done is that the
<filename>pam_winbind.so
</filename> module
276 is copied to
<filename>/lib/security/
</filename> and the PAM
277 control files for relevant services are updated to allow
278 authentication via winbind. See the PAM documentation
279 for more details.
</para>
284 <title>User and Group ID Allocation
</title>
286 <para>When a user or group is created under Windows NT
287 is it allocated a numerical relative identifier (RID). This is
288 slightly different to UNIX which has a range of numbers that are
289 used to identify users, and the same range in which to identify
290 groups. It is winbind's job to convert RIDs to UNIX id numbers and
291 vice versa. When winbind is configured it is given part of the UNIX
292 user id space and a part of the UNIX group id space in which to
293 store Windows NT users and groups. If a Windows NT user is
294 resolved for the first time, it is allocated the next UNIX id from
295 the range. The same process applies for Windows NT groups. Over
296 time, winbind will have mapped all Windows NT users and groups
297 to UNIX user ids and group ids.
</para>
299 <para>The results of this mapping are stored persistently in
300 an ID mapping database held in a tdb database). This ensures that
301 RIDs are mapped to UNIX IDs in a consistent way.
</para>
306 <title>Result Caching
</title>
308 <para>An active system can generate a lot of user and group
309 name lookups. To reduce the network cost of these lookups winbind
310 uses a caching scheme based on the SAM sequence number supplied
311 by NT domain controllers. User or group information returned
312 by a PDC is cached by winbind along with a sequence number also
313 returned by the PDC. This sequence number is incremented by
314 Windows NT whenever any user or group information is modified. If
315 a cached entry has expired, the sequence number is requested from
316 the PDC and compared against the sequence number of the cached entry.
317 If the sequence numbers do not match, then the cached information
318 is discarded and up to date information is requested directly
325 <title>Installation and Configuration
</title>
328 Many thanks to John Trostel
<ulink
329 url=
"mailto:jtrostel@snapserver.com">jtrostel@snapserver.com
</ulink>
330 for providing the HOWTO for this section.
334 This HOWTO describes how to get winbind services up and running
335 to control access and authenticate users on your Linux box using
336 the winbind services which come with SAMBA
2.2.2.
340 There is also some Solaris specific information in
341 <filename>docs/textdocs/Solaris-Winbind-HOWTO.txt
</filename>.
342 Future revisions of this document will incorporate that
349 <title>Introduction
</title>
352 This HOWTO describes the procedures used to get winbind up and
353 running on my RedHat
7.1 system. Winbind is capable of providing access
354 and authentication control for Windows Domain users through an NT
355 or Win2K PDC for 'regular' services, such as telnet a nd ftp, as
356 well for SAMBA services.
360 This HOWTO has been written from a 'RedHat-centric' perspective, so if
361 you are using another distribution, you may have to modify the instructions
362 somewhat to fit the way your distribution works.
369 <emphasis>Why should I to this?
</emphasis>
372 <para>This allows the SAMBA administrator to rely on the
373 authentication mechanisms on the NT/Win2K PDC for the authentication
374 of domain members. NT/Win2K users no longer need to have separate
375 accounts on the SAMBA server.
381 <emphasis>Who should be reading this document?
</emphasis>
385 This HOWTO is designed for system administrators. If you are
386 implementing SAMBA on a file server and wish to (fairly easily)
387 integrate existing NT/Win2K users from your PDC onto the
388 SAMBA server, this HOWTO is for you. That said, I am no NT or PAM
389 expert, so you may find a better or easier way to accomplish
398 <title>Requirements
</title>
401 If you have a samba configuration file that you are currently
402 using...
<emphasis>BACK IT UP!
</emphasis> If your system already uses PAM,
403 <emphasis>back up the
<filename>/etc/pam.d
</filename> directory
404 contents!
</emphasis> If you haven't already made a boot disk,
405 <emphasis>MAKE ONE NOW!
</emphasis>
409 Messing with the pam configuration files can make it nearly impossible
410 to log in to yourmachine. That's why you want to be able to boot back
411 into your machine in single user mode and restore your
412 <filename>/etc/pam.d
</filename> back to the original state they were in if
413 you get frustrated with the way things are going. ;-)
417 The latest version of SAMBA (version
3.0 as of this writing), now
418 includes a functioning winbindd daemon. Please refer to the
419 <ulink url=
"http://samba.org/">main SAMBA web page
</ulink> or,
420 better yet, your closest SAMBA mirror site for instructions on
421 downloading the source code.
425 To allow Domain users the ability to access SAMBA shares and
426 files, as well as potentially other services provided by your
427 SAMBA machine, PAM (pluggable authentication modules) must
428 be setup properly on your machine. In order to compile the
429 winbind modules, you should have at least the pam libraries resident
430 on your system. For recent RedHat systems (
7.1, for instance), that
431 means
<filename>pam-
0.74-
22</filename>. For best results, it is helpful to also
432 install the development packages in
<filename>pam-devel-
0.74-
22</filename>.
439 <title>Testing Things Out
</title>
442 Before starting, it is probably best to kill off all the SAMBA
443 related daemons running on your server. Kill off all
<command>smbd
</command>,
444 <command>nmbd
</command>, and
<command>winbindd
</command> processes that may
445 be running. To use PAM, you will want to make sure that you have the
446 standard PAM package (for RedHat) which supplies the
<filename>/etc/pam.d
</filename>
447 directory structure, including the pam modules are used by pam-aware
448 services, several pam libraries, and the
<filename>/usr/doc
</filename>
449 and
<filename>/usr/man
</filename> entries for pam. Winbind built better
450 in SAMBA if the pam-devel package was also installed. This package includes
451 the header files needed to compile pam-aware applications. For instance,
452 my RedHat system has both
<filename>pam-
0.74-
22</filename> and
453 <filename>pam-devel-
0.74-
22</filename> RPMs installed.
457 <title>Configure and compile SAMBA
</title>
460 The configuration and compilation of SAMBA is pretty straightforward.
461 The first three steps may not be necessary depending upon
462 whether or not you have previously built the Samba binaries.
465 <para><programlisting>
466 <prompt>root#
</prompt> <command>autoconf
</command>
467 <prompt>root#
</prompt> <command>make clean
</command>
468 <prompt>root#
</prompt> <command>rm config.cache
</command>
469 <prompt>root#
</prompt> <command>./configure --with-winbind
</command>
470 <prompt>root#
</prompt> <command>make
</command>
471 <prompt>root#
</prompt> <command>make install
</command>
472 </programlisting></para>
476 This will, by default, install SAMBA in
<filename>/usr/local/samba
</filename>.
477 See the main SAMBA documentation if you want to install SAMBA somewhere else.
478 It will also build the winbindd executable and libraries.
484 <title>Configure
<filename>nsswitch.conf
</filename> and the
485 winbind libraries
</title>
488 The libraries needed to run the
<command>winbindd
</command> daemon
489 through nsswitch need to be copied to their proper locations, so
493 <prompt>root#
</prompt> <command>cp ../samba/source/nsswitch/libnss_winbind.so /lib
</command>
497 I also found it necessary to make the following symbolic link:
501 <prompt>root#
</prompt> <command>ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so
.2</command>
504 <para>And, in the case of Sun solaris:
</para>
506 <prompt>root#
</prompt> <command>ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so
.1</command>
507 <prompt>root#
</prompt> <command>ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so
.1</command>
508 <prompt>root#
</prompt> <command>ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so
.2</command>
512 Now, as root you need to edit
<filename>/etc/nsswitch.conf
</filename> to
513 allow user and group entries to be visible from the
<command>winbindd
</command>
514 daemon. My
<filename>/etc/nsswitch.conf
</filename> file look like
518 <para><programlisting>
519 passwd: files winbind
522 </programlisting></para>
525 The libraries needed by the winbind daemon will be automatically
526 entered into the
<command>ldconfig
</command> cache the next time
527 your system reboots, but it
528 is faster (and you don't need to reboot) if you do it manually:
532 <prompt>root#
</prompt> <command>/sbin/ldconfig -v | grep winbind
</command>
536 This makes
<filename>libnss_winbind
</filename> available to winbindd
537 and echos back a check to you.
544 <title>Configure smb.conf
</title>
547 Several parameters are needed in the smb.conf file to control
548 the behavior of
<command>winbindd
</command>. Configure
549 <filename>smb.conf
</filename> These are described in more detail in
550 the
<ulink url=
"winbindd.8.html">winbindd(
8)
</ulink> man page. My
551 <filename>smb.conf
</filename> file was modified to
552 include the following entries in the [global] section:
555 <para><programlisting>
558 # separate domain and username with '+', like DOMAIN+username
559 <ulink url=
"winbindd.8.html#WINBINDSEPARATOR">winbind separator
</ulink> = +
560 # use uids from
10000 to
20000 for domain users
561 <ulink url=
"winbindd.8.html#WINBINDUID">winbind uid
</ulink> =
10000-
20000
562 # use gids from
10000 to
20000 for domain groups
563 <ulink url=
"winbindd.8.html#WINBINDGID">winbind gid
</ulink> =
10000-
20000
564 # allow enumeration of winbind users and groups
565 <ulink url=
"winbindd.8.html#WINBINDENUMUSERS">winbind enum users
</ulink> = yes
566 <ulink url=
"winbindd.8.html#WINBINDENUMGROUP">winbind enum groups
</ulink> = yes
567 # give winbind users a real shell (only needed if they have telnet access)
568 <ulink url=
"winbindd.8.html#TEMPLATEHOMEDIR">template homedir
</ulink> = /home/winnt/%D/%U
569 <ulink url=
"winbindd.8.html#TEMPLATESHELL">template shell
</ulink> = /bin/bash
570 </programlisting></para>
576 <title>Join the SAMBA server to the PDC domain
</title>
579 Enter the following command to make the SAMBA server join the
580 PDC domain, where
<replaceable>DOMAIN
</replaceable> is the name of
581 your Windows domain and
<replaceable>Administrator
</replaceable> is
582 a domain user who has administrative privileges in the domain.
587 <prompt>root#
</prompt> <command>/usr/local/samba/bin/net rpc join -S PDC -U Administrator
</command>
592 The proper response to the command should be:
"Joined the domain
593 <replaceable>DOMAIN</replaceable>" where
<replaceable>DOMAIN
</replaceable>
601 <title>Start up the winbindd daemon and test it!
</title>
604 Eventually, you will want to modify your smb startup script to
605 automatically invoke the winbindd daemon when the other parts of
606 SAMBA start, but it is possible to test out just the winbind
607 portion first. To start up winbind services, enter the following
612 <prompt>root#
</prompt> <command>/usr/local/samba/bin/winbindd
</command>
616 I'm always paranoid and like to make sure the daemon
621 <prompt>root#
</prompt> <command>ps -ae | grep winbindd
</command>
624 This command should produce output like this, if the daemon is running
627 3025 ?
00:
00:
00 winbindd
631 Now... for the real test, try to get some information about the
636 <prompt>root#
</prompt> <command>/usr/local/samba/bin/wbinfo -u
</command>
640 This should echo back a list of users on your Windows users on
641 your PDC. For example, I get the following response:
644 <para><programlisting>
651 </programlisting></para>
654 Obviously, I have named my domain 'CEO' and my
<parameter>winbind
655 separator
</parameter> is '+'.
659 You can do the same sort of thing to get group information from
663 <para><programlisting>
664 <prompt>root#
</prompt> <command>/usr/local/samba/bin/wbinfo -g
</command>
669 CEO+Domain Controllers
672 CEO+Enterprise Admins
673 CEO+Group Policy Creator Owners
674 </programlisting></para>
677 The function 'getent' can now be used to get unified
678 lists of both local and PDC users and groups.
679 Try the following command:
683 <prompt>root#
</prompt> <command>getent passwd
</command>
687 You should get a list that looks like your
<filename>/etc/passwd
</filename>
688 list followed by the domain users with their new uids, gids, home
689 directories and default shells.
693 The same thing can be done for groups with the command
697 <prompt>root#
</prompt> <command>getent group
</command>
704 <title>Fix the init.d startup scripts
</title>
710 The
<command>winbindd
</command> daemon needs to start up after the
711 <command>smbd
</command> and
<command>nmbd
</command> daemons are running.
712 To accomplish this task, you need to modify the startup scripts of your system. They are located at
<filename>/etc/init.d/smb
</filename> in RedHat and
713 <filename>/etc/init.d/samba
</filename> in Debian.
714 script to add commands to invoke this daemon in the proper sequence. My
715 startup script starts up
<command>smbd
</command>,
716 <command>nmbd
</command>, and
<command>winbindd
</command> from the
717 <filename>/usr/local/samba/bin
</filename> directory directly. The 'start'
718 function in the script looks like this:
721 <para><programlisting>
724 echo -n $
"Starting $KIND services: "
725 daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
729 echo -n $
"Starting $KIND services: "
730 daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
734 echo -n $
"Starting $KIND services: "
735 daemon /usr/local/samba/bin/winbindd
738 [ $RETVAL -eq
0 -a $RETVAL2 -eq
0 -a $RETVAL3 -eq
0 ]
&& touch /var/lock/subsys/smb || \
742 </programlisting></para>
745 The 'stop' function has a corresponding entry to shut down the
746 services and look s like this:
749 <para><programlisting>
752 echo -n $
"Shutting down $KIND services: "
757 echo -n $
"Shutting down $KIND services: "
762 echo -n $
"Shutting down $KIND services: "
765 [ $RETVAL -eq
0 -a $RETVAL2 -eq
0 -a $RETVAL3 -eq
0 ]
&& rm -f /var/lock/subsys/smb
769 </programlisting></para>
773 <title>Solaris
</title>
775 <para>On solaris, you need to modify the
776 <filename>/etc/init.d/samba.server
</filename> startup script. It usually
777 only starts smbd and nmbd but should now start winbindd too. If you
778 have samba installed in
<filename>/usr/local/samba/bin
</filename>,
779 the file could contains something like this:
782 <para><programlisting>
788 then # /usr not mounted
792 killproc() { # kill the named process(es)
793 pid=`/usr/bin/ps -e |
794 /usr/bin/grep -w $
1 |
795 /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
796 [
"$pid" !=
"" ]
&& kill $pid
799 # Start/stop processes required for samba server
805 # Edit these lines to suit your installation (paths, workgroup, host)
808 /usr/local/samba/bin/smbd -D -s \
809 /usr/local/samba/smb.conf
812 /usr/local/samba/bin/nmbd -D -l \
813 /usr/local/samba/var/log -s /usr/local/samba/smb.conf
815 echo Starting Winbind Daemon
816 /usr/local/samba/bin/winbindd
826 echo
"Usage: /etc/init.d/samba.server { start | stop }"
829 </programlisting></para>
833 <title>Restarting
</title>
835 If you restart the
<command>smbd
</command>,
<command>nmbd
</command>,
836 and
<command>winbindd
</command> daemons at this point, you
837 should be able to connect to the samba server as a domain member just as
838 if you were a local user.
844 <title>Configure Winbind and PAM
</title>
847 If you have made it this far, you know that winbindd and samba are working
848 together. If you want to use winbind to provide authentication for other
849 services, keep reading. The pam configuration files need to be altered in
850 this step. (Did you remember to make backups of your original
851 <filename>/etc/pam.d
</filename> files? If not, do it now.)
855 You will need a pam module to use winbindd with these other services. This
856 module will be compiled in the
<filename>../source/nsswitch
</filename> directory
857 by invoking the command
861 <prompt>root#
</prompt> <command>make nsswitch/pam_winbind.so
</command>
865 from the
<filename>../source
</filename> directory. The
866 <filename>pam_winbind.so
</filename> file should be copied to the location of
867 your other pam security modules. On my RedHat system, this was the
868 <filename>/lib/security
</filename> directory. On Solaris, the pam security
869 modules reside in
<filename>/usr/lib/security
</filename>.
873 <prompt>root#
</prompt> <command>cp ../samba/source/nsswitch/pam_winbind.so /lib/security
</command>
877 <title>Linux/FreeBSD-specific PAM configuration
</title>
880 The
<filename>/etc/pam.d/samba
</filename> file does not need to be changed. I
881 just left this fileas it was:
885 <para><programlisting>
886 auth required /lib/security/pam_stack.so service=system-auth
887 account required /lib/security/pam_stack.so service=system-auth
888 </programlisting></para>
891 The other services that I modified to allow the use of winbind
892 as an authentication service were the normal login on the console (or a terminal
893 session), telnet logins, and ftp service. In order to enable these
894 services, you may first need to change the entries in
895 <filename>/etc/xinetd.d
</filename> (or
<filename>/etc/inetd.conf
</filename>).
896 RedHat
7.1 uses the new xinetd.d structure, in this case you need
897 to change the lines in
<filename>/etc/xinetd.d/telnet
</filename>
898 and
<filename>/etc/xinetd.d/wu-ftp
</filename> from
901 <para><programlisting>
903 </programlisting></para>
909 <para><programlisting>
911 </programlisting></para>
914 For ftp services to work properly, you will also need to either
915 have individual directories for the domain users already present on
916 the server, or change the home directory template to a general
917 directory for all domain users. These can be easily set using
918 the
<filename>smb.conf
</filename> global entry
919 <command>template homedir
</command>.
923 The
<filename>/etc/pam.d/ftp
</filename> file can be changed
924 to allow winbind ftp access in a manner similar to the
925 samba file. My
<filename>/etc/pam.d/ftp
</filename> file was
926 changed to look like this:
929 <para><programlisting>
930 auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
931 auth sufficient /lib/security/pam_winbind.so
932 auth required /lib/security/pam_stack.so service=system-auth
933 auth required /lib/security/pam_shells.so
934 account sufficient /lib/security/pam_winbind.so
935 account required /lib/security/pam_stack.so service=system-auth
936 session required /lib/security/pam_stack.so service=system-auth
937 </programlisting></para>
940 The
<filename>/etc/pam.d/login
</filename> file can be changed nearly the
941 same way. It now looks like this:
944 <para><programlisting>
945 auth required /lib/security/pam_securetty.so
946 auth sufficient /lib/security/pam_winbind.so
947 auth sufficient /lib/security/pam_unix.so use_first_pass
948 auth required /lib/security/pam_stack.so service=system-auth
949 auth required /lib/security/pam_nologin.so
950 account sufficient /lib/security/pam_winbind.so
951 account required /lib/security/pam_stack.so service=system-auth
952 password required /lib/security/pam_stack.so service=system-auth
953 session required /lib/security/pam_stack.so service=system-auth
954 session optional /lib/security/pam_console.so
955 </programlisting></para>
958 In this case, I added the
<command>auth sufficient /lib/security/pam_winbind.so
</command>
959 lines as before, but also added the
<command>required pam_securetty.so
</command>
960 above it, to disallow root logins over the network. I also added a
961 <command>sufficient /lib/security/pam_unix.so use_first_pass
</command>
962 line after the
<command>winbind.so
</command> line to get rid of annoying
963 double prompts for passwords.
969 <title>Solaris-specific configuration
</title>
972 The /etc/pam.conf needs to be changed. I changed this file so that my Domain
973 users can logon both locally as well as telnet.The following are the changes
974 that I made.You can customize the pam.conf file as per your requirements,but
975 be sure of those changes because in the worst case it will leave your system
976 nearly impossible to boot.
979 <para><programlisting>
981 #ident
"@(#)pam.conf 1.14 99/09/16 SMI"
983 # Copyright (c)
1996-
1999, Sun Microsystems, Inc.
984 # All Rights Reserved.
988 # Authentication management
990 login auth required /usr/lib/security/pam_winbind.so
991 login auth required /usr/lib/security/$ISA/pam_unix.so
.1 try_first_pass
992 login auth required /usr/lib/security/$ISA/pam_dial_auth.so
.1 try_first_pass
994 rlogin auth sufficient /usr/lib/security/pam_winbind.so
995 rlogin auth sufficient /usr/lib/security/$ISA/pam_rhosts_auth.so
.1
996 rlogin auth required /usr/lib/security/$ISA/pam_unix.so
.1 try_first_pass
998 dtlogin auth sufficient /usr/lib/security/pam_winbind.so
999 dtlogin auth required /usr/lib/security/$ISA/pam_unix.so
.1 try_first_pass
1001 rsh auth required /usr/lib/security/$ISA/pam_rhosts_auth.so
.1
1002 other auth sufficient /usr/lib/security/pam_winbind.so
1003 other auth required /usr/lib/security/$ISA/pam_unix.so
.1 try_first_pass
1005 # Account management
1007 login account sufficient /usr/lib/security/pam_winbind.so
1008 login account requisite /usr/lib/security/$ISA/pam_roles.so
.1
1009 login account required /usr/lib/security/$ISA/pam_unix.so
.1
1011 dtlogin account sufficient /usr/lib/security/pam_winbind.so
1012 dtlogin account requisite /usr/lib/security/$ISA/pam_roles.so
.1
1013 dtlogin account required /usr/lib/security/$ISA/pam_unix.so
.1
1015 other account sufficient /usr/lib/security/pam_winbind.so
1016 other account requisite /usr/lib/security/$ISA/pam_roles.so
.1
1017 other account required /usr/lib/security/$ISA/pam_unix.so
.1
1019 # Session management
1021 other session required /usr/lib/security/$ISA/pam_unix.so
.1
1023 # Password management
1025 #other password sufficient /usr/lib/security/pam_winbind.so
1026 other password required /usr/lib/security/$ISA/pam_unix.so
.1
1027 dtsession auth required /usr/lib/security/$ISA/pam_unix.so
.1
1029 # Support for Kerberos V5 authentication (uncomment to use Kerberos)
1031 #rlogin auth optional /usr/lib/security/$ISA/pam_krb5.so
.1 try_first_pass
1032 #login auth optional /usr/lib/security/$ISA/pam_krb5.so
.1 try_first_pass
1033 #dtlogin auth optional /usr/lib/security/$ISA/pam_krb5.so
.1 try_first_pass
1034 #other auth optional /usr/lib/security/$ISA/pam_krb5.so
.1 try_first_pass
1035 #dtlogin account optional /usr/lib/security/$ISA/pam_krb5.so
.1
1036 #other account optional /usr/lib/security/$ISA/pam_krb5.so
.1
1037 #other session optional /usr/lib/security/$ISA/pam_krb5.so
.1
1038 #other password optional /usr/lib/security/$ISA/pam_krb5.so
.1 try_first_pass
1039 </programlisting></para>
1042 I also added a try_first_pass line after the winbind.so line to get rid of
1043 annoying double prompts for passwords.
1047 Now restart your Samba and try connecting through your application that you
1048 configured in the pam.conf.
1060 <title>Limitations
</title>
1062 <para>Winbind has a number of limitations in its current
1063 released version that we hope to overcome in future
1067 <listitem><para>Winbind is currently only available for
1068 the Linux operating system, although ports to other operating
1069 systems are certainly possible. For such ports to be feasible,
1070 we require the C library of the target operating system to
1071 support the Name Service Switch and Pluggable Authentication
1072 Modules systems. This is becoming more common as NSS and
1073 PAM gain support among UNIX vendors.
</para></listitem>
1075 <listitem><para>The mappings of Windows NT RIDs to UNIX ids
1076 is not made algorithmically and depends on the order in which
1077 unmapped users or groups are seen by winbind. It may be difficult
1078 to recover the mappings of rid to UNIX id mapping if the file
1079 containing this information is corrupted or destroyed.
</para>
1082 <listitem><para>Currently the winbind PAM module does not take
1083 into account possible workstation and logon time restrictions
1084 that may be been set for Windows NT users.
</para></listitem>
1090 <title>Conclusion
</title>
1092 <para>The winbind system, through the use of the Name Service
1093 Switch, Pluggable Authentication Modules, and appropriate
1094 Microsoft RPC calls have allowed us to provide seamless
1095 integration of Microsoft Windows NT domain users on a
1096 UNIX system. The result is a great reduction in the administrative
1097 cost of running a mixed UNIX and NT network.
</para>