Some more doc updates:
[kai/samba.git] / docs / htmldocs / ads.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Samba as a ADS domain member</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="UP"
13 TITLE="Type of installation"
14 HREF="type.html"><LINK
15 REL="PREVIOUS"
16 TITLE="How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain"
17 HREF="samba-bdc.html"><LINK
18 REL="NEXT"
19 TITLE="Samba as a NT4 domain member"
20 HREF="domain-security.html"></HEAD
21 ><BODY
22 CLASS="CHAPTER"
23 BGCOLOR="#FFFFFF"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 SUMMARY="Header navigation table"
32 WIDTH="100%"
33 BORDER="0"
34 CELLPADDING="0"
35 CELLSPACING="0"
36 ><TR
37 ><TH
38 COLSPAN="3"
39 ALIGN="center"
40 >SAMBA Project Documentation</TH
41 ></TR
42 ><TR
43 ><TD
44 WIDTH="10%"
45 ALIGN="left"
46 VALIGN="bottom"
47 ><A
48 HREF="samba-bdc.html"
49 ACCESSKEY="P"
50 >Prev</A
51 ></TD
52 ><TD
53 WIDTH="80%"
54 ALIGN="center"
55 VALIGN="bottom"
56 ></TD
57 ><TD
58 WIDTH="10%"
59 ALIGN="right"
60 VALIGN="bottom"
61 ><A
62 HREF="domain-security.html"
63 ACCESSKEY="N"
64 >Next</A
65 ></TD
66 ></TR
67 ></TABLE
68 ><HR
69 ALIGN="LEFT"
70 WIDTH="100%"></DIV
71 ><DIV
72 CLASS="CHAPTER"
73 ><H1
74 ><A
75 NAME="ADS"
76 ></A
77 >Chapter 9. Samba as a ADS domain member</H1
78 ><P
79 >This is a VERY ROUGH guide to setting up the current (November 2001)
80 pre-alpha version of Samba 3.0 with kerberos authentication against a
81 Windows2000 KDC. The procedures listed here are likely to change as
82 the code develops.</P
83 ><P
84 >Pieces you need before you begin:
85 <P
86 ></P
87 ><TABLE
88 BORDER="0"
89 ><TBODY
90 ><TR
91 ><TD
92 >a Windows 2000 server.</TD
93 ></TR
94 ><TR
95 ><TD
96 >samba 3.0 or higher.</TD
97 ></TR
98 ><TR
99 ><TD
100 >the MIT kerberos development libraries (either install from the above sources or use a package). The heimdal libraries will not work.</TD
101 ></TR
102 ><TR
103 ><TD
104 >the OpenLDAP development libraries.</TD
105 ></TR
106 ></TBODY
107 ></TABLE
108 ><P
109 ></P
110 ></P
111 ><DIV
112 CLASS="SECT1"
113 ><H1
114 CLASS="SECT1"
115 ><A
116 NAME="AEN1203"
117 ></A
118 >9.1. Installing the required packages for Debian</H1
119 ><P
120 >On Debian you need to install the following packages:
121 <P
122 ></P
123 ><TABLE
124 BORDER="0"
125 ><TBODY
126 ><TR
127 ><TD
128 >libkrb5-dev</TD
129 ></TR
130 ><TR
131 ><TD
132 >krb5-user</TD
133 ></TR
134 ></TBODY
135 ></TABLE
136 ><P
137 ></P
138 ></P
139 ></DIV
140 ><DIV
141 CLASS="SECT1"
142 ><H1
143 CLASS="SECT1"
144 ><A
145 NAME="AEN1209"
146 ></A
147 >9.2. Installing the required packages for RedHat</H1
148 ><P
149 >On RedHat this means you should have at least: 
150 <P
151 ></P
152 ><TABLE
153 BORDER="0"
154 ><TBODY
155 ><TR
156 ><TD
157 >krb5-workstation (for kinit)</TD
158 ></TR
159 ><TR
160 ><TD
161 >krb5-libs (for linking with)</TD
162 ></TR
163 ><TR
164 ><TD
165 >krb5-devel (because you are compiling from source)</TD
166 ></TR
167 ></TBODY
168 ></TABLE
169 ><P
170 ></P
171 ></P
172 ><P
173 >in addition to the standard development environment.</P
174 ><P
175 >Note that these are not standard on a RedHat install, and you may need 
176 to get them off CD2.</P
177 ></DIV
178 ><DIV
179 CLASS="SECT1"
180 ><H1
181 CLASS="SECT1"
182 ><A
183 NAME="AEN1218"
184 ></A
185 >9.3. Compile Samba</H1
186 ><P
187 >If your kerberos libraries are in a non-standard location then
188   remember to add the configure option --with-krb5=DIR.</P
189 ><P
190 >After you run configure make sure that include/config.h contains 
191   lines like this:</P
192 ><P
193 ><PRE
194 CLASS="PROGRAMLISTING"
195 >#define HAVE_KRB5 1
196 #define HAVE_LDAP 1</PRE
197 ></P
198 ><P
199 >If it doesn't then configure did not find your krb5 libraries or
200   your ldap libraries. Look in config.log to figure out why and fix
201   it.</P
202 ><P
203 >Then compile and install Samba as usual. You must use at least the
204   following 3 options in smb.conf:</P
205 ><P
206 ><PRE
207 CLASS="PROGRAMLISTING"
208 >  realm = YOUR.KERBEROS.REALM
209   ads server = your.kerberos.server
210   security = ADS
211   encrypt passwords = yes</PRE
212 ></P
213 ><P
214 >Strictly speaking, you can omit the realm name and you can use an IP
215   address for the ads server. In that case Samba will auto-detect these.</P
216 ><P
217 >You do *not* need a smbpasswd file, although it won't do any harm
218   and if you have one then Samba will be able to fall back to normal
219   password security for older clients. I expect that the above
220   required options will change soon when we get better active
221   directory integration.</P
222 ></DIV
223 ><DIV
224 CLASS="SECT1"
225 ><H1
226 CLASS="SECT1"
227 ><A
228 NAME="AEN1230"
229 ></A
230 >9.4. Setup your /etc/krb5.conf</H1
231 ><P
232 >The minimal configuration for krb5.conf is:</P
233 ><P
234 ><PRE
235 CLASS="PROGRAMLISTING"
236 >       [realms]
237     YOUR.KERBEROS.REALM = {
238         kdc = your.kerberos.server
239     }</PRE
240 ></P
241 ><P
242 >Test your config by doing a "kinit USERNAME@REALM" and making sure that
243   your password is accepted by the Win2000 KDC. </P
244 ><P
245 >NOTE: The realm must be uppercase. </P
246 ><P
247 >You also must ensure that you can do a reverse DNS lookup on the IP
248 address of your KDC. Also, the name that this reverse lookup maps to
249 must either be the netbios name of the KDC (ie. the hostname with no
250 domain attached) or it can alternatively be the netbios name
251 followed by the realm. </P
252 ><P
253 >The easiest way to ensure you get this right is to add a /etc/hosts
254 entry mapping the IP address of your KDC to its netbios name. If you
255 don't get this right then you will get a "local error" when you try
256 to join the realm.</P
257 ><P
258 >If all you want is kerberos support in smbclient then you can skip
259 straight to step 5 now. Step 3 is only needed if you want kerberos
260 support in smbd.</P
261 ></DIV
262 ><DIV
263 CLASS="SECT1"
264 ><H1
265 CLASS="SECT1"
266 ><A
267 NAME="AEN1240"
268 ></A
269 >9.5. Create the computer account</H1
270 ><P
271 >Do a "kinit" as a user that has authority to change arbitrary
272 passwords on the KDC ("Administrator" is a good choice). Then as a
273 user that has write permission on the Samba private directory
274 (usually root) run:
275 <B
276 CLASS="COMMAND"
277 >net ads join</B
278 ></P
279 ><DIV
280 CLASS="SECT2"
281 ><H2
282 CLASS="SECT2"
283 ><A
284 NAME="AEN1244"
285 ></A
286 >9.5.1. Possible errors</H2
287 ><P
288 ><P
289 ></P
290 ><DIV
291 CLASS="VARIABLELIST"
292 ><DL
293 ><DT
294 >"bash: kinit: command not found"</DT
295 ><DD
296 ><P
297 >kinit is in the krb5-workstation RPM on RedHat systems, and is in /usr/kerberos/bin, so it won't be in the path until you log in again (or open a new terminal)</P
298 ></DD
299 ><DT
300 >"ADS support not compiled in"</DT
301 ><DD
302 ><P
303 >Samba must be reconfigured (remove config.cache) and recompiled (make clean all install) after the kerberos libs and headers are installed.</P
304 ></DD
305 ></DL
306 ></DIV
307 ></P
308 ></DIV
309 ></DIV
310 ><DIV
311 CLASS="SECT1"
312 ><H1
313 CLASS="SECT1"
314 ><A
315 NAME="AEN1256"
316 ></A
317 >9.6. Test your server setup</H1
318 ><P
319 >On a Windows 2000 client try <B
320 CLASS="COMMAND"
321 >net use * \\server\share</B
322 >. You should
323 be logged in with kerberos without needing to know a password. If
324 this fails then run <B
325 CLASS="COMMAND"
326 >klist tickets</B
327 >. Did you get a ticket for the
328 server? Does it have an encoding type of DES-CBC-MD5 ? </P
329 ></DIV
330 ><DIV
331 CLASS="SECT1"
332 ><H1
333 CLASS="SECT1"
334 ><A
335 NAME="AEN1261"
336 ></A
337 >9.7. Testing with smbclient</H1
338 ><P
339 >On your Samba server try to login to a Win2000 server or your Samba
340 server using smbclient and kerberos. Use smbclient as usual, but
341 specify the -k option to choose kerberos authentication.</P
342 ></DIV
343 ><DIV
344 CLASS="SECT1"
345 ><H1
346 CLASS="SECT1"
347 ><A
348 NAME="AEN1264"
349 ></A
350 >9.8. Notes</H1
351 ><P
352 >You must change administrator password at least once after DC install,
353  to create the right encoding types</P
354 ><P
355 >w2k doesn't seem to create the _kerberos._udp and _ldap._tcp in
356    their defaults DNS setup. Maybe fixed in service packs?</P
357 ></DIV
358 ></DIV
359 ><DIV
360 CLASS="NAVFOOTER"
361 ><HR
362 ALIGN="LEFT"
363 WIDTH="100%"><TABLE
364 SUMMARY="Footer navigation table"
365 WIDTH="100%"
366 BORDER="0"
367 CELLPADDING="0"
368 CELLSPACING="0"
369 ><TR
370 ><TD
371 WIDTH="33%"
372 ALIGN="left"
373 VALIGN="top"
374 ><A
375 HREF="samba-bdc.html"
376 ACCESSKEY="P"
377 >Prev</A
378 ></TD
379 ><TD
380 WIDTH="34%"
381 ALIGN="center"
382 VALIGN="top"
383 ><A
384 HREF="samba-howto-collection.html"
385 ACCESSKEY="H"
386 >Home</A
387 ></TD
388 ><TD
389 WIDTH="33%"
390 ALIGN="right"
391 VALIGN="top"
392 ><A
393 HREF="domain-security.html"
394 ACCESSKEY="N"
395 >Next</A
396 ></TD
397 ></TR
398 ><TR
399 ><TD
400 WIDTH="33%"
401 ALIGN="left"
402 VALIGN="top"
403 >How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</TD
404 ><TD
405 WIDTH="34%"
406 ALIGN="center"
407 VALIGN="top"
408 ><A
409 HREF="type.html"
410 ACCESSKEY="U"
411 >Up</A
412 ></TD
413 ><TD
414 WIDTH="33%"
415 ALIGN="right"
416 VALIGN="top"
417 >Samba as a NT4 domain member</TD
418 ></TR
419 ></TABLE
420 ></DIV
421 ></BODY
422 ></HTML
423 >