Convert DEBUG_REFERRALS to TRACE_* framework
[krb5.git] / doc / install.texinfo
1 \input texinfo-suppl.tex        % contains @doubleleftarrow{} definition
2                                 % this line must come *before* \input texinfo
3 \input texinfo @c -*-texinfo-*-
4 @c %**start of header
5 @c guide
6 @setfilename krb5-install.info
7 @settitle Kerberos V5 Installation Guide
8 @setchapternewpage odd                  @c chapter begins on next odd page
9 @c @setchapternewpage on                   @c chapter begins on next page
10 @c @smallbook                              @c Format for 7" X 9.25" paper
11 @documentencoding UTF-8
12 @c %**end of header
13 @copying
14 Copyright @copyright{} 1985-2010 by the Massachusetts Institute of Technology.
15 @end copying
16
17 @paragraphindent 0
18 @iftex
19 @parskip 6pt plus 6pt
20 @end iftex
21
22 @dircategory Kerberos
23 @direntry
24 * krb5-install: (krb5-install).         Kerberos V5 Installation Guide
25 @end direntry
26
27 @include definitions.texinfo
28 @set EDITION 1.1
29
30 @finalout                               @c don't print black warning boxes
31
32 @titlepage
33 @title @value{PRODUCT} Installation Guide
34 @subtitle Release:  @value{RELEASE}
35 @subtitle Document Edition:  @value{EDITION}
36 @subtitle Last updated:  @value{UPDATED}
37 @author @value{COMPANY}
38
39 @page
40 @vskip 0pt plus 1filll
41 @insertcopying
42 @end titlepage
43
44 @node Top, Introduction, (dir), (dir)
45 @comment  node-name,  next,  previous,  up
46
47 @ifinfo
48 This file documents how to install the @value{RELEASE} release of
49 @value{PRODUCT}.
50
51 @insertcopying
52 @end ifinfo
53
54 @c The master menu is updated using emacs19's M-x texinfo-all-menus-update
55 @c function.  Don't forget to run M-x texinfo-every-node-update after
56 @c you add a new section or subsection, or after you've rearranged the
57 @c order of sections or subsections.  Also, don't forget to add an @node
58 @c comand before each @section or @subsection!  All you need to enter
59 @c is:
60 @c
61 @c @node New Section Name
62
63 @c @section New Section Name
64 @c
65 @c M-x texinfo-every-node-update will take care of calculating the
66 @c node's forward and back pointers.
67 @c
68 @c ---------------------------------------------------------------------
69
70 @menu
71 * Introduction::                
72 * Realm Configuration Decisions::  
73 * Building Kerberos V5::        
74 * Installing Kerberos V5::      
75 * Upgrading Existing Kerberos V5 Installations::  
76 * Bug Reports for Kerberos V5::  
77 * Copyright::                   
78 @end menu
79
80 @node Introduction, Realm Configuration Decisions, Top, Top
81 @chapter Introduction
82
83 @menu
84 * What is Kerberos and How Does it Work?::  
85 * Why Should I use Kerberos?::  
86 * Please Read the Documentation::  
87 * Overview of This Guide::      
88 @end menu
89
90 @node What is Kerberos and How Does it Work?, Why Should I use Kerberos?, Introduction, Introduction
91 @section What is Kerberos and How Does it Work?
92
93 @value{PRODUCT} is based on the Kerberos authentication system developed
94 at MIT.  Under Kerberos, a client (generally either a user or a service)
95 sends a request for a ticket to the Key Distribution Center (KDC).  The
96 KDC creates a @dfn{ticket-granting ticket} (TGT) for the client,
97 encrypts it using the client's password as the key, and sends the
98 encrypted TGT back to the client.  The client then attempts to decrypt
99 the TGT, using its password.  If the client successfully decrypts the
100 TGT (@i{i.e.}, if the client gave the correct password), it keeps the
101 decrypted TGT, which indicates proof of the client's identity.
102
103 The TGT, which expires at a specified time, permits the client to obtain
104 additional tickets, which give permission for specific services.  The
105 requesting and granting of these additional tickets is user-transparent.
106
107 @node Why Should I use Kerberos?, Please Read the Documentation, What is Kerberos and How Does it Work?, Introduction
108 @section Why Should I use Kerberos?
109
110 Since Kerberos negotiates authenticated, and optionally encrypted,
111 communications between two points anywhere on the Internet, it provides
112 a layer of security that is not dependent on which side of a firewall
113 either client is on.  Since studies have shown that half of the computer
114 security breaches in industry happen from @i{inside} firewalls,
115 @value{PRODUCT} from @value{COMPANY} will play a vital role in the
116 security of your network.
117
118 @node Please Read the Documentation, Overview of This Guide, Why Should I use Kerberos?, Introduction
119 @section Please Read the Documentation
120
121 As with any software package that uses a centrallized database, the
122 installation procedure is somewhat involved, and requires forethought
123 and planning.  @value{COMPANY} has attempted to make this
124 @value{PRODUCT} Installation Guide as concise as possible, rather than
125 making it an exhaustive description of the details of Kerberos.
126 @ifset CYGNUS
127 Consequently, everything in this guide appears because @value{COMPANY}
128 believes that it is important.  Please read and follow these
129 instructions carefully, and if there is anything you do not understand
130 or are not sure of, please don't hesitate to call us.
131 @end ifset
132 @ifset MIT
133 Consequently, everything in this guide appears because @value{COMPANY}
134 believes that it is important.  Please read and follow these
135 instructions carefully.
136 @end ifset
137
138 @include document-list.texinfo
139
140 @node Overview of This Guide,  , Please Read the Documentation, Introduction
141 @section Overview of This Guide
142
143 @noindent
144 The next chapter describes the decisions you need to make before
145 installing @value{PRODUCT}.
146
147 @noindent
148 Chapter three provided instructions for building the Kerberos sources.
149
150 @noindent
151 Chapter four describes installation procedures for each class of
152 Kerberos machines:
153
154 @enumerate
155 @item
156 Key Distribution Centers (KDCs).
157
158 @enumerate A
159 @item
160 The Master KDC.
161
162 @item
163 Slave KDCs.
164 @end enumerate
165
166 @item
167 UNIX client machines
168
169 @item
170 UNIX application server machines
171 @end enumerate
172
173 @noindent
174 Note that a machine can be both a client machine and an application
175 server.
176
177 @noindent
178 Chapter five describes procedure for updating previous installations of
179 @value{PRODUCT}.
180
181 @noindent
182 Chapter six describes our problem reporting system.
183
184 @node Realm Configuration Decisions, Building Kerberos V5, Introduction, Top
185 @chapter Realm Configuration Decisions
186
187 Before installing @value{PRODUCT}, it is necessary to consider the
188 following issues:
189
190 @itemize @bullet
191 @item
192 The name of your Kerberos realm (or the name of each realm, if you need
193 more than one).
194
195 @item
196 How you will map your hostnames onto Kerberos realms.
197
198 @item
199 Which ports your KDC and and kadmin (database access) services will use.
200
201 @item
202 How many slave KDCs you need and where they should be located.
203
204 @item
205 The hostnames of your master and slave KDCs.
206
207 @item
208 How frequently you will propagate the database from the master KDC to
209 the slave KDCs.
210 @end itemize
211
212 @menu
213 * Kerberos Realms::             
214 * Mapping Hostnames onto Kerberos Realms::  
215 * Ports for the KDC and Admin Services::  
216 * Slave KDCs::                  
217 * Hostnames for the Master and Slave KDCs::  
218 * Database Propagation::        
219 @end menu
220
221 @node Kerberos Realms, Mapping Hostnames onto Kerberos Realms, Realm Configuration Decisions, Realm Configuration Decisions
222 @section Kerberos Realms
223
224 Although your Kerberos realm can be any ASCII string, convention is to
225 make it the same as your domain name, in upper-case letters.  For
226 example, hosts in the domain @value{SECONDDOMAIN} would be in the
227 Kerberos realm @value{SECONDREALM}.
228
229 If you need multiple Kerberos realms, @value{COMPANY} recommends that
230 you use descriptive names which end with your domain name, such as
231 BOSTON.@value{SECONDREALM} and HOUSTON.@value{SECONDREALM}.
232
233 @node Mapping Hostnames onto Kerberos Realms, Ports for the KDC and Admin Services, Kerberos Realms, Realm Configuration Decisions
234 @section Mapping Hostnames onto Kerberos Realms
235
236 @include dnstxt.texinfo
237
238 @node Ports for the KDC and Admin Services, Slave KDCs, Mapping Hostnames onto Kerberos Realms, Realm Configuration Decisions
239 @section Ports for the KDC and Admin Services
240
241 The default ports used by Kerberos are port @value{DefaultPort} for the
242 KDC@footnote{Kerberos V4 used port @value{DefaultSecondPort}.  If
243 necessary, you can run on both ports for backward compatibility.}  and
244 port @value{DefaultKadmindPort} for the admin server.  You can, however,
245 choose to run on other ports, as long as they are specified in each
246 host's @code{/etc/services} and @code{krb5.conf} files, and the
247 @code{kdc.conf} file on each KDC.  For a more thorough treatment of
248 port numbers used by the @value{PRODUCT} programs, refer to the
249 ``Configuring Your Firewall to Work With @value{PRODUCT}'' section of
250 the @cite{@value{PRODUCT} System Administrator's Guide}.
251
252 @node Slave KDCs, Hostnames for the Master and Slave KDCs, Ports for the KDC and Admin Services, Realm Configuration Decisions
253 @section Slave KDCs
254
255 Slave KDCs provide an additional source of Kerberos ticket-granting
256 services in the event of inaccessibility of the master KDC.  The number
257 of slave KDCs you need and the decision of where to place them, both
258 physically and logically, depends on the specifics of your network.
259
260 All of the Kerberos authentication on your network requires that each
261 client be able to contact a KDC.  Therefore, you need to anticipate any
262 likely reason a KDC might be unavailable and have a slave KDC to take up
263 the slack.
264
265 Some considerations include:
266
267 @itemize @bullet
268 @item
269 Have at least one slave KDC as a backup, for when the master KDC is
270 down, is being upgraded, or is otherwise unavailable.
271
272 @item
273 If your network is split such that a network outage is likely to cause a
274 network partition (some segment or segments of the network to become cut
275 off or isolated from other segments), have a slave KDC accessible to
276 each segment.
277
278 @item
279 If possible, have at least one slave KDC in a different building from
280 the master, in case of power outages, fires, or other localized
281 disasters.
282 @end itemize
283
284
285
286 @node Hostnames for the Master and Slave KDCs, Database Propagation, Slave KDCs, Realm Configuration Decisions
287 @section Hostnames for the Master and Slave KDCs
288
289 @include dnssrv.texinfo
290
291 @node Database Propagation,  , Hostnames for the Master and Slave KDCs, Realm Configuration Decisions
292 @section Database Propagation
293
294 The Kerberos database resides on the master KDC, and must be propagated
295 regularly (usually by a cron job) to the slave KDCs.  In deciding how
296 frequently the propagation should happen, you will need to balance the
297 amount of time the propagation takes against the maximum reasonable
298 amount of time a user should have to wait for a password change to take
299 effect.
300
301 If the propagation time is longer than this maximum reasonable time
302 (@i{e.g.,} you have a particularly large database, you have a lot of
303 slaves, or you experience frequent network delays), you may wish to
304 cut down on your propagation delay by performing the propagation in
305 parallel.  To do this, have the master KDC propagate the database to one
306 set of slaves, and then have each of these slaves propagate the database
307 to additional slaves.
308
309 @node Building Kerberos V5, Installing Kerberos V5, Realm Configuration Decisions, Top
310 @chapter Building @value{PRODUCT}
311
312 @include build.texinfo
313
314 @node Installing Kerberos V5, Upgrading Existing Kerberos V5 Installations, Building Kerberos V5, Top
315 @chapter Installing @value{PRODUCT}
316
317 The sections of this chapter describe procedures for installing
318 @value{PRODUCT} on:
319
320 @enumerate
321 @item
322 The KDCs
323
324 @item
325 UNIX client machines
326
327 @item
328 UNIX Application Servers
329 @end enumerate
330
331 @menu
332 * Installing KDCs::             
333 * Installing and Configuring UNIX Client Machines::  
334 * UNIX Application Servers::    
335 @end menu
336
337 @node Installing KDCs, Installing and Configuring UNIX Client Machines, Installing Kerberos V5, Installing Kerberos V5
338 @section Installing KDCs
339
340 The Key Distribution Centers (KDCs) issue Kerberos tickets.  Each KDC
341 contains a copy of the Kerberos database.  The master KDC contains the
342 master copy of the database, which it propagates to the slave KDCs at
343 regular intervals.  All database changes (such as password changes) are
344 made on the master KDC.
345
346 Slave KDCs provide Kerberos ticket-granting services, but not database
347 administration.  This allows clients to continue to obtain tickets when
348 the master KDC is unavailable.
349
350 @value{COMPANY} recommends that you install all of your KDCs to be able
351 to function as either the master or one of the slaves.  This will enable
352 you to easily switch your master KDC with one of the slaves if
353 necessary.  (@xref{Switching Master and Slave KDCs}.)  This installation
354 procedure is based on that recommendation.
355
356 @menu
357 * Install the Master KDC::      
358 * Install the Slave KDCs::      
359 * Back on the Master KDC::      
360 * Finish Installing the Slave KDCs::  
361 * Add Kerberos Principals to the Database::  
362 * Limit Access to the KDCs::    
363 * Switching Master and Slave KDCs::  
364 * Incremental Database Propagation::  
365 @end menu
366
367 @node Install the Master KDC, Install the Slave KDCs, Installing KDCs, Installing KDCs
368 @subsection Install the Master KDC
369
370 This installation procedure will require you to go back and forth a
371 couple of times between the master KDC and each of the slave KDCs.  The
372 first few steps must be done on the master KDC.
373
374 @menu
375 * Edit the Configuration Files::  
376 * krb5.conf::                   
377 * kdc.conf::                    
378 * Create the Database::         
379 * Add Administrators to the Acl File::  
380 * Add Administrators to the Kerberos Database::  
381 * Create a kadmind Keytab (optional)::  
382 * Start the Kerberos Daemons::  
383 @end menu
384
385 @node Edit the Configuration Files, krb5.conf, Install the Master KDC, Install the Master KDC
386 @subsubsection Edit the Configuration Files
387
388 Modify the configuration files, @code{/etc/krb5.conf} and
389 @code{@value{ROOTDIR}/var/krb5kdc/kdc.conf} to reflect the correct
390 information (such as the hostnames and realm name) for your realm.
391 @value{COMPANY} recommends that you keep @code{krb5.conf} in @code{/etc}.
392
393 Most of the tags in the configuration have default values that will
394 work well for most sites.  There are some tags in the @code{krb5.conf}
395 file whose values must be specified, and this section will explain
396 those as well as give an overview of all of the sections in both
397 configuration files.  For more information on changing defaults with
398 the configuration files, see the @value{PRODUCT} System Administrator's
399 Guide sections on configuration files. 
400
401 @node krb5.conf, kdc.conf, Edit the Configuration Files, Install the Master KDC
402 @subsubsection krb5.conf
403
404 @include krb5conf.texinfo
405
406 If you are not using DNS TXT records, you must specify the
407 @code{default_realm} in the @code{libdefaults} section.  If you are not
408 using DNS SRV records, you must include the @code{kdc} tag for each
409 realm in the @code{realms} section.  To communicate with the kadmin
410 server in each realm, the @code{admin_server} tag must be set in the
411 @code{realms} section.  If your domain name and realm name are not the
412 same, you must provide a translation in @code{domain_realm}.  It is
413 also higly recommeneded that you create a @code{[logging]} stanza if
414 the computer will be functioning as a KDC so that the KDC and kadmind
415 will generate logging output.
416
417 An example @code{krb5.conf} file:
418
419 @smallexample
420 @group
421 [libdefaults]
422     default_realm = @value{PRIMARYREALM}
423
424 [realms]
425     @value{PRIMARYREALM} = @{
426         kdc = @value{KDCSERVER}.@value{PRIMARYDOMAIN}
427         kdc = @value{KDCSLAVE1}.@value{PRIMARYDOMAIN}
428         kdc = @value{KDCSLAVE2}.@value{PRIMARYDOMAIN}
429         admin_server = @value{KDCSERVER}.@value{PRIMARYDOMAIN}
430     @{
431
432 [logging]
433     kdc = FILE:/var/log/krb5kdc.log
434     admin_server = FILE:/var/log/kadmin.log
435     default = FILE:/var/log/krb5lib.log
436 @end group
437 @end smallexample
438
439 @node kdc.conf, Create the Database, krb5.conf, Install the Master KDC
440 @subsubsection kdc.conf
441
442 @include kdcconf.texinfo
443
444 @node Create the Database, Add Administrators to the Acl File, kdc.conf, Install the Master KDC
445 @subsubsection Create the Database
446
447 You will use the @code{kdb5_util} command @emph{on the Master KDC} to
448 create the Kerberos database and the optional stash file.  The
449 @dfn{stash file} is a local copy of the master key that resides in
450 encrypted form on the KDC's local disk.  The stash file is used to
451 authenticate the KDC to itself automatically before starting the
452 @code{kadmind} and @code{krb5kdc} daemons (@i{e.g.,} as part of the
453 machine's boot sequence).  The stash file, like the keytab file
454 (see @xref{The Keytab File}, for more information) is a potential
455 point-of-entry for a break-in,
456 and if compromised, would allow unrestricted access to the Kerberos
457 database.  If you choose to install a stash file, it should be readable
458 only by root, and should exist only on the KDC's local disk.  The file
459 should not be part of any backup of the machine, unless access to the
460 backup data is secured as tightly as access to the master password
461 itself.
462
463 If you choose not to install a stash file, the KDC will prompt you for
464 the master key each time it starts up.  This means that the KDC will
465 not be able to start automatically, such as after a system reboot.
466
467 Note that @code{kdb5_util} will prompt you for the master key for the
468 Kerberos database.  This key can be any string.  A good key is one you
469 can remember, but that no one else can guess.  Examples of bad keys are
470 words that can be found in a dictionary, any common or popular name,
471 especially a famous person (or cartoon character), your username in any
472 form (@i{e.g.}, forward, backward, repeated twice, @i{etc.}), and any of
473 the sample keys that appear in this manual.  One example of a key which
474 might be good if it did not appear in this manual is ``MITiys4K5!'',
475 which represents the sentence ``MIT is your source for Kerberos 5!''
476 (It's the first letter of each word, substituting the numeral ``4'' for
477 the word ``for'', and includes the punctuation mark at the end.)
478
479 The following is an example of how to create a Kerberos database and
480 stash file on the master KDC, using the @code{kdb5_util} command.  (The
481 line that begins with @result{} is a continuation of the previous line.)
482 Replace @i{@value{PRIMARYREALM}} with the name of your Kerberos realm.
483
484 @smallexample
485 @group
486 @b{shell%} @value{ROOTDIR}/sbin/kdb5_util create -r @value{PRIMARYREALM} -s
487 @b{Initializing database '@value{ROOTDIR}/var/krb5kdc/principal' for
488 @result{} realm '@value{PRIMARYREALM}',
489 master key name 'K/M@@@value{PRIMARYREALM}'
490 You will be prompted for the database Master Password.
491 It is important that you NOT FORGET this password.}
492 @iftex
493 @b{Enter KDC database master key:}  @i{@doubleleftarrow{} Type the master password.}
494 @b{Re-enter KDC database master key to verify:}  @i{@doubleleftarrow{} Type it again.}
495 @end iftex
496 @ifinfo
497 @b{Enter KDC database master key:}  @i{<= Type the master password.}
498 @b{Re-enter KDC database master key to verify:}  @i{<= Type it again.}
499 @end ifinfo
500 @ifhtml
501 @b{Enter KDC database master key:}  @i{<= Type the master password.}
502 @b{Re-enter KDC database master key to verify:}  @i{<= Type it again.}
503 @end ifhtml
504 @b{shell%}
505 @end group
506 @end smallexample
507
508 This will create five files in the directory specified in your
509 @code{kdc.conf} file:  two Kerberos database files, @code{principal.db},
510 and @code{principal.ok}; the Kerberos administrative database file,
511 @code{principal.kadm5}; the administrative database lock file,
512 @code{principal.kadm5.lock}; and the stash file, @code{.k5stash}.  (The
513 default directory is @code{@value{ROOTDIR}/var/krb5kdc}.)  If you do not
514 want a stash file, run the above command without the @code{-s} option.
515
516 @node Add Administrators to the Acl File, Add Administrators to the Kerberos Database, Create the Database, Install the Master KDC
517 @subsubsection Add Administrators to the Acl File
518
519 Next, you need create an Access Control List (acl) file, and put the
520 Kerberos principal of at least one of the administrators into it.  This
521 file is used by the @code{kadmind} daemon to control which principals
522 may view and make privileged modifications to the Kerberos database
523 files.  The filename should match the value you have set for
524 ``acl_file'' in your @code{kdc.conf} file.  The default file name is
525 @samp{@value{DefaultAclFile}}.
526
527 @include kadm5acl.texinfo
528
529 @node Add Administrators to the Kerberos Database, Create a kadmind Keytab (optional), Add Administrators to the Acl File, Install the Master KDC
530 @subsubsection Add Administrators to the Kerberos Database
531
532 Next you need to add administrative principals to the Kerberos database.
533 (You must add at least one now.)  To do this, use @code{kadmin.local}
534 @emph{on the master KDC}.  The administrative principals you create
535 should be the ones you added to the ACL file.  (See @xref{Add
536 Administrators to the Acl File}.)  In the following example, the
537 administration principal @code{admin/admin} is created:
538
539 @smallexample
540 @group
541 @b{shell%} @value{ROOTDIR}/sbin/kadmin.local
542 @b{kadmin.local:} addprinc admin/admin@@@value{PRIMARYREALM}
543 @b{NOTICE: no policy specified for "admin/admin@@@value{PRIMARYREALM}";
544 assigning "default".}
545 @iftex
546 @b{Enter password for principal admin/admin@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Enter a password.}
547 Re-enter password for principal admin/admin@@@value{PRIMARYREALM}:  @i{@doubleleftarrow{} Type it again.}
548 @end iftex
549 @ifinfo
550 @b{Enter password for principal admin/admin@@@value{PRIMARYREALM}:}  @i{<= Enter a password.}
551 Re-enter password for principal admin/admin@@@value{PRIMARYREALM}:  @i{<= Type it again.}
552 @end ifinfo
553 @ifhtml
554 @b{Enter password for principal admin/admin@@@value{PRIMARYREALM}:}  @i{<= Enter a password.}
555 Re-enter password for principal admin/admin@@@value{PRIMARYREALM}:  @i{<= Type it again.}
556 @end ifhtml
557 @b{Principal "admin/admin@@@value{PRIMARYREALM}" created.
558 kadmin.local:}
559 @end group
560 @end smallexample
561
562
563
564 @node Create a kadmind Keytab (optional), Start the Kerberos Daemons, Add Administrators to the Kerberos Database, Install the Master KDC
565 @subsubsection Create a kadmind Keytab (optional)
566
567 The kadmind keytab is the key that the legacy admininstration daemons
568 @code{kadmind4} and @code{v5passwdd} will use to decrypt
569 administrators' or clients' Kerberos tickets to determine whether or
570 not they should have access to the database.  You need to create the
571 kadmin keytab with entries for the principals @code{kadmin/admin} and
572 @code{kadmin/changepw}.  (These principals are placed in the Kerberos
573 database automatically when you create it.)  To create the kadmin
574 keytab, run @code{kadmin.local} and use the @code{ktadd} command, as
575 in the following example.  (The line beginning with @result{} is a
576 continuation of the previous line.):
577
578 @smallexample
579 @group
580 @b{shell%} @value{ROOTDIR}/sbin/kadmin.local
581 @b{kadmin.local:} ktadd -k @value{ROOTDIR}/var/krb5kdc/kadm5.keytab
582 @result{} kadmin/admin kadmin/changepw 
583 @b{ Entry for principal kadmin/admin with kvno 5, encryption
584         type Triple DES cbc mode with HMAC/sha1 added to keytab
585         WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
586 Entry for principal kadmin/admin with kvno 5, encryption type DES cbc mode
587         with CRC-32 added to keytab
588         WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
589 Entry for principal kadmin/changepw with kvno 5, encryption
590         type Triple DES cbc mode with HMAC/sha1 added to keytab
591         WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
592 Entry for principal kadmin/changepw with kvno 5,
593         encryption type DES cbc mode with CRC-32 added to keytab
594         WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
595 kadmin.local:} quit
596 @b{shell%}
597 @end group
598 @end smallexample
599
600 @noindent
601 As specified in the @samp{-k} argument, @code{ktadd} will save the
602 extracted keytab as @* @code{@value{ROOTDIR}/var/krb5kdc/kadm5.keytab}.
603 The filename you use must be the one specified in your @code{kdc.conf}
604 file.
605
606 @need 2000
607 @node Start the Kerberos Daemons,  , Create a kadmind Keytab (optional), Install the Master KDC
608 @subsubsection Start the Kerberos Daemons on the Master KDC
609
610 At this point, you are ready to start the Kerberos daemons on the Master
611 KDC.  To do so, type:
612
613 @smallexample
614 @b{shell%} @value{ROOTDIR}/sbin/krb5kdc
615 @b{shell%} @value{ROOTDIR}/sbin/kadmind
616 @end smallexample
617
618 @noindent
619 Each daemon will fork and run in the background.  Assuming you want
620 these daemons to start up automatically at boot time, you can add them
621 to the KDC's @code{/etc/rc} or @code{/etc/inittab} file.  You need to
622 have a stash file in order to do this.
623
624 You can verify that they started properly by checking for their startup
625 messages in the logging locations you defined in @code{/etc/krb5.conf}.
626 (@xref{Edit the Configuration Files}.)  For example:
627
628 @smallexample
629 @b{shell%} tail /var/log/krb5kdc.log
630 Dec 02 12:35:47 beeblebrox krb5kdc[3187](info): commencing operation
631 @b{shell%} tail /var/log/kadmin.log
632 Dec 02 12:35:52 beeblebrox kadmind[3189](info): starting
633 @end smallexample
634
635 Any errors the daemons encounter while starting will also be listed in
636 the logging output.
637
638
639 @node Install the Slave KDCs, Back on the Master KDC, Install the Master KDC, Installing KDCs
640 @subsection Install the Slave KDCs
641
642 You are now ready to start configuring the slave KDCs.  Assuming you are
643 setting the KDCs up so that you can easily switch the master KDC with
644 one of the slaves, you should perform each of these steps on the master
645 KDC as well as the slave KDCs, unless these instructions specify
646 otherwise.
647
648
649 @menu
650 * Create Host Keys for the Slave KDCs::  
651 * Extract Host Keytabs for the KDCs::  
652 * Set Up the Slave KDCs for Database Propagation::  
653 @end menu
654
655 @node Create Host Keys for the Slave KDCs, Extract Host Keytabs for the KDCs, Install the Slave KDCs, Install the Slave KDCs
656 @subsubsection Create Host Keys for the Slave KDCs
657
658 Each KDC needs a host principal in the Kerberos database.  You can enter
659 these from any host, once the @code{kadmind} daemon is running.  For
660 example, if your master KDC were called
661 @value{KDCSERVER}.@value{PRIMARYDOMAIN}, and you had two KDC slaves
662 named @value{KDCSLAVE1}.@value{PRIMARYDOMAIN} and
663 @value{KDCSLAVE2}.@value{PRIMARYDOMAIN}, you would type the following:
664
665 @smallexample
666 @group
667 @b{shell%} @value{ROOTDIR}/sbin/kadmin
668 @b{kadmin:} addprinc -randkey host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}
669 @b{NOTICE: no policy specified for "host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}";
670 assigning "default"
671 Principal "host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}" created.
672 kadmin:} addprinc -randkey host/@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}
673 @b{NOTICE: no policy specified for "host/@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}";
674 assigning "default"
675 Principal "host/@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}" created.}
676 @b{kadmin:} addprinc -randkey host/@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}
677 @b{NOTICE: no policy specified for "host/@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}";
678 assigning "default"
679 Principal "host/@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}" created.
680 kadmin:}
681 @end group
682 @end smallexample
683
684 @noindent
685 It is not actually necessary to have the master KDC server in the
686 Kerberos database, but it can be handy if:
687
688 @itemize @bullet
689 @item
690 anyone will be logging into the machine as something other than root
691
692 @item
693 you want to be able to swap the master KDC with one of the slaves if
694 necessary.
695 @end itemize
696
697 @node Extract Host Keytabs for the KDCs, Set Up the Slave KDCs for Database Propagation, Create Host Keys for the Slave KDCs, Install the Slave KDCs
698 @subsubsection Extract Host Keytabs for the KDCs
699
700 Each KDC (including the master) needs a keytab to decrypt tickets.
701 Ideally, you should extract each keytab locally on its own KDC.  If this
702 is not feasible, you should use an encrypted session to send them across
703 the network.  To extract a keytab on a KDC called
704 @value{KDCSERVER}.@value{PRIMARYDOMAIN}, you would execute the following
705 command:
706
707 @smallexample
708 @group
709 @b{kadmin:} ktadd host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}
710 @b{kadmin: Entry for principal host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM} with
711      kvno 1, encryption type DES-CBC-CRC added to keytab
712      WRFILE:/etc/krb5.keytab.
713 kadmin:}
714 @end group
715 @end smallexample
716
717 @noindent
718 Note that the principal must exist in the Kerberos database in order to
719 extract the keytab.
720
721 @node Set Up the Slave KDCs for Database Propagation,  , Extract Host Keytabs for the KDCs, Install the Slave KDCs
722 @subsubsection Set Up the Slave KDCs for Database Propagation
723
724 The database is propagated from the master KDC to the slave KDCs via the
725 @code{kpropd} daemon.  To set up propagation, create a file on each KDC,
726 named @code{@value{ROOTDIR}/var/krb5kdc/kpropd.acl}, containing the
727 principals for each of the KDCs.
728 @need 1200
729 For example, if the master KDC were
730 @code{@value{KDCSERVER}.@value{PRIMARYDOMAIN}}, the slave KDCs were
731 @code{@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}} and
732 @code{@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}}, and the realm were
733 @code{@value{PRIMARYREALM}}, then the file's contents would be:
734
735 @smallexample
736 @group
737 host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}
738 host/@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}
739 host/@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}
740 @end group
741 @end smallexample
742  
743 @need 1000
744 Then, add the following line to @code{/etc/inetd.conf} file on each KDC:
745
746 @smallexample
747 @group
748 krb5_prop stream tcp nowait root @value{ROOTDIR}/sbin/kpropd kpropd
749 @end group
750 @end smallexample
751
752 @noindent
753 You also need to add the following lines to @code{/etc/services} on each
754 KDC:
755
756 @smallexample
757 @group
758 kerberos        88/udp      kdc       # Kerberos authentication (udp)
759 kerberos        88/tcp      kdc       # Kerberos authentication (tcp)
760 krb5_prop       754/tcp               # Kerberos slave propagation
761 kerberos-adm    749/tcp               # Kerberos 5 admin/changepw (tcp)
762 kerberos-adm    749/udp               # Kerberos 5 admin/changepw (udp)
763 @end group
764 @end smallexample
765
766 @node Back on the Master KDC, Finish Installing the Slave KDCs, Install the Slave KDCs, Installing KDCs
767 @subsection Back on the Master KDC
768
769 Now that the slave KDCs are able to accept database propagation, you'll
770 need to propagate the database to each of them.
771
772 @menu
773 * Propagate the Database to Each Slave KDC::  
774 @end menu
775
776 @node Propagate the Database to Each Slave KDC,  , Back on the Master KDC, Back on the Master KDC
777 @subsubsection Propagate the Database to Each Slave KDC
778
779 First, create a dump of the database on the master KDC, as follows:
780
781 @smallexample
782 @group
783 @b{shell%} @value{ROOTDIR}/sbin/kdb5_util dump @value{ROOTDIR}/var/krb5kdc/slave_datatrans
784 @b{shell%}
785 @end group
786 @end smallexample
787
788 Next, you need to manually propagate the database to each slave KDC, as
789 in the following example.  (The lines beginning with @result{} are
790 continuations of the previous line.):
791
792 @smallexample
793 @group
794 @value{ROOTDIR}/sbin/kprop -f @value{ROOTDIR}/var/krb5kdc/slave_datatrans
795 @result{} @value{KDCSLAVE1}.@value{PRIMARYDOMAIN}
796 @value{ROOTDIR}/sbin/kprop -f @value{ROOTDIR}/var/krb5kdc/slave_datatrans
797 @result{} @value{KDCSLAVE2}.@value{PRIMARYDOMAIN}
798 @end group
799 @end smallexample
800
801 You will need a script to dump and propagate the database.  The
802 following is an example of a bourne shell script that will do this.
803 (Note that the line that begins with @result{} is a continuation of the
804 previous line.  Remember that you need to replace @value{ROOTDIR} with
805 the name of the directory in which you installed @value{PRODUCT}.)
806
807 @smallexample
808 @group
809 #!/bin/sh
810
811 kdclist = "@value{KDCSLAVE1}.@value{PRIMARYDOMAIN} @value{KDCSLAVE2}.@value{PRIMARYDOMAIN}"
812
813 @value{ROOTDIR}/sbin/kdb5_util "dump
814 @result{} @value{ROOTDIR}/var/krb5kdc/slave_datatrans"
815
816 for kdc in $kdclist
817 do
818 @value{ROOTDIR}/sbin/kprop -f @value{ROOTDIR}/var/krb5kdc/slave_datatrans $kdc
819 done
820 @end group
821 @end smallexample
822
823 @noindent
824 You will need to set up a cron job to run this script at the intervals
825 you decided on earlier (@xref{Database Propagation}.)
826
827 @node Finish Installing the Slave KDCs, Add Kerberos Principals to the Database, Back on the Master KDC, Installing KDCs
828 @subsection Finish Installing the Slave KDCs
829
830 Now that the slave KDCs have copies of the Kerberos database, you can
831 create stash files for them and start the @code{krb5kdc} daemon.
832
833 @menu
834 * Create Stash Files on the Slave KDCs::  
835 * Start the krb5kdc Daemon on Each KDC::  
836 @end menu
837
838 @node Create Stash Files on the Slave KDCs, Start the krb5kdc Daemon on Each KDC, Finish Installing the Slave KDCs, Finish Installing the Slave KDCs
839 @subsubsection Create Stash Files on the Slave KDCs
840
841 Create stash files, by issuing the following commands on each slave KDC:
842
843 @smallexample
844 @group
845 @b{shell%} kdb5_util stash
846 @b{kdb5_util: Cannot find/read stored master key while reading master key
847 kdb5_util: Warning: proceeding without master key}
848 @iftex
849 @b{Enter KDC database master key:}  @i{@doubleleftarrow{} Enter the database master key.}
850 @end iftex
851 @ifinfo
852 @b{Enter KDC database master key:}  @i{<= Enter the database master key.}
853 @end ifinfo
854 @ifhtml
855 @b{Enter KDC database master key:}  @i{<= Enter the database master key.}
856 @end ifhtml
857 @b{shell%}
858 @end group
859 @end smallexample
860
861 As mentioned above, the stash file is necessary for your KDCs to be able
862 authenticate to themselves, such as when they reboot.  You could run
863 your KDCs without stash files, but you would then need to type in the
864 Kerberos database master key by hand every time you start a KDC daemon.
865
866 @node Start the krb5kdc Daemon on Each KDC,  , Create Stash Files on the Slave KDCs, Finish Installing the Slave KDCs
867 @subsubsection Start the krb5kdc Daemon on Each KDC
868
869 The final step in configuing your slave KDCs is to run the KDC daemon:
870
871 @smallexample
872 @group
873 @b{shell%} @value{ROOTDIR}/sbin/krb5kdc
874 @end group
875 @end smallexample
876
877 As with the master KDC, you will probably want to add this command to
878 the KDCs' @code{/etc/rc} or @code{/etc/inittab} files, so they will
879 start the krb5kdc daemon automatically at boot time.
880
881 @node Add Kerberos Principals to the Database, Limit Access to the KDCs, Finish Installing the Slave KDCs, Installing KDCs
882 @subsection Add Kerberos Principals to the Database
883
884 @need 1800
885 Once your KDCs are set up and running, you are ready to use
886 @code{kadmin} to load principals for your users, hosts, and other
887 services into the Kerberos database.  This procedure is described fully in the
888 ``Adding or Modifying Principals'' section of the @value{PRODUCT} System
889 Administrator's Guide.  (@xref{Create Host Keys for the Slave KDCs}, for a
890 brief description.)  The keytab is generated by running @code{kadmin}
891 and issuing the @code{ktadd} command.
892
893 @node Limit Access to the KDCs, Switching Master and Slave KDCs, Add Kerberos Principals to the Database, Installing KDCs
894 @subsection Limit Access to the KDCs
895
896 To limit the possibility that your Kerberos database could be
897 compromised, @value{COMPANY} recommends that each KDC be a dedicated
898 host, with limited access.  If your KDC is also a file server, FTP
899 server, Web server, or even just a client machine, someone who obtained
900 root access through a security hole in any of those areas could gain
901 access to the Kerberos database.
902
903 @node Switching Master and Slave KDCs, Incremental Database Propagation, Limit Access to the KDCs, Installing KDCs
904 @subsection Switching Master and Slave KDCs
905
906 You may occasionally want to use one of your slave KDCs as the master.
907 This might happen if you are upgrading the master KDC, or if your master
908 KDC has a disk crash.
909
910 Assuming you have configured all of your KDCs to be able to function as
911 either the master KDC or a slave KDC (as this document recommends), all
912 you need to do to make the changeover is:
913
914 If the master KDC is still running, do the following on the @emph{old}
915 master KDC:
916
917 @enumerate
918 @item
919 Kill the @code{kadmind} process.
920
921 @item
922 Disable the cron job that propagates the database.
923
924 @item
925 Run your database propagation script manually, to ensure that the slaves
926 all have the latest copy of the database.  (@xref{Propagate the Database
927 to Each Slave KDC}.)  If there is a need to preserve per-principal
928 policy information from the database, you should do a ``kdb5_util dump
929 -ov'' in order to preserve that information and propogate that dump file
930 securely by some means to the slave so that its database has the correct
931 state of the per-principal policy information.
932 @end enumerate
933
934 On the @emph{new} master KDC:
935
936 @enumerate
937 @item
938 Create a database keytab.  (@xref{Create a kadmind Keytab (optional)}.)
939
940 @item
941 Start the @code{kadmind} daemon.  (@xref{Start the Kerberos Daemons}.)
942
943 @item
944 Set up the cron job to propagate the database.  (@xref{Propagate the
945 Database to Each Slave KDC}.)
946
947 @item
948 Switch the CNAMEs of the old and new master KDCs.  (If you don't do
949 this, you'll need to change the @code{krb5.conf} file on every client
950 machine in your Kerberos realm.)
951
952 @end enumerate
953
954 @node Incremental Database Propagation,  , Switching Master and Slave KDCs, Installing KDCs
955 @subsection Incremental Database Propagation
956
957 At some very large sites, dumping and transmitting the database can
958 take more time than is desirable for changes to propagate from the
959 master KDC to the slave KDCs.  The incremental propagation support
960 added in the 1.7 release is intended to address this.
961
962 With incremental propagation enabled, all programs on the master KDC
963 that change the database also write information about the changes to
964 an ``update log'' file, maintained as a circular buffer of a certain
965 size.  A process on each slave KDC connects to a service on the master
966 KDC (currently implemented in the @code{kadmind} server) and
967 periodically requests the changes that have been made since the last
968 check.  By default, this check is done every two minutes.  If the
969 database has just been modified in the previous several seconds
970 (currently the threshold is hard-coded at 10 seconds), the slave will
971 not retrieve updates, but instead will pause and try again soon after.
972 This reduces the likelihood that incremental update queries will cause
973 delays for an administrator trying to make a bunch of changes to the
974 database at the same time.
975
976 Incremental propagation uses the following entries in the per-realm
977 data in the KDC config file:
978
979 @table @asis
980 @item @code{iprop_enable} (boolean)
981 If this is set to @code{true}, then incremental propagation is
982 enabled, and (as noted below) normal @code{kprop} propagation is
983 disabled.  The default is @code{false}.
984
985 @item @code{iprop_master_ulogsize} (integer)
986 This indicates the number of entries that should be retained in the
987 update log.  The default is 1000; the maximum number is 2500.
988
989 @item @code{iprop_slave_poll} (time interval)
990 This indicates how often the slave should poll the master KDC for
991 changes to the database.  The default is two minutes.
992
993 @item @code{iprop_port} (integer)
994 This specifies the port number to be used for incremental
995 propagation.  This is required in both master and slave configuration
996 files.
997
998 @item @code{iprop_logfile} (file name)
999 This specifies where the update log file for the realm database is to
1000 be stored.  The default is to use the @code{database_name} entry from
1001 the @code{realms} section of the config file, with @file{.ulog} appended.
1002 (NOTE: If @code{database_name} isn't specified in the @code{realms}
1003 section, perhaps because the LDAP database back end is being used, or
1004 the file name is specified in the @code{dbmodules} section, then the
1005 hard-coded default for @code{database_name} is used.  Determination of
1006 the @code{iprop_logfile} default value will not use values from the
1007 @code{dbmodules} section.)
1008 @end table
1009
1010 Both master and slave sides must have principals named
1011 @code{kiprop/@var{hostname}} (where @var{hostname} is, as usual, the
1012 lower-case, fully-qualified, canonical name for the host) registered
1013 and keys stored in the default keytab file (@file{/etc/krb5.keytab}).
1014 @c XXX: I think the master side, at least, might be able to read the
1015 @c key out of the database.  Test and document this.
1016
1017 On the master KDC side, the @code{kiprop/@var{hostname}} principal
1018 must be listed in the @code{kadmind} ACL file @code{kadm5.acl}, and
1019 given the @code{p} privilege.
1020
1021 On the slave KDC side, @code{kpropd} should be run.  When incremental
1022 propagation is enabled, it will connect to the @code{kadmind} on the
1023 master KDC and start requesting updates.
1024
1025 The normal @code{kprop} mechanism is disabled by the incremental
1026 propagation support.  However, if the slave has been unable to fetch
1027 changes from the master KDC for too long (network problems, perhaps),
1028 the log on the master may wrap around and overwrite some of the
1029 updates that the slave has not yet retrieved.  In this case, the slave
1030 will instruct the master KDC to dump the current database out to a
1031 file and invoke a one-time @code{kprop} propagation, with special
1032 options to also convey the point in the update log at which the slave
1033 should resume fetching incremental updates.  Thus, all the keytab and
1034 ACL setup previously described for @code{kprop} propagation is still
1035 needed.
1036
1037 There are several restrictions in the current implementation:
1038
1039 @itemize
1040 @item
1041 Changes to password policy objects are not propagated incrementally.
1042 Changes to which policy applies to a principal are propagated.
1043 @item
1044 The master and slave must be able to initiate TCP connections in both
1045 directions, without an intervening NAT.
1046 @item
1047 If the slave has an IPv6 interface address but needs to accept
1048 connections over IPv4, the operating system needs ``dual stack'' support
1049 (i.e. the ability to accept IPv6 and IPv4 connections on a single IPv6
1050 listener socket).  At this time, all modern Unix-like operating systems
1051 have dual stack support except OpenBSD.
1052 @end itemize
1053
1054 @menu
1055 * Sun/MIT Incremental Propagation Differences::  
1056 @end menu
1057
1058 @node Sun/MIT Incremental Propagation Differences,  , Incremental Database Propagation, Incremental Database Propagation
1059 @subsubsection Sun/MIT Incremental Propagation Differences
1060
1061 Sun donated the original code for supporting incremental database
1062 propagation to MIT.  Some changes have been made in the MIT source
1063 tree that will be visible to administrators.  (These notes are based
1064 on Sun's patches.  Changes to Sun's implementation since then may not
1065 be reflected here.)
1066
1067 The Sun config file support looks for @code{sunw_dbprop_enable},
1068 @code{sunw_dbprop_master_ulogsize}, and @code{sunw_dbprop_slave_poll}.
1069
1070 The incremental propagation service is implemented as an ONC RPC
1071 service.  In the Sun implementation, the service is registered with
1072 @code{rpcbind} (also known as @code{portmapper}) and the client looks
1073 up the port number to contact.  In the MIT implementation, where
1074 interaction with some modern versions of @code{rpcbind} doesn't always
1075 work well, the port number must be specified in the config file on
1076 both the master and slave sides.
1077
1078 The Sun implementation hard-codes pathnames in @file{/var/krb5} for
1079 the update log and the per-slave @code{kprop} dump files.  In the MIT
1080 implementation, the pathname for the update log is specified in the
1081 config file, and the per-slave dump files are stored in
1082 @code{@value{ROOTDIR}/var/krb5kdc/slave_datatrans_@var{hostname}}.
1083
1084 @node Installing and Configuring UNIX Client Machines, UNIX Application Servers, Installing KDCs, Installing Kerberos V5
1085 @section Installing and Configuring UNIX Client Machines
1086
1087 Client machine installation is much more straightforward than
1088 installation of the KDCs.
1089
1090 @menu
1091 * Client Programs::             
1092 * Client Machine Configuration Files::  
1093 @end menu
1094
1095 @node Client Programs, Client Machine Configuration Files, Installing and Configuring UNIX Client Machines, Installing and Configuring UNIX Client Machines
1096 @subsection Client Programs
1097
1098 The Kerberized client programs are @code{kinit}, @code{klist},
1099 @code{kdestroy}, @code{kpasswd}, and @code{ksu}.  All of these programs
1100 are in the directory @code{@value{ROOTDIR}/bin}.
1101
1102 @value{COMPANY} recommends that you use @code{login.krb5} in place of
1103 @code{/bin/login} to give your users a single-sign-on system.  You will
1104 need to make sure your users know to use their Kerberos passwords when
1105 they log in.
1106
1107 You will also need to educate your users to use the ticket management
1108 programs @code{kinit}, @code{klist}, @code{kdestroy}, and to use the
1109 Kerberos programs @code{ksu} and @code{kpasswd} in place of their
1110 non-Kerberos counterparts @code{su} and @code{passwd}.
1111
1112 @node Client Machine Configuration Files,  , Client Programs, Installing and Configuring UNIX Client Machines
1113 @subsection Client Machine Configuration Files
1114
1115 Each machine running Kerberos must have a @code{/etc/krb5.conf} file.
1116 (@xref{krb5.conf}.)
1117
1118 @need 4000
1119 Also, for most UNIX systems, you must add the appropriate Kerberos
1120 services to each client machine's @code{/etc/services} file.  If you are
1121 using the default configuration for @value{PRODUCT}, you should be able
1122 to just insert the following code:
1123
1124 @smallexample
1125 @group
1126 kerberos      @value{DefaultPort}/udp    kdc    # Kerberos V5 KDC
1127 kerberos      @value{DefaultPort}/tcp    kdc    # Kerberos V5 KDC
1128 kerberos-adm  @value{DefaultKadmindPort}/tcp          # Kerberos 5 admin/changepw
1129 kerberos-adm  @value{DefaultKadmindPort}/udp          # Kerberos 5 admin/changepw
1130 krb5_prop     @value{DefaultKrbPropPort}/tcp          # Kerberos slave propagation
1131 krb524        @value{DefaultKrb524Port}/tcp         # Kerberos 5 to 4 ticket translator
1132 @end group
1133 @end smallexample
1134
1135 @menu
1136 * Mac OS X Configuration::      
1137 @end menu
1138
1139 @node Mac OS X Configuration,  , Client Machine Configuration Files, Client Machine Configuration Files
1140 @subsubsection Mac OS X Configuration
1141
1142 To install Kerberos V5 on Mac OS X and Mac OS X Server, follow the 
1143 directions for generic Unix-based OS's, except for the 
1144 @code{/etc/services} updates described above.  
1145
1146 Mac OS X and Mac OS X Server use a database called NetInfo to store
1147 the contents of files normally found in @code{/etc}.  Instead of
1148 modifying @code{/etc/services}, you should run the following commands
1149 to add the Kerberos service entries to NetInfo:
1150
1151 @smallexample
1152 @group
1153 $ niutil -create . /services/kerberos
1154 $ niutil -createprop . /services/kerberos name kerberos kdc
1155 $ niutil -createprop . /services/kerberos port 750
1156 $ niutil -createprop . /services/kerberos protocol tcp udp
1157 $ niutil -create . /services/krbupdate
1158 $ niutil -createprop . /services/krbupdate name krbupdate kreg
1159 $ niutil -createprop . /services/krbupdate port 760
1160 $ niutil -createprop . /services/krbupdate protocol tcp
1161 $ niutil -create . /services/kpasswd
1162 $ niutil -createprop . /services/kpasswd name kpasswd kpwd
1163 $ niutil -createprop . /services/kpasswd port 761
1164 $ niutil -createprop . /services/kpasswd protocol tcp
1165 $ niutil -create . /services/klogin
1166 $ niutil -createprop . /services/klogin port 543
1167 $ niutil -createprop . /services/klogin protocol tcp
1168 $ niutil -create . /services/eklogin
1169 $ niutil -createprop . /services/eklogin port 2105
1170 $ niutil -createprop . /services/eklogin protocol tcp
1171 $ niutil -create . /services/kshell
1172 $ niutil -createprop . /services/kshell name kshell krcmd
1173 $ niutil -createprop . /services/kshell port 544
1174 $ niutil -createprop . /services/kshell protocol tcp
1175 @end group
1176 @end smallexample
1177
1178 In addition to adding services to NetInfo, you must also modify the
1179 resolver configuration in NetInfo so that the machine resolves its own
1180 hostname as a FQDN (fully qualified domain name).  By default, Mac OS X
1181 and Mac OS X Server machines query NetInfo to resolve hostnames before
1182 falling back to DNS.  Because NetInfo has an unqualified name for all
1183 the machines in the NetInfo database, the machine's own hostname will
1184 resolve to an unqualified name.  Kerberos needs a FQDN to look up keys
1185 in the machine's keytab file.
1186
1187 Fortunately, you can change the @code{lookupd} caching order to query
1188 DNS first.  Run the following NetInfo commands and reboot the machine:
1189
1190 @smallexample
1191 @group
1192 $ niutil -create . /locations/lookupd/hosts
1193 $ niutil -createprop . /locations/lookupd/hosts LookupOrder CacheAgent DNSAgent
1194  NIAgent NILAgent
1195 @end group
1196 @end smallexample
1197
1198 Once you have rebooted, you can verify that the resolver now behaves
1199 correctly.  Compile the Kerberos 5 distribution and run:
1200
1201 @smallexample
1202 @group
1203 $ cd .../src/tests/resolve
1204 $ ./resolve
1205 @end group
1206 @end smallexample
1207
1208 This will tell you whether or not your machine returns FQDNs on name
1209 lookups.  If the test still fails, you can also try turning off DNS
1210 caching.  Run the following commands and reboot:
1211
1212 @smallexample
1213 @group
1214 $ niutil -create . /locations/lookupd/hosts
1215 $ niutil -createprop . /locations/lookupd/hosts LookupOrder DNSAgent
1216  CacheAgent NIAgent NILAgent
1217 @end group
1218 @end smallexample
1219
1220 The remainder of the setup of a Mac OS X client machine or application
1221 server should be the same as for other UNIX-based systems.
1222
1223 @node UNIX Application Servers,  , Installing and Configuring UNIX Client Machines, Installing Kerberos V5
1224 @section UNIX Application Servers
1225
1226 An application server is a host that provides one or more services over
1227 the network.  Application servers can be ``secure'' or ``insecure.''  A
1228 ``secure'' host is set up to require authentication from every client
1229 connecting to it.  An ``insecure'' host will still provide Kerberos
1230 authentication, but will also allow unauthenticated clients to connect.
1231
1232 If you have @value{PRODUCT} installed on all of your client machines,
1233 @value{COMPANY} recommends that you make your hosts secure, to take
1234 advantage of the security that Kerberos authentication affords.
1235 However, if you have some clients that do not have @value{PRODUCT}
1236 installed, you can run an insecure server, and still take advantage of
1237 @value{PRODUCT}'s single sign-on capability.
1238
1239 @menu
1240 * The Keytab File::             
1241 * Some Advice about Secure Hosts::  
1242 @end menu
1243
1244 @node The Keytab File, Some Advice about Secure Hosts, UNIX Application Servers, UNIX Application Servers
1245 @subsection The Keytab File
1246
1247 All Kerberos server machines need a @dfn{keytab} file, called
1248 @code{/etc/krb5.keytab}, to authenticate to the KDC.  The keytab file is
1249 an encrypted, local, on-disk copy of the host's key.  The keytab file,
1250 like the stash file (@ref{Create the Database}) is a potential
1251 point-of-entry for a break-in, and if compromised, would allow
1252 unrestricted access to its host.  The keytab file should be readable
1253 only by root, and should exist only on the machine's local disk.  The
1254 file should not be part of any backup of the machine, unless access to
1255 the backup data is secured as tightly as access to the machine's root
1256 password itself.
1257
1258 In order to generate a keytab for a host, the host must have a principal
1259 in the Kerberos database.  The procedure for adding hosts to the
1260 database is described fully in the ``Adding or Modifying Principals''
1261 section of the @cite{@value{PRODUCT} System Administrator's Guide}.
1262 @xref{Create Host Keys for the Slave KDCs}. for a brief description.)
1263 The keytab is generated by running @code{kadmin} and issuing the
1264 @code{ktadd} command.
1265
1266 @need 1100
1267 For example, to generate a keytab file to allow the host
1268 trillium.@value{PRIMARYDOMAIN} to authenticate for the services
1269 @code{host}, @code{ftp}, and @code{pop}, the administrator
1270 @code{@value{ADMINUSER}} would issue the command (on
1271 trillium.@value{PRIMARYDOMAIN}):
1272
1273 @smallexample
1274 @group
1275 @b{trillium%} @value{ROOTDIR}/sbin/kadmin
1276 @b{kadmin5:} ktadd host/trillium.@value{PRIMARYDOMAIN} ftp/trillium.@value{PRIMARYDOMAIN}
1277 @result{} pop/trillium.@value{PRIMARYDOMAIN}
1278 @b{kadmin: Entry for principal host/trillium.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM} with
1279 kvno 3, encryption type DES-CBC-CRC added to keytab
1280 WRFILE:/etc/krb5.keytab.
1281 kadmin: Entry for principal ftp/trillium.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM} with
1282 kvno 3, encryption type DES-CBC-CRC added to keytab
1283 WRFILE:/etc/krb5.keytab.
1284 kadmin: Entry for principal pop/trillium.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM} with
1285 kvno 3, encryption type DES-CBC-CRC added to keytab
1286 WRFILE:/etc/krb5.keytab.
1287 kadmin5:} quit
1288 @b{trillium%}
1289 @end group
1290 @end smallexample
1291
1292 If you generate the keytab file on another host, you need to get a copy
1293 of the keytab file onto the destination host (@code{trillium}, in the
1294 above example) without sending it unencrypted over the network.
1295
1296 @node Some Advice about Secure Hosts,  , The Keytab File, UNIX Application Servers
1297 @subsection Some Advice about Secure Hosts
1298
1299 @value{PRODUCT} can protect your host from certain types of break-ins,
1300 but it is possible to install @value{PRODUCT} and still leave your host
1301 vulnerable to attack.  Obviously an installation guide is not the place
1302 to try to include an exhaustive list of countermeasures for every
1303 possible attack, but it is worth noting some of the larger holes and how
1304 to close them.
1305
1306 We recommend that backups of secure machines exclude the keytab file
1307 (@code{/etc/krb5.keytab}).  If this is not possible, the backups should
1308 at least be done locally, rather than over a network, and the backup
1309 tapes should be physically secured.
1310
1311 The keytab file and any programs run by root, including the
1312 @value{PRODUCT} binaries, should be kept on local disk.  The keytab file
1313 should be readable only by root.
1314
1315 @node Upgrading Existing Kerberos V5 Installations, Bug Reports for Kerberos V5, Installing Kerberos V5, Top
1316 @chapter Upgrading Existing @value{PRODUCT} Installations
1317
1318 If you already have an existing Kerberos database that you created with
1319 a prior release of Kerberos 5, you can upgrade it to work with the
1320 current release with the @code{kdb5_util} command.  It is only
1321 necessary to perform this dump/undump procedure if you were running a
1322 krb5-1.0.x KDC and are migrating to a krb5-1.1.x or newer KDC or if you
1323 were running a krb5-1.1.x KDC and are migrating to a krb5-1.2.x or newer
1324 KDC.  The process for upgrading a Master KDC involves the following
1325 steps:
1326
1327 @enumerate
1328
1329 @item Stop your current KDC and administration
1330 server processes, if any.
1331
1332 @item Dump your existing Kerberos database to an ASCII file with 
1333 @code{kdb5_util}'s ``dump'' command:
1334
1335 @smallexample
1336 @group
1337 @b{shell%} cd @value{ROOTDIR}/var/krb5kdc
1338 @b{shell%} kdb5_util dump old-kdb-dump
1339 @b{shell%} kdb5_util dump -ov old-kdb-dump.ov
1340 @b{shell%}
1341 @end group
1342 @end smallexample
1343
1344 @item Create a new Master KDC installation (@xref{Install the Master
1345 KDC}.).  If you have a stash file for your current database, choose any
1346 new master password but then copy your existing stash file to the
1347 location specified by your kdc.conf; if you do not have a stash file for
1348 your current database, you must choose the same master password.
1349
1350 @item Load your old Kerberos database into the new system with
1351 @code{kdb5_util}'s ``load'' command:
1352
1353 @smallexample
1354 @group
1355 @b{shell%} cd @value{ROOTDIR}/var/krb5kdc
1356 @b{shell%} kdb5_util load old-kdb-dump
1357 @b{shell%} kdb5_util load -update old-kdb-dump.ov
1358 @b{shell%}
1359 @end group
1360 @end smallexample
1361
1362 @end enumerate
1363
1364 The ``dump -ov'' and ``load -update'' commands are necessary in order to
1365 preserve per-principal policy information, since the default dump format
1366 filters out that information.  If you omit those steps, the loaded
1367 database database will lose the policy information for each principal
1368 that has a policy.
1369
1370 To update a Slave KDC, you must stop the old server processes on the
1371 Slave KDC, install the new server binaries, reload the most recent slave
1372 dump file, and re-start the server processes.
1373
1374 @menu
1375 * Upgrading to Triple-DES and RC4 Encryption Keys::  
1376 @end menu
1377
1378 @node Upgrading to Triple-DES and RC4 Encryption Keys,  , Upgrading Existing Kerberos V5 Installations, Upgrading Existing Kerberos V5 Installations
1379 @section Upgrading to Triple-DES Encryption Keys
1380
1381 Beginning with the 1.2 release from @value{COMPANY}, Kerberos includes
1382 a stronger encryption algorithm called ``triple DES'' -- essentially,
1383 three applications of the basic DES encryption algorithm, greatly
1384 increasing the resistance to a brute-force search for the key by an
1385 attacker.  This algorithm is more secure, but encryption is much
1386 slower.
1387
1388 Release 1.1 had some support for triple-DES service keys, but with
1389 release 1.2 we have added support for user keys and session keys as
1390 well.  Release 1.0 had very little support for multiple cryptosystems,
1391 and some of that software may not function properly in an environment
1392 using triple-DES as well as plain DES.
1393
1394 In the 1.3 release from @value{COMPANY}, Kerberos also includes the RC4
1395 encryption alogorithm, a stream cipher symmetric key algorithm
1396 developed in 1987 by Ronald Rivest at RSA Data Security.  Please note
1397 that RC4 is not part of the IETF standard.
1398
1399 Because of the way the MIT Kerberos database is structured, the KDC
1400 will assume that a service supports only those encryption types for
1401 which keys are found in the database.  Thus, if a service has only a
1402 single-DES key in the database, the KDC will not issue tickets for that
1403 service that use triple-DES or RC4 session keys; it will instead issue
1404 only single-DES session keys, even if other services are already
1405 capable of using triple-DES or RC4.  So if you make sure your
1406 application server software is updated before adding a triple-DES or
1407 RC4 key for the service, clients should be able to talk to services at
1408 all times during the updating process.
1409
1410 Normally, the listed @code{supported_enctypes} in @code{kdc.conf} are
1411 all used when a new key is generated.  You can control this with
1412 command-line flags to @code{kadmin} and @code{kadmin.local}.  You may
1413 want to exclude triple-DES and RC4 by default until you have updated a
1414 lot of your application servers, and then change the default to include
1415 triple-DES and RC4.  We recommend that you always include
1416 @code{des-cbc-crc} in the default list.
1417
1418 @node Bug Reports for Kerberos V5, Copyright, Upgrading Existing Kerberos V5 Installations, Top
1419 @chapter Bug Reports for @value{PRODUCT}
1420
1421 @include send-pr.texinfo
1422
1423 @node Copyright,  , Bug Reports for Kerberos V5, Top
1424 @appendix Copyright
1425 @include copyright.texinfo
1426
1427 @contents
1428 @bye