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