1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 24. Winbind: Use of Domain Accounts</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The Official Samba 3.5.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="prev" href="VFS.html" title="Chapter 23. Stackable VFS modules"><link rel="next" href="AdvancedNetworkManagement.html" title="Chapter 25. Advanced Network Management"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Winbind: Use of Domain Accounts</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="VFS.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="AdvancedNetworkManagement.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 24. Winbind: Use of Domain Accounts"><div class="titlepage"><div><div><h2 class="title"><a name="winbind"></a>Chapter 24. Winbind: Use of Domain Accounts</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Tim</span> <span class="surname">Potter</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:tpot@linuxcare.com.au">tpot@linuxcare.com.au</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Andrew</span> <span class="surname">Tridgell</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:tridge@samba.org">tridge@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Naag</span> <span class="surname">Mummaneni</span></h3><span class="contrib">Notes for Solaris</span> <div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:getnag@rediffmail.com">getnag@rediffmail.com</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="surname">Trostel</span></h3><div class="affiliation"><span class="orgname">SNAP<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jtrostel@snapserver.com">jtrostel@snapserver.com</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><p class="pubdate">June 15, 2005</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="winbind.html#id415432">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="winbind.html#id415759">Introduction</a></span></dt><dt><span class="sect1"><a href="winbind.html#id415837">What Winbind Provides</a></span></dt><dd><dl><dt><span class="sect2"><a href="winbind.html#id415975">Target Uses</a></span></dt><dt><span class="sect2"><a href="winbind.html#id416015">Handling of Foreign SIDs</a></span></dt></dl></dd><dt><span class="sect1"><a href="winbind.html#id416127">How Winbind Works</a></span></dt><dd><dl><dt><span class="sect2"><a href="winbind.html#id416174">Microsoft Remote Procedure Calls</a></span></dt><dt><span class="sect2"><a href="winbind.html#id416252">Microsoft Active Directory Services</a></span></dt><dt><span class="sect2"><a href="winbind.html#id416296">Name Service Switch</a></span></dt><dt><span class="sect2"><a href="winbind.html#id416508">Pluggable Authentication Modules</a></span></dt><dt><span class="sect2"><a href="winbind.html#id416649">User and Group ID Allocation</a></span></dt><dt><span class="sect2"><a href="winbind.html#id416717">Result Caching</a></span></dt></dl></dd><dt><span class="sect1"><a href="winbind.html#id416767">Installation and Configuration</a></span></dt><dd><dl><dt><span class="sect2"><a href="winbind.html#id416773">Introduction</a></span></dt><dt><span class="sect2"><a href="winbind.html#id416880">Requirements</a></span></dt><dt><span class="sect2"><a href="winbind.html#id417022">Testing Things Out</a></span></dt></dl></dd><dt><span class="sect1"><a href="winbind.html#id419254">Conclusion</a></span></dt><dt><span class="sect1"><a href="winbind.html#id419300">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="winbind.html#id419333">NSCD Problem Warning</a></span></dt><dt><span class="sect2"><a href="winbind.html#id419367">Winbind Is Not Resolving Users and Groups</a></span></dt></dl></dd></dl></div><div class="sect1" title="Features and Benefits"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id415432"></a>Features and Benefits</h2></div></div></div><p>
|
---|
2 | <a class="indexterm" name="id415440"></a>
|
---|
3 | <a class="indexterm" name="id415447"></a>
|
---|
4 | Integration of UNIX and Microsoft Windows NT through a unified logon has
|
---|
5 | been considered a <span class="quote">“<span class="quote">holy grail</span>”</span> in heterogeneous computing environments for
|
---|
6 | a long time.
|
---|
7 | </p><p>
|
---|
8 | <a class="indexterm" name="id415462"></a>
|
---|
9 | <a class="indexterm" name="id415469"></a>
|
---|
10 | <a class="indexterm" name="id415475"></a>
|
---|
11 | <a class="indexterm" name="id415482"></a>
|
---|
12 | There is one other facility without which UNIX and Microsoft Windows network
|
---|
13 | interoperability would suffer greatly. It is imperative that there be a
|
---|
14 | mechanism for sharing files across UNIX systems and to be able to assign
|
---|
15 | domain user and group ownerships with integrity.
|
---|
16 | </p><p>
|
---|
17 | <a class="indexterm" name="id415495"></a>
|
---|
18 | <a class="indexterm" name="id415504"></a>
|
---|
19 | <a class="indexterm" name="id415510"></a>
|
---|
20 | <a class="indexterm" name="id415517"></a>
|
---|
21 | <span class="emphasis"><em>winbind</em></span> is a component of the Samba suite of programs that
|
---|
22 | solves the unified logon problem. Winbind uses a UNIX implementation of Microsoft
|
---|
23 | RPC calls, Pluggable Authentication Modules (PAMs), and the name service switch (NSS) to
|
---|
24 | allow Windows NT domain users to appear and operate as UNIX users on a UNIX
|
---|
25 | machine. This chapter describes the Winbind system, the functionality
|
---|
26 | it provides, how it is configured, and how it works internally.
|
---|
27 | </p><p>
|
---|
28 | Winbind provides three separate functions:
|
---|
29 | </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
|
---|
30 | <a class="indexterm" name="id415541"></a>
|
---|
31 | <a class="indexterm" name="id415547"></a>
|
---|
32 | Authentication of user credentials (via PAM). This makes it possible to
|
---|
33 | log onto a UNIX/Linux system using user and group accounts from a Windows
|
---|
34 | NT4 (including a Samba domain) or an Active Directory domain.
|
---|
35 | </p></li><li class="listitem"><p>
|
---|
36 | <a class="indexterm" name="id415560"></a>
|
---|
37 | <a class="indexterm" name="id415567"></a>
|
---|
38 | Identity resolution (via NSS). This is the default when winbind is not used.
|
---|
39 | </p></li><li class="listitem"><p>
|
---|
40 | <a class="indexterm" name="id415579"></a>
|
---|
41 | <a class="indexterm" name="id415585"></a>
|
---|
42 | <a class="indexterm" name="id415592"></a>
|
---|
43 | <a class="indexterm" name="id415598"></a>
|
---|
44 | <a class="indexterm" name="id415605"></a>
|
---|
45 | <a class="indexterm" name="id415612"></a>
|
---|
46 | <a class="indexterm" name="id415619"></a>
|
---|
47 | Winbind maintains a database called winbind_idmap.tdb in which it stores
|
---|
48 | mappings between UNIX UIDs, GIDs, and NT SIDs. This mapping is used only
|
---|
49 | for users and groups that do not have a local UID/GID. It stores the UID/GID
|
---|
50 | allocated from the idmap uid/gid range that it has mapped to the NT SID.
|
---|
51 | If <em class="parameter"><code>idmap backend</code></em> has been specified as <code class="constant">ldap:ldap://hostname[:389]</code>,
|
---|
52 | then instead of using a local mapping, Winbind will obtain this information
|
---|
53 | from the LDAP database.
|
---|
54 | </p></li></ul></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
|
---|
55 | <a class="indexterm" name="id415647"></a>
|
---|
56 | <a class="indexterm" name="id415654"></a>
|
---|
57 | <a class="indexterm" name="id415663"></a>
|
---|
58 | <a class="indexterm" name="id415670"></a>
|
---|
59 | <a class="indexterm" name="id415677"></a>
|
---|
60 | <a class="indexterm" name="id415683"></a>
|
---|
61 | If <code class="literal">winbindd</code> is not running, smbd (which calls <code class="literal">winbindd</code>) will fall back to
|
---|
62 | using purely local information from <code class="filename">/etc/passwd</code> and <code class="filename">/etc/group</code> and no dynamic
|
---|
63 | mapping will be used. On an operating system that has been enabled with the NSS,
|
---|
64 | the resolution of user and group information will be accomplished via NSS.
|
---|
65 | </p></div><div class="figure"><a name="winbind_idmap"></a><p class="title"><b>Figure 24.1. Winbind Idmap</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/idmap_winbind_no_loop.png" width="243" alt="Winbind Idmap"></div></div></div><br class="figure-break"></div><div class="sect1" title="Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id415759"></a>Introduction</h2></div></div></div><p>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
|
---|
69 | manner.</p><p>
|
---|
70 | <a class="indexterm" name="id415772"></a>
|
---|
71 | <a class="indexterm" name="id415779"></a>
|
---|
72 | One common solution in use today has been to create
|
---|
73 | identically named user accounts on both the UNIX and Windows systems
|
---|
74 | and use the Samba suite of programs to provide file and print services
|
---|
75 | between the two. This solution is far from perfect, however, because
|
---|
76 | adding and deleting users on both sets of machines becomes a chore,
|
---|
77 | and two sets of passwords are required both of which
|
---|
78 | can lead to synchronization problems between the UNIX and Windows
|
---|
79 | systems and confusion for users.</p><p>We divide the unified logon problem for UNIX machines into
|
---|
80 | three smaller problems:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Obtaining Windows NT user and group information.
|
---|
81 | </p></li><li class="listitem"><p>Authenticating Windows NT users.
|
---|
82 | </p></li><li class="listitem"><p>Password changing for Windows NT users.
|
---|
83 | </p></li></ul></div><p>
|
---|
84 | <a class="indexterm" name="id415818"></a>
|
---|
85 | <a class="indexterm" name="id415824"></a>
|
---|
86 | Ideally, a prospective solution to the unified logon problem
|
---|
87 | would satisfy all the above components without duplication of
|
---|
88 | information on the UNIX machines and without creating additional
|
---|
89 | tasks for the system administrator when maintaining users and
|
---|
90 | groups on either system. The Winbind system provides a simple
|
---|
91 | and elegant solution to all three components of the unified logon
|
---|
92 | problem.</p></div><div class="sect1" title="What Winbind Provides"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id415837"></a>What Winbind Provides</h2></div></div></div><p>
|
---|
93 | <a class="indexterm" name="id415845"></a>
|
---|
94 | <a class="indexterm" name="id415852"></a>
|
---|
95 | <a class="indexterm" name="id415858"></a>
|
---|
96 | <a class="indexterm" name="id415865"></a>
|
---|
97 | Winbind unifies UNIX and Windows NT account management by
|
---|
98 | allowing a UNIX box to become a full member of an NT domain. Once
|
---|
99 | this is done, the UNIX box will see NT users and groups as if
|
---|
100 | they were <span class="quote">“<span class="quote">native</span>”</span> UNIX users and groups, allowing the NT domain
|
---|
101 | to be used in much the same manner that NIS+ is used within
|
---|
102 | UNIX-only environments.</p><p>
|
---|
103 | <a class="indexterm" name="id415882"></a>
|
---|
104 | <a class="indexterm" name="id415888"></a>
|
---|
105 | <a class="indexterm" name="id415895"></a>
|
---|
106 | <a class="indexterm" name="id415902"></a>
|
---|
107 | The end result is that whenever a
|
---|
108 | program on the UNIX machine asks the operating system to look up
|
---|
109 | a user or group name, the query will be resolved by asking the
|
---|
110 | NT domain controller for the specified domain to do the lookup.
|
---|
111 | Because Winbind hooks into the operating system at a low level
|
---|
112 | (via the NSS name resolution modules in the C library), this
|
---|
113 | redirection to the NT domain controller is completely
|
---|
114 | transparent.</p><p>
|
---|
115 | <a class="indexterm" name="id415916"></a>
|
---|
116 | <a class="indexterm" name="id415922"></a>
|
---|
117 | Users on the UNIX machine can then use NT user and group
|
---|
118 | names as they would <span class="quote">“<span class="quote">native</span>”</span> UNIX names. They can chown files
|
---|
119 | so they are owned by NT domain users or even login to the
|
---|
120 | UNIX machine and run a UNIX X-Window session as a domain user.</p><p>
|
---|
121 | <a class="indexterm" name="id415938"></a>
|
---|
122 | The only obvious indication that Winbind is being used is
|
---|
123 | that user and group names take the form <code class="constant">DOMAIN\user</code> and
|
---|
124 | <code class="constant">DOMAIN\group</code>. This is necessary because it allows Winbind to determine
|
---|
125 | that redirection to a domain controller is wanted for a particular
|
---|
126 | lookup and which trusted domain is being referenced.</p><p>
|
---|
127 | <a class="indexterm" name="id415958"></a>
|
---|
128 | <a class="indexterm" name="id415965"></a>
|
---|
129 | Additionally, Winbind provides an authentication service that hooks into the PAM system
|
---|
130 | to provide authentication via an NT domain to any PAM-enabled
|
---|
131 | applications. This capability solves the problem of synchronizing
|
---|
132 | passwords between systems, since all passwords are stored in a single
|
---|
133 | location (on the domain controller).</p><div class="sect2" title="Target Uses"><div class="titlepage"><div><div><h3 class="title"><a name="id415975"></a>Target Uses</h3></div></div></div><p>
|
---|
134 | <a class="indexterm" name="id415983"></a>
|
---|
135 | Winbind is targeted at organizations that have an
|
---|
136 | existing NT-based domain infrastructure into which they wish
|
---|
137 | to put UNIX workstations or servers. Winbind will allow these
|
---|
138 | organizations to deploy UNIX workstations without having to
|
---|
139 | maintain a separate account infrastructure. This greatly
|
---|
140 | simplifies the administrative overhead of deploying UNIX
|
---|
141 | workstations into an NT-based organization.</p><p>
|
---|
142 | <a class="indexterm" name="id415997"></a>
|
---|
143 | <a class="indexterm" name="id416003"></a>
|
---|
144 | Another interesting way in which we expect Winbind to
|
---|
145 | be used is as a central part of UNIX-based appliances. Appliances
|
---|
146 | that provide file and print services to Microsoft-based networks
|
---|
147 | will be able to use Winbind to provide seamless integration of
|
---|
148 | the appliance into the domain.</p></div><div class="sect2" title="Handling of Foreign SIDs"><div class="titlepage"><div><div><h3 class="title"><a name="id416015"></a>Handling of Foreign SIDs</h3></div></div></div><p>
|
---|
149 | <a class="indexterm" name="id416023"></a>
|
---|
150 | The term <span class="emphasis"><em>foreign SID</em></span> is often met with the reaction that it
|
---|
151 | is not relevant to a particular environment. The following documents an interchange
|
---|
152 | that took place on the Samba mailing list. It is a good example of the confusion
|
---|
153 | often expressed regarding the use of winbind.
|
---|
154 | </p><p>
|
---|
155 | <a class="indexterm" name="id416039"></a>
|
---|
156 | Fact: Winbind is needed to handle users who use workstations that are NOT part
|
---|
157 | of the local domain.
|
---|
158 | </p><p>
|
---|
159 | <a class="indexterm" name="id416050"></a>
|
---|
160 | Response: <span class="quote">“<span class="quote">Why? I've used Samba with workstations that are not part of my domains
|
---|
161 | lots of times without using winbind. I thought winbind was for using Samba as a member server
|
---|
162 | in a domain controlled by another Samba/Windows PDC.</span>”</span>
|
---|
163 | </p><p>
|
---|
164 | <a class="indexterm" name="id416065"></a>
|
---|
165 | <a class="indexterm" name="id416072"></a>
|
---|
166 | <a class="indexterm" name="id416078"></a>
|
---|
167 | If the Samba server will be accessed from a domain other than the local Samba domain, or
|
---|
168 | if there will be access from machines that are not local domain members, winbind will
|
---|
169 | permit the allocation of UIDs and GIDs from the assigned pool that will keep the identity
|
---|
170 | of the foreign user separate from users that are members of the Samba domain.
|
---|
171 | </p><p>
|
---|
172 | <a class="indexterm" name="id416091"></a>
|
---|
173 | <a class="indexterm" name="id416098"></a>
|
---|
174 | <a class="indexterm" name="id416104"></a>
|
---|
175 | <a class="indexterm" name="id416111"></a>
|
---|
176 | This means that winbind is eminently useful in cases where a single
|
---|
177 | Samba PDC on a local network is combined with both domain member and domain non-member workstations.
|
---|
178 | If winbind is not used, the user george on a Windows workstation that is not a domain
|
---|
179 | member will be able to access the files of a user called george in the account database
|
---|
180 | of the Samba server that is acting as a PDC. When winbind is used, the default condition
|
---|
181 | is that the local user george will be treated as the account DOMAIN\george and the
|
---|
182 | foreign (non-member of the domain) account will be treated as MACHINE\george because
|
---|
183 | each has a different SID.
|
---|
184 | </p></div></div><div class="sect1" title="How Winbind Works"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id416127"></a>How Winbind Works</h2></div></div></div><p>
|
---|
185 | <a class="indexterm" name="id416135"></a>
|
---|
186 | <a class="indexterm" name="id416141"></a>
|
---|
187 | <a class="indexterm" name="id416148"></a>
|
---|
188 | <a class="indexterm" name="id416155"></a>
|
---|
189 | The Winbind system is designed around a client/server
|
---|
190 | architecture. A long-running <code class="literal">winbindd</code> daemon
|
---|
191 | listens on a UNIX domain socket waiting for requests
|
---|
192 | to arrive. These requests are generated by the NSS and PAM
|
---|
193 | clients and are processed sequentially.</p><p>The technologies used to implement Winbind are described
|
---|
194 | in detail below.</p><div class="sect2" title="Microsoft Remote Procedure Calls"><div class="titlepage"><div><div><h3 class="title"><a name="id416174"></a>Microsoft Remote Procedure Calls</h3></div></div></div><p>
|
---|
195 | <a class="indexterm" name="id416182"></a>
|
---|
196 | <a class="indexterm" name="id416192"></a>
|
---|
197 | <a class="indexterm" name="id416198"></a>
|
---|
198 | <a class="indexterm" name="id416205"></a>
|
---|
199 | <a class="indexterm" name="id416212"></a>
|
---|
200 | Over the last few years, efforts have been underway by various Samba Team members to implement various aspects of
|
---|
201 | the Microsoft Remote Procedure Call (MSRPC) system. This system is used for most network-related operations
|
---|
202 | between Windows NT machines, including remote management, user authentication, and print spooling. Although
|
---|
203 | initially this work was done to aid the implementation of Primary Domain Controller (PDC) functionality in
|
---|
204 | Samba, it has also yielded a body of code that can be used for other purposes.
|
---|
205 | </p><p>
|
---|
206 | <a class="indexterm" name="id416226"></a>
|
---|
207 | <a class="indexterm" name="id416233"></a>
|
---|
208 | <a class="indexterm" name="id416240"></a>
|
---|
209 | Winbind uses various MSRPC calls to enumerate domain users and groups and to obtain detailed information about
|
---|
210 | individual users or groups. Other MSRPC calls can be used to authenticate NT domain users and to change user
|
---|
211 | passwords. By directly querying a Windows PDC for user and group information, Winbind maps the NT account
|
---|
212 | information onto UNIX user and group names.
|
---|
213 | </p></div><div class="sect2" title="Microsoft Active Directory Services"><div class="titlepage"><div><div><h3 class="title"><a name="id416252"></a>Microsoft Active Directory Services</h3></div></div></div><p>
|
---|
214 | <a class="indexterm" name="id416260"></a>
|
---|
215 | <a class="indexterm" name="id416267"></a>
|
---|
216 | <a class="indexterm" name="id416274"></a>
|
---|
217 | <a class="indexterm" name="id416280"></a>
|
---|
218 | Since late 2001, Samba has gained the ability to interact with Microsoft Windows 2000 using its <span class="quote">“<span class="quote">native
|
---|
219 | mode</span>”</span> protocols rather than the NT4 RPC services. Using LDAP and Kerberos, a domain member running
|
---|
220 | Winbind can enumerate users and groups in exactly the same way as a Windows 200x client would, and in so doing
|
---|
221 | provide a much more efficient and effective Winbind implementation.
|
---|
222 | </p></div><div class="sect2" title="Name Service Switch"><div class="titlepage"><div><div><h3 class="title"><a name="id416296"></a>Name Service Switch</h3></div></div></div><p>
|
---|
223 | <a class="indexterm" name="id416304"></a>
|
---|
224 | <a class="indexterm" name="id416310"></a>
|
---|
225 | <a class="indexterm" name="id416317"></a>
|
---|
226 | <a class="indexterm" name="id416324"></a>
|
---|
227 | The NSS is a feature that is present in many UNIX operating systems. It allows system
|
---|
228 | information such as hostnames, mail aliases, and user information
|
---|
229 | to be resolved from different sources. For example, a standalone
|
---|
230 | UNIX workstation may resolve system information from a series of
|
---|
231 | flat files stored on the local file system. A networked workstation
|
---|
232 | may first attempt to resolve system information from local files,
|
---|
233 | and then consult an NIS database for user information or a DNS server
|
---|
234 | for hostname information.</p><p>
|
---|
235 | <a class="indexterm" name="id416338"></a>
|
---|
236 | <a class="indexterm" name="id416345"></a>
|
---|
237 | <a class="indexterm" name="id416351"></a>
|
---|
238 | <a class="indexterm" name="id416358"></a>
|
---|
239 | <a class="indexterm" name="id416365"></a>
|
---|
240 | The NSS application programming interface allows Winbind to present itself as a source of system
|
---|
241 | information when resolving UNIX usernames and groups. Winbind uses this interface and information obtained
|
---|
242 | from a Windows NT server using MSRPC calls to provide a new source of account enumeration. Using standard UNIX
|
---|
243 | library calls, you can enumerate the users and groups on a UNIX machine running Winbind and see all users and
|
---|
244 | groups in an NT domain plus any trusted domain as though they were local users and groups.
|
---|
245 | </p><p>
|
---|
246 | <a class="indexterm" name="id416380"></a>
|
---|
247 | <a class="indexterm" name="id416386"></a>
|
---|
248 | <a class="indexterm" name="id416393"></a>
|
---|
249 | The primary control file for NSS is <code class="filename">/etc/nsswitch.conf</code>. When a UNIX application
|
---|
250 | makes a request to do a lookup, the C library looks in <code class="filename">/etc/nsswitch.conf</code> for a line that
|
---|
251 | matches the service type being requested; for example, the <span class="quote">“<span class="quote">passwd</span>”</span> service type is used when
|
---|
252 | user or group names are looked up. This config line specifies which implementations of that service should be
|
---|
253 | tried and in what order. If the passwd config line is:
|
---|
254 | </p><pre class="screen">
|
---|
255 | passwd: files example
|
---|
256 | </pre><p>
|
---|
257 | <a class="indexterm" name="id416424"></a>
|
---|
258 | <a class="indexterm" name="id416431"></a>
|
---|
259 | <a class="indexterm" name="id416438"></a>
|
---|
260 | then the C library will first load a module called <code class="filename">/lib/libnss_files.so</code> followed
|
---|
261 | by the module <code class="filename">/lib/libnss_example.so</code>. The C library will dynamically load each of these
|
---|
262 | modules in turn and call resolver functions within the modules to try to resolve the request. Once the request
|
---|
263 | is resolved, the C library returns the result to the application.
|
---|
264 | </p><p>
|
---|
265 | <a class="indexterm" name="id416462"></a>
|
---|
266 | <a class="indexterm" name="id416469"></a>
|
---|
267 | <a class="indexterm" name="id416476"></a>
|
---|
268 | This NSS interface provides an easy way for Winbind to hook into the operating system. All that needs
|
---|
269 | to be done is to put <code class="filename">libnss_winbind.so</code> in <code class="filename">/lib/</code> then add
|
---|
270 | <span class="quote">“<span class="quote">winbind</span>”</span> into <code class="filename">/etc/nsswitch.conf</code> at the appropriate place. The C library
|
---|
271 | will then call Winbind to resolve user and group names.
|
---|
272 | </p></div><div class="sect2" title="Pluggable Authentication Modules"><div class="titlepage"><div><div><h3 class="title"><a name="id416508"></a>Pluggable Authentication Modules</h3></div></div></div><p>
|
---|
273 | <a class="indexterm" name="id416516"></a>
|
---|
274 | <a class="indexterm" name="id416522"></a>
|
---|
275 | <a class="indexterm" name="id416529"></a>
|
---|
276 | <a class="indexterm" name="id416536"></a>
|
---|
277 | PAMs provide a system for abstracting authentication and authorization technologies. With a PAM
|
---|
278 | module, it is possible to specify different authentication methods for different system applications without
|
---|
279 | having to recompile these applications. PAM is also useful for implementing a particular policy for
|
---|
280 | authorization. For example, a system administrator may only allow console logins from users stored in the
|
---|
281 | local password file but only allow users resolved from an NIS database to log in over the network.
|
---|
282 | </p><p>
|
---|
283 | <a class="indexterm" name="id416551"></a>
|
---|
284 | <a class="indexterm" name="id416557"></a>
|
---|
285 | <a class="indexterm" name="id416564"></a>
|
---|
286 | <a class="indexterm" name="id416571"></a>
|
---|
287 | <a class="indexterm" name="id416578"></a>
|
---|
288 | Winbind uses the authentication management and password management PAM interface to integrate Windows
|
---|
289 | NT users into a UNIX system. This allows Windows NT users to log in to a UNIX machine and be authenticated
|
---|
290 | against a suitable PDC. These users can also change their passwords and have this change take effect directly
|
---|
291 | on the PDC.
|
---|
292 | </p><p>
|
---|
293 | <a class="indexterm" name="id416590"></a>
|
---|
294 | <a class="indexterm" name="id416597"></a>
|
---|
295 | <a class="indexterm" name="id416604"></a>
|
---|
296 | <a class="indexterm" name="id416610"></a>
|
---|
297 | PAM is configured by providing control files in the directory <code class="filename">/etc/pam.d/</code> for
|
---|
298 | each of the services that require authentication. When an authentication request is made by an application,
|
---|
299 | the PAM code in the C library looks up this control file to determine what modules to load to do the
|
---|
300 | authentication check and in what order. This interface makes adding a new authentication service for Winbind
|
---|
301 | very easy: simply copy the <code class="filename">pam_winbind.so</code> module to <code class="filename">/lib/security/</code>,
|
---|
302 | and the PAM control files for relevant services are updated to allow authentication via Winbind. See the PAM
|
---|
303 | documentation in <a class="link" href="pam.html" title="Chapter 28. PAM-Based Distributed Authentication">PAM-Based Distributed Authentication</a>, for more information.
|
---|
304 | </p></div><div class="sect2" title="User and Group ID Allocation"><div class="titlepage"><div><div><h3 class="title"><a name="id416649"></a>User and Group ID Allocation</h3></div></div></div><p>
|
---|
305 | <a class="indexterm" name="id416657"></a>
|
---|
306 | <a class="indexterm" name="id416663"></a>
|
---|
307 | <a class="indexterm" name="id416670"></a>
|
---|
308 | When a user or group is created under Windows NT/200x, it is allocated a numerical relative identifier
|
---|
309 | (RID). This is slightly different from UNIX, which has a range of numbers that are used to identify users and
|
---|
310 | the same range used to identify groups. It is Winbind's job to convert RIDs to UNIX ID numbers and vice versa.
|
---|
311 | When Winbind is configured, it is given part of the UNIX user ID space and a part of the UNIX group ID space
|
---|
312 | in which to store Windows NT users and groups. If a Windows NT user is resolved for the first time, it is
|
---|
313 | allocated the next UNIX ID from the range. The same process applies for Windows NT groups. Over time, Winbind
|
---|
314 | will have mapped all Windows NT users and groups to UNIX user IDs and group IDs.
|
---|
315 | </p><p>
|
---|
316 | <a class="indexterm" name="id416686"></a>
|
---|
317 | <a class="indexterm" name="id416693"></a>
|
---|
318 | <a class="indexterm" name="id416700"></a>
|
---|
319 | <a class="indexterm" name="id416706"></a>
|
---|
320 | The results of this mapping are stored persistently in an ID mapping database held in a tdb database.
|
---|
321 | This ensures that RIDs are mapped to UNIX IDs in a consistent way.
|
---|
322 | </p></div><div class="sect2" title="Result Caching"><div class="titlepage"><div><div><h3 class="title"><a name="id416717"></a>Result Caching</h3></div></div></div><p>
|
---|
323 | <a class="indexterm" name="id416724"></a>
|
---|
324 | <a class="indexterm" name="id416731"></a>
|
---|
325 | <a class="indexterm" name="id416738"></a>
|
---|
326 | <a class="indexterm" name="id416745"></a>
|
---|
327 | <a class="indexterm" name="id416751"></a>
|
---|
328 | An active directory system can generate a lot of user and group name lookups. To reduce the network
|
---|
329 | cost of these lookups, Winbind uses a caching scheme based on the SAM sequence number supplied by NT domain
|
---|
330 | controllers. User or group information returned by a PDC is cached by Winbind along with a sequence number
|
---|
331 | also returned by the PDC. This sequence number is incremented by Windows NT whenever any user or group
|
---|
332 | information is modified. If a cached entry has expired, the sequence number is requested from the PDC and
|
---|
333 | compared against the sequence number of the cached entry. If the sequence numbers do not match, then the
|
---|
334 | cached information is discarded and up-to-date information is requested directly from the PDC.
|
---|
335 | </p></div></div><div class="sect1" title="Installation and Configuration"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id416767"></a>Installation and Configuration</h2></div></div></div><div class="sect2" title="Introduction"><div class="titlepage"><div><div><h3 class="title"><a name="id416773"></a>Introduction</h3></div></div></div><p>
|
---|
336 | <a class="indexterm" name="id416781"></a>
|
---|
337 | <a class="indexterm" name="id416787"></a>
|
---|
338 | <a class="indexterm" name="id416794"></a>
|
---|
339 | This section describes the procedures used to get Winbind up and running. Winbind is capable of providing
|
---|
340 | access and authentication control for Windows Domain users through an NT or Windows 200x PDC for regular
|
---|
341 | services, such as telnet and ftp, as well for Samba services.
|
---|
342 | </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
|
---|
343 | <span class="emphasis"><em>Why should I do this?</em></span>
|
---|
344 | </p><p>
|
---|
345 | <a class="indexterm" name="id416817"></a>
|
---|
346 | <a class="indexterm" name="id416824"></a>
|
---|
347 | <a class="indexterm" name="id416831"></a>
|
---|
348 | <a class="indexterm" name="id416838"></a>
|
---|
349 | This allows the Samba administrator to rely on the authentication mechanisms on the Windows NT/200x PDC
|
---|
350 | for the authentication of domain members. Windows NT/200x users no longer need to have separate accounts on
|
---|
351 | the Samba server.
|
---|
352 | </p></li><li class="listitem"><p>
|
---|
353 | <span class="emphasis"><em>Who should be reading this document?</em></span>
|
---|
354 | </p><p>
|
---|
355 | <a class="indexterm" name="id416860"></a>
|
---|
356 | <a class="indexterm" name="id416866"></a>
|
---|
357 | This document is designed for system administrators. If you are implementing Samba on a file server and wish
|
---|
358 | to (fairly easily) integrate existing Windows NT/200x users from your PDC onto the Samba server, this document
|
---|
359 | is for you.
|
---|
360 | </p></li></ul></div></div><div class="sect2" title="Requirements"><div class="titlepage"><div><div><h3 class="title"><a name="id416880"></a>Requirements</h3></div></div></div><p>
|
---|
361 | <a class="indexterm" name="id416887"></a>
|
---|
362 | <a class="indexterm" name="id416894"></a>
|
---|
363 | <a class="indexterm" name="id416901"></a>
|
---|
364 | If you have a Samba configuration file that you are currently using, <span class="emphasis"><em>BACK IT UP!</em></span>
|
---|
365 | If your system already uses PAM, <span class="emphasis"><em>back up the <code class="filename">/etc/pam.d</code> directory
|
---|
366 | contents!</em></span> If you haven't already made a boot disk, <span class="emphasis"><em>MAKE ONE NOW!</em></span>
|
---|
367 | </p><p>
|
---|
368 | <a class="indexterm" name="id416929"></a>
|
---|
369 | <a class="indexterm" name="id416936"></a>
|
---|
370 | <a class="indexterm" name="id416942"></a>
|
---|
371 | Messing with the PAM configuration files can make it nearly impossible to log in to your machine. That's
|
---|
372 | why you want to be able to boot back into your machine in single-user mode and restore your
|
---|
373 | <code class="filename">/etc/pam.d</code> to the original state it was in if you get frustrated with the
|
---|
374 | way things are going.
|
---|
375 | </p><p>
|
---|
376 | <a class="indexterm" name="id416961"></a>
|
---|
377 | <a class="indexterm" name="id416967"></a>
|
---|
378 | The latest version of Samba-3 includes a functioning winbindd daemon. Please refer to the <a class="ulink" href="http://samba.org/" target="_top">main Samba Web page</a>, or better yet, your closest Samba mirror site for
|
---|
379 | instructions on downloading the source code.
|
---|
380 | </p><p>
|
---|
381 | <a class="indexterm" name="id416985"></a>
|
---|
382 | <a class="indexterm" name="id416992"></a>
|
---|
383 | <a class="indexterm" name="id416999"></a>
|
---|
384 | <a class="indexterm" name="id417005"></a>
|
---|
385 | To allow domain users the ability to access Samba shares and files, as well as potentially other services
|
---|
386 | provided by your Samba machine, PAM must be set up properly on your
|
---|
387 | machine. In order to compile the Winbind modules, you should have at least the PAM development libraries installed
|
---|
388 | on your system. Please refer to the PAM Web site <a class="ulink" href="http://www.kernel.org/pub/linux/libs/pam/" target="_top">http://www.kernel.org/pub/linux/libs/pam/</a>.
|
---|
389 | </p></div><div class="sect2" title="Testing Things Out"><div class="titlepage"><div><div><h3 class="title"><a name="id417022"></a>Testing Things Out</h3></div></div></div><p>
|
---|
390 | <a class="indexterm" name="id417029"></a>
|
---|
391 | <a class="indexterm" name="id417036"></a>
|
---|
392 | <a class="indexterm" name="id417043"></a>
|
---|
393 | <a class="indexterm" name="id417050"></a>
|
---|
394 | <a class="indexterm" name="id417057"></a>
|
---|
395 | Before starting, it is probably best to kill off all the Samba-related daemons running on your server.
|
---|
396 | Kill off all <span class="application">smbd</span>, <span class="application">nmbd</span>, and <span class="application">winbindd</span> processes that may be running. To use PAM,
|
---|
397 | make sure that you have the standard PAM package that supplies the <code class="filename">/etc/pam.d</code>
|
---|
398 | directory structure, including the PAM modules that are used by PAM-aware services, several PAM libraries,
|
---|
399 | and the <code class="filename">/usr/doc</code> and <code class="filename">/usr/man</code> entries for PAM. Winbind is built
|
---|
400 | better in Samba if the pam-devel package is also installed. This package includes the header files
|
---|
401 | needed to compile PAM-aware applications.
|
---|
402 | </p><div class="sect3" title="Configure nsswitch.conf and the Winbind Libraries on Linux and Solaris"><div class="titlepage"><div><div><h4 class="title"><a name="id417104"></a>Configure <code class="filename">nsswitch.conf</code> and the Winbind Libraries on Linux and Solaris</h4></div></div></div><p>
|
---|
403 | <a class="indexterm" name="id417118"></a>
|
---|
404 | <a class="indexterm" name="id417124"></a>
|
---|
405 | <a class="indexterm" name="id417131"></a>
|
---|
406 | <a class="indexterm" name="id417138"></a>
|
---|
407 | PAM is a standard component of most current generation UNIX/Linux systems. Unfortunately, few systems install
|
---|
408 | the <code class="filename">pam-devel</code> libraries that are needed to build PAM-enabled Samba. Additionally, Samba-3
|
---|
409 | may auto-install the Winbind files into their correct locations on your system, so before you get too far down
|
---|
410 | the track, be sure to check if the following configuration is really
|
---|
411 | necessary. You may only need to configure
|
---|
412 | <code class="filename">/etc/nsswitch.conf</code>.
|
---|
413 | </p><p>
|
---|
414 | The libraries needed to run the <span class="application">winbindd</span> daemon through nsswitch need to be copied to their proper locations:
|
---|
415 | </p><p>
|
---|
416 | <a class="indexterm" name="id417173"></a>
|
---|
417 | </p><pre class="screen">
|
---|
418 | <code class="prompt">root# </code><strong class="userinput"><code>cp ../samba/source/nsswitch/libnss_winbind.so /lib</code></strong>
|
---|
419 | </pre><p>
|
---|
420 | </p><p>
|
---|
421 | I also found it necessary to make the following symbolic link:
|
---|
422 | </p><p>
|
---|
423 | <code class="prompt">root# </code> <strong class="userinput"><code>ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2</code></strong>
|
---|
424 | </p><p>And, in the case of Sun Solaris:
|
---|
425 | <a class="indexterm" name="id417219"></a>
|
---|
426 | </p><pre class="screen">
|
---|
427 | <code class="prompt">root# </code><strong class="userinput"><code>ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1</code></strong>
|
---|
428 | <code class="prompt">root# </code><strong class="userinput"><code>ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.1</code></strong>
|
---|
429 | <code class="prompt">root# </code><strong class="userinput"><code>ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.2</code></strong>
|
---|
430 | </pre><p>
|
---|
431 | </p><p>
|
---|
432 | <a class="indexterm" name="id417266"></a>
|
---|
433 | As root, edit <code class="filename">/etc/nsswitch.conf</code> to allow user and group entries to be visible from the
|
---|
434 | <span class="application">winbindd</span> daemon. My <code class="filename">/etc/nsswitch.conf</code> file looked like this after editing:
|
---|
435 | </p><pre class="programlisting">
|
---|
436 | passwd: files winbind
|
---|
437 | shadow: files
|
---|
438 | group: files winbind
|
---|
439 | </pre><p>
|
---|
440 | <a class="indexterm" name="id417300"></a>
|
---|
441 | <a class="indexterm" name="id417307"></a>
|
---|
442 | <a class="indexterm" name="id417314"></a>
|
---|
443 | <a class="indexterm" name="id417321"></a>
|
---|
444 | <a class="indexterm" name="id417328"></a>
|
---|
445 | The libraries needed by the <code class="literal">winbindd</code> daemon will be automatically
|
---|
446 | entered into the <code class="literal">ldconfig</code> cache the next time
|
---|
447 | your system reboots, but it is faster (and you do not need to reboot) if you do it manually:
|
---|
448 | </p><pre class="screen">
|
---|
449 | <code class="prompt">root# </code><strong class="userinput"><code>/sbin/ldconfig -v | grep winbind</code></strong>
|
---|
450 | </pre><p>
|
---|
451 | This makes <code class="filename">libnss_winbind</code> available to winbindd and reports the current
|
---|
452 | search path that is used by the dynamic link loader. The use of the <code class="literal">grep</code>
|
---|
453 | filters the output of the <code class="literal">ldconfig</code> command so that we may see proof that
|
---|
454 | this library is indeed recognized by the dynamic link loader.
|
---|
455 | </p><p>
|
---|
456 | <a class="indexterm" name="id417387"></a>
|
---|
457 | <a class="indexterm" name="id417394"></a>
|
---|
458 | <a class="indexterm" name="id417400"></a>
|
---|
459 | <a class="indexterm" name="id417407"></a>
|
---|
460 | <a class="indexterm" name="id417414"></a>
|
---|
461 | The Sun Solaris dynamic link loader management tool is called <code class="literal">crle</code>. The
|
---|
462 | use of this tool is necessary to instruct the dynamic link loader to search directories that
|
---|
463 | contain library files that were not supplied as part of the original operating system platform.
|
---|
464 | The following example shows how to use this tool to add the directory <code class="filename">/usr/local/lib</code>
|
---|
465 | to the dynamic link loader's search path:
|
---|
466 | </p><pre class="screen">
|
---|
467 | <code class="prompt">root# </code> crle -u -l /usr/lib:/usr/local/lib
|
---|
468 | </pre><p>
|
---|
469 | When executed without arguments, <code class="literal">crle</code> reports the current dynamic
|
---|
470 | link loader configuration. This is demonstrated here:
|
---|
471 | </p><pre class="screen">
|
---|
472 | <code class="prompt">root# </code> crle
|
---|
473 |
|
---|
474 | Configuration file [version 4]: /var/ld/ld.config
|
---|
475 | Default Library Path (ELF): /lib:/usr/lib:/usr/local/lib
|
---|
476 | Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
|
---|
477 |
|
---|
478 | Command line:
|
---|
479 | crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib
|
---|
480 | </pre><p>
|
---|
481 | From this it is apparent that the <code class="filename">/usr/local/lib</code> directory is included
|
---|
482 | in the search dynamic link libraries in order to satisfy object module dependencies.
|
---|
483 | </p></div><div class="sect3" title="NSS Winbind on AIX"><div class="titlepage"><div><div><h4 class="title"><a name="id417478"></a>NSS Winbind on AIX</h4></div></div></div><p>(This section is only for those running AIX.)</p><p>
|
---|
484 | <a class="indexterm" name="id417489"></a>
|
---|
485 | <a class="indexterm" name="id417496"></a>
|
---|
486 | <a class="indexterm" name="id417502"></a>
|
---|
487 | <a class="indexterm" name="id417509"></a>
|
---|
488 | <a class="indexterm" name="id417516"></a>
|
---|
489 | <a class="indexterm" name="id417523"></a>
|
---|
490 | The Winbind AIX identification module gets built as <code class="filename">libnss_winbind.so</code> in the
|
---|
491 | nsswitch directory of the Samba source. This file can be copied to <code class="filename">/usr/lib/security</code>,
|
---|
492 | and the AIX naming convention would indicate that it should be named WINBIND. A stanza like the following:
|
---|
493 | </p><pre class="programlisting">
|
---|
494 | WINBIND:
|
---|
495 | program = /usr/lib/security/WINBIND
|
---|
496 | options = authonly
|
---|
497 | </pre><p>
|
---|
498 | can then be added to <code class="filename">/usr/lib/security/methods.cfg</code>. This module only supports
|
---|
499 | identification, but there have been reports of success using the standard Winbind PAM module for
|
---|
500 | authentication. Use caution configuring loadable authentication modules, since misconfiguration can make
|
---|
501 | it impossible to log on to the system. Information regarding the AIX authentication module API can
|
---|
502 | be found in the <span class="quote">“<span class="quote">Kernel Extensions and Device Support Programming Concepts for AIX</span>”</span> document that
|
---|
503 | describes the <a class="ulink" href="http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/kernextc/sec_load_mod.htm" target="_top">
|
---|
504 | Loadable Authentication Module Programming Interface</a> for AIX. Further information on administering the modules
|
---|
505 | can be found in the <a class="ulink" href="http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixbman/baseadmn/iandaadmin.htm" target="_top">System
|
---|
506 | Management Guide: Operating System and Devices.</a>
|
---|
507 | </p></div><div class="sect3" title="Configure smb.conf"><div class="titlepage"><div><div><h4 class="title"><a name="id417580"></a>Configure smb.conf</h4></div></div></div><p>
|
---|
508 | <a class="indexterm" name="id417587"></a>
|
---|
509 | <a class="indexterm" name="id417594"></a>
|
---|
510 | <a class="indexterm" name="id417601"></a>
|
---|
511 | Several parameters are needed in the <code class="filename">smb.conf</code> file to control the behavior of <span class="application">winbindd</span>. These
|
---|
512 | are described in more detail in the <a class="citerefentry" href="winbindd.8.html"><span class="citerefentry"><span class="refentrytitle">winbindd</span>(8)</span></a> man page. My <code class="filename">smb.conf</code> file, as shown in <a class="link" href="winbind.html#winbindcfg" title="Example 24.1. smb.conf for Winbind Setup">the smb.conf for Winbind Setup</a>, was modified to include the necessary entries in the [global] section.
|
---|
513 | </p><div class="example"><a name="winbindcfg"></a><p class="title"><b>Example 24.1. smb.conf for Winbind Setup</b></p><div class="example-contents"><table border="0" summary="Simple list" class="simplelist"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td># separate domain and username with '\', like DOMAIN\username</td></tr><tr><td><a class="indexterm" name="id417672"></a><em class="parameter"><code>winbind separator = \</code></em></td></tr><tr><td># use uids from 10000 to 20000 for domain users</td></tr><tr><td><a class="indexterm" name="id417687"></a><em class="parameter"><code>idmap uid = 10000-20000</code></em></td></tr><tr><td># use gids from 10000 to 20000 for domain groups</td></tr><tr><td><a class="indexterm" name="id417703"></a><em class="parameter"><code>idmap gid = 10000-20000</code></em></td></tr><tr><td># allow enumeration of winbind users and groups</td></tr><tr><td><a class="indexterm" name="id417718"></a><em class="parameter"><code>winbind enum users = yes</code></em></td></tr><tr><td><a class="indexterm" name="id417729"></a><em class="parameter"><code>winbind enum groups = yes</code></em></td></tr><tr><td># give winbind users a real shell (only needed if they have telnet access)</td></tr><tr><td><a class="indexterm" name="id417745"></a><em class="parameter"><code>template homedir = /home/winnt/%D/%U</code></em></td></tr><tr><td><a class="indexterm" name="id417757"></a><em class="parameter"><code>template shell = /bin/bash</code></em></td></tr></table></div></div><br class="example-break"></div><div class="sect3" title="Join the Samba Server to the PDC Domain"><div class="titlepage"><div><div><h4 class="title"><a name="id417770"></a>Join the Samba Server to the PDC Domain</h4></div></div></div><p>
|
---|
514 | <a class="indexterm" name="id417778"></a>
|
---|
515 | <a class="indexterm" name="id417785"></a>
|
---|
516 | <a class="indexterm" name="id417792"></a>
|
---|
517 | All machines that will participate in domain security should be members of
|
---|
518 | the domain. This applies also to the PDC and all BDCs.
|
---|
519 | </p><p>
|
---|
520 | <a class="indexterm" name="id417802"></a>
|
---|
521 | <a class="indexterm" name="id417809"></a>
|
---|
522 | <a class="indexterm" name="id417816"></a>
|
---|
523 | <a class="indexterm" name="id417827"></a>
|
---|
524 | <a class="indexterm" name="id417834"></a>
|
---|
525 | <a class="indexterm" name="id417840"></a>
|
---|
526 | <a class="indexterm" name="id417847"></a>
|
---|
527 | <a class="indexterm" name="id417854"></a>
|
---|
528 | <a class="indexterm" name="id417861"></a>
|
---|
529 | The process of joining a domain requires the use of the <code class="literal">net rpc join</code>
|
---|
530 | command. This process communicates with the domain controller it will register with
|
---|
531 | (usually the PDC) via MS DCE RPC. This means, of course, that the <code class="literal">smbd</code>
|
---|
532 | process must be running on the target domain controller. It is therefore necessary to temporarily
|
---|
533 | start Samba on a PDC so that it can join its own domain.
|
---|
534 | </p><p>
|
---|
535 | <a class="indexterm" name="id417886"></a>
|
---|
536 | <a class="indexterm" name="id417892"></a>
|
---|
537 | <a class="indexterm" name="id417899"></a>
|
---|
538 | Enter the following command to make the Samba server join the domain, where <em class="replaceable"><code>PDC</code></em> is
|
---|
539 | the name of your PDC and <em class="replaceable"><code>Administrator</code></em> is a domain user who has administrative
|
---|
540 | privileges in the domain.
|
---|
541 | </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
|
---|
542 | <a class="indexterm" name="id417919"></a>
|
---|
543 | <a class="indexterm" name="id417925"></a>
|
---|
544 | <a class="indexterm" name="id417932"></a>
|
---|
545 | <a class="indexterm" name="id417939"></a>
|
---|
546 | Before attempting to join a machine to the domain, verify that Samba is running
|
---|
547 | on the target domain controller (usually PDC) and that it is capable of being reached via ports
|
---|
548 | 137/udp, 135/tcp, 139/tcp, and 445/tcp (if Samba or Windows Server 2Kx).
|
---|
549 | </p></div><p>
|
---|
550 | <a class="indexterm" name="id417951"></a>
|
---|
551 | The use of the <code class="literal">net rpc join</code> facility is shown here:
|
---|
552 | </p><pre class="screen">
|
---|
553 | <code class="prompt">root# </code><strong class="userinput"><code>/usr/local/samba/bin/net rpc join -S PDC -U Administrator</code></strong>
|
---|
554 | </pre><p>
|
---|
555 | The proper response to the command should be <span class="quote">“<span class="quote">Joined the domain
|
---|
556 | <em class="replaceable"><code>DOMAIN</code></em></span>”</span> where <em class="replaceable"><code>DOMAIN</code></em>
|
---|
557 | is your domain name.
|
---|
558 | </p></div><div class="sect3" title="Starting and Testing the winbindd Daemon"><div class="titlepage"><div><div><h4 class="title"><a name="id417997"></a>Starting and Testing the <code class="literal">winbindd</code> Daemon</h4></div></div></div><p>
|
---|
559 | <a class="indexterm" name="id418011"></a>
|
---|
560 | <a class="indexterm" name="id418018"></a>
|
---|
561 | <a class="indexterm" name="id418025"></a>
|
---|
562 | Eventually, you will want to modify your Samba startup script to automatically invoke the winbindd daemon when
|
---|
563 | the other parts of Samba start, but it is possible to test out just the Winbind portion first. To start up
|
---|
564 | Winbind services, enter the following command as root:
|
---|
565 | </p><pre class="screen">
|
---|
566 | <code class="prompt">root# </code><strong class="userinput"><code>/usr/local/samba/sbin/winbindd</code></strong>
|
---|
567 | </pre><p>
|
---|
568 | Use the appropriate path to the location of the <code class="literal">winbindd</code> executable file.
|
---|
569 | </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
|
---|
570 | <a class="indexterm" name="id418061"></a>
|
---|
571 | <a class="indexterm" name="id418068"></a>
|
---|
572 | The command to start up Winbind services assumes that Samba has been installed in the
|
---|
573 | <code class="filename">/usr/local/samba</code> directory tree. You may need to search for the location of Samba files
|
---|
574 | if this is not the location of <code class="literal">winbindd</code> on your system.
|
---|
575 | </p></div><p>
|
---|
576 | <a class="indexterm" name="id418091"></a>
|
---|
577 | <a class="indexterm" name="id418098"></a>
|
---|
578 | I'm always paranoid and like to make sure the daemon is really running.
|
---|
579 | </p><pre class="screen">
|
---|
580 | <code class="prompt">root# </code><strong class="userinput"><code>ps -ae | grep winbindd</code></strong>
|
---|
581 | </pre><p>
|
---|
582 | </p><p>
|
---|
583 | <a class="indexterm" name="id418124"></a>
|
---|
584 | This command should produce output like the following if the daemon is running.
|
---|
585 | </p><pre class="screen">
|
---|
586 | 3025 ? 00:00:00 winbindd
|
---|
587 | </pre><p>
|
---|
588 | </p><p>
|
---|
589 | <a class="indexterm" name="id418141"></a>
|
---|
590 | <a class="indexterm" name="id418148"></a>
|
---|
591 | Now, for the real test, try to get some information about the users on your PDC:
|
---|
592 | </p><pre class="screen">
|
---|
593 | <code class="prompt">root# </code><strong class="userinput"><code>/usr/local/samba/bin/wbinfo -u</code></strong>
|
---|
594 | </pre><p>
|
---|
595 | This should echo back a list of users on your Windows users on your PDC. For example, I get the following
|
---|
596 | response:
|
---|
597 | </p><pre class="screen">
|
---|
598 | CEO\Administrator
|
---|
599 | CEO\burdell
|
---|
600 | CEO\Guest
|
---|
601 | CEO\jt-ad
|
---|
602 | CEO\krbtgt
|
---|
603 | CEO\TsInternetUser
|
---|
604 | </pre><p>
|
---|
605 | Obviously, I have named my domain <span class="quote">“<span class="quote">CEO</span>”</span> and my <a class="link" href="smb.conf.5.html#WINBINDSEPARATOR" target="_top">winbind separator</a> is
|
---|
606 | <span class="quote">“<span class="quote">\</span>”</span>.
|
---|
607 | </p><p>
|
---|
608 | <a class="indexterm" name="id418202"></a>
|
---|
609 | <a class="indexterm" name="id418209"></a>
|
---|
610 | You can do the same sort of thing to get group information from the PDC:
|
---|
611 | </p><pre class="screen">
|
---|
612 | <code class="prompt">root# </code><strong class="userinput"><code>/usr/local/samba/bin/wbinfo -g</code></strong>
|
---|
613 | CEO\Domain Admins
|
---|
614 | CEO\Domain Users
|
---|
615 | CEO\Domain Guests
|
---|
616 | CEO\Domain Computers
|
---|
617 | CEO\Domain Controllers
|
---|
618 | CEO\Cert Publishers
|
---|
619 | CEO\Schema Admins
|
---|
620 | CEO\Enterprise Admins
|
---|
621 | CEO\Group Policy Creator Owners
|
---|
622 | </pre><p>
|
---|
623 | <a class="indexterm" name="id418235"></a>
|
---|
624 | <a class="indexterm" name="id418242"></a>
|
---|
625 | <a class="indexterm" name="id418249"></a>
|
---|
626 | <a class="indexterm" name="id418255"></a>
|
---|
627 | <a class="indexterm" name="id418262"></a>
|
---|
628 | <a class="indexterm" name="id418268"></a>
|
---|
629 | <a class="indexterm" name="id418275"></a>
|
---|
630 | The function <code class="literal">getent</code> can now be used to get unified lists of both local and PDC users and
|
---|
631 | groups. Try the following command:
|
---|
632 | </p><pre class="screen">
|
---|
633 | <code class="prompt">root# </code><strong class="userinput"><code>getent passwd</code></strong>
|
---|
634 | </pre><p>
|
---|
635 | You should get a list that looks like your <code class="filename">/etc/passwd</code>
|
---|
636 | list followed by the domain users with their new UIDs, GIDs, home
|
---|
637 | directories, and default shells.
|
---|
638 | </p><p>
|
---|
639 | The same thing can be done for groups with the command:
|
---|
640 | </p><pre class="screen">
|
---|
641 | <code class="prompt">root# </code><strong class="userinput"><code>getent group</code></strong>
|
---|
642 | </pre><p>
|
---|
643 | </p></div><div class="sect3" title="Fix the init.d Startup Scripts"><div class="titlepage"><div><div><h4 class="title"><a name="id418334"></a>Fix the init.d Startup Scripts</h4></div></div></div><div class="sect4" title="Linux"><div class="titlepage"><div><div><h5 class="title"><a name="id418340"></a>Linux</h5></div></div></div><p>
|
---|
644 | <a class="indexterm" name="id418348"></a>
|
---|
645 | <a class="indexterm" name="id418354"></a>
|
---|
646 | <a class="indexterm" name="id418361"></a>
|
---|
647 | <a class="indexterm" name="id418368"></a>
|
---|
648 | <a class="indexterm" name="id418375"></a>
|
---|
649 | <a class="indexterm" name="id418382"></a>
|
---|
650 | <a class="indexterm" name="id418388"></a>
|
---|
651 | <a class="indexterm" name="id418394"></a>
|
---|
652 | <a class="indexterm" name="id418399"></a>
|
---|
653 | The <span class="application">winbindd</span> daemon needs to start up after the <span class="application">smbd</span> and <span class="application">nmbd</span> daemons are running. To accomplish this
|
---|
654 | task, you need to modify the startup scripts of your system. They are located at
|
---|
655 | <code class="filename">/etc/init.d/smb</code> in Red Hat Linux and in <code class="filename">/etc/init.d/samba</code> in Debian
|
---|
656 | Linux. Edit your script to add commands to invoke this daemon in the proper sequence. My startup script starts
|
---|
657 | up <span class="application">smbd</span>, <span class="application">nmbd</span>, and <span class="application">winbindd</span> from the <code class="filename">/usr/local/samba/bin</code> directory directly. The
|
---|
658 | <code class="literal">start</code> function in the script looks like this:
|
---|
659 | </p><pre class="programlisting">
|
---|
660 | start() {
|
---|
661 | KIND="SMB"
|
---|
662 | echo -n $"Starting $KIND services: "
|
---|
663 | daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
|
---|
664 | RETVAL=$?
|
---|
665 | echo
|
---|
666 | KIND="NMB"
|
---|
667 | echo -n $"Starting $KIND services: "
|
---|
668 | daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
|
---|
669 | RETVAL2=$?
|
---|
670 | echo
|
---|
671 | KIND="Winbind"
|
---|
672 | echo -n $"Starting $KIND services: "
|
---|
673 | daemon /usr/local/samba/sbin/winbindd
|
---|
674 | RETVAL3=$?
|
---|
675 | echo
|
---|
676 | [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] && \
|
---|
677 | touch /var/lock/subsys/smb || RETVAL=1
|
---|
678 | return $RETVAL
|
---|
679 | }
|
---|
680 | </pre><p>If you would like to run winbindd in dual daemon mode, replace the line:
|
---|
681 | </p><pre class="programlisting">
|
---|
682 | daemon /usr/local/samba/sbin/winbindd
|
---|
683 | </pre><p>
|
---|
684 |
|
---|
685 | in the example above with:
|
---|
686 |
|
---|
687 | </p><pre class="programlisting">
|
---|
688 | daemon /usr/local/samba/sbin/winbindd -D
|
---|
689 | </pre><p>.
|
---|
690 | </p><p>
|
---|
691 | The <code class="literal">stop</code> function has a corresponding entry to shut down the services and looks like this:
|
---|
692 | </p><pre class="programlisting">
|
---|
693 | stop() {
|
---|
694 | KIND="SMB"
|
---|
695 | echo -n $"Shutting down $KIND services: "
|
---|
696 | killproc smbd
|
---|
697 | RETVAL=$?
|
---|
698 | echo
|
---|
699 | KIND="NMB"
|
---|
700 | echo -n $"Shutting down $KIND services: "
|
---|
701 | killproc nmbd
|
---|
702 | RETVAL2=$?
|
---|
703 | echo
|
---|
704 | KIND="Winbind"
|
---|
705 | echo -n $"Shutting down $KIND services: "
|
---|
706 | killproc winbindd
|
---|
707 | RETVAL3=$?
|
---|
708 | [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] && \
|
---|
709 | rm -f /var/lock/subsys/smb
|
---|
710 | echo ""
|
---|
711 | return $RETVAL
|
---|
712 | }
|
---|
713 | </pre></div><div class="sect4" title="Solaris"><div class="titlepage"><div><div><h5 class="title"><a name="id418523"></a>Solaris</h5></div></div></div><p>
|
---|
714 | Winbind does not work on Solaris 9; see <a class="link" href="Portability.html#winbind-solaris9" title="Winbind on Solaris 9">Winbind on Solaris 9 section</a>
|
---|
715 | for details.
|
---|
716 | </p><p>
|
---|
717 | <a class="indexterm" name="id418543"></a>
|
---|
718 | <a class="indexterm" name="id418549"></a>
|
---|
719 | <a class="indexterm" name="id418556"></a>
|
---|
720 | <a class="indexterm" name="id418563"></a>
|
---|
721 | <a class="indexterm" name="id418570"></a>
|
---|
722 | <a class="indexterm" name="id418577"></a>
|
---|
723 | On Solaris, you need to modify the <code class="filename">/etc/init.d/samba.server</code> startup script. It
|
---|
724 | usually only starts smbd and nmbd but should now start winbindd, too. If you have Samba installed in
|
---|
725 | <code class="filename">/usr/local/samba/bin</code>, the file could contains something like this:
|
---|
726 | </p><p>
|
---|
727 | </p><pre class="programlisting">
|
---|
728 | ##
|
---|
729 | ## samba.server
|
---|
730 | ##
|
---|
731 |
|
---|
732 | if [ ! -d /usr/bin ]
|
---|
733 | then # /usr not mounted
|
---|
734 | exit
|
---|
735 | fi
|
---|
736 |
|
---|
737 | killproc() { # kill the named process(es)
|
---|
738 | pid=`/usr/bin/ps -e |
|
---|
739 | /usr/bin/grep -w $1 |
|
---|
740 | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
|
---|
741 | [ "$pid" != "" ] && kill $pid
|
---|
742 | }
|
---|
743 |
|
---|
744 | # Start/stop processes required for Samba server
|
---|
745 |
|
---|
746 | case "$1" in
|
---|
747 |
|
---|
748 | 'start')
|
---|
749 | #
|
---|
750 | # Edit these lines to suit your installation (paths, workgroup, host)
|
---|
751 | #
|
---|
752 | echo Starting SMBD
|
---|
753 | /usr/local/samba/bin/smbd -D -s \
|
---|
754 | /usr/local/samba/smb.conf
|
---|
755 |
|
---|
756 | echo Starting NMBD
|
---|
757 | /usr/local/samba/bin/nmbd -D -l \
|
---|
758 | /usr/local/samba/var/log -s /usr/local/samba/smb.conf
|
---|
759 |
|
---|
760 | echo Starting Winbind Daemon
|
---|
761 | /usr/local/samba/sbin/winbindd
|
---|
762 | ;;
|
---|
763 |
|
---|
764 | 'stop')
|
---|
765 | killproc nmbd
|
---|
766 | killproc smbd
|
---|
767 | killproc winbindd
|
---|
768 | ;;
|
---|
769 |
|
---|
770 | *)
|
---|
771 | echo "Usage: /etc/init.d/samba.server { start | stop }"
|
---|
772 | ;;
|
---|
773 | esac
|
---|
774 | </pre><p>
|
---|
775 | Again, if you would like to run Samba in dual daemon mode, replace:
|
---|
776 | </p><pre class="programlisting">
|
---|
777 | /usr/local/samba/sbin/winbindd
|
---|
778 | </pre><p>
|
---|
779 | in the script above with:
|
---|
780 | </p><pre class="programlisting">
|
---|
781 | /usr/local/samba/sbin/winbindd -D
|
---|
782 | </pre><p>
|
---|
783 | </p></div><div class="sect4" title="Restarting"><div class="titlepage"><div><div><h5 class="title"><a name="id418642"></a>Restarting</h5></div></div></div><p>
|
---|
784 | <a class="indexterm" name="id418650"></a>
|
---|
785 | <a class="indexterm" name="id418657"></a>
|
---|
786 | If you restart the <span class="application">smbd</span>, <span class="application">nmbd</span>, and <span class="application">winbindd</span> daemons at this point, you
|
---|
787 | should be able to connect to the Samba server as a domain member just as
|
---|
788 | if you were a local user.
|
---|
789 | </p></div></div><div class="sect3" title="Configure Winbind and PAM"><div class="titlepage"><div><div><h4 class="title"><a name="id418686"></a>Configure Winbind and PAM</h4></div></div></div><p>
|
---|
790 | <a class="indexterm" name="id418694"></a>
|
---|
791 | <a class="indexterm" name="id418701"></a>
|
---|
792 | <a class="indexterm" name="id418707"></a>
|
---|
793 | <a class="indexterm" name="id418714"></a>
|
---|
794 | If you have made it this far, you know that <code class="literal">winbindd</code> and Samba are working together. If you
|
---|
795 | want to use Winbind to provide authentication for other services, keep reading. The PAM configuration files
|
---|
796 | need to be altered in this step. (Did you remember to make backups of your original
|
---|
797 | <code class="filename">/etc/pam.d</code> files? If not, do it now.)
|
---|
798 | </p><p>
|
---|
799 | <a class="indexterm" name="id418738"></a>
|
---|
800 | <a class="indexterm" name="id418745"></a>
|
---|
801 | <a class="indexterm" name="id418752"></a>
|
---|
802 | <a class="indexterm" name="id418759"></a>
|
---|
803 | <a class="indexterm" name="id418765"></a>
|
---|
804 | <a class="indexterm" name="id418772"></a>
|
---|
805 | You will need a PAM module to use winbindd with these other services. This module will be compiled in the
|
---|
806 | <code class="filename">../source/nsswitch</code> directory by invoking the command:
|
---|
807 | </p><pre class="screen">
|
---|
808 | <code class="prompt">root# </code><strong class="userinput"><code>make nsswitch/pam_winbind.so</code></strong>
|
---|
809 | </pre><p>
|
---|
810 | from the <code class="filename">../source</code> directory. The <code class="filename">pam_winbind.so</code> file should be
|
---|
811 | copied to the location of your other PAM security modules. On my Red Hat system, this was the
|
---|
812 | <code class="filename">/lib/security</code> directory. On Solaris, the PAM security modules reside in
|
---|
813 | <code class="filename">/usr/lib/security</code>.
|
---|
814 | </p><pre class="screen">
|
---|
815 | <code class="prompt">root# </code><strong class="userinput"><code>cp ../samba/source/nsswitch/pam_winbind.so /lib/security</code></strong>
|
---|
816 | </pre><p>
|
---|
817 | </p><div class="sect4" title="Linux/FreeBSD-Specific PAM Configuration"><div class="titlepage"><div><div><h5 class="title"><a name="id418845"></a>Linux/FreeBSD-Specific PAM Configuration</h5></div></div></div><p>
|
---|
818 | <a class="indexterm" name="id418853"></a>
|
---|
819 | The <code class="filename">/etc/pam.d/samba</code> file does not need to be changed. I just left this file as it was:
|
---|
820 | </p><pre class="programlisting">
|
---|
821 | auth required /lib/security/pam_stack.so service=system-auth
|
---|
822 | account required /lib/security/pam_stack.so service=system-auth
|
---|
823 | </pre><p>
|
---|
824 | <a class="indexterm" name="id418875"></a>
|
---|
825 | <a class="indexterm" name="id418882"></a>
|
---|
826 | <a class="indexterm" name="id418889"></a>
|
---|
827 | <a class="indexterm" name="id418895"></a>
|
---|
828 | <a class="indexterm" name="id418902"></a>
|
---|
829 | <a class="indexterm" name="id418909"></a>
|
---|
830 | <a class="indexterm" name="id418916"></a>
|
---|
831 | <a class="indexterm" name="id418923"></a>
|
---|
832 | <a class="indexterm" name="id418929"></a>
|
---|
833 | The other services that I modified to allow the use of Winbind as an authentication service were the normal
|
---|
834 | login on the console (or a terminal session), telnet logins, and ftp service. In order to enable these
|
---|
835 | services, you may first need to change the entries in <code class="filename">/etc/xinetd.d</code> (or
|
---|
836 | <code class="filename">/etc/inetd.conf</code>). Red Hat Linux 7.1 and later uses the new xinetd.d structure, in this
|
---|
837 | case you need to change the lines in <code class="filename">/etc/xinetd.d/telnet</code> and
|
---|
838 | <code class="filename">/etc/xinetd.d/wu-ftp</code> from:
|
---|
839 | </p><pre class="programlisting">
|
---|
840 | enable = no
|
---|
841 | </pre><p>
|
---|
842 | to
|
---|
843 | </p><pre class="programlisting">
|
---|
844 | enable = yes
|
---|
845 | </pre><p>
|
---|
846 | <a class="indexterm" name="id418977"></a>
|
---|
847 | <a class="indexterm" name="id418984"></a>
|
---|
848 | <a class="indexterm" name="id418991"></a>
|
---|
849 | For ftp services to work properly, you will also need to either have individual directories for the domain
|
---|
850 | users already present on the server or change the home directory template to a general directory for all
|
---|
851 | domain users. These can be easily set using the <code class="filename">smb.conf</code> global entry <a class="link" href="smb.conf.5.html#TEMPLATEHOMEDIR" target="_top">template homedir</a>.
|
---|
852 | </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
|
---|
853 | <a class="indexterm" name="id419023"></a>
|
---|
854 | The directory in <a class="link" href="smb.conf.5.html#TEMPLATEHOMEDIR" target="_top">template homedir</a> is not created automatically! Use pam_mkhomedir or
|
---|
855 | pre-create the directories of users to make sure users can log in on UNIX with their own home directory.
|
---|
856 | </p></div><p>
|
---|
857 | <a class="indexterm" name="id419045"></a>
|
---|
858 | <a class="indexterm" name="id419052"></a>
|
---|
859 | <a class="indexterm" name="id419058"></a>
|
---|
860 | The <code class="filename">/etc/pam.d/ftp</code> file can be changed to allow Winbind ftp access in a manner similar to
|
---|
861 | the samba file. My <code class="filename">/etc/pam.d/ftp</code> file was changed to look like this:
|
---|
862 | </p><pre class="programlisting">
|
---|
863 | auth required /lib/security/pam_listfile.so item=user sense=deny \
|
---|
864 | file=/etc/ftpusers onerr=succeed
|
---|
865 | auth sufficient /lib/security/pam_winbind.so
|
---|
866 | auth required /lib/security/pam_stack.so service=system-auth
|
---|
867 | auth required /lib/security/pam_shells.so
|
---|
868 | account sufficient /lib/security/pam_winbind.so
|
---|
869 | account required /lib/security/pam_stack.so service=system-auth
|
---|
870 | session required /lib/security/pam_stack.so service=system-auth
|
---|
871 | </pre><p>
|
---|
872 | <a class="indexterm" name="id419090"></a>
|
---|
873 | The <code class="filename">/etc/pam.d/login</code> file can be changed in nearly the same way. It now looks like this:
|
---|
874 | </p><pre class="programlisting">
|
---|
875 | auth required /lib/security/pam_securetty.so
|
---|
876 | auth sufficient /lib/security/pam_winbind.so
|
---|
877 | auth sufficient /lib/security/pam_unix.so use_first_pass
|
---|
878 | auth required /lib/security/pam_stack.so service=system-auth
|
---|
879 | auth required /lib/security/pam_nologin.so
|
---|
880 | account sufficient /lib/security/pam_winbind.so
|
---|
881 | account required /lib/security/pam_stack.so service=system-auth
|
---|
882 | password required /lib/security/pam_stack.so service=system-auth
|
---|
883 | session required /lib/security/pam_stack.so service=system-auth
|
---|
884 | session optional /lib/security/pam_console.so
|
---|
885 | </pre><p>
|
---|
886 | <a class="indexterm" name="id419114"></a>
|
---|
887 | <a class="indexterm" name="id419121"></a>
|
---|
888 | <a class="indexterm" name="id419128"></a>
|
---|
889 | In this case, I added the </p><pre class="programlisting">auth sufficient /lib/security/pam_winbind.so</pre><p> lines
|
---|
890 | as before, but also added the </p><pre class="programlisting">required pam_securetty.so</pre><p> above it to disallow
|
---|
891 | root logins over the network. I also added a </p><pre class="programlisting">sufficient /lib/security/pam_unix.so
|
---|
892 | use_first_pass</pre><p> line after the <code class="literal">winbind.so</code> line to get rid of annoying
|
---|
893 | double prompts for passwords.
|
---|
894 | </p></div><div class="sect4" title="Solaris-Specific Configuration"><div class="titlepage"><div><div><h5 class="title"><a name="id419163"></a>Solaris-Specific Configuration</h5></div></div></div><p>
|
---|
895 | <a class="indexterm" name="id419171"></a>
|
---|
896 | <a class="indexterm" name="id419177"></a>
|
---|
897 | The <code class="filename">/etc/pam.conf</code> needs to be changed. I changed this file so my Domain
|
---|
898 | users can log on both locally as well as with telnet. The following are the changes
|
---|
899 | that I made. You can customize the <code class="filename">pam.conf</code> file as per your requirements, but
|
---|
900 | be sure of those changes because in the worst case it will leave your system
|
---|
901 | nearly impossible to boot.
|
---|
902 | </p><pre class="programlisting">
|
---|
903 | #
|
---|
904 | #ident "@(#)pam.conf 1.14 99/09/16 SMI"
|
---|
905 | #
|
---|
906 | # Copyright (c) 1996-1999, Sun Microsystems, Inc.
|
---|
907 | # All Rights Reserved.
|
---|
908 | #
|
---|
909 | # PAM configuration
|
---|
910 | #
|
---|
911 | # Authentication management
|
---|
912 | #
|
---|
913 | login auth required /usr/lib/security/pam_winbind.so
|
---|
914 | login auth required /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
|
---|
915 | login auth required /usr/lib/security/$ISA/pam_dial_auth.so.1 try_first_pass
|
---|
916 | #
|
---|
917 | rlogin auth sufficient /usr/lib/security/pam_winbind.so
|
---|
918 | rlogin auth sufficient /usr/lib/security/$ISA/pam_rhosts_auth.so.1
|
---|
919 | rlogin auth required /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
|
---|
920 | #
|
---|
921 | dtlogin auth sufficient /usr/lib/security/pam_winbind.so
|
---|
922 | dtlogin auth required /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
|
---|
923 | #
|
---|
924 | rsh auth required /usr/lib/security/$ISA/pam_rhosts_auth.so.1
|
---|
925 | other auth sufficient /usr/lib/security/pam_winbind.so
|
---|
926 | other auth required /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
|
---|
927 | #
|
---|
928 | # Account management
|
---|
929 | #
|
---|
930 | login account sufficient /usr/lib/security/pam_winbind.so
|
---|
931 | login account requisite /usr/lib/security/$ISA/pam_roles.so.1
|
---|
932 | login account required /usr/lib/security/$ISA/pam_unix.so.1
|
---|
933 | #
|
---|
934 | dtlogin account sufficient /usr/lib/security/pam_winbind.so
|
---|
935 | dtlogin account requisite /usr/lib/security/$ISA/pam_roles.so.1
|
---|
936 | dtlogin account required /usr/lib/security/$ISA/pam_unix.so.1
|
---|
937 | #
|
---|
938 | other account sufficient /usr/lib/security/pam_winbind.so
|
---|
939 | other account requisite /usr/lib/security/$ISA/pam_roles.so.1
|
---|
940 | other account required /usr/lib/security/$ISA/pam_unix.so.1
|
---|
941 | #
|
---|
942 | # Session management
|
---|
943 | #
|
---|
944 | other session required /usr/lib/security/$ISA/pam_unix.so.1
|
---|
945 | #
|
---|
946 | # Password management
|
---|
947 | #
|
---|
948 | #other password sufficient /usr/lib/security/pam_winbind.so
|
---|
949 | other password required /usr/lib/security/$ISA/pam_unix.so.1
|
---|
950 | dtsession auth required /usr/lib/security/$ISA/pam_unix.so.1
|
---|
951 | #
|
---|
952 | # Support for Kerberos V5 authentication (uncomment to use Kerberos)
|
---|
953 | #
|
---|
954 | #rlogin auth optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
|
---|
955 | #login auth optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
|
---|
956 | #dtlogin auth optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
|
---|
957 | #other auth optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
|
---|
958 | #dtlogin account optional /usr/lib/security/$ISA/pam_krb5.so.1
|
---|
959 | #other account optional /usr/lib/security/$ISA/pam_krb5.so.1
|
---|
960 | #other session optional /usr/lib/security/$ISA/pam_krb5.so.1
|
---|
961 | #other password optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
|
---|
962 | </pre><p>
|
---|
963 | <a class="indexterm" name="id419226"></a>
|
---|
964 | I also added a <em class="parameter"><code>try_first_pass</code></em> line after the <code class="filename">winbind.so</code>
|
---|
965 | line to get rid of annoying double prompts for passwords.
|
---|
966 | </p><p>
|
---|
967 | Now restart your Samba and try connecting through your application that you
|
---|
968 | configured in the pam.conf.
|
---|
969 | </p></div></div></div></div><div class="sect1" title="Conclusion"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id419254"></a>Conclusion</h2></div></div></div><p>
|
---|
970 | <a class="indexterm" name="id419262"></a>
|
---|
971 | <a class="indexterm" name="id419268"></a>
|
---|
972 | <a class="indexterm" name="id419275"></a>
|
---|
973 | <a class="indexterm" name="id419281"></a>
|
---|
974 | <a class="indexterm" name="id419288"></a>
|
---|
975 | The Winbind system, through the use of the NSS, PAMs, and appropriate Microsoft RPC calls, have allowed us to
|
---|
976 | provide seamless integration of Microsoft Windows NT domain users on a UNIX system. The result is a great
|
---|
977 | reduction in the administrative cost of running a mixed UNIX and NT network.
|
---|
978 | </p></div><div class="sect1" title="Common Errors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id419300"></a>Common Errors</h2></div></div></div><p>
|
---|
979 | Winbind has a number of limitations in its current released version that we hope to overcome in future releases:
|
---|
980 | </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
|
---|
981 | Winbind is currently only available for the Linux, Solaris, AIX, and IRIX operating systems, although
|
---|
982 | ports to other operating systems are certainly possible. For such ports to be feasible, we require the C
|
---|
983 | library of the target operating system to support the NSS and PAM systems. This is becoming more common as NSS
|
---|
984 | and PAM gain support among UNIX vendors.
|
---|
985 | </p></li><li class="listitem"><p>
|
---|
986 | The mappings of Windows NT RIDs to UNIX IDs is not made algorithmically and depends on the order in
|
---|
987 | which unmapped users or groups are seen by Winbind. It may be difficult to recover the mappings of RID to UNIX
|
---|
988 | ID if the file containing this information is corrupted or destroyed.
|
---|
989 | </p></li><li class="listitem"><p>
|
---|
990 | Currently the Winbind PAM module does not take into account possible workstation and logon time
|
---|
991 | restrictions that may be set for Windows NT users; this is instead up to the PDC to enforce.
|
---|
992 | </p></li></ul></div><div class="sect2" title="NSCD Problem Warning"><div class="titlepage"><div><div><h3 class="title"><a name="id419333"></a>NSCD Problem Warning</h3></div></div></div><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
|
---|
993 | Do not under any circumstances run <code class="literal">nscd</code> on any system
|
---|
994 | on which <code class="literal">winbindd</code> is running.
|
---|
995 | </p></div><p>
|
---|
996 | If <code class="literal">nscd</code> is running on the UNIX/Linux system, then
|
---|
997 | even though NSSWITCH is correctly configured, it will not be possible to resolve
|
---|
998 | domain users and groups for file and directory controls.
|
---|
999 | </p></div><div class="sect2" title="Winbind Is Not Resolving Users and Groups"><div class="titlepage"><div><div><h3 class="title"><a name="id419367"></a>Winbind Is Not Resolving Users and Groups</h3></div></div></div><p><span class="quote">“<span class="quote">
|
---|
1000 | My <code class="filename">smb.conf</code> file is correctly configured. I have specified <a class="link" href="smb.conf.5.html#IDMAPUID" target="_top">idmap uid = 12000</a>,
|
---|
1001 | and <a class="link" href="smb.conf.5.html#IDMAPGID" target="_top">idmap gid = 3000-3500</a> and <code class="literal">winbind</code> is running.
|
---|
1002 | When I do the following, it all works fine.
|
---|
1003 | </span>”</span></p><pre class="screen">
|
---|
1004 | <code class="prompt">root# </code><strong class="userinput"><code>wbinfo -u</code></strong>
|
---|
1005 | MIDEARTH\maryo
|
---|
1006 | MIDEARTH\jackb
|
---|
1007 | MIDEARTH\ameds
|
---|
1008 | ...
|
---|
1009 | MIDEARTH\root
|
---|
1010 |
|
---|
1011 | <code class="prompt">root# </code><strong class="userinput"><code>wbinfo -g</code></strong>
|
---|
1012 | MIDEARTH\Domain Users
|
---|
1013 | MIDEARTH\Domain Admins
|
---|
1014 | MIDEARTH\Domain Guests
|
---|
1015 | ...
|
---|
1016 | MIDEARTH\Accounts
|
---|
1017 |
|
---|
1018 | <code class="prompt">root# </code><strong class="userinput"><code>getent passwd</code></strong>
|
---|
1019 | root:x:0:0:root:/root:/bin/bash
|
---|
1020 | bin:x:1:1:bin:/bin:/bin/bash
|
---|
1021 | ...
|
---|
1022 | maryo:x:15000:15003:Mary Orville:/home/MIDEARTH/maryo:/bin/false
|
---|
1023 | </pre><p><span class="quote">“<span class="quote">
|
---|
1024 | But the following command just fails:
|
---|
1025 | </span>”</span>
|
---|
1026 | </p><pre class="screen">
|
---|
1027 | <code class="prompt">root# </code><strong class="userinput"><code>chown maryo a_file</code></strong>
|
---|
1028 | chown: `maryo': invalid user
|
---|
1029 | </pre><p>
|
---|
1030 | <span class="quote">“<span class="quote">
|
---|
1031 | This is driving me nuts! What can be wrong?
|
---|
1032 | </span>”</span></p><p>
|
---|
1033 | Same problem as the one above.
|
---|
1034 | Your system is likely running <code class="literal">nscd</code>, the name service
|
---|
1035 | caching daemon. Shut it down, do not restart it! You will find your problem resolved.
|
---|
1036 | Alternately, fix the operation of nscd to resolve the problem.
|
---|
1037 | </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="VFS.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="optional.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="AdvancedNetworkManagement.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 23. Stackable VFS modules </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 25. Advanced Network Management</td></tr></table></div></body></html>
|
---|