This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[samba.git] / docs / htmldocs / securitylevels.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >User and Share security level (for servers not in a domain)</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
9 "><LINK
10 REL="HOME"
11 TITLE="SAMBA Project Documentation"
12 HREF="samba-howto-collection.html"><LINK
13 REL="UP"
14 TITLE="Type of installation"
15 HREF="type.html"><LINK
16 REL="PREVIOUS"
17 TITLE="Type of installation"
18 HREF="type.html"><LINK
19 REL="NEXT"
20 TITLE="How to Configure Samba as a NT4 Primary Domain Controller"
21 HREF="samba-pdc.html"></HEAD
22 ><BODY
23 CLASS="CHAPTER"
24 BGCOLOR="#FFFFFF"
25 TEXT="#000000"
26 LINK="#0000FF"
27 VLINK="#840084"
28 ALINK="#0000FF"
29 ><DIV
30 CLASS="NAVHEADER"
31 ><TABLE
32 SUMMARY="Header navigation table"
33 WIDTH="100%"
34 BORDER="0"
35 CELLPADDING="0"
36 CELLSPACING="0"
37 ><TR
38 ><TH
39 COLSPAN="3"
40 ALIGN="center"
41 >SAMBA Project Documentation</TH
42 ></TR
43 ><TR
44 ><TD
45 WIDTH="10%"
46 ALIGN="left"
47 VALIGN="bottom"
48 ><A
49 HREF="type.html"
50 ACCESSKEY="P"
51 >Prev</A
52 ></TD
53 ><TD
54 WIDTH="80%"
55 ALIGN="center"
56 VALIGN="bottom"
57 ></TD
58 ><TD
59 WIDTH="10%"
60 ALIGN="right"
61 VALIGN="bottom"
62 ><A
63 HREF="samba-pdc.html"
64 ACCESSKEY="N"
65 >Next</A
66 ></TD
67 ></TR
68 ></TABLE
69 ><HR
70 ALIGN="LEFT"
71 WIDTH="100%"></DIV
72 ><DIV
73 CLASS="CHAPTER"
74 ><H1
75 ><A
76 NAME="SECURITYLEVELS">Chapter 5. User and Share security level (for servers not in a domain)</H1
77 ><P
78 >A SMB server tells the client at startup what "security level" it is
79 running. There are two options "share level" and "user level". Which
80 of these two the client receives affects the way the client then tries
81 to authenticate itself. It does not directly affect (to any great
82 extent) the way the Samba server does security. I know this is
83 strange, but it fits in with the client/server approach of SMB. In SMB
84 everything is initiated and controlled by the client, and the server
85 can only tell the client what is available and whether an action is
86 allowed. </P
87 ><P
88 >I'll describe user level security first, as its simpler. In user level
89 security the client will send a "session setup" command directly after
90 the protocol negotiation. This contains a username and password. The
91 server can either accept or reject that username/password
92 combination. Note that at this stage the server has no idea what
93 share the client will eventually try to connect to, so it can't base
94 the "accept/reject" on anything other than:</P
95 ><P
96 ></P
97 ><OL
98 TYPE="1"
99 ><LI
100 ><P
101 >the username/password</P
102 ></LI
103 ><LI
104 ><P
105 >the machine that the client is coming from</P
106 ></LI
107 ></OL
108 ><P
109 >If the server accepts the username/password then the client expects to
110 be able to mount any share (using a "tree connection") without
111 specifying a password. It expects that all access rights will be as
112 the username/password specified in the "session setup". </P
113 ><P
114 >It is also possible for a client to send multiple "session setup"
115 requests. When the server responds it gives the client a "uid" to use
116 as an authentication tag for that username/password. The client can
117 maintain multiple authentication contexts in this way (WinDD is an
118 example of an application that does this)</P
119 ><P
120 >Ok, now for share level security. In share level security the client
121 authenticates itself separately for each share. It will send a
122 password along with each "tree connection" (share mount). It does not
123 explicitly send a username with this operation. The client is
124 expecting a password to be associated with each share, independent of
125 the user. This means that samba has to work out what username the
126 client probably wants to use. It is never explicitly sent the
127 username. Some commercial SMB servers such as NT actually associate
128 passwords directly with shares in share level security, but samba
129 always uses the unix authentication scheme where it is a
130 username/password that is authenticated, not a "share/password".</P
131 ><P
132 >Many clients send a "session setup" even if the server is in share
133 level security. They normally send a valid username but no
134 password. Samba records this username in a list of "possible
135 usernames". When the client then does a "tree connection" it also adds
136 to this list the name of the share they try to connect to (useful for
137 home directories) and any users listed in the "user =" smb.conf
138 line. The password is then checked in turn against these "possible
139 usernames". If a match is found then the client is authenticated as
140 that user.</P
141 ><P
142 >Finally "server level" security. In server level security the samba
143 server reports to the client that it is in user level security. The
144 client then does a "session setup" as described earlier. The samba
145 server takes the username/password that the client sends and attempts
146 to login to the "password server" by sending exactly the same
147 username/password that it got from the client. If that server is in
148 user level security and accepts the password then samba accepts the
149 clients connection. This allows the samba server to use another SMB
150 server as the "password server". </P
151 ><P
152 >You should also note that at the very start of all this, where the
153 server tells the client what security level it is in, it also tells
154 the client if it supports encryption. If it does then it supplies the
155 client with a random "cryptkey". The client will then send all
156 passwords in encrypted form. You have to compile samba with encryption
157 enabled to support this feature, and you have to maintain a separate
158 smbpasswd file with SMB style encrypted passwords. It is
159 cryptographically impossible to translate from unix style encryption
160 to SMB style encryption, although there are some fairly simple management
161 schemes by which the two could be kept in sync.</P
162 ><P
163 >"security = server" means that Samba reports to clients that
164 it is running in "user mode" but actually passes off all authentication
165 requests to another "user mode" server. This requires an additional
166 parameter "password server =" that points to the real authentication server.
167 That real authentication server can be another Samba server or can be a
168 Windows NT server, the later natively capable of encrypted password support.</P
169 ></DIV
170 ><DIV
171 CLASS="NAVFOOTER"
172 ><HR
173 ALIGN="LEFT"
174 WIDTH="100%"><TABLE
175 SUMMARY="Footer navigation table"
176 WIDTH="100%"
177 BORDER="0"
178 CELLPADDING="0"
179 CELLSPACING="0"
180 ><TR
181 ><TD
182 WIDTH="33%"
183 ALIGN="left"
184 VALIGN="top"
185 ><A
186 HREF="type.html"
187 ACCESSKEY="P"
188 >Prev</A
189 ></TD
190 ><TD
191 WIDTH="34%"
192 ALIGN="center"
193 VALIGN="top"
194 ><A
195 HREF="samba-howto-collection.html"
196 ACCESSKEY="H"
197 >Home</A
198 ></TD
199 ><TD
200 WIDTH="33%"
201 ALIGN="right"
202 VALIGN="top"
203 ><A
204 HREF="samba-pdc.html"
205 ACCESSKEY="N"
206 >Next</A
207 ></TD
208 ></TR
209 ><TR
210 ><TD
211 WIDTH="33%"
212 ALIGN="left"
213 VALIGN="top"
214 >Type of installation</TD
215 ><TD
216 WIDTH="34%"
217 ALIGN="center"
218 VALIGN="top"
219 ><A
220 HREF="type.html"
221 ACCESSKEY="U"
222 >Up</A
223 ></TD
224 ><TD
225 WIDTH="33%"
226 ALIGN="right"
227 VALIGN="top"
228 >How to Configure Samba as a NT4 Primary Domain Controller</TD
229 ></TR
230 ></TABLE
231 ></DIV
232 ></BODY
233 ></HTML
234 >