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