1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="ServerType">
10 <title>Server Types and Security Modes</title>
13 <indexterm><primary>migrate</primary></indexterm>
14 <indexterm><primary>security mode</primary></indexterm>
15 This chapter provides information regarding the types of server that Samba may be configured to be. A
16 Microsoft network administrator who wishes to migrate to or use Samba will want to know the meaning, within a
17 Samba context, of terms familiar to the MS Windows administrator. This means that it is essential also to
18 define how critical security modes function before we get into the details of how to configure the server
23 The chapter provides an overview of the security modes of which Samba is capable and how they relate to MS
24 Windows servers and clients.
28 A question often asked is, <quote>Why would I want to use Samba?</quote> Most chapters contain a section that
29 highlights features and benefits. We hope that the information provided will help to answer this question. Be
30 warned though, we want to be fair and reasonable, so not all features are positive toward Samba. The benefit
31 may be on the side of our competition.
35 <title>Features and Benefits</title>
38 Two men were walking down a dusty road, when one suddenly kicked up a small red stone. It
39 hurt his toe and lodged in his sandal. He took the stone out and cursed it with a passion
40 and fury befitting his anguish. The other looked at the stone and said, <quote>This is a garnet.
41 I can turn that into a precious gem and some day it will make a princess very happy!</quote>
45 The moral of this tale: Two men, two very different perspectives regarding the same stone.
46 Like it or not, Samba is like that stone. Treat it the right way and it can bring great
47 pleasure, but if you are forced to use it and have no time for its secrets, then it can be
48 a source of discomfort.
52 <indexterm><primary>UNIX</primary><secondary>server</secondary></indexterm>
53 <indexterm><primary>interoperability</primary></indexterm>
54 Samba started out as a project that sought to provide interoperability for MS Windows 3.x
55 clients with a UNIX server. It has grown up a lot since its humble beginnings and now provides
56 features and functionality fit for large-scale deployment. It also has some warts. In sections
57 like this one, we tell of both.
61 So, what are the benefits of the features mentioned in this chapter?
66 <indexterm><primary>domain</primary><secondary>controller</secondary></indexterm>
67 Samba-3 can replace an MS Windows NT4 domain controller.
71 <indexterm><primary>active directory</primary></indexterm>
72 Samba-3 offers excellent interoperability with MS Windows NT4-style
73 domains as well as natively with Microsoft Active Directory domains.
77 <indexterm><primary>interdomain</primary><secondary>trustrs</secondary></indexterm>
78 Samba-3 permits full NT4-style interdomain trusts.
82 <indexterm><primary>authentication</primary></indexterm>
83 <indexterm><primary>security</primary><secondary>modes</secondary></indexterm>
84 Samba has security modes that permit more flexible authentication
85 than is possible with MS Windows NT4 domain controllers.
89 <indexterm><primary>account</primary><secondary>database</secondary><tertiary>backends</tertiary></indexterm>
90 <indexterm><primary>encrypted</primary></indexterm>
91 Samba-3 permits use of multiple concurrent account database backends.
92 (Encrypted passwords that are stored in the account database are in
93 formats that is unique to Windows networking).
97 <indexterm><primary>replicated</primary></indexterm>
98 The account database backends can be distributed
99 and replicated using multiple methods. This gives Samba-3
100 greater flexibility than MS Windows NT4 and in many cases a
101 significantly higher utility than Active Directory domains
102 with MS Windows 200x.
109 <title>Server Types</title>
113 <indexterm><primary>Server Type</primary></indexterm>
114 Administrators of Microsoft networks often refer to three different type of servers:
118 <listitem><para>Domain Controller</para>
120 <listitem><para>Primary Domain Controller (PDC)</para></listitem>
121 <listitem><para>Backup Domain Controller (BDC)</para></listitem>
122 <listitem><para>ADS Domain Controller</para></listitem>
125 <listitem><para>Domain Member Server</para>
127 <listitem><para>Active Directory Domain Server</para></listitem>
128 <listitem><para>NT4 Style Domain Domain Server</para></listitem>
131 <listitem><para>Standalone Server</para></listitem>
135 <indexterm><primary>domain</primary><secondary>control</secondary></indexterm>
136 <indexterm><primary>domain</primary><secondary>member</secondary></indexterm>
137 <indexterm><primary>domain control</primary><secondary>primary</secondary></indexterm>
138 <indexterm><primary>domain control</primary><secondary>backup</secondary></indexterm>
139 The chapters covering domain control (<link linkend="samba-pdc">Domain Control</link>),
140 backup domain control (<link linkend="samba-bdc">Backup Domain Control</link>), and
141 domain membership (<link linkend="domain-member">Domain Membership</link>) provide
142 pertinent information regarding Samba configuration for each of these server roles.
143 You are strongly encouraged to become intimately familiar with these chapters because
144 they lay the foundation for deployment of Samba domain security.
148 <indexterm><primary>standalone</primary></indexterm>
149 A Standalone server has is autonomous in respect of the source of its account backend.
150 Refer to <link linkend="StandAloneServer">Standalone Servers</link> to gain a wider appreciation
151 of what is mean by a server being configured as a <emphasis>standalone</emphasis> server.
157 <title>Samba Security Modes</title>
161 <indexterm><primary>Security Mode</primary></indexterm>
162 <indexterm><primary>security</primary></indexterm>
163 In this section the function and purpose of Samba's security modes are described. An accurate understanding of
164 how Samba implements each security mode as well as how to configure MS Windows clients for each mode will
165 significantly reduce user complaints and administrator heartache.
169 <indexterm><primary>Server Message Block</primary><see>SMB</see></indexterm>
170 <indexterm><primary>Common Internet Filesystem</primary><see>CIFS</see></indexterm>
171 Microsoft Windows networking uses a protocol that was originally called the Server Message Block (SMB)
172 protocol. Since some time around 1996 the protocol has been better known as the Common Internet Filesystem
177 <indexterm><primary>security levels</primary></indexterm>
178 <indexterm><primary>security modes</primary></indexterm>
179 <indexterm><primary>user-level</primary></indexterm>
180 <indexterm><primary>share-level</primary></indexterm>
181 In the SMB/CIFS networking world, there are only two types of security: <emphasis>user-level</emphasis> and
182 <emphasis>share level</emphasis>. We refer to these collectively as <emphasis>security levels</emphasis>. In
183 implementing these two security levels, Samba provides flexibilities that are not available with MS Windows
184 NT4/200x servers. In fact, Samba implements <emphasis>share-level</emphasis> security only one way, but has
185 four ways of implementing <emphasis>user-level</emphasis> security. Collectively, we call the Samba
186 implementations of the security levels <emphasis>security modes</emphasis>. They are known as
187 <emphasis>share</emphasis>, <emphasis>user</emphasis>, <emphasis>domain</emphasis>, <emphasis>ADS</emphasis>,
188 and <emphasis>server</emphasis> modes. They are documented in this chapter.
192 An SMB server informs the client, at the time of a session setup, the security level the server is running.
193 There are two options: share-level and user-level. Which of these two the client receives affects the way the
194 client then tries to authenticate itself. It does not directly affect (to any great extent) the way the Samba
195 server does security. This may sound strange, but it fits in with the client/server approach of SMB. In SMB
196 everything is initiated and controlled by the client, and the server can only tell the client what is
197 available and whether an action is allowed.
201 The term <literal>client</literal> refers to all agents whether it is a Windows workstation, a Windows server,
202 another Samba server, or any vanilla SMB or CIFS client application (e.g., <command>smbclient</command>) that
203 make use of services provided by an SMB/CIFS server.
207 <title>User Level Security</title>
210 <indexterm><primary>user-level</primary></indexterm>
211 We describe user-level security first because its simpler. In user-level security, the client sends a session
212 setup request directly following protocol negotiation. This request provides a username and password. The
213 server can either accept or reject that username/password combination. At this stage the server has no idea
214 what share the client will eventually try to connect to, so it can't base the
215 <emphasis>accept/reject</emphasis> on anything other than:
219 <listitem><para>the username/password.</para></listitem>
220 <listitem><para>the name of the client machine.</para></listitem>
224 <indexterm><primary>credentials</primary></indexterm>
225 If the server accepts the username/password credentials, the client expects to be able to mount shares (using
226 a <emphasis>tree connection</emphasis>) without further specifying a password. It expects that all access
227 rights will be as the username/password credentials set that was specified in the initial <emphasis>session
232 <indexterm><primary>session setup</primary></indexterm>
233 It is also possible for a client to send multiple <emphasis>session setup</emphasis>
234 requests. When the server responds, it gives the client a <emphasis>uid</emphasis> to use
235 as an authentication tag for that username/password. The client can maintain multiple
236 authentication contexts in this way (WinDD is an example of an application that does this).
240 <indexterm><primary>LanManager</primary></indexterm>
241 <indexterm><primary>case-preserving</primary></indexterm>
242 <indexterm><primary>case-insensitive</primary></indexterm>
243 <indexterm><primary>upper-case</primary></indexterm>
244 <indexterm><primary>lower-case</primary></indexterm>
245 Windows networking user account names are case-insensitive, meaning that upper-case and lower-case characters
246 in the account name are considered equivalent. They are said to be case-preserving, but not case significant.
247 Windows and LanManager systems previous to Windows NT version 3.10 have case-insensitive passwords that were
248 not necessarilty case-preserving. All Windows NT family systems treat passwords are case-preserving and
253 <title>Example Configuration</title>
256 The &smb.conf; parameter that sets user-level security is:
260 <smbconfoption name="security">user</smbconfoption>
261 </smbconfblock></para>
264 This is the default setting since Samba-2.2.x.
271 <title>Share-Level Security</title>
274 <indexterm><primary>share-level</primary></indexterm>
275 <indexterm><primary>mount</primary></indexterm>
276 In share-level security, the client authenticates itself separately for each share. It sends a password along
277 with each tree connection request (share mount), but it does not explicitly send a username with this
278 operation. The client expects a password to be associated with each share, independent of the user. This means
279 that Samba has to work out what username the client probably wants to use, the SMB server is not explicitly
280 sent the username. Some commercial SMB servers such as NT actually associate passwords directly with shares
281 in share-level security, but Samba always uses the UNIX authentication scheme where it is a username/password
282 pair that is authenticated, not a share/password pair.
286 To understand the MS Windows networking parallels, think in terms of MS Windows 9x/Me where you can create a
287 shared folder that provides read-only or full access, with or without a password.
291 Many clients send a session setup request even if the server is in share-level security. They normally send a valid
292 username but no password. Samba records this username in a list of possible usernames. When the client then
293 issues a tree connection request, it also adds to this list the name of the share they try to connect to (useful for
294 home directories) and any users listed in the <smbconfoption name="user"/> parameter in the &smb.conf; file.
295 The password is then checked in turn against these possible usernames. If a match is found, then the client is
296 authenticated as that user.
300 <indexterm><primary>name service switch</primary><see>NSS</see></indexterm>
301 <indexterm><primary>/etc/passwd</primary></indexterm>
302 <indexterm><primary>nsswitch.conf</primary></indexterm>
303 Where the list of possible user names is not provided, Samba checks makes a UNIX system call to find the user
304 account that has a password that matches the one provided from the standard account database. On a system that
305 has no name service switch (NSS) facility such lookups will be from the <filename>/etc/passwd</filename>
306 database. On NSS enabled systems the lookup will go to the libraries that have been specified in the
307 <filename>nsswitch.conf</filename> file. The entries in that file in which the libraries are specified are:
309 passwd: files nis ldap
310 shadow: files nis ldap
311 group: files nis ldap
313 <indexterm><primary>/etc/passwd</primary></indexterm>
314 <indexterm><primary>/etc/group</primary></indexterm>
315 <indexterm><primary>NIS</primary></indexterm>
316 In the example shown here (not likely to be used in practice) the lookup will check
317 <filename>/etc/passwd</filename> and <filename>/etc/group</filename>, if not found it will check NIS, then
322 <title>Example Configuration</title>
325 The &smb.conf; parameter that sets share-level security is:
329 <smbconfoption name="security">share</smbconfoption>
330 </smbconfblock></para>
336 <title>Domain Security Mode (User-Level Security)</title>
339 <indexterm><primary>domain</primary><secondary>controllers</secondary></indexterm>
340 <indexterm><primary>security</primary><secondary>controllers</secondary></indexterm>
341 <indexterm><primary>PDC</primary></indexterm>
342 <indexterm><primary>BDC</primary></indexterm>
343 <indexterm><primary>logon</primary></indexterm>
344 <indexterm><primary>authentication</primary></indexterm>
345 Domain security provides a mechanism for storing all user and group accounts in a central, shared, account
346 repository. The centralized account repository is shared between domain (security) controllers. Servers that
347 act as domain controllers provide authentication and validation services to all machines that participate in
348 the security context for the domain. A primary domain controller (PDC) is a server that is responsible for
349 maintaining the integrity of the security account database. Backup domain controllers (BDCs) provide only domain
350 logon and authentication services. Usually, BDCs will answer network logon requests more responsively than
355 <indexterm><primary>domain member</primary></indexterm>
356 <indexterm><primary>trust account</primary></indexterm>
357 <indexterm><primary>trust</primary><secondary>account</secondary></indexterm>
358 <indexterm><primary>domain</primary><secondary>security</secondary></indexterm>
359 <indexterm><primary>domain</primary><secondary>controller</secondary></indexterm>
360 When Samba is operating in <smbconfoption name="security">domain</smbconfoption> mode, the Samba server has a
361 domain security trust account (a machine account) and causes all authentication requests to be passed through
362 to the domain controllers. In other words, this configuration makes the Samba server a domain member server,
363 even when it is in fact acting as a domain controller. All machines that participate in domain security must
364 have a machine account in the security database.
368 <indexterm><primary>account</primary><secondary>database</secondary></indexterm>
369 <indexterm><primary>machine</primary><secondary>account</secondary></indexterm>
370 <indexterm><primary>NetBIOS</primary><secondary>name</secondary></indexterm>
371 <indexterm><primary>NetBIOS</primary></indexterm>
372 Within the domain security environment the underlying security architecture uses User-level security. Even
373 machines that are domain members must authenticate on startup. The machine account consists of an account
374 entry in the accounts database, the name of which is the NetBIOS name of the machine and of which the password
375 is randomly generated and known to both the domain controllers and the member machine. If the machine account
376 can not be validated during startup, users will not be able to log onto the domain using this machine because
377 it can not be trusted. The machine account is referred to as a machine trust account.
381 There are three possible domain member configurations:
385 <listitem><para>Primary domain controller (PDC) - of which there is one per domain.</para></listitem>
386 <listitem><para>Backup domain controller (BDC) - of which there can be any number per domain.</para></listitem>
387 <listitem><para>Domain member server (DMS) - of which there can be any number per domain.</para></listitem>
391 <indexterm><primary>DMS</primary></indexterm>
392 We will discuss each of these in separate chapters. For now, we are most interested in basic DMS
397 <title>Example Configuration</title>
399 Samba as a Domain Member Server
404 <indexterm><primary>server type</primary><secondary>domain member</secondary></indexterm>
405 This method involves addition of the following parameters in the &smb.conf; file:
407 <smbconfoption name="security">domain</smbconfoption>
408 <smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
413 In order for this method to work, the Samba server needs to join the MS Windows NT
414 security domain. This is done as follows:
415 <indexterm><primary>net</primary><secondary>rpc</secondary></indexterm>
416 <indexterm><primary>Domain Member</primary><secondary>joining</secondary></indexterm>
421 <step><para>On the MS Windows NT domain controller, using
422 the Server Manager, add a machine account for the Samba server.
425 <step><para>On the UNIX/Linux system execute:</para>
427 <para><screen>&rootprompt;<userinput>net rpc join -U administrator%password</userinput></screen></para>
432 <indexterm><primary>smbpasswd</primary></indexterm>
433 Samba-2.2.4 and later Samba 2.2.x series releases can autojoin a Windows NT4-style domain just by executing:
435 &rootprompt;<userinput>smbpasswd -j <replaceable>DOMAIN_NAME</replaceable> -r <replaceable>PDC_NAME</replaceable> \
436 -U Administrator%<replaceable>password</replaceable></userinput>
438 <indexterm><primary>net</primary><secondary>rpc</secondary><tertiary>join</tertiary></indexterm>
439 Samba-3 can do the same by executing:
441 &rootprompt;<userinput>net rpc join -U Administrator%<replaceable>password</replaceable></userinput>
443 It is not necessary with Samba-3 to specify the <replaceable>DOMAIN_NAME</replaceable> or the
444 <replaceable>PDC_NAME</replaceable>, as it figures this out from the &smb.conf; file settings.
448 <indexterm><primary>invalid shell</primary></indexterm>
449 <indexterm><primary>/etc/passwd</primary></indexterm>
450 <indexterm><primary>/bin/false</primary></indexterm>
451 Use of this mode of authentication requires there to be a standard UNIX account for each user in order to
452 assign a UID once the account has been authenticated by the Windows domain controller. This account can be
453 blocked to prevent logons by clients other than MS Windows through means such as setting an invalid shell in
454 the <filename>/etc/passwd</filename> entry. The best way to allocate an invalid shell to a user account is to
455 set the shell to the file <filename>/bin/false</filename>.
459 <indexterm><primary>PDC</primary></indexterm>
460 <indexterm><primary>BDC</primary></indexterm>
461 Domain controllers can be located anywhere that is convenient. The best advice is to have a BDC on every
462 physical network segment, and if the PDC is on a remote network segment the use of WINS (see <link
463 linkend="NetworkBrowsing">Network Browsing</link> for more information) is almost essential.
467 An alternative to assigning UIDs to Windows users on a Samba member server is presented in <link
468 linkend="winbind">Winbind</link>, <link linkend="winbind">Winbind: Use of Domain Accounts</link>.
472 For more information regarding domain membership, <link linkend="domain-member">Domain Membership</link>.
479 <title>ADS Security Mode (User-Level Security)</title>
482 <indexterm><primary>ADS</primary></indexterm>
483 <indexterm><primary>native mode</primary></indexterm>
484 Both Samba-2.2, and Samba-3 can join an Active Directory domain using NT4 style RPC based security. This is
485 possible if the domain is run in native mode. Active Directory in native mode perfectly allows NT4-style
486 domain members. This is contrary to popular belief.
490 If you are using Active Directory, starting with Samba-3 you can join as a native AD member. Why would you
491 want to do that? Your security policy might prohibit the use of NT-compatible authentication protocols. All
492 your machines are running Windows 2000 and above and all use Kerberos. In this case Samba, as an NT4-style
493 domain, would still require NT-compatible authentication data. Samba in AD-member mode can accept Kerberos
498 <indexterm><primary>realm</primary></indexterm>
499 <indexterm><primary>mixed mode</primary></indexterm>
500 Sites that use Microsoft Windows active directory services (ADS) should be aware of the significance of the
501 terms: <literal>native mode</literal> and <literal>mixed mode</literal> ADS operation. The term
502 <literal>realm</literal> is used to describe a Kerberos-based security architecture (such as is used by
507 <title>Example Configuration</title>
510 <smbconfoption name="realm">your.kerberos.REALM</smbconfoption>
511 <smbconfoption name="security">ADS</smbconfoption>
512 </smbconfblock></para>
515 The following parameter may be required:
519 <smbconfoption name="password server">your.kerberos.server</smbconfoption>
520 </smbconfblock></para>
523 Please refer to <link linkend="domain-member">Domain Membership</link>, and <link linkend="ads-member">Samba
524 ADS Domain Membership</link> for more information regarding this configuration option.
531 <title>Server Security (User Level Security)</title>
534 Server security mode is left over from the time when Samba was not capable of acting
535 as a domain member server. It is highly recommended not to use this feature. Server
536 security mode has many drawbacks that include:
540 <listitem><para>Potential account lockout on MS Windows NT4/200x password servers.</para></listitem>
541 <listitem><para>Lack of assurance that the password server is the one specified.</para></listitem>
542 <listitem><para>Does not work with Winbind, which is particularly needed when storing profiles remotely.</para></listitem>
543 <listitem><para>This mode may open connections to the password server and keep them open for extended periods.</para></listitem>
544 <listitem><para>Security on the Samba server breaks badly when the remote password server suddenly shuts down.</para></listitem>
545 <listitem><para>With this mode there is NO security account in the domain that the password server belongs to for the Samba server.</para></listitem>
549 <indexterm><primary>session setup</primary></indexterm>
550 <indexterm><primary>SMB</primary></indexterm>
551 In server security mode the Samba server reports to the client that it is in user-level security. The client
552 then does a session setup as described earlier. The Samba server takes the username/password that the client
553 sends and attempts to log into the <smbconfoption name="password server"/> by sending exactly the same
554 username/password that it got from the client. If that server is in user-level security and accepts the
555 password, then Samba accepts the client's connection. This parameter allows the Samba server to use another
556 SMB server as the <smbconfoption name="password server"/>.
560 <indexterm><primary>security level</primary></indexterm>
561 <indexterm><primary>encryption</primary></indexterm>
562 You should also note that at the start of all this, when the server tells the client
563 what security level it is in, it also tells the client if it supports encryption. If it
564 does, it supplies the client with a random cryptkey. The client will then send all
565 passwords in encrypted form. Samba supports this type of encryption by default.
569 The parameter <smbconfoption name="security">server</smbconfoption> means that Samba reports to clients that
570 it is running in <emphasis>user mode</emphasis> but actually passes off all authentication requests to another
571 user mode server. This requires an additional parameter <smbconfoption name="password server"/> that points to
572 the real authentication server. The real authentication server can be another Samba server, or it can be a
573 Windows NT server, the latter being natively capable of encrypted password support.
577 <indexterm><primary>password server</primary></indexterm>
578 <indexterm><primary>workgroup</primary></indexterm>
579 When Samba is running in <emphasis>server security mode</emphasis>, it is essential that the parameter
580 <emphasis>password server</emphasis> is set to the precise NetBIOS machine name of the target authentication
581 server. Samba cannot determine this from NetBIOS name lookups because the choice of the target authentication
582 server is arbitrary and cannot be determined from a domain name. In essence, a Samba server that is in
583 <emphasis>server security mode</emphasis> is operating in what used to be known as workgroup mode.
587 <title>Example Configuration</title>
589 Using MS Windows NT as an Authentication Server
593 This method involves the additions of the following parameters in the &smb.conf; file:
597 <smbconfoption name="encrypt passwords">Yes</smbconfoption>
598 <smbconfoption name="security">server</smbconfoption>
599 <smbconfoption name="password server">"NetBIOS_name_of_a_DC"</smbconfoption>
600 </smbconfblock></para>
604 There are two ways of identifying whether or not a username and password pair is valid.
605 One uses the reply information provided as part of the authentication messaging
606 process, the other uses just an error code.
610 <indexterm><primary>bogus</primary></indexterm>
611 <indexterm><primary>lockout</primary></indexterm>
612 The downside of this mode of configuration is that for security reasons Samba
613 will send the password server a bogus username and a bogus password, and if the remote
614 server fails to reject the bogus username and password pair, then an alternative mode of
615 identification or validation is used. Where a site uses password lockout, after a
616 certain number of failed authentication attempts, this will result in user lockouts.
620 Use of this mode of authentication requires a standard UNIX account for the user.
621 This account can be blocked to prevent logons by non-SMB/CIFS clients.
630 <title>Password Checking</title>
633 MS Windows clients may use encrypted passwords as part of a challenge/response
634 authentication model (a.k.a. NTLMv1 and NTLMv2) or alone, or clear-text strings for simple
635 password-based authentication. It should be realized that with the SMB protocol,
636 the password is passed over the network either in plaintext or encrypted, but
637 not both in the same authentication request.
641 <indexterm><primary>encrypted passwords</primary></indexterm>
642 <indexterm><primary>encrypted</primary></indexterm>
643 When encrypted passwords are used, a password that has been entered by the user
644 is encrypted in two ways:
648 <listitem><para>An MD4 hash of the unicode of the password
649 string. This is known as the NT hash.
652 <listitem><para>The password is converted to uppercase,
653 and then padded or truncated to 14 bytes. This string is
654 then appended with 5 bytes of NULL characters and split to
655 form two 56-bit DES keys to encrypt a "magic" 8-byte value.
656 The resulting 16 bytes form the LanMan hash.
661 <indexterm><primary>plain-text</primary><secondary>passwords</secondary></indexterm>
662 MS Windows 95 pre-service pack 1 and MS Windows NT versions 3.x and version 4.0 pre-service pack 3 will use
663 either mode of password authentication. All versions of MS Windows that follow these versions no longer
664 support plain-text passwords by default.
668 <indexterm><primary>cached</primary><secondary>password</secondary></indexterm>
669 MS Windows clients have a habit of dropping network mappings that have been idle
670 for 10 minutes or longer. When the user attempts to use the mapped drive
671 connection that has been dropped, the client re-establishes the connection using
672 a cached copy of the password.
676 When Microsoft changed the default password mode, support was dropped for caching
677 of the plaintext password. This means that when the registry parameter is changed
678 to re-enable use of plaintext passwords, it appears to work, but when a dropped
679 service connection mapping attempts to revalidate, this will fail if the remote
680 authentication server does not support encrypted passwords. It is definitely not
681 a good idea to re-enable plaintext password support in such clients.
685 The following parameters can be used to work around the issue of Windows 9x/Me clients
686 uppercasing usernames and passwords before transmitting them to the SMB server
687 when using clear-text authentication:
691 <smbconfoption name="password level"><replaceable>integer</replaceable></smbconfoption>
692 <smbconfoption name="username level"><replaceable>integer</replaceable></smbconfoption>
693 </smbconfblock></para>
696 By default Samba will convert to lowercase the username before attempting to lookup the user
697 in the database of local system accounts. Because UNIX usernames conventionally
698 only contain lowercase characters, the <smbconfoption name="username-level"/> parameter
703 <indexterm><primary>clear-text</primary></indexterm>
704 However, passwords on UNIX systems often make use of mixed-case characters. This means that in order for a
705 user on a Windows 9x/Me client to connect to a Samba server using clear-text authentication, the
706 <smbconfoption name="password level"/> must be set to the maximum number of uppercase letters that
707 <emphasis>could</emphasis> appear in a password. Note that if the Server OS uses the traditional DES version
708 of crypt(), a <smbconfoption name="password level"/> of 8 will result in case-insensitive passwords as seen
709 from Windows users. This will also result in longer login times because Samba has to compute the permutations
710 of the password string and try them one by one until a match is located (or all combinations fail).
714 The best option to adopt is to enable support for encrypted passwords wherever
715 Samba is used. Most attempts to apply the registry change to re-enable plaintext
716 passwords will eventually lead to user complaints and unhappiness.
722 <title>Common Errors</title>
725 We all make mistakes. It is okay to make mistakes, as long as they are made in the right places
726 and at the right time. A mistake that causes lost productivity is seldom tolerated; however, a mistake
727 made in a developmental test lab is expected.
731 Here we look at common mistakes and misapprehensions that have been the subject of discussions
732 on the Samba mailing lists. Many of these are avoidable by doing your homework before attempting
733 a Samba implementation. Some are the result of a misunderstanding of the English language,
734 which has many phrases that are potentially vague and may be highly confusing
735 to those for whom English is not their native tongue.
739 <title>What Makes Samba a Server?</title>
742 To some, the nature of the Samba security mode is obvious, but entirely
743 wrong all the same. It is assumed that <smbconfoption name="security">server</smbconfoption> means that Samba
744 will act as a server. Not so! This setting means that Samba will <emphasis>try</emphasis>
745 to use another SMB server as its source for user authentication alone.
749 Samba is a server regardless of which security mode is chosen. When Samba is used outside of a domain security
750 context, it is best to leave the security mode at the default setting. By default Samba-3 uses User-mode
757 <title>What Makes Samba a Domain Controller?</title>
760 <indexterm><primary>server-mode</primary></indexterm>
761 The &smb.conf; parameter <smbconfoption name="security">domain</smbconfoption> does not really make Samba behave
762 as a domain controller. This setting means we want Samba to be a domain member. See <link linkend="samba-pdc">Samba as a PDC</link> for more information.
768 <title>What Makes Samba a Domain Member?</title>
771 Guess! So many others do. But whatever you do, do not think that <smbconfoption name="security">user</smbconfoption>
772 makes Samba act as a domain member. Read the manufacturer's manual before the warranty expires. See
773 <link linkend="domain-member">Domain Membership</link>, for more information.
780 <title>Constantly Losing Connections to Password Server</title>
784 Why does server_validate() simply give up rather than re-establish its connection to the
785 password server? Though I am not fluent in the SMB protocol, perhaps the cluster server
786 process passes along to its client workstation the session key it receives from the password
787 server, which means the password hashes submitted by the client would not work on a subsequent
788 connection whose session key would be different. So server_validate() must give up.</quote>
792 Indeed. That's why <smbconfoption name="security">server</smbconfoption>
793 is at best a nasty hack. Please use <smbconfoption name="security">domain</smbconfoption>;
794 <smbconfoption name="security">server</smbconfoption> mode is also known as pass-through authentication.