File: ServerType.html

package info (click to toggle)
samba 2:3.6.6-6+deb7u7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 160,976 kB
  • sloc: ansic: 1,764,536; xml: 114,867; python: 78,119; perl: 27,633; sh: 13,802; makefile: 4,704; asm: 3,281; cpp: 2,281; yacc: 1,949; exp: 1,784; ada: 1,681; pascal: 1,089; cs: 879; awk: 756; lex: 566; csh: 58; sed: 45; php: 6
file content (471 lines) | stat: -rw-r--r-- 45,478 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�3.�Server Types and Security Modes</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="type.html" title="Part�II.�Server Configuration Basics"><link rel="prev" href="type.html" title="Part�II.�Server Configuration Basics"><link rel="next" href="samba-pdc.html" title="Chapter�4.�Domain Control"></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�3.�Server Types and Security Modes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="type.html">Prev</a>�</td><th width="60%" align="center">Part�II.�Server Configuration Basics</th><td width="20%" align="right">�<a accesskey="n" href="samba-pdc.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter�3.�Server Types and Security Modes"><div class="titlepage"><div><div><h2 class="title"><a name="ServerType"></a>Chapter�3.�Server Types and Security Modes</h2></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">&lt;<a class="email" href="mailto:tridge@samba.org">tridge@samba.org</a>&gt;</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">&lt;<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</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">&lt;<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>&gt;</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="ServerType.html#id330679">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="ServerType.html#id330822">Server Types</a></span></dt><dt><span class="sect1"><a href="ServerType.html#id330959">Samba Security Modes</a></span></dt><dd><dl><dt><span class="sect2"><a href="ServerType.html#id331101">User Level Security</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id331249">Share-Level Security</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id331413">Domain Security Mode (User-Level Security)</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id331866">ADS Security Mode (User-Level Security)</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id331998">Server Security (User Level Security)</a></span></dt></dl></dd><dt><span class="sect1"><a href="ServerType.html#id332239">Password Checking</a></span></dt><dt><span class="sect1"><a href="ServerType.html#id332395">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="ServerType.html#id332416">What Makes Samba a Server?</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id332443">What Makes Samba a Domain Controller?</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id332478">What Makes Samba a Domain Member?</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id332502">Constantly Losing Connections to Password Server</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id332541">Stand-alone Server is converted to Domain Controller  Now User accounts don't work</a></span></dt></dl></dd></dl></div><p>
<a class="indexterm" name="id330648"></a>
<a class="indexterm" name="id330655"></a>
This chapter provides information regarding the types of server that Samba may be configured to be. A
Microsoft network administrator who wishes to migrate to or use Samba will want to know the meaning, within a
Samba context, of terms familiar to the MS Windows administrator. This means that it is essential also to
define how critical security modes function before we get into the details of how to configure the server
itself.
</p><p>
This chapter provides an overview of the security modes of which Samba is capable and how they relate to MS
Windows servers and clients.
</p><p>
A question often asked is, <span class="quote">&#8220;<span class="quote">Why would I want to use Samba?</span>&#8221;</span> Most chapters contain a section that
highlights features and benefits. We hope that the information provided will help to answer this question. Be
warned though, we want to be fair and reasonable, so not all features are positive toward Samba. The benefit
may be on the side of our competition.
</p><div class="sect1" title="Features and Benefits"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id330679"></a>Features and Benefits</h2></div></div></div><p>
Two men were walking down a dusty road, when one suddenly kicked up a small red stone. It
hurt his toe and lodged in his sandal. He took the stone out and cursed it with a passion
and fury befitting his anguish. The other looked at the stone and said, <span class="quote">&#8220;<span class="quote">This is a garnet.
I can turn that into a precious gem and some day it will make a princess very happy!</span>&#8221;</span>
</p><p>
The moral of this tale: Two men, two very different perspectives regarding the same stone.
Like it or not, Samba is like that stone. Treat it the right way and it can bring great
pleasure, but if you are forced to use it and have no time for its secrets, then it can be
a source of discomfort.
</p><p>
<a class="indexterm" name="id330702"></a>
<a class="indexterm" name="id330710"></a>
Samba started out as a project that sought to provide interoperability for MS Windows 3.x
clients with a UNIX server. It has grown up a lot since its humble beginnings and now provides
features and functionality fit for large-scale deployment. It also has some warts. In sections
like this one, we tell of both.
</p><p>
So, what are the benefits of the features mentioned in this chapter?
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
	<a class="indexterm" name="id330730"></a>
	Samba-3 can replace an MS Windows NT4 domain controller.
	</p></li><li class="listitem"><p>
	<a class="indexterm" name="id330743"></a>
	Samba-3 offers excellent interoperability with MS Windows NT4-style
	domains as well as natively with Microsoft Active Directory domains.
	</p></li><li class="listitem"><p>
	<a class="indexterm" name="id330755"></a>
	Samba-3 permits full NT4-style interdomain trusts.
	</p></li><li class="listitem"><p>
	<a class="indexterm" name="id330768"></a>
	<a class="indexterm" name="id330774"></a>
	Samba has security modes that permit more flexible authentication
	than is possible with MS Windows NT4 domain controllers.
	</p></li><li class="listitem"><p>
	<a class="indexterm" name="id330788"></a>
	<a class="indexterm" name="id330798"></a>
	Samba-3 permits use of multiple concurrent account database backends.
	(Encrypted passwords that are stored in the account database are in
	formats that are unique to Windows networking).
	</p></li><li class="listitem"><p>
	<a class="indexterm" name="id330811"></a>
	The account database backends can be distributed
	and replicated using multiple methods. This gives Samba-3
	greater flexibility than MS Windows NT4 and in many cases a
	significantly higher utility than Active Directory domains
	with MS Windows 200x.
	</p></li></ul></div></div><div class="sect1" title="Server Types"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id330822"></a>Server Types</h2></div></div></div><p>
<a class="indexterm" name="id330830"></a>
Administrators of Microsoft networks often refer to three different types of servers:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Domain Controller</p><div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem"><p>Primary Domain Controller (PDC)</p></li><li class="listitem"><p>Backup Domain Controller (BDC)</p></li><li class="listitem"><p>ADS Domain Controller</p></li></ul></div></li><li class="listitem"><p>Domain Member Server</p><div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem"><p>Active Directory Domain Server</p></li><li class="listitem"><p>NT4 Style Domain Domain Server</p></li></ul></div></li><li class="listitem"><p>Standalone Server</p></li></ul></div><p>
<a class="indexterm" name="id330886"></a>
<a class="indexterm" name="id330894"></a>
<a class="indexterm" name="id330903"></a>
<a class="indexterm" name="id330911"></a>
The chapters covering domain control (<a class="link" href="samba-pdc.html" title="Chapter�4.�Domain Control">Domain Control</a>), 
backup domain control (<a class="link" href="samba-bdc.html" title="Chapter�5.�Backup Domain Control">Backup Domain Control</a>), and 
domain membership (<a class="link" href="domain-member.html" title="Chapter�6.�Domain Membership">Domain Membership</a>) provide
pertinent information regarding Samba configuration for each of these server roles.
You are strongly encouraged to become intimately familiar with these chapters because
they lay the foundation for deployment of Samba domain security.
</p><p>
<a class="indexterm" name="id330940"></a>
A Standalone server is autonomous in respect of the source of its account backend.
Refer to <a class="link" href="StandAloneServer.html" title="Chapter�7.�Standalone Servers">Standalone Servers</a> to gain a wider appreciation
of what is meant by a server being configured as a <span class="emphasis"><em>standalone</em></span> server.
</p></div><div class="sect1" title="Samba Security Modes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id330959"></a>Samba Security Modes</h2></div></div></div><p>
<a class="indexterm" name="id330966"></a>
<a class="indexterm" name="id330973"></a>
In this section, the function and purpose of Samba's security modes are described. An accurate understanding of
how Samba implements each security mode as well as how to configure MS Windows clients for each mode will
significantly reduce user complaints and administrator heartache.
</p><p>
<a class="indexterm" name="id330985"></a>
<a class="indexterm" name="id330993"></a>
Microsoft Windows networking uses a protocol that was originally called the Server Message Block (SMB)
protocol. Since some time around 1996 the protocol has been better known as the Common Internet Filesystem
(CIFS) protocol.
</p><p>
<a class="indexterm" name="id331007"></a>
<a class="indexterm" name="id331013"></a>
<a class="indexterm" name="id331019"></a>
<a class="indexterm" name="id331026"></a>
In the SMB/CIFS networking world, there are only two types of security: <span class="emphasis"><em>user-level</em></span> and
<span class="emphasis"><em>share level</em></span>. We refer to these collectively as <span class="emphasis"><em>security levels</em></span>.  In
implementing these two security levels, Samba provides flexibilities that are not available with MS Windows
NT4/200x servers. In fact, Samba implements <span class="emphasis"><em>share-level</em></span> security only one way, but has
four ways of implementing <span class="emphasis"><em>user-level</em></span> security. Collectively, we call the Samba
implementations of the security levels <span class="emphasis"><em>security modes</em></span>. They are known as
<span class="emphasis"><em>share</em></span>, <span class="emphasis"><em>user</em></span>, <span class="emphasis"><em>domain</em></span>, <span class="emphasis"><em>ADS</em></span>,
and <span class="emphasis"><em>server</em></span> modes.  They are documented in this chapter.
</p><p>
An SMB server informs the client, at the time of a session setup, the security level the server is running.
There are two options: share-level and user-level. Which of these two the client receives affects the way the
client then tries to authenticate itself. It does not directly affect (to any great extent) the way the Samba
server does security. This may sound strange, but it fits in with the client/server approach of SMB.  In SMB
everything is initiated and controlled by the client, and the server can only tell the client what is
available and whether an action is allowed.
</p><p>
The term <code class="literal">client</code> refers to all agents whether it is a Windows workstation, a Windows server,
another Samba server, or any vanilla SMB or CIFS client application (e.g., <code class="literal">smbclient</code>) that
make use of services provided by an SMB/CIFS server.
</p><div class="sect2" title="User Level Security"><div class="titlepage"><div><div><h3 class="title"><a name="id331101"></a>User Level Security</h3></div></div></div><p>
<a class="indexterm" name="id331108"></a>
We describe user-level security first because its simpler.  In user-level security, the client sends a session
setup request directly following protocol negotiation.  This request provides a username and password. The
server can either accept or reject that username/password combination. At this stage the server has no idea
what share the client will eventually try to connect to, so it can't base the
<span class="emphasis"><em>accept/reject</em></span> on anything other than:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>the username/password.</p></li><li class="listitem"><p>the name of the client machine.</p></li></ol></div><p>
<a class="indexterm" name="id331140"></a>
If the server accepts the username/password credentials, the client expects to be able to mount shares (using
a <span class="emphasis"><em>tree connection</em></span>) without further specifying a password. It expects that all access
rights will be as the username/password credentials set that was specified in the initial <span class="emphasis"><em>session
setup</em></span>.
</p><p>
<a class="indexterm" name="id331158"></a>
It is also possible for a client to send multiple <span class="emphasis"><em>session setup</em></span>
requests. When the server responds, it gives the client a <span class="emphasis"><em>uid</em></span> to use
as an authentication tag for that username/password. The client can maintain multiple
authentication contexts in this way (WinDD is an example of an application that does this).
</p><p>
<a class="indexterm" name="id331177"></a>
<a class="indexterm" name="id331183"></a>
<a class="indexterm" name="id331189"></a>
<a class="indexterm" name="id331195"></a>
<a class="indexterm" name="id331202"></a>
Windows networking user account names are case-insensitive, meaning that upper-case and lower-case characters
in the account name are considered equivalent. They are said to be case-preserving, but not case significant.
Windows and LanManager systems previous to Windows NT version 3.10 have case-insensitive passwords that were
not necessarily case-preserving. All Windows NT family systems treat passwords as case-preserving and
case-sensitive.
</p><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id331213"></a>Example Configuration</h4></div></div></div><p>
The <code class="filename">smb.conf</code> parameter that sets user-level security is:
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id331233"></a><em class="parameter"><code>security = user</code></em></td></tr></table><p>
This is the default setting since Samba-2.2.x.
</p></div></div><div class="sect2" title="Share-Level Security"><div class="titlepage"><div><div><h3 class="title"><a name="id331249"></a>Share-Level Security</h3></div></div></div><p>
<a class="indexterm" name="id331256"></a>
<a class="indexterm" name="id331262"></a>
In share-level security, the client authenticates itself separately for each share. It sends a password along
with each tree connection request (share mount), but it does not explicitly send a username with this
operation. The client expects a password to be associated with each share, independent of the user. This means
that Samba has to work out what username the client probably wants to use,
because the username is not explicitly sent to the SMB server. Some commercial SMB servers such as NT actually associate passwords directly with shares
in share-level security, but Samba always uses the UNIX authentication scheme where it is a username/password
pair that is authenticated, not a share/password pair.
</p><p>
To understand the MS Windows networking parallels, think in terms of MS Windows 9x/Me where you can create a
shared folder that provides read-only or full access, with or without a password.
</p><p>
Many clients send a session setup request even if the server is in share-level security. They normally send a valid
username but no password. Samba records this username in a list of possible usernames. When the client then
issues a tree connection request, it also adds to this list the name of the share they try to connect to (useful for
home directories) and any users listed in the <a class="link" href="smb.conf.5.html#USER" target="_top">user</a> parameter in the <code class="filename">smb.conf</code> file.
The password is then checked in turn against these possible usernames. If a match is found, then the client is
authenticated as that user.
</p><p>
<a class="indexterm" name="id331308"></a>
<a class="indexterm" name="id331317"></a>
<a class="indexterm" name="id331323"></a>
Where the list of possible user names is not provided, Samba makes a UNIX system call to find the user
account that has a password that matches the one provided from the standard account database. On a system that
has no name service switch (NSS) facility, such lookups will be from the <code class="filename">/etc/passwd</code>
database. On NSS enabled systems, the lookup will go to the libraries that have been specified in the
<code class="filename">nsswitch.conf</code> file. The entries in that file in which the libraries are specified are:
</p><pre class="screen">
passwd: files nis ldap
shadow: files nis ldap
group: files nis ldap
</pre><p>
<a class="indexterm" name="id331349"></a>
<a class="indexterm" name="id331355"></a>
<a class="indexterm" name="id331362"></a>
In the example shown here (not likely to be used in practice) the lookup will check
<code class="filename">/etc/passwd</code> and <code class="filename">/etc/group</code>, if not found it will check NIS, then
LDAP.
</p><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id331380"></a>Example Configuration</h4></div></div></div><p>
The <code class="filename">smb.conf</code> parameter that sets share-level security is:
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id331400"></a><em class="parameter"><code>security = share</code></em></td></tr></table></div></div><div class="sect2" title="Domain Security Mode (User-Level Security)"><div class="titlepage"><div><div><h3 class="title"><a name="id331413"></a>Domain Security Mode (User-Level Security)</h3></div></div></div><p>
<a class="indexterm" name="id331420"></a>
<a class="indexterm" name="id331428"></a>
<a class="indexterm" name="id331437"></a>
<a class="indexterm" name="id331443"></a>
<a class="indexterm" name="id331449"></a>
<a class="indexterm" name="id331456"></a>
Domain security provides a mechanism for storing all user and group accounts in a central, shared, account
repository. The centralized account repository is shared between domain (security) controllers. Servers that
act as domain controllers provide authentication and validation services to all machines that participate in
the security context for the domain. A primary domain controller (PDC) is a server that is responsible for
maintaining the integrity of the security account database. Backup domain controllers (BDCs) provide only domain
logon and authentication services. Usually, BDCs will answer network logon requests more responsively than
will a PDC.
</p><p>
<a class="indexterm" name="id331476"></a>
<a class="indexterm" name="id331483"></a>
<a class="indexterm" name="id331489"></a>
<a class="indexterm" name="id331497"></a>
<a class="indexterm" name="id331506"></a>
When Samba is operating in <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = domain</a> mode, the Samba server has a
domain security trust account (a machine account) and causes all authentication requests to be passed through
to the domain controllers.  In other words, this configuration makes the Samba server a domain member server,
even when it is in fact acting as a domain controller. All machines that participate in domain security must
have a machine account in the security database.
</p><p>
<a class="indexterm" name="id331529"></a>
<a class="indexterm" name="id331537"></a>
<a class="indexterm" name="id331546"></a>
<a class="indexterm" name="id331554"></a>
Within the domain security environment, the underlying security architecture uses user-level security. Even
machines that are domain members must authenticate on startup. The machine account consists of an account
entry in the accounts database, the name of which is the NetBIOS name of the machine and of which the password
is randomly generated and known to both the domain controllers and the member machine. If the machine account
cannot be validated during startup, users will not be able to log on to the domain using this machine because
it cannot be trusted. The machine account is referred to as a machine trust account.
</p><p>
There are three possible domain member configurations:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Primary domain controller (PDC) - of which there is one per domain.</p></li><li class="listitem"><p>Backup domain controller (BDC) - of which there can be any number per domain.</p></li><li class="listitem"><p>Domain member server (DMS) - of which there can be any number per domain.</p></li></ol></div><p>
<a class="indexterm" name="id331594"></a>
We will discuss each of these in separate chapters. For now, we are most interested in basic DMS
configuration.
</p><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id331603"></a>Example Configuration</h4></div></div></div><p><span class="emphasis"><em>
Samba as a Domain Member Server
</em></span></p><p>
<a class="indexterm" name="id331614"></a>
This method involves addition of the following parameters in the <code class="filename">smb.conf</code> file:
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id331634"></a><em class="parameter"><code>security = domain</code></em></td></tr><tr><td><a class="indexterm" name="id331644"></a><em class="parameter"><code>workgroup = MIDEARTH</code></em></td></tr></table><p>
</p><p>
In order for this method to work, the Samba server needs to join the MS Windows NT
security domain. This is done as follows:
<a class="indexterm" name="id331659"></a>
<a class="indexterm" name="id331667"></a>
</p><div class="procedure"><ol class="procedure" type="1"><li class="step" title="Step 1"><p>On the MS Windows NT domain controller, using
        the Server Manager, add a machine account for the Samba server.
        </p></li><li class="step" title="Step 2"><p>On the UNIX/Linux system execute:</p><pre class="screen"><code class="prompt">root# </code><strong class="userinput"><code>net rpc join -U administrator%password</code></strong></pre></li></ol></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
<a class="indexterm" name="id331712"></a>
Samba-2.2.4 and later Samba 2.2.x series releases can autojoin a Windows NT4-style domain just by executing:
</p><pre class="screen">
<code class="prompt">root# </code><strong class="userinput"><code>smbpasswd -j <em class="replaceable"><code>DOMAIN_NAME</code></em> -r <em class="replaceable"><code>PDC_NAME</code></em> \
	 -U Administrator%<em class="replaceable"><code>password</code></em></code></strong>
</pre><p>
<a class="indexterm" name="id331742"></a>
Samba-3 can do the same by executing:
</p><pre class="screen">
<code class="prompt">root# </code><strong class="userinput"><code>net rpc join -U Administrator%<em class="replaceable"><code>password</code></em></code></strong>
</pre><p>
It is not necessary with Samba-3 to specify the <em class="replaceable"><code>DOMAIN_NAME</code></em> or the
<em class="replaceable"><code>PDC_NAME</code></em>, as it figures this out from the <code class="filename">smb.conf</code> file settings.
</p></div><p>
<a class="indexterm" name="id331784"></a>
<a class="indexterm" name="id331790"></a>
<a class="indexterm" name="id331796"></a>
Use of this mode of authentication requires there to be a standard UNIX account for each user in order to
assign a UID once the account has been authenticated by the Windows domain controller. This account can be
blocked to prevent logons by clients other than MS Windows through means such as setting an invalid shell in
the <code class="filename">/etc/passwd</code> entry. The best way to allocate an invalid shell to a user account is to
set the shell to the file <code class="filename">/bin/false</code>.
</p><p>
<a class="indexterm" name="id331820"></a>
<a class="indexterm" name="id331826"></a>
Domain controllers can be located anywhere that is convenient. The best advice is to have a BDC on every
physical network segment, and if the PDC is on a remote network segment the use of WINS (see <a class="link" href="NetworkBrowsing.html" title="Chapter�10.�Network Browsing">Network Browsing</a> for more information) is almost essential.
</p><p>
An alternative to assigning UIDs to Windows users on a Samba member server is presented in <a class="link" href="winbind.html" title="Chapter�24.�Winbind: Use of Domain Accounts">Winbind</a>, <a class="link" href="winbind.html" title="Chapter�24.�Winbind: Use of Domain Accounts">Winbind: Use of Domain Accounts</a>.
</p><p>
For more information regarding domain membership, <a class="link" href="domain-member.html" title="Chapter�6.�Domain Membership">Domain Membership</a>.
</p></div></div><div class="sect2" title="ADS Security Mode (User-Level Security)"><div class="titlepage"><div><div><h3 class="title"><a name="id331866"></a>ADS Security Mode (User-Level Security)</h3></div></div></div><p>
<a class="indexterm" name="id331873"></a>
<a class="indexterm" name="id331879"></a>
Both Samba-2.2, and Samba-3 can join an Active Directory domain using NT4 style RPC based security.  This is
possible if the domain is run in native mode. Active Directory in native mode perfectly allows NT4-style
domain members. This is contrary to popular belief.
</p><p>
If you are using Active Directory, starting with Samba-3 you can join as a native AD member. Why would you
want to do that?  Your security policy might prohibit the use of NT-compatible authentication protocols. All
your machines are running Windows 2000 and above and all use Kerberos. In this case, Samba, as an NT4-style
domain, would still require NT-compatible authentication data. Samba in AD-member mode can accept Kerberos
tickets.
</p><p>
<a class="indexterm" name="id331898"></a>
<a class="indexterm" name="id331905"></a>
Sites that use Microsoft Windows active directory services (ADS) should be aware of the significance of the
terms: <code class="literal">native mode</code> and <code class="literal">mixed mode</code> ADS operation. The term
<code class="literal">realm</code> is used to describe a Kerberos-based security architecture (such as is used by
Microsoft ADS).
</p><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id331930"></a>Example Configuration</h4></div></div></div><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id331941"></a><em class="parameter"><code>realm = your.kerberos.REALM</code></em></td></tr><tr><td><a class="indexterm" name="id331952"></a><em class="parameter"><code>security = ADS</code></em></td></tr></table><p>
The following parameter may be required:
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id331971"></a><em class="parameter"><code>password server = your.kerberos.server</code></em></td></tr></table><p>
Please refer to <a class="link" href="domain-member.html" title="Chapter�6.�Domain Membership">Domain Membership</a>, and <a class="link" href="domain-member.html#ads-member" title="Samba ADS Domain Membership">Samba
ADS Domain Membership</a> for more information regarding this configuration option.
</p></div></div><div class="sect2" title="Server Security (User Level Security)"><div class="titlepage"><div><div><h3 class="title"><a name="id331998"></a>Server Security (User Level Security)</h3></div></div></div><p>
Server security mode is left over from the time when Samba was not capable of acting
as a domain member server. It is highly recommended not to use this feature. Server
security mode has many drawbacks that include:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Potential account lockout on MS Windows NT4/200x password servers.</p></li><li class="listitem"><p>Lack of assurance that the password server is the one specified.</p></li><li class="listitem"><p>Does not work with Winbind, which is particularly needed when storing profiles remotely.</p></li><li class="listitem"><p>This mode may open connections to the password server and keep them open for extended periods.</p></li><li class="listitem"><p>Security on the Samba server breaks badly when the remote password server suddenly shuts down.</p></li><li class="listitem"><p>With this mode there is NO security account in the domain that the password server belongs to for the Samba server.</p></li></ul></div><p>
<a class="indexterm" name="id332045"></a>
<a class="indexterm" name="id332051"></a>
In server security mode the Samba server reports to the client that it is in user-level security. The client
then does a session setup as described earlier.  The Samba server takes the username/password that the client
sends and attempts to log into the <a class="link" href="smb.conf.5.html#PASSWORDSERVER" target="_top">password server</a> by sending exactly the same
username/password that it got from the client. If that server is in user-level security and accepts the
password, then Samba accepts the client's connection. This parameter allows the Samba server to use another
SMB server as the <a class="link" href="smb.conf.5.html#PASSWORDSERVER" target="_top">password server</a>.
</p><p>
<a class="indexterm" name="id332080"></a>
<a class="indexterm" name="id332087"></a>
You should also note that at the start of all this, when the server tells the client
what security level it is in, it also tells the client if it supports encryption. If it
does, it supplies the client with a random cryptkey. The client will then send all
passwords in encrypted form. Samba supports this type of encryption by default.
</p><p>
The parameter <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = server</a> means that Samba reports to clients that
it is running in <span class="emphasis"><em>user mode</em></span> but actually passes off all authentication requests to another
user mode server. This requires an additional parameter <a class="link" href="smb.conf.5.html#PASSWORDSERVER" target="_top">password server</a> that points to
the real authentication server.  The real authentication server can be another Samba server, or it can be a
Windows NT server, the latter being natively capable of encrypted password support.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
<a class="indexterm" name="id332125"></a>
<a class="indexterm" name="id332131"></a>
When Samba is running in <span class="emphasis"><em>server security mode</em></span>, it is essential that the parameter
<span class="emphasis"><em>password server</em></span> is set to the precise NetBIOS machine name of the target authentication
server. Samba cannot determine this from NetBIOS name lookups because the choice of the target authentication
server is arbitrary and cannot be determined from a domain name. In essence, a Samba server that is in
<span class="emphasis"><em>server security mode</em></span> is operating in what used to be known as workgroup mode.
</p></div><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id332151"></a>Example Configuration</h4></div></div></div><p><span class="emphasis"><em>
Using MS Windows NT as an Authentication Server
</em></span></p><p>
This method involves the additions of the following parameters in the <code class="filename">smb.conf</code> file:
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id332176"></a><em class="parameter"><code>encrypt passwords = Yes</code></em></td></tr><tr><td><a class="indexterm" name="id332186"></a><em class="parameter"><code>security = server</code></em></td></tr><tr><td><a class="indexterm" name="id332197"></a><em class="parameter"><code>password server = "NetBIOS_name_of_a_DC"</code></em></td></tr></table><p>
There are two ways of identifying whether or not a username and password pair is valid.
One uses the reply information provided as part of the authentication messaging
process, the other uses just an error code.
</p><p>
<a class="indexterm" name="id332214"></a>
<a class="indexterm" name="id332221"></a>
The downside of this mode of configuration is that for security reasons Samba
will send the password server a bogus username and a bogus password, and if the remote
server fails to reject the bogus username and password pair, then an alternative mode of
identification or validation is used. Where a site uses password lockout, after a
certain number of failed authentication attempts, this will result in user lockouts.
</p><p>
Use of this mode of authentication requires a standard UNIX account for the user.
This account can be blocked to prevent logons by non-SMB/CIFS clients.
</p></div></div></div><div class="sect1" title="Password Checking"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id332239"></a>Password Checking</h2></div></div></div><p>
MS Windows clients may use encrypted passwords as part of a challenge/response
authentication model (a.k.a. NTLMv1 and NTLMv2) or alone, or clear-text strings for simple
password-based authentication. It should be realized that with the SMB protocol,
the password is passed over the network either in plaintext or encrypted, but
not both in the same authentication request.
</p><p>
<a class="indexterm" name="id332253"></a>
<a class="indexterm" name="id332260"></a>
When encrypted passwords are used, a password that has been entered by the user
is encrypted in two ways:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>An MD4 hash of the unicode of the password
        string. This is known as the NT hash.
        </p></li><li class="listitem"><p>The password is converted to uppercase,
        and then padded or truncated to 14 bytes. This string is
        then appended with 5 bytes of NULL characters and split to
        form two 56-bit DES keys to encrypt a "magic" 8-byte value.
        The resulting 16 bytes form the LanMan hash.
        </p></li></ul></div><p>
<a class="indexterm" name="id332285"></a>
MS Windows 95 pre-service pack 1 and MS Windows NT versions 3.x and version 4.0 pre-service pack 3 will use
either mode of password authentication. All versions of MS Windows that follow these versions no longer
support plain-text passwords by default.
</p><p>
<a class="indexterm" name="id332299"></a>
MS Windows clients have a habit of dropping network mappings that have been idle
for 10 minutes or longer. When the user attempts to use the mapped drive
connection that has been dropped, the client re-establishes the connection using
a cached copy of the password.
</p><p>
When Microsoft changed the default password mode, support was dropped for caching
of the plaintext password. This means that when the registry parameter is changed
to re-enable use of plaintext passwords, it appears to work, but when a dropped
service connection mapping attempts to revalidate, this will fail if the remote
authentication server does not support encrypted passwords. It is definitely not
a good idea to re-enable plaintext password support in such clients.
</p><p>
The following parameters can be used to work around the issue of Windows 9x/Me clients
uppercasing usernames and passwords before transmitting them to the SMB server
when using clear-text authentication:
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id332331"></a></td></tr><tr><td><a class="indexterm" name="id332337"></a></td></tr></table><p>
By default Samba will convert to lowercase the username before attempting to lookup the user
in the database of local system accounts. Because UNIX usernames conventionally
only contain lowercase characters, the <a class="link" href="smb.conf.5.html#USERNAME-LEVEL" target="_top">username-level</a> parameter
is rarely needed.
</p><p>
<a class="indexterm" name="id332358"></a>
However, passwords on UNIX systems often make use of mixed-case characters.  This means that in order for a
user on a Windows 9x/Me client to connect to a Samba server using clear-text authentication, the
<a class="link" href="smb.conf.5.html#PASSWORDLEVEL" target="_top">password level</a> must be set to the maximum number of uppercase letters that
<span class="emphasis"><em>could</em></span> appear in a password. Note that if the Server OS uses the traditional DES version
of crypt(), a <a class="link" href="smb.conf.5.html#PASSWORDLEVEL" target="_top">password level</a> of 8 will result in case-insensitive passwords as seen
from Windows users. This will also result in longer login times because Samba has to compute the permutations
of the password string and try them one by one until a match is located (or all combinations fail).
</p><p>
The best option to adopt is to enable support for encrypted passwords wherever
Samba is used. Most attempts to apply the registry change to re-enable plaintext
passwords will eventually lead to user complaints and unhappiness.
</p></div><div class="sect1" title="Common Errors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id332395"></a>Common Errors</h2></div></div></div><p>
We all make mistakes. It is okay to make mistakes, as long as they are made in the right places
and at the right time. A mistake that causes lost productivity is seldom tolerated; however, a mistake
made in a developmental test lab is expected.
</p><p>
Here we look at common mistakes and misapprehensions that have been the subject of discussions
on the Samba mailing lists. Many of these are avoidable by doing your homework before attempting
a Samba implementation. Some are the result of a misunderstanding of the English language,
which has many phrases that are potentially vague and may be highly confusing
to those for whom English is not their native tongue.
</p><div class="sect2" title="What Makes Samba a Server?"><div class="titlepage"><div><div><h3 class="title"><a name="id332416"></a>What Makes Samba a Server?</h3></div></div></div><p>
To some, the nature of the Samba security mode is obvious, but entirely
wrong all the same. It is assumed that <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = server</a> means that Samba
will act as a server. Not so! This setting means that Samba will <span class="emphasis"><em>try</em></span>
to use another SMB server as its source for user authentication alone.
</p><p>
Samba is a server regardless of which security mode is chosen. When Samba is used outside of a domain security
context, it is best to leave the security mode at the default setting. By default Samba-3 uses user-mode
security.
</p></div><div class="sect2" title="What Makes Samba a Domain Controller?"><div class="titlepage"><div><div><h3 class="title"><a name="id332443"></a>What Makes Samba a Domain Controller?</h3></div></div></div><p>
<a class="indexterm" name="id332450"></a>
The <code class="filename">smb.conf</code> parameter <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = domain</a> does not really make Samba behave
as a domain controller. This setting means we want Samba to be a domain member. See <a class="link" href="samba-pdc.html" title="Chapter�4.�Domain Control">Samba as a PDC</a> for more information.
</p></div><div class="sect2" title="What Makes Samba a Domain Member?"><div class="titlepage"><div><div><h3 class="title"><a name="id332478"></a>What Makes Samba a Domain Member?</h3></div></div></div><p>
Guess! So many others do. But whatever you do, do not think that <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = user</a>
makes Samba act as a domain member. Read the manufacturer's manual before the warranty expires. See 
<a class="link" href="domain-member.html" title="Chapter�6.�Domain Membership">Domain Membership</a>, for more information.
</p></div><div class="sect2" title="Constantly Losing Connections to Password Server"><div class="titlepage"><div><div><h3 class="title"><a name="id332502"></a>Constantly Losing Connections to Password Server</h3></div></div></div><p><span class="quote">&#8220;<span class="quote">
Why does server_validate() simply give up rather than re-establish its connection to the
password server?  Though I am not fluent in the SMB protocol, perhaps the cluster server
process passes along to its client workstation the session key it receives from the password
server, which means the password hashes submitted by the client would not work on a subsequent
connection whose session key would be different. So server_validate() must give up.
</span>&#8221;</span></p><p>
Indeed. That's why <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = server</a>
is at best a nasty hack. Please use <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = domain</a>;
<a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = server</a> mode is also known as pass-through authentication.
</p></div><div class="sect2" title="Stand-alone Server is converted to Domain Controller Now User accounts don't work"><div class="titlepage"><div><div><h3 class="title"><a name="id332541"></a>Stand-alone Server is converted to Domain Controller  Now User accounts don't work</h3></div></div></div><p><span class="quote">&#8220;<span class="quote">
When I try to log in to the DOMAIN, the eventlog shows <span class="emphasis"><em>tried credentials DOMAIN/username; effective
credentials SERVER/username</em></span>
</span>&#8221;</span></p><p>
Usually this is due to a user or machine account being created before the Samba server is configured to be a
domain controller. Accounts created before the server becomes a domain controller will be
<span class="emphasis"><em>local</em></span> accounts and authenticated as what looks like a member in the SERVER domain, much
like local user accounts in Windows 2000 and later.  Accounts created after the Samba server becomes a domain
controller will be <span class="emphasis"><em>domain</em></span> accounts and will be authenticated as a member of the DOMAIN
domain.
</p><p>
This can be verified by issuing the command <code class="literal">pdbedit -L -v username</code>.  If this reports DOMAIN
then the account is a domain account, if it reports SERVER then the account is a local account.
</p><p>
The easiest way to resolve this is to remove and recreate the account; however this may cause problems with
established user profiles. You can also use <code class="literal">pdbedit -u username -I DOMAIN</code>. You may also
need to change the User SID and Primary Group SID to match the domain.
</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="type.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="type.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="samba-pdc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part�II.�Server Configuration Basics�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Chapter�4.�Domain Control</td></tr></table></div></body></html>