1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 14. Identity Mapping (IDMAP)</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.0"><link rel="start" href="index.html" title="The Official Samba-3 HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="prev" href="NetCommand.html" title="Chapter 13. Remote and Local Management: The Net Command"><link rel="next" href="rights.html" title="Chapter 15. User Rights and Privileges"></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 14. Identity Mapping (IDMAP)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="NetCommand.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="rights.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="idmapper"></a>Chapter 14. Identity Mapping (IDMAP)</h2></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 href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="idmapper.html#id367289">Samba Server Deployment Types and IDMAP</a></span></dt><dd><dl><dt><span class="sect2"><a href="idmapper.html#id367312">Standalone Samba Server</a></span></dt><dt><span class="sect2"><a href="idmapper.html#id367370">Domain Member Server or Domain Member Client</a></span></dt><dt><span class="sect2"><a href="idmapper.html#id368265">Primary Domain Controller</a></span></dt><dt><span class="sect2"><a href="idmapper.html#id368484">Backup Domain Controller</a></span></dt></dl></dd><dt><span class="sect1"><a href="idmapper.html#id368550">Examples of IDMAP Backend Usage</a></span></dt><dd><dl><dt><span class="sect2"><a href="idmapper.html#id368610">Default Winbind TDB</a></span></dt><dt><span class="sect2"><a href="idmapper.html#id369321">IDMAP_RID with Winbind</a></span></dt><dt><span class="sect2"><a href="idmapper.html#id369895">IDMAP Storage in LDAP Using Winbind</a></span></dt><dt><span class="sect2"><a href="idmapper.html#id370456">IDMAP and NSS Using LDAP from ADS with RFC2307bis Schema Extension</a></span></dt></dl></dd></dl></div><p>
|
---|
2 | <a class="indexterm" name="id367035"></a>
|
---|
3 | <a class="indexterm" name="id367042"></a>
|
---|
4 | <a class="indexterm" name="id367049"></a>
|
---|
5 | <a class="indexterm" name="id367056"></a>
|
---|
6 | <a class="indexterm" name="id367065"></a>
|
---|
7 | <a class="indexterm" name="id367071"></a>
|
---|
8 | <a class="indexterm" name="id367078"></a>
|
---|
9 | The Microsoft Windows operating system has a number of features that impose specific challenges
|
---|
10 | to interoperability with the operating systems on which Samba is implemented. This chapter deals
|
---|
11 | explicitly with the mechanisms Samba-3 (version 3.0.8 and later) uses to overcome one of the
|
---|
12 | key challenges in the integration of Samba servers into an MS Windows networking environment.
|
---|
13 | This chapter deals with identity mapping (IDMAP) of Windows security identifiers (SIDs)
|
---|
14 | to UNIX UIDs and GIDs.
|
---|
15 | </p><p>
|
---|
16 | To ensure sufficient coverage, each possible Samba deployment type is discussed.
|
---|
17 | This is followed by an overview of how the IDMAP facility may be implemented.
|
---|
18 | </p><p>
|
---|
19 | <a class="indexterm" name="id367097"></a>
|
---|
20 | <a class="indexterm" name="id367103"></a>
|
---|
21 | <a class="indexterm" name="id367110"></a>
|
---|
22 | <a class="indexterm" name="id367117"></a>
|
---|
23 | The IDMAP facility is of concern where more than one Samba server (or Samba network client)
|
---|
24 | is installed in a domain. Where there is a single Samba server, do not be too concerned regarding
|
---|
25 | the IDMAP infrastructure the default behavior of Samba is nearly always sufficient.
|
---|
26 | Where mulitple Samba servers are used it is often necessary to move data off one server and onto
|
---|
27 | another, and that is where the fun begins!
|
---|
28 | </p><p>
|
---|
29 | <a class="indexterm" name="id367134"></a>
|
---|
30 | <a class="indexterm" name="id367140"></a>
|
---|
31 | <a class="indexterm" name="id367146"></a>
|
---|
32 | <a class="indexterm" name="id367153"></a>
|
---|
33 | <a class="indexterm" name="id367160"></a>
|
---|
34 | <a class="indexterm" name="id367166"></a>
|
---|
35 | <a class="indexterm" name="id367173"></a>
|
---|
36 | <a class="indexterm" name="id367180"></a>
|
---|
37 | Where user and group account information is stored in an LDAP directory every server can have the same
|
---|
38 | consistent UID and GID for users and groups. This is achieved using NSS and the nss_ldap tool. Samba
|
---|
39 | can be configured to use only local accounts, in which case the scope of the IDMAP problem is somewhat
|
---|
40 | reduced. This works reasonably well if the servers belong to a single domain, and interdomain trusts
|
---|
41 | are not needed. On the other hand, if the Samba servers are NT4 domain members, or ADS domain members,
|
---|
42 | or if there is a need to keep the security name-space separate (i.e., the user
|
---|
43 | <code class="literal">DOMINICUS\FJones</code> must not be given access to the account resources of the user
|
---|
44 | <code class="literal">FRANCISCUS\FJones</code><sup>[<a name="id367203" href="#ftn.id367203">4</a>]</sup> free from inadvertent cross-over, close attention should be given
|
---|
45 | to the way that the IDMAP facility is configured.
|
---|
46 | </p><p>
|
---|
47 | <a class="indexterm" name="id367229"></a>
|
---|
48 | <a class="indexterm" name="id367236"></a>
|
---|
49 | <a class="indexterm" name="id367242"></a>
|
---|
50 | <a class="indexterm" name="id367249"></a>
|
---|
51 | <a class="indexterm" name="id367256"></a>
|
---|
52 | <a class="indexterm" name="id367262"></a>
|
---|
53 | The use of IDMAP is important where the Samba server will be accessed by workstations or servers from
|
---|
54 | more than one domain, in which case it is important to run winbind so it can handle the resolution (ID mapping)
|
---|
55 | of foreign SIDs to local UNIX UIDs and GIDs.
|
---|
56 | </p><p>
|
---|
57 | <a class="indexterm" name="id367274"></a>
|
---|
58 | The use of the IDMAP facility requires the execution of the <code class="literal">winbindd</code> upon Samba startup.
|
---|
59 | </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id367289"></a>Samba Server Deployment Types and IDMAP</h2></div></div></div><p>
|
---|
60 | <a class="indexterm" name="id367297"></a>
|
---|
61 | There are four basic server deployment types, as documented in <a href="ServerType.html" title="Chapter 3. Server Types and Security Modes">the chapter
|
---|
62 | on Server Types and Security Modes</a>.
|
---|
63 | </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id367312"></a>Standalone Samba Server</h3></div></div></div><p>
|
---|
64 | <a class="indexterm" name="id367320"></a>
|
---|
65 | <a class="indexterm" name="id367327"></a>
|
---|
66 | <a class="indexterm" name="id367334"></a>
|
---|
67 | A standalone Samba server is an implementation that is not a member of a Windows NT4 domain,
|
---|
68 | a Windows 200X Active Directory domain, or a Samba domain.
|
---|
69 | </p><p>
|
---|
70 | <a class="indexterm" name="id367345"></a>
|
---|
71 | <a class="indexterm" name="id367352"></a>
|
---|
72 | <a class="indexterm" name="id367359"></a>
|
---|
73 | By definition, this means that users and groups will be created and controlled locally, and
|
---|
74 | the identity of a network user must match a local UNIX/Linux user login. The IDMAP facility
|
---|
75 | is therefore of little to no interest, winbind will not be necessary, and the IDMAP facility
|
---|
76 | will not be relevant or of interest.
|
---|
77 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id367370"></a>Domain Member Server or Domain Member Client</h3></div></div></div><p>
|
---|
78 | <a class="indexterm" name="id367378"></a>
|
---|
79 | <a class="indexterm" name="id367385"></a>
|
---|
80 | <a class="indexterm" name="id367391"></a>
|
---|
81 | <a class="indexterm" name="id367398"></a>
|
---|
82 | <a class="indexterm" name="id367404"></a>
|
---|
83 | Samba-3 can act as a Windows NT4 PDC or BDC, thereby providing domain control protocols that
|
---|
84 | are compatible with Windows NT4. Samba-3 file and print sharing protocols are compatible with
|
---|
85 | all versions of MS Windows products. Windows NT4, as with MS Active Directory,
|
---|
86 | extensively makes use of Windows SIDs.
|
---|
87 | </p><p>
|
---|
88 | <a class="indexterm" name="id367417"></a>
|
---|
89 | <a class="indexterm" name="id367424"></a>
|
---|
90 | <a class="indexterm" name="id367430"></a>
|
---|
91 | Samba-3 domain member servers and clients must interact correctly with MS Windows SIDs. Incoming
|
---|
92 | Windows SIDs must be translated to local UNIX UIDs and GIDs. Outgoing information from the Samba
|
---|
93 | server must provide to MS Windows clients and servers appropriate SIDs.
|
---|
94 | </p><p>
|
---|
95 | <a class="indexterm" name="id367443"></a>
|
---|
96 | <a class="indexterm" name="id367449"></a>
|
---|
97 | A Samba member of a Windows networking domain (NT4-style or ADS) can be configured to handle
|
---|
98 | identity mapping in a variety of ways. The mechanism it uses depends on whether or not
|
---|
99 | the <code class="literal">winbindd</code> daemon is used and how the winbind functionality is configured.
|
---|
100 | The configuration options are briefly described here:
|
---|
101 | </p><div class="variablelist"><dl><dt><span class="term">Winbind is not used; users and groups are local: </span></dt><dd><p>
|
---|
102 | <a class="indexterm" name="id367477"></a>
|
---|
103 | <a class="indexterm" name="id367484"></a>
|
---|
104 | <a class="indexterm" name="id367490"></a>
|
---|
105 | <a class="indexterm" name="id367497"></a>
|
---|
106 | <a class="indexterm" name="id367504"></a>
|
---|
107 | <a class="indexterm" name="id367511"></a>
|
---|
108 | <a class="indexterm" name="id367518"></a>
|
---|
109 | <a class="indexterm" name="id367524"></a>
|
---|
110 | <a class="indexterm" name="id367531"></a>
|
---|
111 | <a class="indexterm" name="id367538"></a>
|
---|
112 | <a class="indexterm" name="id367545"></a>
|
---|
113 | Where <code class="literal">winbindd</code> is not used Samba (<code class="literal">smbd</code>)
|
---|
114 | uses the underlying UNIX/Linux mechanisms to resolve the identity of incoming
|
---|
115 | network traffic. This is done using the LoginID (account name) in the
|
---|
116 | session setup request and passing it to the getpwnam() system function call.
|
---|
117 | This call is implemented using the name service switch (NSS) mechanism on
|
---|
118 | modern UNIX/Linux systems. By saying "users and groups are local,"
|
---|
119 | we are implying that they are stored only on the local system, in the
|
---|
120 | <code class="filename">/etc/passwd</code> and <code class="filename">/etc/group</code> respectively.
|
---|
121 | </p><p>
|
---|
122 | <a class="indexterm" name="id367583"></a>
|
---|
123 | <a class="indexterm" name="id367589"></a>
|
---|
124 | For example, when the user <code class="literal">BERYLIUM\WambatW</code> tries to open a
|
---|
125 | connection to a Samba server the incoming SessionSetupAndX request will make a
|
---|
126 | system call to look up the user <code class="literal">WambatW</code> in the
|
---|
127 | <code class="filename">/etc/passwd</code> file.
|
---|
128 | </p><p>
|
---|
129 | <a class="indexterm" name="id367619"></a>
|
---|
130 | <a class="indexterm" name="id367626"></a>
|
---|
131 | <a class="indexterm" name="id367632"></a>
|
---|
132 | <a class="indexterm" name="id367639"></a>
|
---|
133 | <a class="indexterm" name="id367646"></a>
|
---|
134 | <a class="indexterm" name="id367652"></a>
|
---|
135 | <a class="indexterm" name="id367659"></a>
|
---|
136 | <a class="indexterm" name="id367666"></a>
|
---|
137 | This configuration may be used with standalone Samba servers, domain member
|
---|
138 | servers (NT4 or ADS), and for a PDC that uses either an smbpasswd
|
---|
139 | or a tdbsam-based Samba passdb backend.
|
---|
140 | </p></dd><dt><span class="term">Winbind is not used; users and groups resolved via NSS: </span></dt><dd><p>
|
---|
141 | <a class="indexterm" name="id367687"></a>
|
---|
142 | <a class="indexterm" name="id367693"></a>
|
---|
143 | <a class="indexterm" name="id367700"></a>
|
---|
144 | <a class="indexterm" name="id367707"></a>
|
---|
145 | <a class="indexterm" name="id367714"></a>
|
---|
146 | <a class="indexterm" name="id367720"></a>
|
---|
147 | In this situation user and group accounts are treated as if they are local
|
---|
148 | accounts. The only way in which this differs from having local accounts is
|
---|
149 | that the accounts are stored in a repository that can be shared. In practice
|
---|
150 | this means that they will reside in either an NIS-type database or else in LDAP.
|
---|
151 | </p><p>
|
---|
152 | <a class="indexterm" name="id367733"></a>
|
---|
153 | <a class="indexterm" name="id367740"></a>
|
---|
154 | <a class="indexterm" name="id367747"></a>
|
---|
155 | <a class="indexterm" name="id367753"></a>
|
---|
156 | <a class="indexterm" name="id367760"></a>
|
---|
157 | <a class="indexterm" name="id367766"></a>
|
---|
158 | <a class="indexterm" name="id367773"></a>
|
---|
159 | This configuration may be used with standalone Samba servers, domain member
|
---|
160 | servers (NT4 or ADS), and for a PDC that uses either an smbpasswd
|
---|
161 | or a tdbsam-based Samba passdb backend.
|
---|
162 | </p></dd><dt><span class="term">Winbind/NSS with the default local IDMAP table: </span></dt><dd><p>
|
---|
163 | <a class="indexterm" name="id367794"></a>
|
---|
164 | <a class="indexterm" name="id367801"></a>
|
---|
165 | <a class="indexterm" name="id367808"></a>
|
---|
166 | <a class="indexterm" name="id367814"></a>
|
---|
167 | There are many sites that require only a simple Samba server or a single Samba
|
---|
168 | server that is a member of a Windows NT4 domain or an ADS domain. A typical example
|
---|
169 | is an appliance like file server on which no local accounts are configured and
|
---|
170 | winbind is used to obtain account credentials from the domain controllers for the
|
---|
171 | domain. The domain control can be provided by Samba-3, MS Windows NT4, or MS Windows
|
---|
172 | Active Directory.
|
---|
173 | </p><p>
|
---|
174 | <a class="indexterm" name="id367828"></a>
|
---|
175 | <a class="indexterm" name="id367835"></a>
|
---|
176 | <a class="indexterm" name="id367842"></a>
|
---|
177 | <a class="indexterm" name="id367849"></a>
|
---|
178 | <a class="indexterm" name="id367856"></a>
|
---|
179 | Winbind is a great convenience in this situation. All that is needed is a range of
|
---|
180 | UID numbers and GID numbers that can be defined in the <code class="filename">smb.conf</code> file. The
|
---|
181 | <code class="filename">/etc/nsswitch.conf</code> file is configured to use <code class="literal">winbind</code>,
|
---|
182 | which does all the difficult work of mapping incoming SIDs to appropriate UIDs and GIDs.
|
---|
183 | The SIDs are allocated a UID/GID in the order in which winbind receives them.
|
---|
184 | </p><p>
|
---|
185 | <a class="indexterm" name="id367886"></a>
|
---|
186 | <a class="indexterm" name="id367893"></a>
|
---|
187 | <a class="indexterm" name="id367899"></a>
|
---|
188 | <a class="indexterm" name="id367906"></a>
|
---|
189 | This configuration is not convenient or practical in sites that have more than one
|
---|
190 | Samba server and that require the same UID or GID for the same user or group across
|
---|
191 | all servers. One of the hazards of this method is that in the event that the winbind
|
---|
192 | IDMAP file becomes corrupted or lost, the repaired or rebuilt IDMAP file may allocate
|
---|
193 | UIDs and GIDs to different users and groups from what was there previously with the
|
---|
194 | result that MS Windows files that are stored on the Samba server may now not belong to
|
---|
195 | the rightful owners.
|
---|
196 | </p></dd><dt><span class="term">Winbind/NSS uses RID based IDMAP: </span></dt><dd><p>
|
---|
197 | <a class="indexterm" name="id367930"></a>
|
---|
198 | <a class="indexterm" name="id367936"></a>
|
---|
199 | <a class="indexterm" name="id367943"></a>
|
---|
200 | <a class="indexterm" name="id367950"></a>
|
---|
201 | The IDMAP_RID facility is new to Samba version 3.0.8. It was added to make life easier
|
---|
202 | for a number of sites that are committed to use of MS ADS, that do not apply
|
---|
203 | an ADS schema extension, and that do not have an installed an LDAP directory server just for
|
---|
204 | the purpose of maintaining an IDMAP table. If you have a single ADS domain (not a forest of
|
---|
205 | domains, and not multiple domain trees) and you want a simple cookie-cutter solution to the
|
---|
206 | IDMAP table problem, then IDMAP_RID is an obvious choice.
|
---|
207 | </p><p>
|
---|
208 | <a class="indexterm" name="id367969"></a>
|
---|
209 | <a class="indexterm" name="id367975"></a>
|
---|
210 | <a class="indexterm" name="id367982"></a>
|
---|
211 | <a class="indexterm" name="id367989"></a>
|
---|
212 | <a class="indexterm" name="id367996"></a>
|
---|
213 | <a class="indexterm" name="id368002"></a>
|
---|
214 | <a class="indexterm" name="id368009"></a>
|
---|
215 | <a class="indexterm" name="id368015"></a>
|
---|
216 | This facility requires the allocation of the <em class="parameter"><code>idmap uid</code></em> and the
|
---|
217 | <em class="parameter"><code>idmap gid</code></em> ranges, and within the <em class="parameter"><code>idmap uid</code></em>
|
---|
218 | it is possible to allocate a subset of this range for automatic mapping of the relative
|
---|
219 | identifier (RID) portion of the SID directly to the base of the UID plus the RID value.
|
---|
220 | For example, if the <em class="parameter"><code>idmap uid</code></em> range is <code class="constant">1000-100000000</code>
|
---|
221 | and the <em class="parameter"><code>idmap backend = idmap_rid:DOMAIN_NAME=1000-50000000</code></em>, and
|
---|
222 | a SID is encountered that has the value <code class="constant">S-1-5-21-34567898-12529001-32973135-1234</code>,
|
---|
223 | the resulting UID will be <code class="constant">1000 + 1234 = 2234</code>.
|
---|
224 | </p></dd><dt><span class="term">Winbind with an NSS/LDAP backend-based IDMAP facility: </span></dt><dd><p>
|
---|
225 | <a class="indexterm" name="id368079"></a>
|
---|
226 | <a class="indexterm" name="id368086"></a>
|
---|
227 | <a class="indexterm" name="id368092"></a>
|
---|
228 | <a class="indexterm" name="id368099"></a>
|
---|
229 | <a class="indexterm" name="id368106"></a>
|
---|
230 | <a class="indexterm" name="id368112"></a>
|
---|
231 | <a class="indexterm" name="id368119"></a>
|
---|
232 | <a class="indexterm" name="id368126"></a>
|
---|
233 | In this configuration <code class="literal">winbind</code> resolved SIDs to UIDs and GIDs from
|
---|
234 | the <em class="parameter"><code>idmap uid</code></em> and <em class="parameter"><code>idmap gid</code></em> ranges specified
|
---|
235 | in the <code class="filename">smb.conf</code> file, but instead of using a local winbind IDMAP table, it is stored
|
---|
236 | in an LDAP directory so that all domain member machines (clients and servers) can share
|
---|
237 | a common IDMAP table.
|
---|
238 | </p><p>
|
---|
239 | <a class="indexterm" name="id368162"></a>
|
---|
240 | <a class="indexterm" name="id368169"></a>
|
---|
241 | <a class="indexterm" name="id368176"></a>
|
---|
242 | It is important that all LDAP IDMAP clients use only the master LDAP server because the
|
---|
243 | <em class="parameter"><code>idmap backend</code></em> facility in the <code class="filename">smb.conf</code> file does not correctly
|
---|
244 | handle LDAP redirects.
|
---|
245 | </p></dd><dt><span class="term">Winbind with NSS to resolve UNIX/Linux user and group IDs: </span></dt><dd><p>
|
---|
246 | The use of LDAP as the passdb backend is a smart solution for PDC, BDC, and
|
---|
247 | domain member servers. It is a neat method for assuring that UIDs, GIDs, and the matching
|
---|
248 | SIDs are consistent across all servers.
|
---|
249 | </p><p>
|
---|
250 | <a class="indexterm" name="id368213"></a>
|
---|
251 | <a class="indexterm" name="id368220"></a>
|
---|
252 | The use of the LDAP-based passdb backend requires use of the PADL nss_ldap utility or
|
---|
253 | an equivalent. In this situation winbind is used to handle foreign SIDs, that is, SIDs from
|
---|
254 | standalone Windows clients (i.e., not a member of our domain) as well as SIDs from
|
---|
255 | another domain. The foreign UID/GID is mapped from allocated ranges (idmap uid and idmap gid)
|
---|
256 | in precisely the same manner as when using winbind with a local IDMAP table.
|
---|
257 | </p><p>
|
---|
258 | <a class="indexterm" name="id368234"></a>
|
---|
259 | <a class="indexterm" name="id368241"></a>
|
---|
260 | <a class="indexterm" name="id368248"></a>
|
---|
261 | The nss_ldap tool set can be used to access UIDs and GIDs via LDAP as well as via Active
|
---|
262 | Directory. In order to use Active Directory, it is necessary to modify the ADS schema by
|
---|
263 | installing either the AD4UNIX schema extension or using the Microsoft Services for UNIX
|
---|
264 | version 3.5 or later to extend the ADS schema so it maintains UNIX account credentials.
|
---|
265 | Where the ADS schema is extended, a Microsoft Management Console (MMC) snap-in is also
|
---|
266 | installed to permit the UNIX credentials to be set and managed from the ADS User and Computer
|
---|
267 | Management tool. Each account must be separately UNIX-enabled before the UID and GID data can
|
---|
268 | be used by Samba.
|
---|
269 | </p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id368265"></a>Primary Domain Controller</h3></div></div></div><p>
|
---|
270 | <a class="indexterm" name="id368273"></a>
|
---|
271 | <a class="indexterm" name="id368280"></a>
|
---|
272 | <a class="indexterm" name="id368287"></a>
|
---|
273 | <a class="indexterm" name="id368293"></a>
|
---|
274 | Microsoft Windows domain security systems generate the user and group SID as part
|
---|
275 | of the process of creation of an account. Windows does not have a concept of the UNIX UID or a GID; rather,
|
---|
276 | it has its own type of security descriptor. When Samba is used as a domain controller, it provides a method
|
---|
277 | of producing a unique SID for each user and group. Samba generates a machine and a domain SID to which it
|
---|
278 | adds an RID that is calculated algorithmically from a base value that can be specified
|
---|
279 | in the <code class="filename">smb.conf</code> file, plus twice (2x) the UID or GID. This method is called “<span class="quote">algorithmic mapping</span>”.
|
---|
280 | </p><p>
|
---|
281 | <a class="indexterm" name="id368317"></a>
|
---|
282 | For example, if a user has a UID of 4321, and the algorithmic RID base has a value of 1000, the RID will
|
---|
283 | be <code class="literal">1000 + (2 x 4321) = 9642</code>. Thus, if the domain SID is
|
---|
284 | <code class="literal">S-1-5-21-89238497-92787123-12341112</code>, the resulting SID is
|
---|
285 | <code class="literal">S-1-5-21-89238497-92787123-12341112-9642</code>.
|
---|
286 | </p><p>
|
---|
287 | <a class="indexterm" name="id368347"></a>
|
---|
288 | <a class="indexterm" name="id368354"></a>
|
---|
289 | <a class="indexterm" name="id368360"></a>
|
---|
290 | <a class="indexterm" name="id368367"></a>
|
---|
291 | The foregoing type of SID is produced by Samba as an automatic function and is either produced on the fly
|
---|
292 | (as is the case when using a <em class="parameter"><code>passdb backend = [tdbsam | smbpasswd]</code></em>), or may be stored
|
---|
293 | as a permanent part of an account in an LDAP-based ldapsam.
|
---|
294 | </p><p>
|
---|
295 | <a class="indexterm" name="id368385"></a>
|
---|
296 | <a class="indexterm" name="id368392"></a>
|
---|
297 | <a class="indexterm" name="id368398"></a>
|
---|
298 | <a class="indexterm" name="id368405"></a>
|
---|
299 | <a class="indexterm" name="id368412"></a>
|
---|
300 | <a class="indexterm" name="id368419"></a>
|
---|
301 | <a class="indexterm" name="id368425"></a>
|
---|
302 | <a class="indexterm" name="id368432"></a>
|
---|
303 | <a class="indexterm" name="id368439"></a>
|
---|
304 | ADS uses a directory schema that can be extended to accommodate additional
|
---|
305 | account attributes such as UIDs and GIDs. The installation of Microsoft Service for UNIX 3.5 will expand
|
---|
306 | the normal ADS schema to include UNIX account attributes. These must of course be managed separately
|
---|
307 | through a snap-in module to the normal ADS account management MMC interface.
|
---|
308 | </p><p>
|
---|
309 | <a class="indexterm" name="id368452"></a>
|
---|
310 | <a class="indexterm" name="id368458"></a>
|
---|
311 | <a class="indexterm" name="id368465"></a>
|
---|
312 | <a class="indexterm" name="id368472"></a>
|
---|
313 | Security identifiers used within a domain must be managed to avoid conflict and to preserve itegrity.
|
---|
314 | In an NT4 domain context, the PDC manages the distribution of all security credentials to the backup
|
---|
315 | domain controllers (BDCs). At this time the only passdb backend for a Samba domain controller that is suitable
|
---|
316 | for such information is an LDAP backend.
|
---|
317 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id368484"></a>Backup Domain Controller</h3></div></div></div><p>
|
---|
318 | <a class="indexterm" name="id368492"></a>
|
---|
319 | <a class="indexterm" name="id368498"></a>
|
---|
320 | <a class="indexterm" name="id368505"></a>
|
---|
321 | <a class="indexterm" name="id368512"></a>
|
---|
322 | <a class="indexterm" name="id368518"></a>
|
---|
323 | <a class="indexterm" name="id368525"></a>
|
---|
324 | <a class="indexterm" name="id368532"></a>
|
---|
325 | BDCs have read-only access to security credentials that are stored in LDAP.
|
---|
326 | Changes in user or group account information are passed by the BDC to the PDC. Only the PDC can write
|
---|
327 | changes to the directory.
|
---|
328 | </p><p>
|
---|
329 | IDMAP information can be written directly to the LDAP server so long as all domain controllers
|
---|
330 | have access to the master (writable) LDAP server. Samba-3 at this time does not handle LDAP redirects
|
---|
331 | in the IDMAP backend. This means that it is is unsafe to use a slave (replicate) LDAP server with
|
---|
332 | the IDMAP facility.
|
---|
333 | </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id368550"></a>Examples of IDMAP Backend Usage</h2></div></div></div><p>
|
---|
334 | <a class="indexterm" name="id368558"></a>
|
---|
335 | <a class="indexterm" name="id368567"></a>
|
---|
336 | <a class="indexterm" name="id368576"></a>
|
---|
337 | <a class="indexterm" name="id368582"></a>
|
---|
338 | <a class="indexterm" name="id368589"></a>
|
---|
339 | Anyone who wishes to use <code class="literal">winbind</code> will find the following example configurations helpful.
|
---|
340 | Remember that in the majority of cases <code class="literal">winbind</code> is of primary interest for use with
|
---|
341 | domain member servers (DMSs) and domain member clients (DMCs).
|
---|
342 | </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id368610"></a>Default Winbind TDB</h3></div></div></div><p>
|
---|
343 | Two common configurations are used:
|
---|
344 | </p><div class="itemizedlist"><ul type="disc"><li><p>
|
---|
345 | Networks that have an NT4 PDC (with or without BDCs) or a Samba PDC (with or without BDCs).
|
---|
346 | </p></li><li><p>
|
---|
347 | Networks that use MS Windows 200x ADS.
|
---|
348 | </p></li></ul></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id368633"></a>NT4-Style Domains (Includes Samba Domains)</h4></div></div></div><p>
|
---|
349 | <a href="idmapper.html#idmapnt4dms" title="Example 14.1. NT4 Domain Member Server smb.conf">NT4 Domain Member Server smb.con</a> is a simple example of an NT4 DMS
|
---|
350 | <code class="filename">smb.conf</code> file that shows only the global section.
|
---|
351 | </p><div class="example"><a name="idmapnt4dms"></a><p class="title"><b>Example 14.1. NT4 Domain Member Server smb.conf</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id368684"></a><em class="parameter"><code>workgroup = MEGANET2</code></em></td></tr><tr><td><a class="indexterm" name="id368696"></a><em class="parameter"><code>security = DOMAIN</code></em></td></tr><tr><td><a class="indexterm" name="id368709"></a><em class="parameter"><code>idmap uid = 10000-20000</code></em></td></tr><tr><td><a class="indexterm" name="id368721"></a><em class="parameter"><code>idmap gid = 10000-20000</code></em></td></tr><tr><td><a class="indexterm" name="id368734"></a><em class="parameter"><code>template primary group = "Domain Users"</code></em></td></tr><tr><td><a class="indexterm" name="id368747"></a><em class="parameter"><code>template shell = /bin/bash</code></em></td></tr></table></div></div><br class="example-break"><p>
|
---|
352 | <a class="indexterm" name="id368762"></a>
|
---|
353 | <a class="indexterm" name="id368769"></a>
|
---|
354 | The use of <code class="literal">winbind</code> requires configuration of NSS. Edit the <code class="filename">/etc/nsswitch.conf</code>
|
---|
355 | so it includes the following entries:
|
---|
356 | </p><pre class="screen">
|
---|
357 | ...
|
---|
358 | passwd: files winbind
|
---|
359 | shadow: files winbind
|
---|
360 | group: files winbind
|
---|
361 | ...
|
---|
362 | hosts: files [dns] wins
|
---|
363 | ...
|
---|
364 | </pre><p>
|
---|
365 | The use of DNS in the hosts entry should be made only if DNS is used on site.
|
---|
366 | </p><p>
|
---|
367 | The creation of the DMS requires the following steps:
|
---|
368 | </p><div class="procedure"><ol type="1"><li><p>
|
---|
369 | Create or install an <code class="filename">smb.conf</code> file with the above configuration.
|
---|
370 | </p></li><li><p>
|
---|
371 | Execute:
|
---|
372 | </p><pre class="screen">
|
---|
373 | <code class="prompt">root# </code> net rpc join -UAdministrator%password
|
---|
374 | Joined domain MEGANET2.
|
---|
375 | </pre><p>
|
---|
376 | <a class="indexterm" name="id368834"></a>
|
---|
377 | The success of the join can be confirmed with the following command:
|
---|
378 | </p><pre class="screen">
|
---|
379 | <code class="prompt">root# </code> net rpc testjoin
|
---|
380 | Join to 'MIDEARTH' is OK
|
---|
381 | </pre><p>
|
---|
382 | A failed join would report an error message like the following:
|
---|
383 | <a class="indexterm" name="id368854"></a>
|
---|
384 | </p><pre class="screen">
|
---|
385 | <code class="prompt">root# </code> net rpc testjoin
|
---|
386 | [2004/11/05 16:34:12, 0] utils/net_rpc_join.c:net_rpc_join_ok(66)
|
---|
387 | Join to domain 'MEGANET2' is not valid
|
---|
388 | </pre><p>
|
---|
389 | </p></li><li><p>
|
---|
390 | <a class="indexterm" name="id368880"></a>
|
---|
391 | <a class="indexterm" name="id368886"></a>
|
---|
392 | <a class="indexterm" name="id368893"></a>
|
---|
393 | Start the <code class="literal">nmbd, winbind,</code> and <code class="literal">smbd</code> daemons in the order shown.
|
---|
394 | </p></li></ol></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id368916"></a>ADS Domains</h4></div></div></div><p>
|
---|
395 | <a class="indexterm" name="id368923"></a>
|
---|
396 | <a class="indexterm" name="id368930"></a>
|
---|
397 | The procedure for joining an ADS domain is similar to the NT4 domain join, except the <code class="filename">smb.conf</code> file
|
---|
398 | will have the contents shown in <a href="idmapper.html#idmapadsdms" title="Example 14.2. ADS Domain Member Server smb.conf">ADS Domain Member Server smb.conf</a>
|
---|
399 | </p><div class="example"><a name="idmapadsdms"></a><p class="title"><b>Example 14.2. ADS Domain Member Server smb.conf</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id368980"></a><em class="parameter"><code>workgroup = BUTTERNET</code></em></td></tr><tr><td><a class="indexterm" name="id368992"></a><em class="parameter"><code>netbios name = GARGOYLE</code></em></td></tr><tr><td><a class="indexterm" name="id369005"></a><em class="parameter"><code>realm = BUTTERNET.BIZ</code></em></td></tr><tr><td><a class="indexterm" name="id369017"></a><em class="parameter"><code>security = ADS</code></em></td></tr><tr><td><a class="indexterm" name="id369030"></a><em class="parameter"><code>template shell = /bin/bash</code></em></td></tr><tr><td><a class="indexterm" name="id369042"></a><em class="parameter"><code>idmap uid = 500-10000000</code></em></td></tr><tr><td><a class="indexterm" name="id369055"></a><em class="parameter"><code>idmap gid = 500-10000000</code></em></td></tr><tr><td><a class="indexterm" name="id369068"></a><em class="parameter"><code>winbind use default domain = Yes</code></em></td></tr><tr><td><a class="indexterm" name="id369080"></a><em class="parameter"><code>winbind nested groups = Yes</code></em></td></tr><tr><td><a class="indexterm" name="id369093"></a><em class="parameter"><code>printer admin = "BUTTERNET\Domain Admins"</code></em></td></tr></table></div></div><br class="example-break"><p>
|
---|
400 | <a class="indexterm" name="id369109"></a>
|
---|
401 | <a class="indexterm" name="id369116"></a>
|
---|
402 | <a class="indexterm" name="id369123"></a>
|
---|
403 | <a class="indexterm" name="id369130"></a>
|
---|
404 | <a class="indexterm" name="id369136"></a>
|
---|
405 | <a class="indexterm" name="id369143"></a>
|
---|
406 | <a class="indexterm" name="id369150"></a>
|
---|
407 | ADS DMS operation requires use of kerberos (KRB). For this to work, the <code class="filename">krb5.conf</code>
|
---|
408 | must be configured. The exact requirements depends on which version of MIT or Heimdal Kerberos is being
|
---|
409 | used. It is sound advice to use only the latest version, which at this time are MIT Kerberos version
|
---|
410 | 1.3.5 and Heimdal 0.61.
|
---|
411 | </p><p>
|
---|
412 | The creation of the DMS requires the following steps:
|
---|
413 | </p><div class="procedure"><ol type="1"><li><p>
|
---|
414 | Create or install an <code class="filename">smb.conf</code> file with the above configuration.
|
---|
415 | </p></li><li><p>
|
---|
416 | Edit the <code class="filename">/etc/nsswitch.conf</code> file as shown above.
|
---|
417 | </p></li><li><p>
|
---|
418 | Execute:
|
---|
419 | <a class="indexterm" name="id369204"></a>
|
---|
420 | </p><pre class="screen">
|
---|
421 | <code class="prompt">root# </code> net ads join -UAdministrator%password
|
---|
422 | Joined domain BUTTERNET.
|
---|
423 | </pre><p>
|
---|
424 | The success or failure of the join can be confirmed with the following command:
|
---|
425 | </p><pre class="screen">
|
---|
426 | <code class="prompt">root# </code> net ads testjoin
|
---|
427 | Using short domain name -- BUTTERNET
|
---|
428 | Joined 'GARGOYLE' to realm 'BUTTERNET.BIZ'
|
---|
429 | </pre><p>
|
---|
430 | </p><p>
|
---|
431 | An invalid or failed join can be detected by executing:
|
---|
432 | </p><pre class="screen">
|
---|
433 | <code class="prompt">root# </code> net ads testjoin
|
---|
434 | GARGOYLE$@'s password:
|
---|
435 | [2004/11/05 16:53:03, 0] utils/net_ads.c:ads_startup(186)
|
---|
436 | ads_connect: No results returned
|
---|
437 | Join to domain is not valid
|
---|
438 | </pre><p>
|
---|
439 | <a class="indexterm" name="id369256"></a>
|
---|
440 | <a class="indexterm" name="id369263"></a>
|
---|
441 | <a class="indexterm" name="id369270"></a>
|
---|
442 | <a class="indexterm" name="id369277"></a>
|
---|
443 | The specific error message may differ from the above because it depends on the type of failure that
|
---|
444 | may have occurred. Increase the <em class="parameter"><code>log level</code></em> to 10, repeat the test,
|
---|
445 | and then examine the log files produced to identify the nature of the failure.
|
---|
446 | </p></li><li><p>
|
---|
447 | Start the <code class="literal">nmbd</code>, <code class="literal">winbind</code>, and <code class="literal">smbd</code> daemons in the order shown.
|
---|
448 | </p></li></ol></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id369321"></a>IDMAP_RID with Winbind</h3></div></div></div><p>
|
---|
449 | <a class="indexterm" name="id369328"></a>
|
---|
450 | <a class="indexterm" name="id369335"></a>
|
---|
451 | <a class="indexterm" name="id369342"></a>
|
---|
452 | <a class="indexterm" name="id369348"></a>
|
---|
453 | The <code class="literal">idmap_rid</code> facility is a new tool that, unlike native winbind, creates a
|
---|
454 | predictable mapping of MS Windows SIDs to UNIX UIDs and GIDs. The key benefit of this method
|
---|
455 | of implementing the Samba IDMAP facility is that it eliminates the need to store the IDMAP data
|
---|
456 | in a central place. The downside is that it can be used only within a single ADS domain and
|
---|
457 | is not compatible with trusted domain implementations.
|
---|
458 | </p><p>
|
---|
459 | <a class="indexterm" name="id369368"></a>
|
---|
460 | <a class="indexterm" name="id369374"></a>
|
---|
461 | <a class="indexterm" name="id369381"></a>
|
---|
462 | <a class="indexterm" name="id369388"></a>
|
---|
463 | This alternate method of SID to UID/GID mapping can be achieved using the idmap_rid
|
---|
464 | plug-in. This plug-in uses the RID of the user SID to derive the UID and GID by adding the
|
---|
465 | RID to a base value specified. This utility requires that the parameter
|
---|
466 | “<span class="quote">allow trusted domains = No</span>” be specified, as it is not compatible
|
---|
467 | with multiple domain environments. The <em class="parameter"><code>idmap uid</code></em> and
|
---|
468 | <em class="parameter"><code>idmap gid</code></em> ranges must be specified.
|
---|
469 | </p><p>
|
---|
470 | <a class="indexterm" name="id369417"></a>
|
---|
471 | <a class="indexterm" name="id369424"></a>
|
---|
472 | The idmap_rid facility can be used both for NT4/Samba-style domains and Active Directory.
|
---|
473 | To use this with an NT4 domain, do not include the <em class="parameter"><code>realm</code></em> parameter; additionally, the
|
---|
474 | method used to join the domain uses the <code class="constant">net rpc join</code> process.
|
---|
475 | </p><p>
|
---|
476 | An example <code class="filename">smb.conf</code> file for and ADS domain environment is shown in <a href="idmapper.html#idmapadsridDMS" title="Example 14.3. ADS Domain Member smb.conf using idmap_rid">ADS
|
---|
477 | Domain Member smb.conf using idmap_rid</a>.
|
---|
478 | </p><div class="example"><a name="idmapadsridDMS"></a><p class="title"><b>Example 14.3. ADS Domain Member smb.conf using idmap_rid</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id369488"></a><em class="parameter"><code>workgroup = KPAK</code></em></td></tr><tr><td><a class="indexterm" name="id369500"></a><em class="parameter"><code>netbios name = BIGJOE</code></em></td></tr><tr><td><a class="indexterm" name="id369513"></a><em class="parameter"><code>realm = CORP.KPAK.COM</code></em></td></tr><tr><td><a class="indexterm" name="id369525"></a><em class="parameter"><code>server string = Office Server</code></em></td></tr><tr><td><a class="indexterm" name="id369538"></a><em class="parameter"><code>security = ADS</code></em></td></tr><tr><td><a class="indexterm" name="id369550"></a><em class="parameter"><code>allow trusted domains = No</code></em></td></tr><tr><td><a class="indexterm" name="id369563"></a><em class="parameter"><code>idmap backend = idmap_rid:KPAK=500-100000000</code></em></td></tr><tr><td><a class="indexterm" name="id369576"></a><em class="parameter"><code>idmap uid = 500-100000000</code></em></td></tr><tr><td><a class="indexterm" name="id369589"></a><em class="parameter"><code>idmap gid = 500-100000000</code></em></td></tr><tr><td><a class="indexterm" name="id369601"></a><em class="parameter"><code>template shell = /bin/bash</code></em></td></tr><tr><td><a class="indexterm" name="id369614"></a><em class="parameter"><code>winbind use default domain = Yes</code></em></td></tr><tr><td><a class="indexterm" name="id369627"></a><em class="parameter"><code>winbind enum users = No</code></em></td></tr><tr><td><a class="indexterm" name="id369639"></a><em class="parameter"><code>winbind enum groups = No</code></em></td></tr><tr><td><a class="indexterm" name="id369652"></a><em class="parameter"><code>winbind nested groups = Yes</code></em></td></tr><tr><td><a class="indexterm" name="id369665"></a><em class="parameter"><code>printer admin = "Domain Admins"</code></em></td></tr></table></div></div><br class="example-break"><p>
|
---|
479 | <a class="indexterm" name="id369680"></a>
|
---|
480 | <a class="indexterm" name="id369687"></a>
|
---|
481 | <a class="indexterm" name="id369694"></a>
|
---|
482 | <a class="indexterm" name="id369701"></a>
|
---|
483 | In a large domain with many users it is imperative to disable enumeration of users and groups.
|
---|
484 | For example, at a site that has 22,000 users in Active Directory the winbind-based user and
|
---|
485 | group resolution is unavailable for nearly 12 minutes following first startup of
|
---|
486 | <code class="literal">winbind</code>. Disabling enumeration resulted in instantaneous response.
|
---|
487 | The disabling of user and group enumeration means that it will not be possible to list users
|
---|
488 | or groups using the <code class="literal">getent passwd</code> and <code class="literal">getent group</code>
|
---|
489 | commands. It will be possible to perform the lookup for individual users, as shown in the following procedure.
|
---|
490 | </p><p>
|
---|
491 | <a class="indexterm" name="id369733"></a>
|
---|
492 | <a class="indexterm" name="id369740"></a>
|
---|
493 | The use of this tool requires configuration of NSS as per the native use of winbind. Edit the
|
---|
494 | <code class="filename">/etc/nsswitch.conf</code> so it has the following parameters:
|
---|
495 | </p><pre class="screen">
|
---|
496 | ...
|
---|
497 | passwd: files winbind
|
---|
498 | shadow: files winbind
|
---|
499 | group: files winbind
|
---|
500 | ...
|
---|
501 | hosts: files wins
|
---|
502 | ...
|
---|
503 | </pre><p>
|
---|
504 | </p><p>
|
---|
505 | The following procedure can use the idmap_rid facility:
|
---|
506 | </p><div class="procedure"><ol type="1"><li><p>
|
---|
507 | Create or install an <code class="filename">smb.conf</code> file with the above configuration.
|
---|
508 | </p></li><li><p>
|
---|
509 | Edit the <code class="filename">/etc/nsswitch.conf</code> file as shown above.
|
---|
510 | </p></li><li><p>
|
---|
511 | Execute:
|
---|
512 | </p><pre class="screen">
|
---|
513 | <code class="prompt">root# </code> net ads join -UAdministrator%password
|
---|
514 | Using short domain name -- KPAK
|
---|
515 | Joined 'BIGJOE' to realm 'CORP.KPAK.COM'
|
---|
516 | </pre><p>
|
---|
517 | </p><p>
|
---|
518 | <a class="indexterm" name="id369814"></a>
|
---|
519 | An invalid or failed join can be detected by executing:
|
---|
520 | </p><pre class="screen">
|
---|
521 | <code class="prompt">root# </code> net ads testjoin
|
---|
522 | BIGJOE$@'s password:
|
---|
523 | [2004/11/05 16:53:03, 0] utils/net_ads.c:ads_startup(186)
|
---|
524 | ads_connect: No results returned
|
---|
525 | Join to domain is not valid
|
---|
526 | </pre><p>
|
---|
527 | The specific error message may differ from the above because it depends on the type of failure that
|
---|
528 | may have occurred. Increase the <em class="parameter"><code>log level</code></em> to 10, repeat the test,
|
---|
529 | and then examine the log files produced to identify the nature of the failure.
|
---|
530 | </p></li><li><p>
|
---|
531 | Start the <code class="literal">nmbd</code>, <code class="literal">winbind</code>, and <code class="literal">smbd</code> daemons in the order shown.
|
---|
532 | </p></li><li><p>
|
---|
533 | Validate the operation of this configuration by executing:
|
---|
534 | <a class="indexterm" name="id369875"></a>
|
---|
535 | </p><pre class="screen">
|
---|
536 | <code class="prompt">root# </code> getent passwd administrator
|
---|
537 | administrator:x:1000:1013:Administrator:/home/BE/administrator:/bin/bash
|
---|
538 | </pre><p>
|
---|
539 | </p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id369895"></a>IDMAP Storage in LDAP Using Winbind</h3></div></div></div><p>
|
---|
540 | <a class="indexterm" name="id369903"></a>
|
---|
541 | <a class="indexterm" name="id369910"></a>
|
---|
542 | The storage of IDMAP information in LDAP can be used with both NT4/Samba-3-style domains and
|
---|
543 | ADS domains. OpenLDAP is a commonly used LDAP server for this purpose, although any
|
---|
544 | standards-complying LDAP server can be used. It is therefore possible to deploy this IDMAP
|
---|
545 | configuration using the Sun iPlanet LDAP server, Novell eDirectory, Microsoft ADS plus ADAM,
|
---|
546 | and so on.
|
---|
547 | </p><p>
|
---|
548 | An example is for an ADS domain is shown in <a href="idmapper.html#idmapldapDMS" title="Example 14.4. ADS Domain Member Server using LDAP">ADS Domain Member Server using
|
---|
549 | LDAP</a>.
|
---|
550 | </p><div class="example"><a name="idmapldapDMS"></a><p class="title"><b>Example 14.4. ADS Domain Member Server using LDAP</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id369959"></a><em class="parameter"><code>workgroup = SNOWSHOW</code></em></td></tr><tr><td><a class="indexterm" name="id369972"></a><em class="parameter"><code>netbios name = GOODELF</code></em></td></tr><tr><td><a class="indexterm" name="id369984"></a><em class="parameter"><code>realm = SNOWSHOW.COM</code></em></td></tr><tr><td><a class="indexterm" name="id369997"></a><em class="parameter"><code>server string = Samba Server</code></em></td></tr><tr><td><a class="indexterm" name="id370009"></a><em class="parameter"><code>security = ADS</code></em></td></tr><tr><td><a class="indexterm" name="id370022"></a><em class="parameter"><code>log level = 1 ads:10 auth:10 sam:10 rpc:10</code></em></td></tr><tr><td><a class="indexterm" name="id370035"></a><em class="parameter"><code>ldap admin dn = cn=Manager,dc=SNOWSHOW,dc=COM</code></em></td></tr><tr><td><a class="indexterm" name="id370047"></a><em class="parameter"><code>ldap idmap suffix = ou=Idmap</code></em></td></tr><tr><td><a class="indexterm" name="id370060"></a><em class="parameter"><code>ldap suffix = dc=SNOWSHOW,dc=COM</code></em></td></tr><tr><td><a class="indexterm" name="id370073"></a><em class="parameter"><code>idmap backend = ldap:ldap://ldap.snowshow.com</code></em></td></tr><tr><td><a class="indexterm" name="id370086"></a><em class="parameter"><code>idmap uid = 150000-550000</code></em></td></tr><tr><td><a class="indexterm" name="id370098"></a><em class="parameter"><code>idmap gid = 150000-550000</code></em></td></tr><tr><td><a class="indexterm" name="id370111"></a><em class="parameter"><code>template shell = /bin/bash</code></em></td></tr><tr><td><a class="indexterm" name="id370124"></a><em class="parameter"><code>winbind use default domain = Yes</code></em></td></tr></table></div></div><br class="example-break"><p>
|
---|
551 | <a class="indexterm" name="id370140"></a>
|
---|
552 | In the case of an NT4 or Samba-3-style domain the <em class="parameter"><code>realm</code></em> is not used, and the
|
---|
553 | command used to join the domain is <code class="literal">net rpc join</code>. The above example also demonstrates
|
---|
554 | advanced error-reporting techniques that are documented in <a href="bugreport.html#dbglvl" title="Debug Levels">Reporting Bugs</a>.
|
---|
555 | </p><p>
|
---|
556 | <a class="indexterm" name="id370171"></a>
|
---|
557 | <a class="indexterm" name="id370178"></a>
|
---|
558 | <a class="indexterm" name="id370185"></a>
|
---|
559 | Where MIT kerberos is installed (version 1.3.4 or later), edit the <code class="filename">/etc/krb5.conf</code>
|
---|
560 | file so it has the following contents:
|
---|
561 | </p><pre class="screen">
|
---|
562 | [logging]
|
---|
563 | default = FILE:/var/log/krb5libs.log
|
---|
564 | kdc = FILE:/var/log/krb5kdc.log
|
---|
565 | admin_server = FILE:/var/log/kadmind.log
|
---|
566 |
|
---|
567 | [libdefaults]
|
---|
568 | default_realm = SNOWSHOW.COM
|
---|
569 | dns_lookup_realm = false
|
---|
570 | dns_lookup_kdc = true
|
---|
571 |
|
---|
572 | [appdefaults]
|
---|
573 | pam = {
|
---|
574 | debug = false
|
---|
575 | ticket_lifetime = 36000
|
---|
576 | renew_lifetime = 36000
|
---|
577 | forwardable = true
|
---|
578 | krb4_convert = false
|
---|
579 | }
|
---|
580 | </pre><p>
|
---|
581 | </p><p>
|
---|
582 | Where Heimdal kerberos is installed, edit the <code class="filename">/etc/krb5.conf</code>
|
---|
583 | file so it is either empty (i.e., no contents) or it has the following contents:
|
---|
584 | </p><pre class="screen">
|
---|
585 | [libdefaults]
|
---|
586 | default_realm = SNOWSHOW.COM
|
---|
587 | clockskew = 300
|
---|
588 |
|
---|
589 | [realms]
|
---|
590 | SNOWSHOW.COM = {
|
---|
591 | kdc = ADSDC.SHOWSHOW.COM
|
---|
592 | }
|
---|
593 |
|
---|
594 | [domain_realm]
|
---|
595 | .snowshow.com = SNOWSHOW.COM
|
---|
596 | </pre><p>
|
---|
597 | </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
|
---|
598 | Samba cannot use the Heimdal libraries if there is no <code class="filename">/etc/krb5.conf</code> file.
|
---|
599 | So long as there is an empty file, the Heimdal kerberos libraries will be usable. There is no
|
---|
600 | need to specify any settings because Samba, using the Heimdal libraries, can figure this out automatically.
|
---|
601 | </p></div><p>
|
---|
602 | Edit the NSS control file <code class="filename">/etc/nsswitch.conf</code> so it has the following entries:
|
---|
603 | </p><pre class="screen">
|
---|
604 | ...
|
---|
605 | passwd: files ldap
|
---|
606 | shadow: files ldap
|
---|
607 | group: files ldap
|
---|
608 | ...
|
---|
609 | hosts: files wins
|
---|
610 | ...
|
---|
611 | </pre><p>
|
---|
612 | </p><p>
|
---|
613 | <a class="indexterm" name="id370257"></a>
|
---|
614 | <a class="indexterm" name="id370264"></a>
|
---|
615 | You will need the <a href="http://www.padl.com" target="_top">PADL</a> <code class="literal">nss_ldap</code>
|
---|
616 | tool set for this solution. Configure the <code class="filename">/etc/ldap.conf</code> file so it has
|
---|
617 | the information needed. The following is an example of a working file:
|
---|
618 | </p><pre class="screen">
|
---|
619 | host 192.168.2.1
|
---|
620 | base dc=snowshow,dc=com
|
---|
621 | binddn cn=Manager,dc=snowshow,dc=com
|
---|
622 | bindpw not24get
|
---|
623 |
|
---|
624 | pam_password exop
|
---|
625 |
|
---|
626 | nss_base_passwd ou=People,dc=snowshow,dc=com?one
|
---|
627 | nss_base_shadow ou=People,dc=snowshow,dc=com?one
|
---|
628 | nss_base_group ou=Groups,dc=snowshow,dc=com?one
|
---|
629 | ssl no
|
---|
630 | </pre><p>
|
---|
631 | </p><p>
|
---|
632 | The following procedure may be followed to effect a working configuration:
|
---|
633 | </p><div class="procedure"><ol type="1"><li><p>
|
---|
634 | Configure the <code class="filename">smb.conf</code> file as shown above.
|
---|
635 | </p></li><li><p>
|
---|
636 | Create the <code class="filename">/etc/krb5.conf</code> file as shown above.
|
---|
637 | </p></li><li><p>
|
---|
638 | Configure the <code class="filename">/etc/nsswitch.conf</code> file as shown above.
|
---|
639 | </p></li><li><p>
|
---|
640 | Download, build, and install the PADL nss_ldap tool set. Configure the
|
---|
641 | <code class="filename">/etc/ldap.conf</code> file as shown above.
|
---|
642 | </p></li><li><p>
|
---|
643 | Configure an LDAP server and initialize the directory with the top-level entries needed by IDMAP,
|
---|
644 | shown in the following LDIF file:
|
---|
645 | </p><pre class="screen">
|
---|
646 | dn: dc=snowshow,dc=com
|
---|
647 | objectClass: dcObject
|
---|
648 | objectClass: organization
|
---|
649 | dc: snowshow
|
---|
650 | o: The Greatest Snow Show in Singapore.
|
---|
651 | description: Posix and Samba LDAP Identity Database
|
---|
652 |
|
---|
653 | dn: cn=Manager,dc=snowshow,dc=com
|
---|
654 | objectClass: organizationalRole
|
---|
655 | cn: Manager
|
---|
656 | description: Directory Manager
|
---|
657 |
|
---|
658 | dn: ou=Idmap,dc=snowshow,dc=com
|
---|
659 | objectClass: organizationalUnit
|
---|
660 | ou: idmap
|
---|
661 | </pre><p>
|
---|
662 | </p></li><li><p>
|
---|
663 | Execute the command to join the Samba DMS to the ADS domain as shown here:
|
---|
664 | </p><pre class="screen">
|
---|
665 | <code class="prompt">root# </code> net ads testjoin
|
---|
666 | Using short domain name -- SNOWSHOW
|
---|
667 | Joined 'GOODELF' to realm 'SNOWSHOW.COM'
|
---|
668 | </pre><p>
|
---|
669 | </p></li><li><p>
|
---|
670 | Store the LDAP server access password in the Samba <code class="filename">secrets.tdb</code> file as follows:
|
---|
671 | </p><pre class="screen">
|
---|
672 | <code class="prompt">root# </code> smbpasswd -w not24get
|
---|
673 | </pre><p>
|
---|
674 | </p></li><li><p>
|
---|
675 | Start the <code class="literal">nmbd</code>, <code class="literal">winbind</code>, and <code class="literal">smbd</code> daemons in the order shown.
|
---|
676 | </p></li></ol></div><p>
|
---|
677 | <a class="indexterm" name="id370445"></a>
|
---|
678 | Follow the diagnositic procedures shown earlier in this chapter to identify success or failure of the join.
|
---|
679 | In many cases a failure is indicated by a silent return to the command prompt with no indication of the
|
---|
680 | reason for failure.
|
---|
681 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id370456"></a>IDMAP and NSS Using LDAP from ADS with RFC2307bis Schema Extension</h3></div></div></div><p>
|
---|
682 | <a class="indexterm" name="id370464"></a>
|
---|
683 | <a class="indexterm" name="id370471"></a>
|
---|
684 | The use of this method is messy. The information provided in the following is for guidance only
|
---|
685 | and is very definitely not complete. This method does work; it is used in a number of large sites
|
---|
686 | and has an acceptable level of performance.
|
---|
687 | </p><p>
|
---|
688 | An example <code class="filename">smb.conf</code> file is shown in <a href="idmapper.html#idmaprfc2307" title="Example 14.5. ADS Domain Member Server using RFC2307bis Schema Extension Date via NSS">ADS Domain Member Server using
|
---|
689 | RFC2307bis Schema Extension Date via NSS</a>.
|
---|
690 | </p><div class="example"><a name="idmaprfc2307"></a><p class="title"><b>Example 14.5. ADS Domain Member Server using RFC2307bis Schema Extension Date via NSS</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id370527"></a><em class="parameter"><code>workgroup = BOBBY</code></em></td></tr><tr><td><a class="indexterm" name="id370539"></a><em class="parameter"><code>realm = BOBBY.COM</code></em></td></tr><tr><td><a class="indexterm" name="id370552"></a><em class="parameter"><code>security = ADS</code></em></td></tr><tr><td><a class="indexterm" name="id370564"></a><em class="parameter"><code>idmap uid = 150000-550000</code></em></td></tr><tr><td><a class="indexterm" name="id370577"></a><em class="parameter"><code>idmap gid = 150000-550000</code></em></td></tr><tr><td><a class="indexterm" name="id370590"></a><em class="parameter"><code>template shell = /bin/bash</code></em></td></tr><tr><td><a class="indexterm" name="id370602"></a><em class="parameter"><code>winbind cache time = 5</code></em></td></tr><tr><td><a class="indexterm" name="id370615"></a><em class="parameter"><code>winbind use default domain = Yes</code></em></td></tr><tr><td><a class="indexterm" name="id370628"></a><em class="parameter"><code>winbind trusted domains only = Yes</code></em></td></tr><tr><td><a class="indexterm" name="id370640"></a><em class="parameter"><code>winbind nested groups = Yes</code></em></td></tr></table></div></div><br class="example-break"><p>
|
---|
691 | <a class="indexterm" name="id370656"></a>
|
---|
692 | The DMS must be joined to the domain using the usual procedure. Additionally, it is necessary
|
---|
693 | to build and install the PADL nss_ldap tool set. Be sure to build this tool set with the
|
---|
694 | following:
|
---|
695 | </p><pre class="screen">
|
---|
696 | ./configure --enable-rfc2307bis --enable-schema-mapping
|
---|
697 | make install
|
---|
698 | </pre><p>
|
---|
699 | </p><p>
|
---|
700 | <a class="indexterm" name="id370674"></a>
|
---|
701 | The following <code class="filename">/etc/nsswitch.conf</code> file contents are required:
|
---|
702 | </p><pre class="screen">
|
---|
703 | ...
|
---|
704 | passwd: files ldap
|
---|
705 | shadow: files ldap
|
---|
706 | group: files ldap
|
---|
707 | ...
|
---|
708 | hosts: files wins
|
---|
709 | ...
|
---|
710 | </pre><p>
|
---|
711 | </p><p>
|
---|
712 | <a class="indexterm" name="id370697"></a>
|
---|
713 | <a class="indexterm" name="id370704"></a>
|
---|
714 | The <code class="filename">/etc/ldap.conf</code> file must be configured also. Refer to the PADL documentation
|
---|
715 | and source code for nss_ldap to specific instructions.
|
---|
716 | </p><p>
|
---|
717 | The next step involves preparation of the ADS schema. This is briefly discussed in the remaining
|
---|
718 | part of this chapter.
|
---|
719 | </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id370723"></a>IDMAP, Active Directory, and MS Services for UNIX 3.5</h4></div></div></div><p>
|
---|
720 | <a class="indexterm" name="id370731"></a>
|
---|
721 | The Microsoft Windows Service for UNIX (SFU) version 3.5 is available for free
|
---|
722 | <a href="http://www.microsoft.com/windows/sfu/" target="_top">download</a>
|
---|
723 | from the Microsoft Web site. You will need to download this tool and install it following
|
---|
724 | Microsoft instructions.
|
---|
725 | </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id370748"></a>IDMAP, Active Directory and AD4UNIX</h4></div></div></div><p>
|
---|
726 | Instructions for obtaining and installing the AD4UNIX tool set can be found from the
|
---|
727 | <a href="http://www.geekcomix.com/cgi-bin/classnotes/wiki.pl?LDAP01/An_Alternative_Approach" target="_top">
|
---|
728 | Geekcomix</a> Web site.
|
---|
729 | </p></div></div></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><code class="literal"><sup>[<a name="ftn.id367203" href="#id367203">4</a>] </sup>DOMINICUS\FJones</code><code class="literal">FRANCISCUS\FJones</code><code class="literal">FJones</code></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="NetCommand.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="rights.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 13. Remote and Local Management: The Net Command </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 15. User Rights and Privileges</td></tr></table></div></body></html>
|
---|