r18022@luminous: jaltman | 2006-05-19 05:18:37 -0400
[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
210 @item
211 Whether you need backward compatibility with Kerberos V4.
212 @end itemize
213
214 @menu
215 * Kerberos Realms::             
216 * Mapping Hostnames onto Kerberos Realms::  
217 * Ports for the KDC and Admin Services::  
218 * Slave KDCs::                  
219 * Hostnames for the Master and Slave KDCs::  
220 * Database Propagation::        
221 @end menu
222
223 @node Kerberos Realms, Mapping Hostnames onto Kerberos Realms, Realm Configuration Decisions, Realm Configuration Decisions
224 @section Kerberos Realms
225
226 Although your Kerberos realm can be any ASCII string, convention is to
227 make it the same as your domain name, in upper-case letters.  For
228 example, hosts in the domain @value{SECONDDOMAIN} would be in the
229 Kerberos realm @value{SECONDREALM}.
230
231 If you need multiple Kerberos realms, @value{COMPANY} recommends that
232 you use descriptive names which end with your domain name, such as
233 BOSTON.@value{SECONDREALM} and HOUSTON.@value{SECONDREALM}.
234
235 @node Mapping Hostnames onto Kerberos Realms, Ports for the KDC and Admin Services, Kerberos Realms, Realm Configuration Decisions
236 @section Mapping Hostnames onto Kerberos Realms
237
238 @include dnstxt.texinfo
239
240 @node Ports for the KDC and Admin Services, Slave KDCs, Mapping Hostnames onto Kerberos Realms, Realm Configuration Decisions
241 @section Ports for the KDC and Admin Services
242
243 The default ports used by Kerberos are port @value{DefaultPort} for the
244 KDC@footnote{Kerberos V4 used port @value{DefaultSecondPort}.  If
245 necessary, you can run on both ports for backward compatibility.}  and
246 port @value{DefaultKadmindPort} for the admin server.  You can, however,
247 choose to run on other ports, as long as they are specified in each
248 host's @code{/etc/services} and @code{krb5.conf} files, and the
249 @code{kdc.conf} file on each KDC.  For a more thorough treatment of
250 port numbers used by the @value{PRODUCT} programs, refer to the
251 ``Configuring Your Firewall to Work With @value{PRODUCT}'' section of
252 the @cite{@value{PRODUCT} System Administrator's Guide}.
253
254 @node Slave KDCs, Hostnames for the Master and Slave KDCs, Ports for the KDC and Admin Services, Realm Configuration Decisions
255 @section Slave KDCs
256
257 Slave KDCs provide an additional source of Kerberos ticket-granting
258 services in the event of inaccessibility of the master KDC.  The number
259 of slave KDCs you need and the decision of where to place them, both
260 physically and logically, depends on the specifics of your network.
261
262 All of the Kerberos authentication on your network requires that each
263 client be able to contact a KDC.  Therefore, you need to anticipate any
264 likely reason a KDC might be unavailable and have a slave KDC to take up
265 the slack.
266
267 Some considerations include:
268
269 @itemize @bullet
270 @item
271 Have at least one slave KDC as a backup, for when the master KDC is
272 down, is being upgraded, or is otherwise unavailable.
273
274 @item
275 If your network is split such that a network outage is likely to cause a
276 network partition (some segment or segments of the network to become cut
277 off or isolated from other segments), have a slave KDC accessible to
278 each segment.
279
280 @item
281 If possible, have at least one slave KDC in a different building from
282 the master, in case of power outages, fires, or other localized
283 disasters.
284 @end itemize
285
286
287
288 @node Hostnames for the Master and Slave KDCs, Database Propagation, Slave KDCs, Realm Configuration Decisions
289 @section Hostnames for the Master and Slave KDCs
290
291 @include dnssrv.texinfo
292
293 @node Database Propagation,  , Hostnames for the Master and Slave KDCs, Realm Configuration Decisions
294 @section Database Propagation
295
296 The Kerberos database resides on the master KDC, and must be propagated
297 regularly (usually by a cron job) to the slave KDCs.  In deciding how
298 frequently the propagation should happen, you will need to balance the
299 amount of time the propagation takes against the maximum reasonable
300 amount of time a user should have to wait for a password change to take
301 effect.
302
303 If the propagation time is longer than this maximum reasonable time
304 (@i{e.g.,} you have a particularly large database, you have a lot of
305 slaves, or you experience frequent network delays), you may wish to
306 cut down on your propagation delay by performing the propagation in
307 parallel.  To do this, have the master KDC propagate the database to one
308 set of slaves, and then have each of these slaves propagate the database
309 to additional slaves.
310
311 @node Building Kerberos V5, Installing Kerberos V5, Realm Configuration Decisions, Top
312 @chapter Building @value{PRODUCT}
313
314 @include build.texinfo
315
316 @node Installing Kerberos V5, Upgrading Existing Kerberos V5 Installations, Building Kerberos V5, Top
317 @chapter Installing @value{PRODUCT}
318
319 The sections of this chapter describe procedures for installing
320 @value{PRODUCT} on:
321
322 @enumerate
323 @item
324 The KDCs
325
326 @item
327 UNIX client machines
328
329 @item
330 UNIX Application Servers
331 @end enumerate
332
333 @menu
334 * Installing KDCs::             
335 * Installing and Configuring UNIX Client Machines::  
336 * UNIX Application Servers::    
337 @end menu
338
339 @node Installing KDCs, Installing and Configuring UNIX Client Machines, Installing Kerberos V5, Installing Kerberos V5
340 @section Installing KDCs
341
342 The Key Distribution Centers (KDCs) issue Kerberos tickets.  Each KDC
343 contains a copy of the Kerberos database.  The master KDC contains the
344 master copy of the database, which it propagates to the slave KDCs at
345 regular intervals.  All database changes (such as password changes) are
346 made on the master KDC.
347
348 Slave KDCs provide Kerberos ticket-granting services, but not database
349 administration.  This allows clients to continue to obtain tickets when
350 the master KDC is unavailable.
351
352 @value{COMPANY} recommends that you install all of your KDCs to be able
353 to function as either the master or one of the slaves.  This will enable
354 you to easily switch your master KDC with one of the slaves if
355 necessary.  (@xref{Switching Master and Slave KDCs}.)  This installation
356 procedure is based on that recommendation.
357
358 @menu
359 * Install the Master KDC::      
360 * Install the Slave KDCs::      
361 * Back on the Master KDC::      
362 * Finish Installing the Slave KDCs::  
363 * Add Kerberos Principals to the Database::  
364 * Limit Access to the KDCs::    
365 * Switching Master and Slave KDCs::  
366 @end menu
367
368 @node Install the Master KDC, Install the Slave KDCs, Installing KDCs, Installing KDCs
369 @subsection Install the Master KDC
370
371 This installation procedure will require you to go back and forth a
372 couple of times between the master KDC and each of the slave KDCs.  The
373 first few steps must be done on the master KDC.
374
375 @menu
376 * Edit the Configuration Files::  
377 * krb5.conf::                   
378 * kdc.conf::                    
379 * Create the Database::         
380 * Add Administrators to the Acl File::  
381 * Add Administrators to the Kerberos Database::  
382 * Create a kadmind Keytab (optional)::  
383 * Start the Kerberos Daemons::  
384 @end menu
385
386 @node Edit the Configuration Files, krb5.conf, Install the Master KDC, Install the Master KDC
387 @subsubsection Edit the Configuration Files
388
389 Modify the configuration files, @code{/etc/krb5.conf} and
390 @code{@value{ROOTDIR}/var/krb5kdc/kdc.conf} to reflect the correct
391 information (such as the hostnames and realm name) for your realm.
392 @value{COMPANY} recommends that you keep @code{krb5.conf} in @code{/etc}.
393
394 Most of the tags in the configuration have default values that will
395 work well for most sites.  There are some tags in the @code{krb5.conf}
396 file whose values must be specified, and this section will explain
397 those as well as give an overview of all of the sections in both
398 configuration files.  For more information on changing defaults with
399 the configuration files, see the @value{PRODUCT} System Administrator's
400 Guide sections on configuration files. 
401
402 @node krb5.conf, kdc.conf, Edit the Configuration Files, Install the Master KDC
403 @subsubsection krb5.conf
404
405 @include krb5conf.texinfo
406
407 If you are not using DNS TXT records, you must specify the
408 @code{default_realm} in the @code{libdefaults} section.  If you are not
409 using DNS SRV records, you must include the @code{kdc} tag for each
410 realm in the @code{realms} section.  To communicate with the kadmin
411 server in each realm, the @code{admin_server} tag must be set in the
412 @code{realms} section.  If your domain name and realm name are not the
413 same, you must provide a translation in @code{domain_realm}.  It is
414 also higly recommeneded that you create a @code{[logging]} stanza if
415 the computer will be functioning as a KDC so that the KDC and kadmind
416 will generate logging output.
417
418 An example @code{krb5.conf} file:
419
420 @smallexample
421 @group
422 [libdefaults]
423     default_realm = @value{PRIMARYREALM}
424
425 [realms]
426     @value{PRIMARYREALM} = @{
427         kdc = @value{KDCSERVER}.@value{PRIMARYDOMAIN}
428         kdc = @value{KDCSLAVE1}.@value{PRIMARYDOMAIN}
429         kdc = @value{KDCSLAVE2}.@value{PRIMARYDOMAIN}
430         admin_server = @value{KDCSERVER}.@value{PRIMARYDOMAIN}
431     @{
432
433 [logging]
434     kdc = FILE:/var/log/krb5kdc.log
435     admin_server = FILE:/var/log/kadmin.log
436     default = FILE:/var/log/krb5lib.log
437 @end group
438 @end smallexample
439
440 @node kdc.conf, Create the Database, krb5.conf, Install the Master KDC
441 @subsubsection kdc.conf
442
443 @include kdcconf.texinfo
444
445 @node Create the Database, Add Administrators to the Acl File, kdc.conf, Install the Master KDC
446 @subsubsection Create the Database
447
448 You will use the @code{kdb5_util} command @emph{on the Master KDC} to
449 create the Kerberos database and the optional stash file.  The
450 @dfn{stash file} is a local copy of the master key that resides in
451 encrypted form on the KDC's local disk.  The stash file is used to
452 authenticate the KDC to itself automatically before starting the
453 @code{kadmind} and @code{krb5kdc} daemons (@i{e.g.,} as part of the
454 machine's boot sequence).  The stash file, like the keytab file
455 (see @xref{The Keytab File}, for more information) is a potential
456 point-of-entry for a break-in,
457 and if compromised, would allow unrestricted access to the Kerberos
458 database.  If you choose to install a stash file, it should be readable
459 only by root, and should exist only on the KDC's local disk.  The file
460 should not be part of any backup of the machine, unless access to the
461 backup data is secured as tightly as access to the master password
462 itself.
463
464 Note that @code{kdb5_util} will prompt you for the master key for the
465 Kerberos database.  This key can be any string.  A good key is one you
466 can remember, but that no one else can guess.  Examples of bad keys are
467 words that can be found in a dictionary, any common or popular name,
468 especially a famous person (or cartoon character), your username in any
469 form (@i{e.g.}, forward, backward, repeated twice, @i{etc.}), and any of
470 the sample keys that appear in this manual.  One example of a key which
471 might be good if it did not appear in this manual is ``MITiys4K5!'',
472 which represents the sentence ``MIT is your source for Kerberos 5!''
473 (It's the first letter of each word, substituting the numeral ``4'' for
474 the word ``for'', and includes the punctuation mark at the end.)
475
476 The following is an example of how to create a Kerberos database and
477 stash file on the master KDC, using the @code{kdb5_util} command.  (The
478 line that begins with @result{} is a continuation of the previous line.)
479 Replace @i{@value{PRIMARYREALM}} with the name of your Kerberos realm.
480
481 @smallexample
482 @group
483 @b{shell%} @value{ROOTDIR}/sbin/kdb5_util create -r @value{PRIMARYREALM} -s
484 @b{Initializing database '@value{ROOTDIR}/var/krb5kdc/principal' for
485 @result{} realm '@value{PRIMARYREALM}',
486 master key name 'K/M@@@value{PRIMARYREALM}'
487 You will be prompted for the database Master Password.
488 It is important that you NOT FORGET this password.}
489 @iftex
490 @b{Enter KDC database master key:}  @i{@doubleleftarrow{} Type the master password.}
491 @b{Re-enter KDC database master key to verify:}  @i{@doubleleftarrow{} Type it again.}
492 @end iftex
493 @ifinfo
494 @b{Enter KDC database master key:}  @i{<= Type the master password.}
495 @b{Re-enter KDC database master key to verify:}  @i{<= Type it again.}
496 @end ifinfo
497 @ifhtml
498 @b{Enter KDC database master key:}  @i{<= Type the master password.}
499 @b{Re-enter KDC database master key to verify:}  @i{<= Type it again.}
500 @end ifhtml
501 @b{shell%}
502 @end group
503 @end smallexample
504
505 This will create five files in the directory specified in your
506 @code{kdc.conf} file:  two Kerberos database files, @code{principal.db},
507 and @code{principal.ok}; the Kerberos administrative database file,
508 @code{principal.kadm5}; the administrative database lock file,
509 @code{principal.kadm5.lock}; and the stash file, @code{.k5stash}.  (The
510 default directory is @code{@value{ROOTDIR}/var/krb5kdc}.)  If you do not
511 want a stash file, run the above command without the @code{-s} option.
512
513 @node Add Administrators to the Acl File, Add Administrators to the Kerberos Database, Create the Database, Install the Master KDC
514 @subsubsection Add Administrators to the Acl File
515
516 Next, you need create an Access Control List (acl) file, and put the
517 Kerberos principal of at least one of the administrators into it.  The
518 filename should match the value you have set for ``acl_file'' in your
519 @code{kdc.conf} file.  The default file name is
520 @samp{@value{DefaultAclFile}}.  
521
522 @include kadm5acl.texinfo
523
524 @node Add Administrators to the Kerberos Database, Create a kadmind Keytab (optional), Add Administrators to the Acl File, Install the Master KDC
525 @subsubsection Add Administrators to the Kerberos Database
526
527 Next you need to add administrative principals to the Kerberos database.
528 (You must add at least one now.)  To do this, use @code{kadmin.local}
529 @emph{on the master KDC}.  The administrative principals you create
530 should be the ones you added to the ACL file.  (See @xref{Add
531 Administrators to the Acl File}.)  In the following example, the
532 administration principal @code{admin/admin} is created:
533
534 @smallexample
535 @group
536 @b{shell%} @value{ROOTDIR}/sbin/kadmin.local
537 @b{kadmin.local:} addprinc admin/admin@@@value{PRIMARYREALM}
538 @b{NOTICE: no policy specified for "admin/admin@@@value{PRIMARYREALM}";
539 assigning "default".}
540 @iftex
541 @b{Enter password for principal admin/admin@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Enter a password.}
542 Re-enter password for principal admin/admin@@@value{PRIMARYREALM}:  @i{@doubleleftarrow{} Type it again.}
543 @end iftex
544 @ifinfo
545 @b{Enter password for principal admin/admin@@@value{PRIMARYREALM}:}  @i{<= Enter a password.}
546 Re-enter password for principal admin/admin@@@value{PRIMARYREALM}:  @i{<= Type it again.}
547 @end ifinfo
548 @ifhtml
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 ifhtml
552 @b{Principal "admin/admin@@@value{PRIMARYREALM}" created.
553 kadmin.local:}
554 @end group
555 @end smallexample
556
557
558
559 @node Create a kadmind Keytab (optional), Start the Kerberos Daemons, Add Administrators to the Kerberos Database, Install the Master KDC
560 @subsubsection Create a kadmind Keytab (optional)
561
562 The kadmind keytab is the key that the legacy admininstration daemons
563 @code{kadmind4} and @code{v5passwdd} will use to decrypt
564 administrators' or clients' Kerberos tickets to determine whether or
565 not they should have access to the database.  You need to create the
566 kadmin keytab with entries for the principals @code{kadmin/admin} and
567 @code{kadmin/changepw}.  (These principals are placed in the Kerberos
568 database automatically when you create it.)  To create the kadmin
569 keytab, run @code{kadmin.local} and use the @code{ktadd} command, as
570 in the following example.  (The line beginning with @result{} is a
571 continuation of the previous line.):
572
573 @smallexample
574 @group
575 @b{shell%} @value{ROOTDIR}/sbin/kadmin.local
576 @b{kadmin.local:} ktadd -k @value{ROOTDIR}/var/krb5kdc/kadm5.keytab
577 @result{} kadmin/admin kadmin/changepw 
578 @b{ Entry for principal kadmin/admin with kvno 5, encryption
579         type Triple DES cbc mode with HMAC/sha1 added to keytab
580         WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
581 Entry for principal kadmin/admin with kvno 5, encryption type DES cbc mode
582         with CRC-32 added to keytab
583         WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
584 Entry for principal kadmin/changepw with kvno 5, encryption
585         type Triple DES cbc mode with HMAC/sha1 added to keytab
586         WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
587 Entry for principal kadmin/changepw with kvno 5,
588         encryption type DES cbc mode with CRC-32 added to keytab
589         WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
590 kadmin.local:} quit
591 @b{shell%}
592 @end group
593 @end smallexample
594
595 @noindent
596 As specified in the @samp{-k} argument, @code{ktadd} will save the
597 extracted keytab as @* @code{@value{ROOTDIR}/var/krb5kdc/kadm5.keytab}.
598 The filename you use must be the one specified in your @code{kdc.conf}
599 file.
600
601 @need 2000
602 @node Start the Kerberos Daemons,  , Create a kadmind Keytab (optional), Install the Master KDC
603 @subsubsection Start the Kerberos Daemons on the Master KDC
604
605 At this point, you are ready to start the Kerberos daemons on the Master
606 KDC.  To do so, type:
607
608 @smallexample
609 @b{shell%} @value{ROOTDIR}/sbin/krb5kdc
610 @b{shell%} @value{ROOTDIR}/sbin/kadmind
611 @end smallexample
612
613 @noindent
614 Each daemon will fork and run in the background.  Assuming you want
615 these daemons to start up automatically at boot time, you can add them
616 to the KDC's @code{/etc/rc} or @code{/etc/inittab} file.  You need to
617 have a stash file in order to do this.
618
619 You can verify that they started properly by checking for their startup
620 messages in the logging locations you defined in @code{/etc/krb5.conf}.
621 (@xref{Edit the Configuration Files}.)  For example:
622
623 @smallexample
624 @b{shell%} tail /var/log/krb5kdc.log
625 Dec 02 12:35:47 beeblebrox krb5kdc[3187](info): commencing operation
626 @b{shell%} tail /var/log/kadmin.log
627 Dec 02 12:35:52 beeblebrox kadmind[3189](info): starting
628 @end smallexample
629
630 Any errors the daemons encounter while starting will also be listed in
631 the logging output.
632
633
634 @node Install the Slave KDCs, Back on the Master KDC, Install the Master KDC, Installing KDCs
635 @subsection Install the Slave KDCs
636
637 You are now ready to start configuring the slave KDCs.  Assuming you are
638 setting the KDCs up so that you can easily switch the master KDC with
639 one of the slaves, you should perform each of these steps on the master
640 KDC as well as the slave KDCs, unless these instructions specify
641 otherwise.
642
643
644 @menu
645 * Create Host Keys for the Slave KDCs::  
646 * Extract Host Keytabs for the KDCs::  
647 * Set Up the Slave KDCs for Database Propagation::  
648 @end menu
649
650 @node Create Host Keys for the Slave KDCs, Extract Host Keytabs for the KDCs, Install the Slave KDCs, Install the Slave KDCs
651 @subsubsection Create Host Keys for the Slave KDCs
652
653 Each KDC needs a host principal in the Kerberos database.  You can enter
654 these from any host, once the @code{kadmind} daemon is running.  For
655 example, if your master KDC were called
656 @value{KDCSERVER}.@value{PRIMARYDOMAIN}, and you had two KDC slaves
657 named @value{KDCSLAVE1}.@value{PRIMARYDOMAIN} and
658 @value{KDCSLAVE2}.@value{PRIMARYDOMAIN}, you would type the following:
659
660 @smallexample
661 @group
662 @b{shell%} @value{ROOTDIR}/sbin/kadmin
663 @b{kadmin:} addprinc -randkey host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}
664 @b{NOTICE: no policy specified for "host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}";
665 assigning "default"
666 Principal "host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}" created.
667 kadmin:} addprinc -randkey host/@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}
668 @b{NOTICE: no policy specified for "host/@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}";
669 assigning "default"
670 Principal "host/@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}" created.}
671 @b{kadmin:} addprinc -randkey host/@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}
672 @b{NOTICE: no policy specified for "host/@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}";
673 assigning "default"
674 Principal "host/@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}" created.
675 kadmin:}
676 @end group
677 @end smallexample
678
679 @noindent
680 It is not actually necessary to have the master KDC server in the
681 Kerberos database, but it can be handy if:
682
683 @itemize @bullet
684 @item
685 anyone will be logging into the machine as something other than root
686
687 @item
688 you want to be able to swap the master KDC with one of the slaves if
689 necessary.
690 @end itemize
691
692 @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
693 @subsubsection Extract Host Keytabs for the KDCs
694
695 Each KDC (including the master) needs a keytab to decrypt tickets.
696 Ideally, you should extract each keytab locally on its own KDC.  If this
697 is not feasible, you should use an encrypted session to send them across
698 the network.  To extract a keytab on a KDC called
699 @value{KDCSERVER}.@value{PRIMARYDOMAIN}, you would execute the following
700 command:
701
702 @smallexample
703 @group
704 @b{kadmin:} ktadd host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}
705 @b{kadmin: Entry for principal host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM} with
706      kvno 1, encryption type DES-CBC-CRC added to keytab
707      WRFILE:/etc/krb5.keytab.
708 kadmin:}
709 @end group
710 @end smallexample
711
712 @noindent
713 Note that the principal must exist in the Kerberos database in order to
714 extract the keytab.
715
716 @node Set Up the Slave KDCs for Database Propagation,  , Extract Host Keytabs for the KDCs, Install the Slave KDCs
717 @subsubsection Set Up the Slave KDCs for Database Propagation
718
719 The database is propagated from the master KDC to the slave KDCs via the
720 @code{kpropd} daemon.  To set up propagation, create a file on each KDC,
721 named @code{@value{ROOTDIR}/var/krb5kdc/kpropd.acl}, containing the
722 principals for each of the KDCs.
723 @need 1200
724 For example, if the master KDC were
725 @code{@value{KDCSERVER}.@value{PRIMARYDOMAIN}}, the slave KDCs were
726 @code{@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}} and
727 @code{@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}}, and the realm were
728 @code{@value{PRIMARYREALM}}, then the file's contents would be:
729
730 @smallexample
731 @group
732 host/@value{KDCSERVER}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}
733 host/@value{KDCSLAVE1}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}
734 host/@value{KDCSLAVE2}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}
735 @end group
736 @end smallexample
737  
738 @need 1000
739 Then, add the following lines to @code{/etc/inetd.conf} file on each KDC
740 (the line beginnng with @result{} is a continuation of the previous
741 line):
742
743 @smallexample
744 @group
745 krb5_prop stream tcp nowait root @value{ROOTDIR}/sbin/kpropd kpropd
746 eklogin   stream tcp nowait root @value{ROOTDIR}/sbin/klogind 
747 @result{} klogind -k -c -e
748 @end group
749 @end smallexample
750
751 @noindent
752 The first line sets up the @code{kpropd} database propagation daemon.
753 The second line sets up the @code{eklogin} daemon, allowing
754 Kerberos-authenticated, encrypted rlogin to the KDC.
755
756 You also need to add the following lines to @code{/etc/services} on each
757 KDC:
758
759 @smallexample
760 @group
761 kerberos        88/udp      kdc       # Kerberos authentication (udp)
762 kerberos        88/tcp      kdc       # Kerberos authentication (tcp)
763 krb5_prop       754/tcp               # Kerberos slave propagation
764 kerberos-adm    749/tcp               # Kerberos 5 admin/changepw (tcp)
765 kerberos-adm    749/udp               # Kerberos 5 admin/changepw (udp)
766 eklogin         2105/tcp              # Kerberos encrypted rlogin
767 @end group
768 @end smallexample
769
770 @node Back on the Master KDC, Finish Installing the Slave KDCs, Install the Slave KDCs, Installing KDCs
771 @subsection Back on the Master KDC
772
773 Now that the slave KDCs are able to accept database propagation, you'll
774 need to propagate the database to each of them.
775
776 @menu
777 * Propagate the Database to Each Slave KDC::  
778 @end menu
779
780 @node Propagate the Database to Each Slave KDC,  , Back on the Master KDC, Back on the Master KDC
781 @subsubsection Propagate the Database to Each Slave KDC
782
783 First, create a dump of the database on the master KDC, as follows:
784
785 @smallexample
786 @group
787 @b{shell%} @value{ROOTDIR}/sbin/kdb5_util dump @value{ROOTDIR}/var/krb5kdc/slave_datatrans
788 @b{shell%}
789 @end group
790 @end smallexample
791
792 Next, you need to manually propagate the database to each slave KDC, as
793 in the following example.  (The lines beginning with @result{} are
794 continuations of the previous line.):
795
796 @smallexample
797 @group
798 @value{ROOTDIR}/sbin/kprop -f @value{ROOTDIR}/var/krb5kdc/slave_datatrans
799 @result{} @value{KDCSLAVE1}.@value{PRIMARYDOMAIN}
800 @value{ROOTDIR}/sbin/kprop -f @value{ROOTDIR}/var/krb5kdc/slave_datatrans
801 @result{} @value{KDCSLAVE2}.@value{PRIMARYDOMAIN}
802 @end group
803 @end smallexample
804
805 You will need a script to dump and propagate the database.  The
806 following is an example of a bourne shell script that will do this.
807 (Note that the line that begins with @result{} is a continuation of the
808 previous line.  Remember that you need to replace @value{ROOTDIR} with
809 the name of the directory in which you installed @value{PRODUCT}.)
810
811 @smallexample
812 @group
813 #!/bin/sh
814
815 kdclist = "@value{KDCSLAVE1}.@value{PRIMARYDOMAIN} @value{KDCSLAVE2}.@value{PRIMARYDOMAIN}"
816
817 @value{ROOTDIR}/sbin/kdb5_util "dump
818 @result{} @value{ROOTDIR}/var/krb5kdc/slave_datatrans"
819
820 for kdc in $kdclist
821 do
822 @value{ROOTDIR}/sbin/kprop -f @value{ROOTDIR}/var/krb5kdc/slave_datatrans $kdc
823 done
824 @end group
825 @end smallexample
826
827 @noindent
828 You will need to set up a cron job to run this script at the intervals
829 you decided on earlier (@xref{Database Propagation}.)
830
831 @node Finish Installing the Slave KDCs, Add Kerberos Principals to the Database, Back on the Master KDC, Installing KDCs
832 @subsection Finish Installing the Slave KDCs
833
834 Now that the slave KDCs have copies of the Kerberos database, you can
835 create stash files for them and start the @code{krb5kdc} daemon.
836
837 @menu
838 * Create Stash Files on the Slave KDCs::  
839 * Start the krb5kdc Daemon on Each KDC::  
840 @end menu
841
842 @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
843 @subsubsection Create Stash Files on the Slave KDCs
844
845 Create stash files, by issuing the following commands on each slave KDC:
846
847 @smallexample
848 @group
849 @b{shell%} kdb5_util stash
850 @b{kdb5_util: Cannot find/read stored master key while reading master key
851 kdb5_util: Warning: proceeding without master key}
852 @iftex
853 @b{Enter KDC database master key:}  @i{@doubleleftarrow{} Enter the database master key.}
854 @end iftex
855 @ifinfo
856 @b{Enter KDC database master key:}  @i{<= Enter the database master key.}
857 @end ifinfo
858 @ifhtml
859 @b{Enter KDC database master key:}  @i{<= Enter the database master key.}
860 @end ifhtml
861 @b{shell%}
862 @end group
863 @end smallexample
864
865 As mentioned above, the stash file is necessary for your KDCs to be able
866 authenticate to themselves, such as when they reboot.  You could run
867 your KDCs without stash files, but you would then need to type in the
868 Kerberos database master key by hand every time you start a KDC daemon.
869
870 @node Start the krb5kdc Daemon on Each KDC,  , Create Stash Files on the Slave KDCs, Finish Installing the Slave KDCs
871 @subsubsection Start the krb5kdc Daemon on Each KDC
872
873 The final step in configuing your slave KDCs is to run the KDC daemon:
874
875 @smallexample
876 @group
877 @b{shell%} @value{ROOTDIR}/sbin/krb5kdc
878 @end group
879 @end smallexample
880
881 As with the master KDC, you will probably want to add this command to
882 the KDCs' @code{/etc/rc} or @code{/etc/inittab} files, so they will
883 start the krb5kdc daemon automatically at boot time.
884
885 @node Add Kerberos Principals to the Database, Limit Access to the KDCs, Finish Installing the Slave KDCs, Installing KDCs
886 @subsection Add Kerberos Principals to the Database
887
888 @need 1800
889 Once your KDCs are set up and running, you are ready to use
890 @code{kadmin} to load principals for your users, hosts, and other
891 services into the Kerberos database.  This procedure is described fully in the
892 ``Adding or Modifying Principals'' section of the @value{PRODUCT} System
893 Administrator's Guide.  (@xref{Create Host Keys for the Slave KDCs}, for a
894 brief description.)  The keytab is generated by running @code{kadmin}
895 and issuing the @code{ktadd} command.
896
897 @node Limit Access to the KDCs, Switching Master and Slave KDCs, Add Kerberos Principals to the Database, Installing KDCs
898 @subsection Limit Access to the KDCs
899
900 To limit the possibility that your Kerberos database could be
901 compromised, @value{COMPANY} recommends that each KDC be a dedicated
902 host, with limited access.  If your KDC is also a file server, FTP
903 server, Web server, or even just a client machine, someone who obtained
904 root access through a security hole in any of those areas could gain
905 access to the Kerberos database.
906
907 @need 4700
908 @value{COMPANY} recommends that your KDCs use the following
909 @code{/etc/inetd.conf} file.  (Note:  each line beginning with @result{}
910 is a continuation of the previous line.):
911
912 @smallexample
913 @group
914 #
915 # Configuration file for inetd(1M).  See inetd.conf(4).
916 #
917 # To re-configure the running inetd process, edit this file, then
918 # send the inetd process a SIGHUP.
919 #
920 # Syntax for socket-based Internet services:
921 #  <service_name> <socket_type> <proto> <flags> <user> 
922 @result{} <server_pathname> <args>
923 #
924 # Syntax for TLI-based Internet services:
925 #
926 #  <service_name> tli <proto> <flags> <user> <server_pathname> <args>
927 #
928 # Ftp and telnet are standard Internet services.
929 #
930 # This machine is a secure Kerberos Key Distribution Center (KDC).  
931 # Services are limited.
932 #
933 #
934 # Time service is used for clock synchronization.
935 #
936 time    stream  tcp     nowait  root    internal
937 time    dgram   udp     wait    root    internal
938 #
939 # Limited Kerberos services
940 #
941 krb5_prop stream tcp nowait root @value{ROOTDIR}/sbin/kpropd  kpropd
942 eklogin   stream tcp nowait root @value{ROOTDIR}/sbin/klogind 
943 @result{} klogind -5 -c -e
944 @end group
945 @end smallexample
946
947 @node Switching Master and Slave KDCs,  , Limit Access to the KDCs, Installing KDCs
948 @subsection Switching Master and Slave KDCs
949
950 You may occasionally want to use one of your slave KDCs as the master.
951 This might happen if you are upgrading the master KDC, or if your master
952 KDC has a disk crash.
953
954 Assuming you have configured all of your KDCs to be able to function as
955 either the master KDC or a slave KDC (as this document recommends), all
956 you need to do to make the changeover is:
957
958 If the master KDC is still running, do the following on the @emph{old}
959 master KDC:
960
961 @enumerate
962 @item
963 Kill the @code{kadmind} process.
964
965 @item
966 Disable the cron job that propagates the database.
967
968 @item
969 Run your database propagation script manually, to ensure that the slaves
970 all have the latest copy of the database.  (@xref{Propagate the Database
971 to Each Slave KDC}.)  If there is a need to preserve per-principal
972 policy information from the database, you should do a ``kdb5_util dump
973 -ov'' in order to preserve that information and propogate that dump file
974 securely by some means to the slave so that its database has the correct
975 state of the per-principal policy information.
976 @end enumerate
977
978 On the @emph{new} master KDC:
979
980 @enumerate
981 @item
982 Create a database keytab.  (@xref{Create a kadmind Keytab (optional)}.)
983
984 @item
985 Start the @code{kadmind} daemon.  (@xref{Start the Kerberos Daemons}.)
986
987 @item
988 Set up the cron job to propagate the database.  (@xref{Propagate the
989 Database to Each Slave KDC}.)
990
991 @item
992 Switch the CNAMEs of the old and new master KDCs.  (If you don't do
993 this, you'll need to change the @code{krb5.conf} file on every client
994 machine in your Kerberos realm.)
995
996 @end enumerate
997
998 @node Installing and Configuring UNIX Client Machines, UNIX Application Servers, Installing KDCs, Installing Kerberos V5
999 @section Installing and Configuring UNIX Client Machines
1000
1001 Client machine installation is much more straightforward than
1002 installation of the KDCs.
1003
1004 @menu
1005 * Client Programs::             
1006 * Client Machine Configuration Files::  
1007 @end menu
1008
1009 @node Client Programs, Client Machine Configuration Files, Installing and Configuring UNIX Client Machines, Installing and Configuring UNIX Client Machines
1010 @subsection Client Programs
1011
1012 The Kerberized client programs are @code{login.krb5}, @code{rlogin},
1013 @code{telnet}, @code{ftp}, @code{rcp}, @code{rsh}, @code{kinit},
1014 @code{klist}, @code{kdestroy}, @code{kpasswd}, @code{ksu}, and
1015 @code{krb524init}.  All of these programs are in the directory
1016 @code{@value{ROOTDIR}/bin}, except for @code{login.krb5} which is in
1017 @code{@value{ROOTDIR}/sbin}.
1018
1019 You will probably want to have your users put @code{@value{ROOTDIR}/bin}
1020 ahead of @code{/bin} and @code{/usr/bin} in their paths, so they will by
1021 default get the @value{PRODUCT} versions of @code{rlogin},
1022 @code{telnet}, @code{ftp}, @code{rcp}, and @code{rsh}.
1023
1024 @value{COMPANY} recommends that you use @code{login.krb5} in place of
1025 @code{/bin/login} to give your users a single-sign-on system.  You will
1026 need to make sure your users know to use their Kerberos passwords when
1027 they log in.
1028
1029 You will also need to educate your users to use the ticket management
1030 programs @code{kinit},
1031 @c @code{krb524init}, 
1032 @code{klist}, @code{kdestroy}, and to use the Kerberos programs
1033 @c @code{pfrom},
1034 @code{ksu}, and @code{kpasswd} in place of their non-Kerberos
1035 counterparts
1036 @c @code{from}
1037 @code{su}, @code{passwd}, and @code{rdist}.
1038
1039 @node Client Machine Configuration Files,  , Client Programs, Installing and Configuring UNIX Client Machines
1040 @subsection Client Machine Configuration Files
1041
1042 Each machine running Kerberos must have a @code{/etc/krb5.conf} file.
1043 (@xref{krb5.conf}.)
1044
1045 @need 4000
1046 Also, for most UNIX systems, you must add the appropriate Kerberos
1047 services to each client machine's @code{/etc/services} file.  If you are
1048 using the default configuration for @value{PRODUCT}, you should be able
1049 to just insert the following code:
1050
1051 @smallexample
1052 @group
1053 #
1054 # Note --- if you are using Kerberos V4 and you either:
1055 #
1056 #    (a) haven't converted all your master or slave KDCs to V5, or
1057 #
1058 #    (b) are worried about inter-realm interoperability with other KDC's
1059 #        that are still using V4 
1060 #
1061 # you will need to switch the "kerberos" service to port 750 and create a
1062 # "kerberos-sec" service on port 88.
1063 #
1064 kerberos      @value{DefaultPort}/udp    kdc    # Kerberos V5 KDC
1065 kerberos      @value{DefaultPort}/tcp    kdc    # Kerberos V5 KDC
1066 klogin        @value{DefaultKloginPort}/tcp          # Kerberos authenticated rlogin
1067 kshell        @value{DefaultKshellPort}/tcp   cmd    # and remote shell
1068 kerberos-adm  @value{DefaultKadmindPort}/tcp          # Kerberos 5 admin/changepw
1069 kerberos-adm  @value{DefaultKadmindPort}/udp          # Kerberos 5 admin/changepw
1070 krb5_prop     @value{DefaultKrbPropPort}/tcp          # Kerberos slave propagation
1071 @c kpop          1109/tcp         # Pop with Kerberos
1072 eklogin       @value{DefaultEkloginPort}/tcp         # Kerberos auth. & encrypted rlogin
1073 krb524        @value{DefaultKrb524Port}/tcp         # Kerberos 5 to 4 ticket translator
1074 @end group
1075 @end smallexample
1076
1077 @noindent As described in the comments in the above code, if your master
1078 KDC or any of your slave KDCs is running Kerberos V4, (or if you will be
1079 authenticating to any Kerberos V4 KDCs in another realm) you will need
1080 to switch the port number for @code{kerberos} to 750 and create a
1081 @code{kerberos-sec} service (tcp and udp) on port 88, so the Kerberos
1082 V4 KDC(s) will continue to work properly.
1083
1084 @menu
1085 * Mac OS X Configuration::      
1086 @end menu
1087
1088 @node Mac OS X Configuration,  , Client Machine Configuration Files, Client Machine Configuration Files
1089 @subsubsection Mac OS X Configuration
1090
1091 To install Kerberos V5 on Mac OS X and Mac OS X Server, follow the 
1092 directions for generic Unix-based OS's, except for the 
1093 @code{/etc/services} updates described above.  
1094
1095 Mac OS X and Mac OS X Server use a database called NetInfo to store
1096 the contents of files normally found in @code{/etc}.  Instead of
1097 modifying @code{/etc/services}, you should run the following commands
1098 to add the Kerberos service entries to NetInfo:
1099
1100 @smallexample
1101 @group
1102 $ niutil -create . /services/kerberos
1103 $ niutil -createprop . /services/kerberos name kerberos kdc
1104 $ niutil -createprop . /services/kerberos port 750
1105 $ niutil -createprop . /services/kerberos protocol tcp udp
1106 $ niutil -create . /services/krbupdate
1107 $ niutil -createprop . /services/krbupdate name krbupdate kreg
1108 $ niutil -createprop . /services/krbupdate port 760
1109 $ niutil -createprop . /services/krbupdate protocol tcp
1110 $ niutil -create . /services/kpasswd
1111 $ niutil -createprop . /services/kpasswd name kpasswd kpwd
1112 $ niutil -createprop . /services/kpasswd port 761
1113 $ niutil -createprop . /services/kpasswd protocol tcp
1114 $ niutil -create . /services/klogin
1115 $ niutil -createprop . /services/klogin port 543
1116 $ niutil -createprop . /services/klogin protocol tcp
1117 $ niutil -create . /services/eklogin
1118 $ niutil -createprop . /services/eklogin port 2105
1119 $ niutil -createprop . /services/eklogin protocol tcp
1120 $ niutil -create . /services/kshell
1121 $ niutil -createprop . /services/kshell name kshell krcmd
1122 $ niutil -createprop . /services/kshell port 544
1123 $ niutil -createprop . /services/kshell protocol tcp
1124 @end group
1125 @end smallexample
1126
1127 In addition to adding services to NetInfo, you must also modify the
1128 resolver configuration in NetInfo so that the machine resolves its own
1129 hostname as a FQDN (fully qualified domain name).  By default, Mac OS X
1130 and Mac OS X Server machines query NetInfo to resolve hostnames before
1131 falling back to DNS.  Because NetInfo has an unqualified name for all
1132 the machines in the NetInfo database, the machine's own hostname will
1133 resolve to an unqualified name.  Kerberos needs a FQDN to look up keys
1134 in the machine's keytab file.
1135
1136 Fortunately, you can change the @code{lookupd} caching order to query
1137 DNS first.  Run the following NetInfo commands and reboot the machine:
1138
1139 @smallexample
1140 @group
1141 $ niutil -create . /locations/lookupd/hosts
1142 $ niutil -createprop . /locations/lookupd/hosts LookupOrder CacheAgent DNSAgent
1143  NIAgent NILAgent
1144 @end group
1145 @end smallexample
1146
1147 Once you have rebooted, you can verify that the resolver now behaves
1148 correctly.  Compile the Kerberos 5 distribution and run:
1149
1150 @smallexample
1151 @group
1152 $ cd .../src/tests/resolve
1153 $ ./resolve
1154 @end group
1155 @end smallexample
1156
1157 This will tell you whether or not your machine returns FQDNs on name
1158 lookups.  If the test still fails, you can also try turning off DNS
1159 caching.  Run the following commands and reboot:
1160
1161 @smallexample
1162 @group
1163 $ niutil -create . /locations/lookupd/hosts
1164 $ niutil -createprop . /locations/lookupd/hosts LookupOrder DNSAgent
1165  CacheAgent NIAgent NILAgent
1166 @end group
1167 @end smallexample
1168
1169 The remainder of the setup of a Mac OS X client machine or application
1170 server should be the same as for other UNIX-based systems.
1171
1172 @node UNIX Application Servers,  , Installing and Configuring UNIX Client Machines, Installing Kerberos V5
1173 @section UNIX Application Servers
1174
1175 An application server is a host that provides one or more services over
1176 the network.  Application servers can be ``secure'' or ``insecure.''  A
1177 ``secure'' host is set up to require authentication from every client
1178 connecting to it.  An ``insecure'' host will still provide Kerberos
1179 authentication, but will also allow unauthenticated clients to connect.
1180
1181 If you have @value{PRODUCT} installed on all of your client machines,
1182 @value{COMPANY} recommends that you make your hosts secure, to take
1183 advantage of the security that Kerberos authentication affords.
1184 However, if you have some clients that do not have @value{PRODUCT}
1185 installed, you can run an insecure server, and still take advantage of
1186 @value{PRODUCT}'s single sign-on capability.
1187
1188 @menu
1189 * Server Programs::             
1190 * Server Configuration Files::  
1191 * The Keytab File::             
1192 * Some Advice about Secure Hosts::  
1193 @end menu
1194
1195 @node Server Programs, Server Configuration Files, UNIX Application Servers, UNIX Application Servers
1196 @subsection Server Programs
1197
1198 Just as @value{PRODUCT} provided its own Kerberos-enhanced versions of
1199 client UNIX network programs, @value{PRODUCT} also provides
1200 Kerberos-enhanced versions of server UNIX network daemons.  These are
1201 @code{ftpd}, @code{klogind}, @code{kshd}, and @code{telnetd}.
1202 @c @code{popper}, 
1203 These programs are installed in the directory
1204 @code{@value{ROOTDIR}/sbin}.  You may want to add this directory to
1205 root's path.
1206
1207 @node Server Configuration Files, The Keytab File, Server Programs, UNIX Application Servers
1208 @subsection Server Configuration Files
1209
1210 For a @emph{secure} server, make the following changes to
1211 @code{/etc/inetd.conf}:
1212
1213 Find and comment out any lines for the services @code{ftp},
1214 @code{telnet}, @code{shell}, @code{login}, and @code{exec}.
1215
1216 @need 1800
1217 Add the following lines.  (Note:  each line beginning with @result{} is
1218 a continuation of the previous line.)
1219
1220 @smallexample
1221 @group
1222 klogin  stream  tcp  nowait  root  @value{ROOTDIR}/sbin/klogind
1223 @result{} klogind -k -c
1224 eklogin stream  tcp  nowait  root  @value{ROOTDIR}/sbin/klogind
1225 @result{} klogind -k -c -e
1226 kshell  stream  tcp  nowait  root  @value{ROOTDIR}/sbin/kshd
1227 @result{} kshd -k -c -A
1228 ftp     stream  tcp  nowait  root  @value{ROOTDIR}/sbin/ftpd
1229 @result{} ftpd -a
1230 telnet  stream  tcp  nowait  root  @value{ROOTDIR}/sbin/telnetd
1231 @result{} telnetd -a valid
1232 @end group
1233 @end smallexample
1234
1235 For an @emph{insecure} server, make the following changes instead to
1236 @code{/etc/inetd.conf}:
1237
1238 @need 1800
1239 Find and comment out any lines for the services @code{ftp} and
1240 @code{telnet}.
1241
1242 Add the following lines.  (Note:  each line beginning with @result{} is
1243 a continuation of the previous line.)
1244 @smallexample
1245 @group
1246 klogin  stream  tcp  nowait  root  @value{ROOTDIR}/sbin/klogind
1247 @result{} klogind -k -c
1248 eklogin stream  tcp  nowait  root  @value{ROOTDIR}/sbin/klogind
1249 @result{} klogind -k -c -e
1250 kshell  stream  tcp  nowait  root  @value{ROOTDIR}/sbin/kshd
1251 @result{} kshd -k -c -A
1252 ftp     stream  tcp  nowait  root  @value{ROOTDIR}/sbin/ftpd
1253 @result{} ftpd
1254 telnet  stream  tcp  nowait  root  @value{ROOTDIR}/sbin/telnetd
1255 @result{} telnetd -a none
1256 @end group
1257 @end smallexample
1258
1259 @node The Keytab File, Some Advice about Secure Hosts, Server Configuration Files, UNIX Application Servers
1260 @subsection The Keytab File
1261
1262 All Kerberos server machines need a @dfn{keytab} file, called
1263 @code{/etc/krb5.keytab}, to authenticate to the KDC.  The keytab file is
1264 an encrypted, local, on-disk copy of the host's key.  The keytab file,
1265 like the stash file (@ref{Create the Database}) is a potential
1266 point-of-entry for a break-in, and if compromised, would allow
1267 unrestricted access to its host.  The keytab file should be readable
1268 only by root, and should exist only on the machine's local disk.  The
1269 file should not be part of any backup of the machine, unless access to
1270 the backup data is secured as tightly as access to the machine's root
1271 password itself.
1272
1273 In order to generate a keytab for a host, the host must have a principal
1274 in the Kerberos database.  The procedure for adding hosts to the
1275 database is described fully in the ``Adding or Modifying Principals''
1276 section of the @cite{@value{PRODUCT} System Administrator's Guide}.
1277 @xref{Create Host Keys for the Slave KDCs}. for a brief description.)
1278 The keytab is generated by running @code{kadmin} and issuing the
1279 @code{ktadd} command.
1280
1281 @need 1100
1282 For example, to generate a keytab file to allow the host
1283 trillium.@value{PRIMARYDOMAIN} to authenticate for the services
1284 @code{host}, @code{ftp}, and @code{pop}, the administrator
1285 @code{@value{ADMINUSER}} would issue the command (on
1286 trillium.@value{PRIMARYDOMAIN}):
1287
1288 @smallexample
1289 @group
1290 @b{trillium%} @value{ROOTDIR}/sbin/kadmin
1291 @b{kadmin5:} ktadd host/trillium.@value{PRIMARYDOMAIN} ftp/trillium.@value{PRIMARYDOMAIN}
1292 @result{} pop/trillium.@value{PRIMARYDOMAIN}
1293 @b{kadmin: Entry for principal host/trillium.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM} with
1294 kvno 3, encryption type DES-CBC-CRC added to keytab
1295 WRFILE:/etc/krb5.keytab.
1296 kadmin: Entry for principal ftp/trillium.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM} with
1297 kvno 3, encryption type DES-CBC-CRC added to keytab
1298 WRFILE:/etc/krb5.keytab.
1299 kadmin: Entry for principal pop/trillium.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM} with
1300 kvno 3, encryption type DES-CBC-CRC added to keytab
1301 WRFILE:/etc/krb5.keytab.
1302 kadmin5:} quit
1303 @b{trillium%}
1304 @end group
1305 @end smallexample
1306
1307 If you generate the keytab file on another host, you need to get a copy
1308 of the keytab file onto the destination host (@code{trillium}, in the
1309 above example) without sending it unencrypted over the network.  If you
1310 have installed the @value{PRODUCT} client programs, you can use
1311 encrypted @code{rcp}.
1312
1313 @node Some Advice about Secure Hosts,  , The Keytab File, UNIX Application Servers
1314 @subsection Some Advice about Secure Hosts
1315
1316 @value{PRODUCT} can protect your host from certain types of break-ins,
1317 but it is possible to install @value{PRODUCT} and still leave your host
1318 vulnerable to attack.  Obviously an installation guide is not the place
1319 to try to include an exhaustive list of countermeasures for every
1320 possible attack, but it is worth noting some of the larger holes and how
1321 to close them.
1322
1323 As stated earlier in this section, @value{COMPANY} recommends that on a
1324 secure host, you disable the standard @code{ftp}, @code{login},
1325 @code{telnet}, @code{shell}, and @code{exec} services in
1326 @code{/etc/inetd.conf}.  We also recommend that secure hosts have an empty
1327 @code{/etc/hosts.equiv} file and that there not be a @code{.rhosts} file
1328 in @code{root}'s home directory.  You can grant Kerberos-authenticated
1329 root access to specific Kerberos principals by placing those principals
1330 in the file @code{.k5login} in root's home directory.
1331
1332 We recommend that backups of secure machines exclude the keytab file
1333 (@code{/etc/krb5.keytab}).  If this is not possible, the backups should
1334 at least be done locally, rather than over a network, and the backup
1335 tapes should be physically secured.
1336
1337 Finally, the keytab file and any programs run by root, including the
1338 @value{PRODUCT} binaries, should be kept on local disk.  The keytab file
1339 should be readable only by root.
1340
1341 @node Upgrading Existing Kerberos V5 Installations, Bug Reports for Kerberos V5, Installing Kerberos V5, Top
1342 @chapter Upgrading Existing @value{PRODUCT} Installations
1343
1344 If you already have an existing Kerberos database that you created with
1345 a prior release of Kerberos 5, you can upgrade it to work with the
1346 current release with the @code{kdb5_util} command.  It is only
1347 necessary to perform this dump/undump procedure if you were running a
1348 krb5-1.0.x KDC and are migrating to a krb5-1.1.x or newer KDC or if you
1349 were running a krb5-1.1.x KDC and are migrating to a krb5-1.2.x or newer
1350 KDC.  The process for upgrading a Master KDC involves the following
1351 steps:
1352
1353 @enumerate
1354
1355 @item Stop your current KDC and administration
1356 server processes, if any.
1357
1358 @item Dump your existing Kerberos database to an ASCII file with 
1359 @code{kdb5_util}'s ``dump'' command:
1360
1361 @smallexample
1362 @group
1363 @b{shell%} cd @value{ROOTDIR}/var/krb5kdc
1364 @b{shell%} kdb5_util dump old-kdb-dump
1365 @b{shell%} kdb5_util dump -ov old-kdb-dump.ov
1366 @b{shell%}
1367 @end group
1368 @end smallexample
1369
1370 @item Create a new Master KDC installation (@xref{Install the Master
1371 KDC}.).  If you have a stash file for your current database, choose any
1372 new master password but then copy your existing stash file to the
1373 location specified by your kdc.conf; if you do not have a stash file for
1374 your current database, you must choose the same master password.
1375
1376 @item Load your old Kerberos database into the new system with
1377 @code{kdb5_util}'s ``load'' command:
1378
1379 @smallexample
1380 @group
1381 @b{shell%} cd @value{ROOTDIR}/var/krb5kdc
1382 @b{shell%} kdb5_util load old-kdb-dump
1383 @b{shell%} kdb5_util load -update old-kdb-dump.ov
1384 @b{shell%}
1385 @end group
1386 @end smallexample
1387
1388 @end enumerate
1389
1390 The ``dump -ov'' and ``load -update'' commands are necessary in order to
1391 preserve per-principal policy information, since the default dump format
1392 filters out that information.  If you omit those steps, the loaded
1393 database database will lose the policy information for each principal
1394 that has a policy.
1395
1396 To update a Slave KDC, you must stop the old server processes on the
1397 Slave KDC, install the new server binaries, reload the most recent slave
1398 dump file, and re-start the server processes.
1399
1400 @menu
1401 * Upgrading to Triple-DES and RC4 Encryption Keys::  
1402 @end menu
1403
1404 @node Upgrading to Triple-DES and RC4 Encryption Keys,  , Upgrading Existing Kerberos V5 Installations, Upgrading Existing Kerberos V5 Installations
1405 @section Upgrading to Triple-DES Encryption Keys
1406
1407 Beginning with the 1.2 release from @value{COMPANY}, Kerberos includes
1408 a stronger encryption algorithm called ``triple DES'' -- essentially,
1409 three applications of the basic DES encryption algorithm, greatly
1410 increasing the resistance to a brute-force search for the key by an
1411 attacker.  This algorithm is more secure, but encryption is much
1412 slower.
1413
1414 Release 1.1 had some support for triple-DES service keys, but with
1415 release 1.2 we have added support for user keys and session keys as
1416 well.  Release 1.0 had very little support for multiple cryptosystems,
1417 and some of that software may not function properly in an environment
1418 using triple-DES as well as plain DES.
1419
1420 In the 1.3 release from @value{COMPANY}, Kerberos also includes the RC4
1421 encryption alogorithm, a stream cipher symmetric key algorithm
1422 developed in 1987 by Ronald Rivest at RSA Data Security.  Please note
1423 that RC4 is not part of the IETF standard.
1424
1425 Because of the way the MIT Kerberos database is structured, the KDC
1426 will assume that a service supports only those encryption types for
1427 which keys are found in the database.  Thus, if a service has only a
1428 single-DES key in the database, the KDC will not issue tickets for that
1429 service that use triple-DES or RC4 session keys; it will instead issue
1430 only single-DES session keys, even if other services are already
1431 capable of using triple-DES or RC4.  So if you make sure your
1432 application server software is updated before adding a triple-DES or
1433 RC4 key for the service, clients should be able to talk to services at
1434 all times during the updating process.
1435
1436 Normally, the listed @code{supported_enctypes} in @code{kdc.conf} are
1437 all used when a new key is generated.  You can control this with
1438 command-line flags to @code{kadmin} and @code{kadmin.local}.  You may
1439 want to exclude triple-DES and RC4 by default until you have updated a
1440 lot of your application servers, and then change the default to include
1441 triple-DES and RC4.  We recommend that you always include
1442 @code{des-cbc-crc} in the default list.
1443
1444 @node Bug Reports for Kerberos V5,  , Upgrading Existing Kerberos V5 Installations, Top
1445 @chapter Bug Reports for @value{PRODUCT}
1446
1447 @include send-pr.texinfo
1448
1449 @contents
1450 @bye