~ubuntu-branches/ubuntu/maverick/samba/maverick-security

« back to all changes in this revision

Viewing changes to docs/htmldocs/Samba3-HOWTO/ServerType.html

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-01-29 06:16:15 UTC
  • mfrom: (0.27.9 upstream) (0.34.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100129061615-37hs6xqpsdhjq3ld
Tags: 2:3.4.5~dfsg-1ubuntu1
* Merge from debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/smb.conf:
    - Add "(Samba, Ubuntu)" to server string.
    - Comment out the default [homes] share, and add a comment about "valid users = %s"
      to show users how to restrict access to \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are allowed to create
      public shares in additon to authenticated ones.
    - add map to guest = Bad user, maps bad username to gues access.
  + debian/samba-common.conf:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/mksambapasswd.awk:
    - Do not add user with UID less than 1000 to smbpasswd.
  + debian/control: 
    - Make libswbclient0 replace/conflict with hardy's likewise-open.
    - Don't build against ctdb, since its not in main yet.
  + debian/rules:
    - Enable "native" PIE hardening.
    - Add BIND_NOW to maximize benefit of RELRO hardening.
  + Add ufw integration:
    - Created debian/samba.ufw.profile.
    - debian/rules, debian/samba.dirs, debian/samba.files: install
  + Add apoort hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + debian/rules, debian/samba.if-up: allow "NetworkManager" as a recognized address
    family... it's obviously /not/ an address family, but it's what gets
    sent when using NM, so we'll cope for now.  (LP: #462169). Taken from karmic-proposed.
  + debian/control: Recommend keyutils for smbfs (LP: #493565)
  + Dropped patches:
    - debian/patches/security-CVE-2009-3297.patch: No longer needed
    - debian/patches/fix-too-many-open-files.patch: No longer needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<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.74.0"><link rel="home" href="index.html" title="The Official Samba 3.4.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" lang="en"><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="orgname">Samba Team</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="orgname">The Samba Team</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="orgname">Samba Team</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#id2558832">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="ServerType.html#id2558991">Server Types</a></span></dt><dt><span class="sect1"><a href="ServerType.html#id2559136">Samba Security Modes</a></span></dt><dd><dl><dt><span class="sect2"><a href="ServerType.html#id2559298">User Level Security</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2559461">Share-Level Security</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2559653">Domain Security Mode (User-Level Security)</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2560148">ADS Security Mode (User-Level Security)</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2560291">Server Security (User Level Security)</a></span></dt></dl></dd><dt><span class="sect1"><a href="ServerType.html#id2560566">Password Checking</a></span></dt><dt><span class="sect1"><a href="ServerType.html#id2560753">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="ServerType.html#id2560783">What Makes Samba a Server?</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2560815">What Makes Samba a Domain Controller?</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2560852">What Makes Samba a Domain Member?</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2560879">Constantly Losing Connections to Password Server</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2560937">Stand-alone Server is converted to Domain Controller  Now User accounts don't work</a></span></dt></dl></dd></dl></div><p>
2
 
<a class="indexterm" name="id2558793"></a>
3
 
<a class="indexterm" name="id2558799"></a>
 
1
<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.4.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#id2564889">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="ServerType.html#id2565049">Server Types</a></span></dt><dt><span class="sect1"><a href="ServerType.html#id2565193">Samba Security Modes</a></span></dt><dd><dl><dt><span class="sect2"><a href="ServerType.html#id2565355">User Level Security</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2565518">Share-Level Security</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2565710">Domain Security Mode (User-Level Security)</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2566205">ADS Security Mode (User-Level Security)</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2566348">Server Security (User Level Security)</a></span></dt></dl></dd><dt><span class="sect1"><a href="ServerType.html#id2566623">Password Checking</a></span></dt><dt><span class="sect1"><a href="ServerType.html#id2566810">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="ServerType.html#id2566840">What Makes Samba a Server?</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2566873">What Makes Samba a Domain Controller?</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2566910">What Makes Samba a Domain Member?</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2566937">Constantly Losing Connections to Password Server</a></span></dt><dt><span class="sect2"><a href="ServerType.html#id2566995">Stand-alone Server is converted to Domain Controller  Now User accounts don't work</a></span></dt></dl></dd></dl></div><p>
 
2
<a class="indexterm" name="id2564850"></a>
 
3
<a class="indexterm" name="id2564856"></a>
4
4
This chapter provides information regarding the types of server that Samba may be configured to be. A
5
5
Microsoft network administrator who wishes to migrate to or use Samba will want to know the meaning, within a
6
6
Samba context, of terms familiar to the MS Windows administrator. This means that it is essential also to
10
10
This chapter provides an overview of the security modes of which Samba is capable and how they relate to MS
11
11
Windows servers and clients.
12
12
</p><p>
13
 
A question often asked is, &#8220;<span class="quote">Why would I want to use Samba?</span>&#8221; Most chapters contain a section that
 
13
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
14
14
highlights features and benefits. We hope that the information provided will help to answer this question. Be
15
15
warned though, we want to be fair and reasonable, so not all features are positive toward Samba. The benefit
16
16
may be on the side of our competition.
17
 
</p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2558832"></a>Features and Benefits</h2></div></div></div><p>
 
17
</p><div class="sect1" title="Features and Benefits"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2564889"></a>Features and Benefits</h2></div></div></div><p>
18
18
Two men were walking down a dusty road, when one suddenly kicked up a small red stone. It
19
19
hurt his toe and lodged in his sandal. He took the stone out and cursed it with a passion
20
 
and fury befitting his anguish. The other looked at the stone and said, &#8220;<span class="quote">This is a garnet.
21
 
I can turn that into a precious gem and some day it will make a princess very happy!</span>&#8221;
 
20
and fury befitting his anguish. The other looked at the stone and said, <span class="quote">&#8220;<span class="quote">This is a garnet.
 
21
I can turn that into a precious gem and some day it will make a princess very happy!</span>&#8221;</span>
22
22
</p><p>
23
23
The moral of this tale: Two men, two very different perspectives regarding the same stone.
24
24
Like it or not, Samba is like that stone. Treat it the right way and it can bring great
25
25
pleasure, but if you are forced to use it and have no time for its secrets, then it can be
26
26
a source of discomfort.
27
27
</p><p>
28
 
<a class="indexterm" name="id2558860"></a>
29
 
<a class="indexterm" name="id2558869"></a>
 
28
<a class="indexterm" name="id2564918"></a>
 
29
<a class="indexterm" name="id2564926"></a>
30
30
Samba started out as a project that sought to provide interoperability for MS Windows 3.x
31
31
clients with a UNIX server. It has grown up a lot since its humble beginnings and now provides
32
32
features and functionality fit for large-scale deployment. It also has some warts. In sections
33
33
like this one, we tell of both.
34
34
</p><p>
35
35
So, what are the benefits of the features mentioned in this chapter?
36
 
</p><div class="itemizedlist"><ul type="disc"><li><p>
37
 
        <a class="indexterm" name="id2558891"></a>
 
36
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
 
37
        <a class="indexterm" name="id2564949"></a>
38
38
        Samba-3 can replace an MS Windows NT4 domain controller.
39
 
        </p></li><li><p>
40
 
        <a class="indexterm" name="id2558905"></a>
 
39
        </p></li><li class="listitem"><p>
 
40
        <a class="indexterm" name="id2564962"></a>
41
41
        Samba-3 offers excellent interoperability with MS Windows NT4-style
42
42
        domains as well as natively with Microsoft Active Directory domains.
43
 
        </p></li><li><p>
44
 
        <a class="indexterm" name="id2558918"></a>
 
43
        </p></li><li class="listitem"><p>
 
44
        <a class="indexterm" name="id2564976"></a>
45
45
        Samba-3 permits full NT4-style interdomain trusts.
46
 
        </p></li><li><p>
47
 
        <a class="indexterm" name="id2558932"></a>
48
 
        <a class="indexterm" name="id2558938"></a>
 
46
        </p></li><li class="listitem"><p>
 
47
        <a class="indexterm" name="id2564989"></a>
 
48
        <a class="indexterm" name="id2564996"></a>
49
49
        Samba has security modes that permit more flexible authentication
50
50
        than is possible with MS Windows NT4 domain controllers.
51
 
        </p></li><li><p>
52
 
        <a class="indexterm" name="id2558953"></a>
53
 
        <a class="indexterm" name="id2558964"></a>
 
51
        </p></li><li class="listitem"><p>
 
52
        <a class="indexterm" name="id2565010"></a>
 
53
        <a class="indexterm" name="id2565021"></a>
54
54
        Samba-3 permits use of multiple concurrent account database backends.
55
55
        (Encrypted passwords that are stored in the account database are in
56
56
        formats that are unique to Windows networking).
57
 
        </p></li><li><p>
58
 
        <a class="indexterm" name="id2558978"></a>
 
57
        </p></li><li class="listitem"><p>
 
58
        <a class="indexterm" name="id2565035"></a>
59
59
        The account database backends can be distributed
60
60
        and replicated using multiple methods. This gives Samba-3
61
61
        greater flexibility than MS Windows NT4 and in many cases a
62
62
        significantly higher utility than Active Directory domains
63
63
        with MS Windows 200x.
64
 
        </p></li></ul></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2558991"></a>Server Types</h2></div></div></div><p>
65
 
<a class="indexterm" name="id2558999"></a>
 
64
        </p></li></ul></div></div><div class="sect1" title="Server Types"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2565049"></a>Server Types</h2></div></div></div><p>
 
65
<a class="indexterm" name="id2565056"></a>
66
66
Administrators of Microsoft networks often refer to three different types of servers:
67
 
</p><div class="itemizedlist"><ul type="disc"><li><p>Domain Controller</p><div class="itemizedlist"><ul type="circle"><li><p>Primary Domain Controller (PDC)</p></li><li><p>Backup Domain Controller (BDC)</p></li><li><p>ADS Domain Controller</p></li></ul></div></li><li><p>Domain Member Server</p><div class="itemizedlist"><ul type="circle"><li><p>Active Directory Domain Server</p></li><li><p>NT4 Style Domain Domain Server</p></li></ul></div></li><li><p>Standalone Server</p></li></ul></div><p>
68
 
<a class="indexterm" name="id2559058"></a>
69
 
<a class="indexterm" name="id2559067"></a>
70
 
<a class="indexterm" name="id2559075"></a>
71
 
<a class="indexterm" name="id2559084"></a>
 
67
</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>
 
68
<a class="indexterm" name="id2565116"></a>
 
69
<a class="indexterm" name="id2565124"></a>
 
70
<a class="indexterm" name="id2565133"></a>
 
71
<a class="indexterm" name="id2565141"></a>
72
72
The chapters covering domain control (<a class="link" href="samba-pdc.html" title="Chapter�4.�Domain Control">Domain Control</a>), 
73
73
backup domain control (<a class="link" href="samba-bdc.html" title="Chapter�5.�Backup Domain Control">Backup Domain Control</a>), and 
74
74
domain membership (<a class="link" href="domain-member.html" title="Chapter�6.�Domain Membership">Domain Membership</a>) provide
76
76
You are strongly encouraged to become intimately familiar with these chapters because
77
77
they lay the foundation for deployment of Samba domain security.
78
78
</p><p>
79
 
<a class="indexterm" name="id2559116"></a>
 
79
<a class="indexterm" name="id2565173"></a>
80
80
A Standalone server is autonomous in respect of the source of its account backend.
81
81
Refer to <a class="link" href="StandAloneServer.html" title="Chapter�7.�Standalone Servers">Standalone Servers</a> to gain a wider appreciation
82
82
of what is meant by a server being configured as a <span class="emphasis"><em>standalone</em></span> server.
83
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2559136"></a>Samba Security Modes</h2></div></div></div><p>
84
 
<a class="indexterm" name="id2559143"></a>
85
 
<a class="indexterm" name="id2559150"></a>
 
83
</p></div><div class="sect1" title="Samba Security Modes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2565193"></a>Samba Security Modes</h2></div></div></div><p>
 
84
<a class="indexterm" name="id2565201"></a>
 
85
<a class="indexterm" name="id2565207"></a>
86
86
In this section, the function and purpose of Samba's security modes are described. An accurate understanding of
87
87
how Samba implements each security mode as well as how to configure MS Windows clients for each mode will
88
88
significantly reduce user complaints and administrator heartache.
89
89
</p><p>
90
 
<a class="indexterm" name="id2559164"></a>
91
 
<a class="indexterm" name="id2559172"></a>
 
90
<a class="indexterm" name="id2565221"></a>
 
91
<a class="indexterm" name="id2565230"></a>
92
92
Microsoft Windows networking uses a protocol that was originally called the Server Message Block (SMB)
93
93
protocol. Since some time around 1996 the protocol has been better known as the Common Internet Filesystem
94
94
(CIFS) protocol.
95
95
</p><p>
96
 
<a class="indexterm" name="id2559188"></a>
97
 
<a class="indexterm" name="id2559194"></a>
98
 
<a class="indexterm" name="id2559201"></a>
99
 
<a class="indexterm" name="id2559207"></a>
 
96
<a class="indexterm" name="id2565245"></a>
 
97
<a class="indexterm" name="id2565252"></a>
 
98
<a class="indexterm" name="id2565258"></a>
 
99
<a class="indexterm" name="id2565264"></a>
100
100
In the SMB/CIFS networking world, there are only two types of security: <span class="emphasis"><em>user-level</em></span> and
101
101
<span class="emphasis"><em>share level</em></span>. We refer to these collectively as <span class="emphasis"><em>security levels</em></span>.  In
102
102
implementing these two security levels, Samba provides flexibilities that are not available with MS Windows
116
116
The term <code class="literal">client</code> refers to all agents whether it is a Windows workstation, a Windows server,
117
117
another Samba server, or any vanilla SMB or CIFS client application (e.g., <code class="literal">smbclient</code>) that
118
118
make use of services provided by an SMB/CIFS server.
119
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2559298"></a>User Level Security</h3></div></div></div><p>
120
 
<a class="indexterm" name="id2559306"></a>
 
119
</p><div class="sect2" title="User Level Security"><div class="titlepage"><div><div><h3 class="title"><a name="id2565355"></a>User Level Security</h3></div></div></div><p>
 
120
<a class="indexterm" name="id2565363"></a>
121
121
We describe user-level security first because its simpler.  In user-level security, the client sends a session
122
122
setup request directly following protocol negotiation.  This request provides a username and password. The
123
123
server can either accept or reject that username/password combination. At this stage the server has no idea
124
124
what share the client will eventually try to connect to, so it can't base the
125
125
<span class="emphasis"><em>accept/reject</em></span> on anything other than:
126
 
</p><div class="orderedlist"><ol type="1"><li><p>the username/password.</p></li><li><p>the name of the client machine.</p></li></ol></div><p>
127
 
<a class="indexterm" name="id2559342"></a>
 
126
</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>
 
127
<a class="indexterm" name="id2565399"></a>
128
128
If the server accepts the username/password credentials, the client expects to be able to mount shares (using
129
129
a <span class="emphasis"><em>tree connection</em></span>) without further specifying a password. It expects that all access
130
130
rights will be as the username/password credentials set that was specified in the initial <span class="emphasis"><em>session
131
131
setup</em></span>.
132
132
</p><p>
133
 
<a class="indexterm" name="id2559362"></a>
 
133
<a class="indexterm" name="id2565420"></a>
134
134
It is also possible for a client to send multiple <span class="emphasis"><em>session setup</em></span>
135
135
requests. When the server responds, it gives the client a <span class="emphasis"><em>uid</em></span> to use
136
136
as an authentication tag for that username/password. The client can maintain multiple
137
137
authentication contexts in this way (WinDD is an example of an application that does this).
138
138
</p><p>
139
 
<a class="indexterm" name="id2559383"></a>
140
 
<a class="indexterm" name="id2559390"></a>
141
 
<a class="indexterm" name="id2559396"></a>
142
 
<a class="indexterm" name="id2559402"></a>
143
 
<a class="indexterm" name="id2559408"></a>
 
139
<a class="indexterm" name="id2565441"></a>
 
140
<a class="indexterm" name="id2565447"></a>
 
141
<a class="indexterm" name="id2565453"></a>
 
142
<a class="indexterm" name="id2565459"></a>
 
143
<a class="indexterm" name="id2565466"></a>
144
144
Windows networking user account names are case-insensitive, meaning that upper-case and lower-case characters
145
145
in the account name are considered equivalent. They are said to be case-preserving, but not case significant.
146
146
Windows and LanManager systems previous to Windows NT version 3.10 have case-insensitive passwords that were
147
147
not necessarily case-preserving. All Windows NT family systems treat passwords as case-preserving and
148
148
case-sensitive.
149
 
</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2559423"></a>Example Configuration</h4></div></div></div><p>
 
149
</p><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id2565481"></a>Example Configuration</h4></div></div></div><p>
150
150
The <code class="filename">smb.conf</code> parameter that sets user-level security is:
151
 
</p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2559444"></a><em class="parameter"><code>security = user</code></em></td></tr></table><p>
 
151
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2565502"></a><em class="parameter"><code>security = user</code></em></td></tr></table><p>
152
152
This is the default setting since Samba-2.2.x.
153
 
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2559461"></a>Share-Level Security</h3></div></div></div><p>
154
 
<a class="indexterm" name="id2559468"></a>
155
 
<a class="indexterm" name="id2559475"></a>
 
153
</p></div></div><div class="sect2" title="Share-Level Security"><div class="titlepage"><div><div><h3 class="title"><a name="id2565518"></a>Share-Level Security</h3></div></div></div><p>
 
154
<a class="indexterm" name="id2565526"></a>
 
155
<a class="indexterm" name="id2565532"></a>
156
156
In share-level security, the client authenticates itself separately for each share. It sends a password along
157
157
with each tree connection request (share mount), but it does not explicitly send a username with this
158
158
operation. The client expects a password to be associated with each share, independent of the user. This means
171
171
The password is then checked in turn against these possible usernames. If a match is found, then the client is
172
172
authenticated as that user.
173
173
</p><p>
174
 
<a class="indexterm" name="id2559541"></a>
175
 
<a class="indexterm" name="id2559549"></a>
176
 
<a class="indexterm" name="id2559556"></a>
 
174
<a class="indexterm" name="id2565598"></a>
 
175
<a class="indexterm" name="id2565607"></a>
 
176
<a class="indexterm" name="id2565613"></a>
177
177
Where the list of possible user names is not provided, Samba makes a UNIX system call to find the user
178
178
account that has a password that matches the one provided from the standard account database. On a system that
179
179
has no name service switch (NSS) facility, such lookups will be from the <code class="filename">/etc/passwd</code>
184
184
shadow: files nis ldap
185
185
group: files nis ldap
186
186
</pre><p>
187
 
<a class="indexterm" name="id2559587"></a>
188
 
<a class="indexterm" name="id2559593"></a>
189
 
<a class="indexterm" name="id2559599"></a>
 
187
<a class="indexterm" name="id2565644"></a>
 
188
<a class="indexterm" name="id2565650"></a>
 
189
<a class="indexterm" name="id2565657"></a>
190
190
In the example shown here (not likely to be used in practice) the lookup will check
191
191
<code class="filename">/etc/passwd</code> and <code class="filename">/etc/group</code>, if not found it will check NIS, then
192
192
LDAP.
193
 
</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2559620"></a>Example Configuration</h4></div></div></div><p>
 
193
</p><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id2565677"></a>Example Configuration</h4></div></div></div><p>
194
194
The <code class="filename">smb.conf</code> parameter that sets share-level security is:
195
 
</p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2559641"></a><em class="parameter"><code>security = share</code></em></td></tr></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2559653"></a>Domain Security Mode (User-Level Security)</h3></div></div></div><p>
196
 
<a class="indexterm" name="id2559661"></a>
197
 
<a class="indexterm" name="id2559669"></a>
198
 
<a class="indexterm" name="id2559677"></a>
199
 
<a class="indexterm" name="id2559684"></a>
200
 
<a class="indexterm" name="id2559690"></a>
201
 
<a class="indexterm" name="id2559696"></a>
 
195
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2565698"></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="id2565710"></a>Domain Security Mode (User-Level Security)</h3></div></div></div><p>
 
196
<a class="indexterm" name="id2565718"></a>
 
197
<a class="indexterm" name="id2565726"></a>
 
198
<a class="indexterm" name="id2565735"></a>
 
199
<a class="indexterm" name="id2565741"></a>
 
200
<a class="indexterm" name="id2565747"></a>
 
201
<a class="indexterm" name="id2565754"></a>
202
202
Domain security provides a mechanism for storing all user and group accounts in a central, shared, account
203
203
repository. The centralized account repository is shared between domain (security) controllers. Servers that
204
204
act as domain controllers provide authentication and validation services to all machines that participate in
207
207
logon and authentication services. Usually, BDCs will answer network logon requests more responsively than
208
208
will a PDC.
209
209
</p><p>
210
 
<a class="indexterm" name="id2559728"></a>
211
 
<a class="indexterm" name="id2559734"></a>
212
 
<a class="indexterm" name="id2559740"></a>
213
 
<a class="indexterm" name="id2559749"></a>
214
 
<a class="indexterm" name="id2559757"></a>
 
210
<a class="indexterm" name="id2565785"></a>
 
211
<a class="indexterm" name="id2565792"></a>
 
212
<a class="indexterm" name="id2565798"></a>
 
213
<a class="indexterm" name="id2565806"></a>
 
214
<a class="indexterm" name="id2565815"></a>
215
215
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
216
216
domain security trust account (a machine account) and causes all authentication requests to be passed through
217
217
to the domain controllers.  In other words, this configuration makes the Samba server a domain member server,
218
218
even when it is in fact acting as a domain controller. All machines that participate in domain security must
219
219
have a machine account in the security database.
220
220
</p><p>
221
 
<a class="indexterm" name="id2559785"></a>
222
 
<a class="indexterm" name="id2559794"></a>
223
 
<a class="indexterm" name="id2559802"></a>
224
 
<a class="indexterm" name="id2559810"></a>
 
221
<a class="indexterm" name="id2565842"></a>
 
222
<a class="indexterm" name="id2565851"></a>
 
223
<a class="indexterm" name="id2565859"></a>
 
224
<a class="indexterm" name="id2565868"></a>
225
225
Within the domain security environment, the underlying security architecture uses user-level security. Even
226
226
machines that are domain members must authenticate on startup. The machine account consists of an account
227
227
entry in the accounts database, the name of which is the NetBIOS name of the machine and of which the password
230
230
it cannot be trusted. The machine account is referred to as a machine trust account.
231
231
</p><p>
232
232
There are three possible domain member configurations:
233
 
</p><div class="orderedlist"><ol type="1"><li><p>Primary domain controller (PDC) - of which there is one per domain.</p></li><li><p>Backup domain controller (BDC) - of which there can be any number per domain.</p></li><li><p>Domain member server (DMS) - of which there can be any number per domain.</p></li></ol></div><p>
234
 
<a class="indexterm" name="id2559859"></a>
 
233
</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>
 
234
<a class="indexterm" name="id2565916"></a>
235
235
We will discuss each of these in separate chapters. For now, we are most interested in basic DMS
236
236
configuration.
237
 
</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2559868"></a>Example Configuration</h4></div></div></div><p><span class="emphasis"><em>
 
237
</p><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id2565925"></a>Example Configuration</h4></div></div></div><p><span class="emphasis"><em>
238
238
Samba as a Domain Member Server
239
239
</em></span></p><p>
240
 
<a class="indexterm" name="id2559880"></a>
 
240
<a class="indexterm" name="id2565937"></a>
241
241
This method involves addition of the following parameters in the <code class="filename">smb.conf</code> file:
242
 
</p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2559900"></a><em class="parameter"><code>security = domain</code></em></td></tr><tr><td><a class="indexterm" name="id2559910"></a><em class="parameter"><code>workgroup = MIDEARTH</code></em></td></tr></table><p>
 
242
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2565957"></a><em class="parameter"><code>security = domain</code></em></td></tr><tr><td><a class="indexterm" name="id2565968"></a><em class="parameter"><code>workgroup = MIDEARTH</code></em></td></tr></table><p>
243
243
</p><p>
244
244
In order for this method to work, the Samba server needs to join the MS Windows NT
245
245
security domain. This is done as follows:
246
 
<a class="indexterm" name="id2559926"></a>
247
 
<a class="indexterm" name="id2559934"></a>
248
 
</p><div class="procedure"><ol type="1"><li><p>On the MS Windows NT domain controller, using
 
246
<a class="indexterm" name="id2565983"></a>
 
247
<a class="indexterm" name="id2565992"></a>
 
248
</p><div class="procedure"><ol class="procedure" type="1"><li class="step" title="Step 1"><p>On the MS Windows NT domain controller, using
249
249
        the Server Manager, add a machine account for the Samba server.
250
 
        </p></li><li><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" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
251
 
<a class="indexterm" name="id2559981"></a>
 
250
        </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>
 
251
<a class="indexterm" name="id2566038"></a>
252
252
Samba-2.2.4 and later Samba 2.2.x series releases can autojoin a Windows NT4-style domain just by executing:
253
253
</p><pre class="screen">
254
254
<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> \
255
255
         -U Administrator%<em class="replaceable"><code>password</code></em></code></strong>
256
256
</pre><p>
257
 
<a class="indexterm" name="id2560012"></a>
 
257
<a class="indexterm" name="id2566070"></a>
258
258
Samba-3 can do the same by executing:
259
259
</p><pre class="screen">
260
260
<code class="prompt">root# </code><strong class="userinput"><code>net rpc join -U Administrator%<em class="replaceable"><code>password</code></em></code></strong>
262
262
It is not necessary with Samba-3 to specify the <em class="replaceable"><code>DOMAIN_NAME</code></em> or the
263
263
<em class="replaceable"><code>PDC_NAME</code></em>, as it figures this out from the <code class="filename">smb.conf</code> file settings.
264
264
</p></div><p>
265
 
<a class="indexterm" name="id2560058"></a>
266
 
<a class="indexterm" name="id2560064"></a>
267
 
<a class="indexterm" name="id2560070"></a>
 
265
<a class="indexterm" name="id2566115"></a>
 
266
<a class="indexterm" name="id2566121"></a>
 
267
<a class="indexterm" name="id2566127"></a>
268
268
Use of this mode of authentication requires there to be a standard UNIX account for each user in order to
269
269
assign a UID once the account has been authenticated by the Windows domain controller. This account can be
270
270
blocked to prevent logons by clients other than MS Windows through means such as setting an invalid shell in
271
271
the <code class="filename">/etc/passwd</code> entry. The best way to allocate an invalid shell to a user account is to
272
272
set the shell to the file <code class="filename">/bin/false</code>.
273
273
</p><p>
274
 
<a class="indexterm" name="id2560097"></a>
275
 
<a class="indexterm" name="id2560104"></a>
 
274
<a class="indexterm" name="id2566155"></a>
 
275
<a class="indexterm" name="id2566161"></a>
276
276
Domain controllers can be located anywhere that is convenient. The best advice is to have a BDC on every
277
277
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.
278
278
</p><p>
279
279
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>.
280
280
</p><p>
281
281
For more information regarding domain membership, <a class="link" href="domain-member.html" title="Chapter�6.�Domain Membership">Domain Membership</a>.
282
 
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2560148"></a>ADS Security Mode (User-Level Security)</h3></div></div></div><p>
283
 
<a class="indexterm" name="id2560156"></a>
284
 
<a class="indexterm" name="id2560163"></a>
 
282
</p></div></div><div class="sect2" title="ADS Security Mode (User-Level Security)"><div class="titlepage"><div><div><h3 class="title"><a name="id2566205"></a>ADS Security Mode (User-Level Security)</h3></div></div></div><p>
 
283
<a class="indexterm" name="id2566214"></a>
 
284
<a class="indexterm" name="id2566220"></a>
285
285
Both Samba-2.2, and Samba-3 can join an Active Directory domain using NT4 style RPC based security.  This is
286
286
possible if the domain is run in native mode. Active Directory in native mode perfectly allows NT4-style
287
287
domain members. This is contrary to popular belief.
292
292
domain, would still require NT-compatible authentication data. Samba in AD-member mode can accept Kerberos
293
293
tickets.
294
294
</p><p>
295
 
<a class="indexterm" name="id2560187"></a>
296
 
<a class="indexterm" name="id2560194"></a>
 
295
<a class="indexterm" name="id2566245"></a>
 
296
<a class="indexterm" name="id2566251"></a>
297
297
Sites that use Microsoft Windows active directory services (ADS) should be aware of the significance of the
298
298
terms: <code class="literal">native mode</code> and <code class="literal">mixed mode</code> ADS operation. The term
299
299
<code class="literal">realm</code> is used to describe a Kerberos-based security architecture (such as is used by
300
300
Microsoft ADS).
301
 
</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2560220"></a>Example Configuration</h4></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2560232"></a><em class="parameter"><code>realm = your.kerberos.REALM</code></em></td></tr><tr><td><a class="indexterm" name="id2560242"></a><em class="parameter"><code>security = ADS</code></em></td></tr></table><p>
 
301
</p><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id2566278"></a>Example Configuration</h4></div></div></div><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2566289"></a><em class="parameter"><code>realm = your.kerberos.REALM</code></em></td></tr><tr><td><a class="indexterm" name="id2566300"></a><em class="parameter"><code>security = ADS</code></em></td></tr></table><p>
302
302
The following parameter may be required:
303
 
</p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2560263"></a><em class="parameter"><code>password server = your.kerberos.server</code></em></td></tr></table><p>
 
303
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2566320"></a><em class="parameter"><code>password server = your.kerberos.server</code></em></td></tr></table><p>
304
304
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
305
305
ADS Domain Membership</a> for more information regarding this configuration option.
306
 
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2560291"></a>Server Security (User Level Security)</h3></div></div></div><p>
 
306
</p></div></div><div class="sect2" title="Server Security (User Level Security)"><div class="titlepage"><div><div><h3 class="title"><a name="id2566348"></a>Server Security (User Level Security)</h3></div></div></div><p>
307
307
Server security mode is left over from the time when Samba was not capable of acting
308
308
as a domain member server. It is highly recommended not to use this feature. Server
309
309
security mode has many drawbacks that include:
310
 
</p><div class="itemizedlist"><ul type="disc"><li><p>Potential account lockout on MS Windows NT4/200x password servers.</p></li><li><p>Lack of assurance that the password server is the one specified.</p></li><li><p>Does not work with Winbind, which is particularly needed when storing profiles remotely.</p></li><li><p>This mode may open connections to the password server and keep them open for extended periods.</p></li><li><p>Security on the Samba server breaks badly when the remote password server suddenly shuts down.</p></li><li><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>
311
 
<a class="indexterm" name="id2560344"></a>
312
 
<a class="indexterm" name="id2560351"></a>
 
310
</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>
 
311
<a class="indexterm" name="id2566402"></a>
 
312
<a class="indexterm" name="id2566408"></a>
313
313
In server security mode the Samba server reports to the client that it is in user-level security. The client
314
314
then does a session setup as described earlier.  The Samba server takes the username/password that the client
315
315
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
317
317
password, then Samba accepts the client's connection. This parameter allows the Samba server to use another
318
318
SMB server as the <a class="link" href="smb.conf.5.html#PASSWORDSERVER" target="_top">password server</a>.
319
319
</p><p>
320
 
<a class="indexterm" name="id2560387"></a>
321
 
<a class="indexterm" name="id2560393"></a>
 
320
<a class="indexterm" name="id2566444"></a>
 
321
<a class="indexterm" name="id2566450"></a>
322
322
You should also note that at the start of all this, when the server tells the client
323
323
what security level it is in, it also tells the client if it supports encryption. If it
324
324
does, it supplies the client with a random cryptkey. The client will then send all
329
329
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
330
330
the real authentication server.  The real authentication server can be another Samba server, or it can be a
331
331
Windows NT server, the latter being natively capable of encrypted password support.
332
 
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
333
 
<a class="indexterm" name="id2560439"></a>
334
 
<a class="indexterm" name="id2560445"></a>
 
332
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
333
<a class="indexterm" name="id2566496"></a>
 
334
<a class="indexterm" name="id2566503"></a>
335
335
When Samba is running in <span class="emphasis"><em>server security mode</em></span>, it is essential that the parameter
336
336
<span class="emphasis"><em>password server</em></span> is set to the precise NetBIOS machine name of the target authentication
337
337
server. Samba cannot determine this from NetBIOS name lookups because the choice of the target authentication
338
338
server is arbitrary and cannot be determined from a domain name. In essence, a Samba server that is in
339
339
<span class="emphasis"><em>server security mode</em></span> is operating in what used to be known as workgroup mode.
340
 
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2560468"></a>Example Configuration</h4></div></div></div><p><span class="emphasis"><em>
 
340
</p></div><div class="sect3" title="Example Configuration"><div class="titlepage"><div><div><h4 class="title"><a name="id2566526"></a>Example Configuration</h4></div></div></div><p><span class="emphasis"><em>
341
341
Using MS Windows NT as an Authentication Server
342
342
</em></span></p><p>
343
343
This method involves the additions of the following parameters in the <code class="filename">smb.conf</code> file:
344
 
</p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2560495"></a><em class="parameter"><code>encrypt passwords = Yes</code></em></td></tr><tr><td><a class="indexterm" name="id2560505"></a><em class="parameter"><code>security = server</code></em></td></tr><tr><td><a class="indexterm" name="id2560516"></a><em class="parameter"><code>password server = "NetBIOS_name_of_a_DC"</code></em></td></tr></table><p>
 
344
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2566552"></a><em class="parameter"><code>encrypt passwords = Yes</code></em></td></tr><tr><td><a class="indexterm" name="id2566562"></a><em class="parameter"><code>security = server</code></em></td></tr><tr><td><a class="indexterm" name="id2566573"></a><em class="parameter"><code>password server = "NetBIOS_name_of_a_DC"</code></em></td></tr></table><p>
345
345
There are two ways of identifying whether or not a username and password pair is valid.
346
346
One uses the reply information provided as part of the authentication messaging
347
347
process, the other uses just an error code.
348
348
</p><p>
349
 
<a class="indexterm" name="id2560536"></a>
350
 
<a class="indexterm" name="id2560542"></a>
 
349
<a class="indexterm" name="id2566593"></a>
 
350
<a class="indexterm" name="id2566599"></a>
351
351
The downside of this mode of configuration is that for security reasons Samba
352
352
will send the password server a bogus username and a bogus password, and if the remote
353
353
server fails to reject the bogus username and password pair, then an alternative mode of
356
356
</p><p>
357
357
Use of this mode of authentication requires a standard UNIX account for the user.
358
358
This account can be blocked to prevent logons by non-SMB/CIFS clients.
359
 
</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2560566"></a>Password Checking</h2></div></div></div><p>
 
359
</p></div></div></div><div class="sect1" title="Password Checking"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2566623"></a>Password Checking</h2></div></div></div><p>
360
360
MS Windows clients may use encrypted passwords as part of a challenge/response
361
361
authentication model (a.k.a. NTLMv1 and NTLMv2) or alone, or clear-text strings for simple
362
362
password-based authentication. It should be realized that with the SMB protocol,
363
363
the password is passed over the network either in plaintext or encrypted, but
364
364
not both in the same authentication request.
365
365
</p><p>
366
 
<a class="indexterm" name="id2560583"></a>
367
 
<a class="indexterm" name="id2560589"></a>
 
366
<a class="indexterm" name="id2566640"></a>
 
367
<a class="indexterm" name="id2566646"></a>
368
368
When encrypted passwords are used, a password that has been entered by the user
369
369
is encrypted in two ways:
370
 
</p><div class="itemizedlist"><ul type="disc"><li><p>An MD4 hash of the unicode of the password
 
370
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>An MD4 hash of the unicode of the password
371
371
        string. This is known as the NT hash.
372
 
        </p></li><li><p>The password is converted to uppercase,
 
372
        </p></li><li class="listitem"><p>The password is converted to uppercase,
373
373
        and then padded or truncated to 14 bytes. This string is
374
374
        then appended with 5 bytes of NULL characters and split to
375
375
        form two 56-bit DES keys to encrypt a "magic" 8-byte value.
376
376
        The resulting 16 bytes form the LanMan hash.
377
377
        </p></li></ul></div><p>
378
 
<a class="indexterm" name="id2560619"></a>
 
378
<a class="indexterm" name="id2566676"></a>
379
379
MS Windows 95 pre-service pack 1 and MS Windows NT versions 3.x and version 4.0 pre-service pack 3 will use
380
380
either mode of password authentication. All versions of MS Windows that follow these versions no longer
381
381
support plain-text passwords by default.
382
382
</p><p>
383
 
<a class="indexterm" name="id2560635"></a>
 
383
<a class="indexterm" name="id2566692"></a>
384
384
MS Windows clients have a habit of dropping network mappings that have been idle
385
385
for 10 minutes or longer. When the user attempts to use the mapped drive
386
386
connection that has been dropped, the client re-establishes the connection using
396
396
The following parameters can be used to work around the issue of Windows 9x/Me clients
397
397
uppercasing usernames and passwords before transmitting them to the SMB server
398
398
when using clear-text authentication:
399
 
</p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2560675"></a></td></tr><tr><td><a class="indexterm" name="id2560681"></a></td></tr></table><p>
 
399
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2566732"></a></td></tr><tr><td><a class="indexterm" name="id2566739"></a></td></tr></table><p>
400
400
By default Samba will convert to lowercase the username before attempting to lookup the user
401
401
in the database of local system accounts. Because UNIX usernames conventionally
402
402
only contain lowercase characters, the <a class="link" href="smb.conf.5.html#USERNAME-LEVEL" target="_top">username-level</a> parameter
403
403
is rarely needed.
404
404
</p><p>
405
 
<a class="indexterm" name="id2560706"></a>
 
405
<a class="indexterm" name="id2566763"></a>
406
406
However, passwords on UNIX systems often make use of mixed-case characters.  This means that in order for a
407
407
user on a Windows 9x/Me client to connect to a Samba server using clear-text authentication, the
408
408
<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
414
414
The best option to adopt is to enable support for encrypted passwords wherever
415
415
Samba is used. Most attempts to apply the registry change to re-enable plaintext
416
416
passwords will eventually lead to user complaints and unhappiness.
417
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2560753"></a>Common Errors</h2></div></div></div><p>
 
417
</p></div><div class="sect1" title="Common Errors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2566810"></a>Common Errors</h2></div></div></div><p>
418
418
We all make mistakes. It is okay to make mistakes, as long as they are made in the right places
419
419
and at the right time. A mistake that causes lost productivity is seldom tolerated; however, a mistake
420
420
made in a developmental test lab is expected.
424
424
a Samba implementation. Some are the result of a misunderstanding of the English language,
425
425
which has many phrases that are potentially vague and may be highly confusing
426
426
to those for whom English is not their native tongue.
427
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2560783"></a>What Makes Samba a Server?</h3></div></div></div><p>
 
427
</p><div class="sect2" title="What Makes Samba a Server?"><div class="titlepage"><div><div><h3 class="title"><a name="id2566840"></a>What Makes Samba a Server?</h3></div></div></div><p>
428
428
To some, the nature of the Samba security mode is obvious, but entirely
429
429
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
430
430
will act as a server. Not so! This setting means that Samba will <span class="emphasis"><em>try</em></span>
433
433
Samba is a server regardless of which security mode is chosen. When Samba is used outside of a domain security
434
434
context, it is best to leave the security mode at the default setting. By default Samba-3 uses user-mode
435
435
security.
436
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2560815"></a>What Makes Samba a Domain Controller?</h3></div></div></div><p>
437
 
<a class="indexterm" name="id2560823"></a>
 
436
</p></div><div class="sect2" title="What Makes Samba a Domain Controller?"><div class="titlepage"><div><div><h3 class="title"><a name="id2566873"></a>What Makes Samba a Domain Controller?</h3></div></div></div><p>
 
437
<a class="indexterm" name="id2566880"></a>
438
438
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
439
439
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.
440
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2560852"></a>What Makes Samba a Domain Member?</h3></div></div></div><p>
 
440
</p></div><div class="sect2" title="What Makes Samba a Domain Member?"><div class="titlepage"><div><div><h3 class="title"><a name="id2566910"></a>What Makes Samba a Domain Member?</h3></div></div></div><p>
441
441
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>
442
442
makes Samba act as a domain member. Read the manufacturer's manual before the warranty expires. See 
443
443
<a class="link" href="domain-member.html" title="Chapter�6.�Domain Membership">Domain Membership</a>, for more information.
444
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2560879"></a>Constantly Losing Connections to Password Server</h3></div></div></div><p>&#8220;<span class="quote">
 
444
</p></div><div class="sect2" title="Constantly Losing Connections to Password Server"><div class="titlepage"><div><div><h3 class="title"><a name="id2566937"></a>Constantly Losing Connections to Password Server</h3></div></div></div><p><span class="quote">&#8220;<span class="quote">
445
445
Why does server_validate() simply give up rather than re-establish its connection to the
446
446
password server?  Though I am not fluent in the SMB protocol, perhaps the cluster server
447
447
process passes along to its client workstation the session key it receives from the password
448
448
server, which means the password hashes submitted by the client would not work on a subsequent
449
449
connection whose session key would be different. So server_validate() must give up.
450
 
</span>&#8221;</p><p>
 
450
</span>&#8221;</span></p><p>
451
451
Indeed. That's why <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = server</a>
452
452
is at best a nasty hack. Please use <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = domain</a>;
453
453
<a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = server</a> mode is also known as pass-through authentication.
454
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2560937"></a>Stand-alone Server is converted to Domain Controller  Now User accounts don't work</h3></div></div></div><p>&#8220;<span class="quote">
 
454
</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="id2566995"></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">
455
455
When I try to log in to the DOMAIN, the eventlog shows <span class="emphasis"><em>tried credentials DOMAIN/username; effective
456
456
credentials SERVER/username</em></span>
457
 
</span>&#8221;</p><p>
 
457
</span>&#8221;</span></p><p>
458
458
Usually this is due to a user or machine account being created before the Samba server is configured to be a
459
459
domain controller. Accounts created before the server becomes a domain controller will be
460
460
<span class="emphasis"><em>local</em></span> accounts and authenticated as what looks like a member in the SERVER domain, much