Remove an outdated parenthetical comment about master_kdc; we actually
[krb5.git] / doc / admin.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-admin.info
7 @settitle Kerberos V5 System Administrator's 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 @paragraphindent 0
13 @iftex
14 @parskip 6pt plus 6pt
15 @end iftex
16
17 @dircategory Kerberos
18 @direntry
19 * krb5-admin: (krb5-admin).             Kerberos V5 Administrator's Guide
20 @end direntry
21
22 @include definitions.texinfo
23 @set EDITION 1.0
24 @set UPDATED June 14, 2007
25
26 @finalout                               @c don't print black warning boxes
27
28 @titlepage
29 @title @value{PRODUCT} System Administrator's 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 @comment  node-name,  next,  previous,  up
41 @node Top, Copyright, (dir), (dir)
42
43 @ifinfo
44 This document describes how to administrate a @value{PRODUCT}
45 installation.
46 @end ifinfo
47
48 @c The master menu is updated using emacs19's M-x texinfo-all-menus-update
49 @c function.  Don't forget to run M-x texinfo-every-node-update after
50 @c you add a new section or subsection, or after you've rearranged the
51 @c order of sections or subsections.  Also, don't forget to add an @node
52 @c comand before each @section or @subsection!  All you need to enter
53 @c is:
54 @c
55 @c @node New Section Name
56 @c @section New Section Name
57 @c
58 @c M-x texinfo-every-node-update will take care of calculating the
59 @c node's forward and back pointers.
60 @c
61 @c ---------------------------------------------------------------------
62
63 @menu
64 * Copyright::                   
65 * Introduction::                
66 * How Kerberos Works::          
67 * Configuration Files::         
68 * Using DNS::                   
69 * Administrating the Kerberos Database::  
70 * Configuring Kerberos with OpenLDAP back-end::  
71 * Application Servers::         
72 * Backups of Secure Hosts::     
73 * Bug Reporting::               
74 * Appendix::                    
75 @end menu
76
77 @node Copyright, Introduction, Top, Top
78 @unnumbered Copyright
79 @include copyright.texinfo
80
81
82 @node Introduction, How Kerberos Works, Copyright, Top
83 @chapter Introduction
84
85 @menu
86 * Why Should I use Kerberos?::  
87 * Documentation for Kerberos V5::  
88 * Overview of This Guide::      
89 @end menu
90
91 @node Why Should I use Kerberos?, Documentation for Kerberos V5, Introduction, Introduction
92 @section Why Should I use Kerberos?
93
94 Since Kerberos negotiates authenticated, and optionally encrypted,
95 communications between two points anywhere on the internet, it provides
96 a layer of security that is not dependent on which side of a firewall
97 either client is on.  Since studies have shown that half of the computer
98 security breaches in industry happen from @i{inside} firewalls,
99 @value{PRODUCT} from @value{COMPANY} will play a vital role in the
100 security of your network.
101
102 @node Documentation for Kerberos V5, Overview of This Guide, Why Should I use Kerberos?, Introduction
103 @section Documentation for @value{PRODUCT}
104
105 @include document-list.texinfo
106
107 @node Overview of This Guide,  , Documentation for Kerberos V5, Introduction
108 @section Overview of This Guide
109
110 The next chapter describes how Kerberos works.
111
112 Chapter three describes administration of the principals in the Kerberos
113 database.
114
115 Chapter four describes how you can use DNS in configuring your Kerberos realm.
116
117 Chapter five describes administrative programs for manipulating the
118 Kerberos database as a whole.
119
120 Chapter six describes OpenLDAP Configuration steps.
121
122 Chapter seven describes issues to consider when adding an application
123 server to the database.
124
125 Chapter eight describes our problem reporting system.
126
127 The appendices include the list of Kerberos error messages, and a
128 complete list of the time zones understood by @code{kadmin}.
129
130 @node How Kerberos Works, Configuration Files, Introduction, Top
131 @chapter How Kerberos Works
132
133 This section provides a simplified description of a general user's
134 interaction with the Kerberos system.  This interaction happens
135 transparently---users don't need to know and probably don't care about
136 what's going on---but Kerberos administrators might find a schematic
137 description of the process useful.  This description glosses over a lot
138 of details; for more information, see @i{Kerberos: An Authentication
139 Service for Open Network Systems}, a paper presented at Winter USENIX
140 1988, in Dallas, Texas.  This paper can be retreived by FTP from
141 @code{athena-dist.mit.edu}, in the location:
142 @code{/pub/ATHENA/kerberos/doc/usenix.PS}.
143
144 @menu
145 * Network Services and Their Client Programs::  
146 * Kerberos Tickets::            
147 * The Kerberos Database::       
148 * Kerberos Realms::             
149 * The Ticket-Granting Ticket::  
150 * Network Services and the Master Database::  
151 * The User/Kerberos Interaction::  
152 * Definitions::                 
153 @end menu
154
155 @node Network Services and Their Client Programs, Kerberos Tickets, How Kerberos Works, How Kerberos Works
156 @section Network Services and Their Client Programs
157
158 In an environment that provides network services, you use @dfn{client}
159 programs to request @dfn{services} from @dfn{server} programs that are
160 somewhere on the network.  Suppose you have logged in to a workstation
161 and you want to @samp{rlogin} to a typical UNIX host.  You use the local
162 @samp{rlogin} client program to contact the remote machine's
163 @samp{rlogind} daemon.
164
165 @node Kerberos Tickets, The Kerberos Database, Network Services and Their Client Programs, How Kerberos Works
166 @section Kerberos Tickets
167
168 Under Kerberos, the @samp{klogind} daemon allows you to login to a
169 remote machine if you can provide @samp{klogind} a Kerberos ticket
170 which proves your identity.  In addition to the ticket, you must also
171 have possession of the corresponding ticket session key. The
172 combination of a ticket and the ticket's session key is known as a credential.
173
174 Typically, a client program automatically obtains credentials
175 identifying the person using the client program.  The credentials are
176 obtained from a Kerberos server that resides somewhere on the network.
177 A Kerberos server maintains a database of user, server, and password
178 information.
179
180 @node The Kerberos Database, Kerberos Realms, Kerberos Tickets, How Kerberos Works
181 @section The Kerberos Database
182
183 Kerberos will give you credentials only if you have an entry in the
184 Kerberos server's @dfn{Kerberos database}.  Your database entry includes
185 your Kerberos @dfn{principal} (an identifying string, which is often
186 just your username), and your Kerberos password.  Every Kerberos user
187 must have an entry in this database.
188
189 @node Kerberos Realms, The Ticket-Granting Ticket, The Kerberos Database, How Kerberos Works
190 @section Kerberos Realms
191
192 Each administrative domain will have its own Kerberos database, which
193 contains information about the users and services for that particular
194 site or administrative domain.  This administrative domain is the
195 @dfn{Kerberos realm}.
196
197 Each Kerberos realm will have at least one Kerberos server, where the
198 master Kerberos database for that site or administrative domain is
199 stored.  A Kerberos realm may also have one or more @dfn{slave servers},
200 which have read-only copies of the Kerberos database that are
201 periodically propagated from the master server.  For more details on how
202 this is done, see the ``Set Up the Slave KDCs for Database Propagation''
203 and ``Propagate the Database to Each Slave KDC'' sections of the
204 @value{PRODUCT} Installation Guide.
205
206 @node The Ticket-Granting Ticket, Network Services and the Master Database, Kerberos Realms, How Kerberos Works
207 @section The Ticket-Granting Ticket
208
209 The @samp{kinit} command prompts for your password.  If you enter it
210 successfully, you will obtain a @dfn{ticket-granting ticket} and a
211 @dfn{ticket session key} which gives you the right to use the ticket.
212 This combination of the ticket and its associated key is known as your
213 @dfn{credentials}.  As illustrated below, client programs use your
214 ticket-granting ticket credentials in order to obtain client-specific
215 credentials as needed.
216
217 Your credentials are stored in a @dfn{credentials cache}, which is often
218 just a file in @code{/tmp}.  The credentials cache is also called the
219 @dfn{ticket file}, especially in Kerberos V4 documentation.  Note,
220 however, that a credentials cache does not have to be stored in a file.
221
222 @node Network Services and the Master Database, The User/Kerberos Interaction, The Ticket-Granting Ticket, How Kerberos Works
223 @section Network Services and the Master Database
224
225 The master database also contains entries for all network services that
226 require Kerberos authentication.  Suppose that your site has a machine,
227 @samp{laughter.@value{PRIMARYDOMAIN}}, that requires Kerberos
228 authentication from anyone who wants to @samp{rlogin} to it.  The host's
229 Kerberos realm is @samp{@value{PRIMARYREALM}}.
230
231 This service must be registered in the Kerberos database, using the
232 proper service name, which in this case is the @dfn{principal}:
233
234 @smallexample
235 host/laughter.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}
236 @end smallexample
237
238 @noindent
239 The @samp{/} character separates the Kerberos @dfn{primary} (in this
240 case, @samp{host}) from the @dfn{instance} (in this case,
241 @samp{laughter.@value{PRIMARYDOMAIN}}); the @samp{@@} character separates
242 the realm name (in this case, @samp{@value{PRIMARYREALM}}) from the rest
243 of the principal.  The primary, @samp{host}, denotes the name or type of
244 the service that is being offered:  generic host-level access to the
245 machine.  The instance, @samp{laughter.@value{PRIMARYDOMAIN}}, names the
246 specific machine that is offering this service.  There will generally be
247 many different machines, each offering one particular type of service,
248 and the instance serves to give each one of these servers a different
249 Kerberos principal.
250
251 @menu
252 * The Keytab File::             
253 @end menu
254
255 @node The Keytab File,  , Network Services and the Master Database, Network Services and the Master Database
256 @subsection The Keytab File
257
258 For each service, there must also be a @dfn{service key} known only by
259 Kerberos and the service.  On the Kerberos server, the service key is
260 stored in the Kerberos database.
261
262 On the server host, these service keys are stored in @dfn{key tables},
263 which are files known as @dfn{keytabs}.@footnote{Keytabs were called
264 @dfn{srvtabs} in Kerberos V4.}  For example, the service keys used by
265 services that run as root are usually stored in the keytab file
266 @code{/etc/krb5.keytab}.  @b{N.B.:} This service key is the equivalent
267 of the service's password, and must be kept secure.  Data which is meant
268 to be read only by the service is encrypted using this key.
269
270 @node The User/Kerberos Interaction, Definitions, Network Services and the Master Database, How Kerberos Works
271 @section The User/Kerberos Interaction
272
273 Suppose that you walk up to a host intending to login to it, and then
274 @samp{rlogin} to the machine @samp{laughter}.  Here's what happens:
275
276 @enumerate
277 @item
278 You login to the workstation and use the @samp{kinit} command to get a
279 ticket-granting ticket.  This command prompts you for your Kerberos
280 password.  (On systems running the @value{PRODUCT} @samp{login} program,
281 this may be done as part of the login process, not requiring the user to
282 run a separate program.)
283
284 @enumerate A
285 @item
286 The @samp{kinit} command sends your request to the Kerberos master
287 server machine.  The server software looks for your principal name's
288 entry in the Kerberos database.
289
290 @item
291 If this entry exists, the Kerberos server creates and returns a
292 ticket-granting ticket and the key which allows you to use it, encrypted
293 by your password.  If @samp{kinit} can decrypt the Kerberos reply using
294 the password you provide, it stores this ticket in a credentials cache
295 on your local machine for later use.  The name of the credentials cache
296 can be specified in the @samp{KRB5CCNAME} environment variable.  If this
297 variable is not set, the name of the file will be
298 @file{/tmp/krb5cc_<uid>}, where <uid> is your UNIX user-id, represented
299 in decimal format.
300 @end enumerate
301
302 @need 1500
303 @item
304 Now you use the @samp{rlogin} client to access the machine
305 @samp{laughter}.
306
307 @example
308 host% @b{rlogin laughter}
309 @end example
310
311 @enumerate A
312 @item
313 The @samp{rlogin} client checks your ticket file to see if you have a
314 ticket for the @samp{host} service for @samp{laughter}.  You don't, so
315 @samp{rlogin} uses the credential cache's ticket-granting ticket to make
316 a request to the master server's ticket-granting service.
317
318 @item
319 This ticket-granting service receives the request for a ticket for
320 @samp{host/laughter.@value{PRIMARYDOMAIN}}, and looks in the master
321 database for an entry for @samp{host/laughter.@value{PRIMARYDOMAIN}}.
322 If the entry exists, the ticket-granting service issues you a ticket for
323 that service.  That ticket is also cached in your credentials cache.
324
325 @item
326 The @samp{rlogin} client now sends that ticket to the @samp{laughter}
327 @samp{klogind} service program.  The service program checks the ticket
328 by using its own service key.  If the ticket is valid, it now knows your
329 identity.  If you are allowed to login to @samp{laughter} (because your
330 username matches one in /etc/passwd, or your Kerberos principal is in
331 the appropriate @file{.k5login} file), @code{klogind} will let you
332 login.
333 @end enumerate
334 @end enumerate
335
336 @node Definitions,  , The User/Kerberos Interaction, How Kerberos Works
337 @section Definitions
338
339 Following are definitions of some of the Kerberos terminology.
340
341 @include glossary.texinfo
342
343 @node Configuration Files, Using DNS, How Kerberos Works, Top
344 @chapter Configuration Files
345
346 @menu
347 * Supported Encryption Types::  
348 * Salts::                       
349 * krb5.conf::                   
350 * kdc.conf::                    
351 @end menu
352
353 @node Supported Encryption Types, Salts, Configuration Files, Configuration Files
354 @section Supported Encryption Types
355
356 Any tag in the configuration files which requires a list of encryption
357 types can be set to some combination of the following strings.
358 Encryption types marked as ``weak'' are available for compatibility
359 but not recommended for use.
360
361 @include support-enc.texinfo
362
363 The string DEFAULT can be used to refer to the default set of types for
364 the variable in question.  Types or families can be removed from the
365 current list by prefixing them with a minus sign (``-'').  Types or
366 families can be prefixed with a plus sign (``+'') for symmetry; it has
367 the same meaning as just listing the type or family.  For example,
368 ``DEFAULT -des'' would be the default set of encryption types with DES
369 types removed, and ``des3 DEFAULT'' would be the default set of
370 encryption types with triple DES types moved to the front.
371
372 While aes128-cts and aes256-cts are supported for all Kerberos
373 operations, they are not supported by older versions of our GSSAPI
374 implementation (krb5-1.3.1 and earlier).
375
376 By default, AES is enabled in this release.  Sites wishing to use AES
377 encryption types on their KDCs need to be careful not to give GSSAPI
378 services AES keys if the servers have not been updated.  If older
379 GSSAPI services are given AES keys, then services may fail when
380 clients supporting AES for GSSAPI are used.  Sites may wish to use AES
381 for user keys and for the ticket granting ticket key, although doing
382 so requires specifying what encryption types are used as each
383 principal is created.
384
385 If all GSSAPI-based services have been updated before or with the KDC,
386 this is not an issue.
387
388 @node Salts, krb5.conf, Supported Encryption Types, Configuration Files
389 @section Salts
390
391 Your Kerberos key is derived from your password.  To ensure that people
392 who happen to pick the same password do not have the same key, Kerberos
393 5 incorporates more information into the key using something called a
394 salt.  The supported values for salts are as follows.
395
396 @include salts.texinfo
397
398 @node krb5.conf, kdc.conf, Salts, Configuration Files
399 @section krb5.conf
400
401 @include krb5conf.texinfo
402
403 @menu
404 * libdefaults::                 
405 * appdefaults::                 
406 * login::                       
407 * realms (krb5.conf)::          
408 * domain_realm::                
409 * logging::                     
410 * capaths::                     
411 * dbdefaults::                  
412 * dbmodules::                   
413 * pkinit client options::
414 * Sample krb5.conf File::       
415 @end menu
416
417 @node libdefaults, appdefaults, krb5.conf, krb5.conf
418 @subsection [libdefaults]
419
420 The @code{libdefaults} section may contain any of the following
421 relations:
422
423 @table @b
424 @itemx default_keytab_name
425 This relation specifies the default keytab name to be used by
426 application servers such as telnetd and rlogind.  The default is
427 @value{DefaultDefaultKeytabName}.
428
429 @itemx default_realm
430 Identifies the default Kerberos realm for the client.  Set its value to
431 your Kerberos realm.  If this is not specified and the TXT record
432 lookup is enabled (see @ref{Using DNS}), then that information will be
433 used to determine the default realm.  If this tag is not set in this
434 configuration file and there is no DNS information found, then an error
435 will be returned.
436
437 @itemx default_tgs_enctypes
438 Identifies the supported list of session key encryption types that
439 should be returned by the KDC.  The list may be delimited with commas
440 or whitespace.  Kerberos supports many different encryption types, and
441 support for more is planned in the future. (see @ref{Supported Encryption
442 Types} for a list of the accepted values for this tag).  The default
443 value is @value{DefaultDefaultTgsEnctypes}.
444
445 @itemx default_tkt_enctypes
446 Identifies the supported list of session key encryption types that
447 should be requested by the client.  The format is the same as for
448 @emph{default_tgs_enctypes}.  The default value for this tag is
449 @value{DefaultDefaultTktEnctypes}.
450
451 @itemx permitted_enctypes 
452 Identifies all encryption types that are permitted for use in session
453 key encryption.  The default value for this tag is
454 @value{DefaultPermittedEnctypes}.
455
456 @itemx allow_weak_crypto
457 If this is set to 0 (for false), then weak encryption types will be
458 filtered out of the previous three lists (as noted in @ref{Supported
459 Encryption Types}).  The default value for this tag is true, but that
460 default may change in the future.
461
462 @itemx clockskew
463 Sets the maximum allowable amount of clockskew in seconds that the
464 library  will tolerate before assuming that a Kerberos message is
465 invalid.  The default value is @value{DefaultClockskew}.
466
467 @itemx kdc_timesync
468 If this is set to 1 (for true), then client machines will compute the
469 difference between their time and the time returned by the KDC in the
470 timestamps in the tickets and use this value to correct for an
471 inaccurate system clock.  This corrective factor is only used by the
472 Kerberos library.  The default is @value{DefaultKDCTimesync}.
473
474 @itemx kdc_req_checksum_type
475
476 @itemx ap_req_checksum_type
477
478 @itemx safe_checksum_type
479 An integer which specifies the type of checksum to use.  Used for
480 compatability with DCE security servers which do not support the
481 default @value{DefaultChecksumType} used by this version of Kerberos.
482 The
483 kdc_req_checksum_type is only used for DES keys.   The ap_req_checksum_type defaults to the preferred checksum for the encryption type being used if unset.  If set, then the selected checksum is used regardless of the type of key being used.  The possible values and their meanings are as follows.
484
485 @comment taken from krb5/src/include/krb5.h[in]
486 @table @b
487 @item 1
488 CRC32
489 @item 2
490 RSA MD4
491 @item 3
492 RSA MD4 DES
493 @item 4
494 DES CBC
495 @item 7
496 RSA MD5
497 @item 8
498 RSA MD5 DES
499 @item 9
500 NIST SHA
501 @item 12
502 HMAC SHA1 DES3
503 @item -138
504 Microsoft MD5 HMAC checksum type
505 @end table
506
507 @comment see lib/krb5/ccache/fcc.h
508 @itemx ccache_type
509 Use this parameter on systems which are DCE clients, to specify the
510 type of cache to be created by kinit, or when forwarded tickets are
511 received.  DCE and Kerberos can share the cache, but some versions of
512 DCE do not support the default cache as created by this version of
513 Kerberos.  Use a value of 1 on DCE 1.0.3a systems, and a value of 2 on
514 DCE 1.1 systems.  The default value is @value{DefaultCcacheType}.
515
516 @ignore
517 @itemx tkt_lifetime
518 The default lifetime of a ticket.  The default is
519 @value{DefaultTktLifetime}.  This is currently not supported by the
520 code.
521 @end ignore
522
523 @itemx dns_lookup_kdc
524 Indicate whether DNS SRV records should be used to locate the KDCs and
525 other servers for a realm, if they are not listed in the information for
526 the realm.  (Note that the @samp{admin_server} entry must be in the
527 file, because the DNS implementation for it is incomplete.)
528
529 Enabling this option does open up a type of denial-of-service attack, if
530 someone spoofs the DNS records and redirects you to another server.
531 However, it's no worse than a denial of service, because that fake KDC
532 will be unable to decode anything you send it (besides the initial
533 ticket request, which has no encrypted data), and anything the fake KDC
534 sends will not be trusted without verification using some secret that it
535 won't know.
536
537 If this option is not specified but @samp{dns_fallback} is, that value
538 will be used instead.  If neither option is specified, the behavior
539 depends on configure-time options; if none were given, the default is to
540 enable this option.  If the DNS support is not compiled in, this entry
541 has no effect.
542
543 @itemx dns_lookup_realm
544 Indicate whether DNS TXT records should be used to determine the
545 Kerberos realm of a host.
546
547 Enabling this option may permit a redirection attack, where spoofed DNS
548 replies persuade a client to authenticate to the wrong realm, when
549 talking to the wrong host (either by spoofing yet more DNS records or by
550 intercepting the net traffic).  Depending on how the client software
551 manages hostnames, however, it could already be vulnerable to such
552 attacks.  We are looking at possible ways to minimize or eliminate this
553 exposure.  For now, we encourage more adventurous sites to try using
554 Secure DNS.
555
556 If this option is not specified but @samp{dns_fallback} is, that value
557 will be used instead.  If neither option is specified, the behavior
558 depends on configure-time options; if none were given, the default is to
559 disable this option.  If the DNS support is not compiled in, this entry
560 has no effect.
561
562 @itemx dns_fallback
563 General flag controlling the use of DNS for Kerberos information.  If
564 both of the preceding options are specified, this option has no effect.
565
566 @itemx extra_addresses
567 This allows a computer to use multiple local addresses, in order to
568 allow Kerberos to work in a network that uses NATs.  The addresses
569 should be in a comma-separated list.
570
571 @itemx udp_preference_limit
572 When sending a message to the KDC, the library will try using TCP before
573 UDP if the size of the message is above @code{udp_preference_list}.
574 If the message is smaller than @code{udp_preference_list}, then UDP
575 will be tried before TCP.  Regardless of the size, both protocols will
576 be tried if the first attempt fails.
577
578 @itemx verify_ap_req_nofail
579 If this flag is set, then an attempt to get initial credentials will
580 fail if the client machine does not have a keytab.  The default for the
581 flag is @value{DefaultVerifyApReqNofail}.
582
583 @itemx renew_lifetime
584 The value of this tag is the default renewable lifetime for
585 initial tickets.  The default value for the tag is
586 @value{DefaultRenewLifetime}.
587
588 @itemx noaddresses
589 Setting this flag causes the initial Kerberos ticket to be addressless.
590 The default for the flag is @value{DefaultNoaddresses}.
591
592 @itemx forwardable
593 If this flag is set, initial tickets by default will be forwardable.
594 The default value for this flag is @value{DefaultForwardable}.
595
596 @itemx proxiable
597 If this flag is set, initial tickets by default will be proxiable.
598 The default value for this flag is @value{DefaultProxiable}.
599
600 @end table
601
602
603
604 @node appdefaults, login, libdefaults, krb5.conf
605 @subsection [appdefaults]
606
607 Each tag in the [appdefaults] section names a Kerberos V5 application
608 or an option that is used by some Kerberos V5 application[s].  The
609 value of the tag defines the default behaviors for that application.
610
611 For example:
612
613 @smallexample
614 @group
615 [appdefaults]
616     telnet = @{
617         @value{PRIMARYREALM} = @{
618              option1 = false
619         @}
620     @}
621     telnet = @{
622         option1 = true
623         option2 = true
624     @}
625     @value{PRIMARYREALM} = @{
626         option2 = false
627     @}
628     option2 = true
629
630 @end group
631 @end smallexample
632
633 The above four ways of specifying the value of an option are shown
634 in order of decreasing precedence.   In this example, if telnet is
635 running in the realm @value{SECONDREALM}, it should, by default, have
636 option1 and option2 set to true.  However, a telnet program in the realm
637 @value{PRIMARYREALM} should have option1 set to false and option2 set
638 to true.  Any other programs in @value{PRIMARYREALM} should have option2
639 set to false by default.  Any programs running in other realms should
640 have option2 set to true.
641
642 The list of specifiable options for each application may be found in
643 that application's man pages.  The application defaults specified here
644 are overridden by those specified in the [realms] section.
645
646
647 @node login, realms (krb5.conf), appdefaults, krb5.conf
648 @subsection [login]
649
650 Each tag in the [login] section of the file is an option for
651 login.krb5.  This section may contain any of the following relations:
652
653 @table @b
654 @itemx krb5_get_tickets
655 Indicate whether or not to use a user's password to get V5 tickets.
656 The default value is @value{DefaultKrb5GetTickets}.
657
658 @itemx krb_run_aklog
659 Indicate whether or not to run aklog.  The default value is
660 @value{DefaultKrbRunAklog}.
661
662 @itemx aklog_path
663 Indicate where to find aklog.  The default value is
664 @value{DefaultAklogPath}.
665
666 @itemx accept_passwd
667 A true value will cause login not to accept plaintext passwords.  The
668 default value is @value{DefaultAcceptPasswd}.  This is not yet
669 implemented.
670 @end table
671
672 @node realms (krb5.conf), domain_realm, login, krb5.conf
673 @subsection [realms]
674
675 Each tag in the [realms] section of the file is the name of a Kerberos
676 realm.  The value of the tag is a subsection with relations that define
677 the properties of that particular realm.  For each realm, the following
678 tags may be specified in the realm's subsection:
679
680 @table @b
681 @itemx kdc
682 The name of a host running a KDC for that realm.  An optional port
683 number (separated from the hostname by a colon) may be included.  For
684 your computer to be able to communicate with the KDC for each realm,
685 this tag must be given a value in each realm subsection in the
686 configuration file, or there must be DNS SRV records specifying the
687 KDCs (see @ref{Using DNS}).
688
689 @itemx master_kdc
690 Identifies the master KDC(s).  Currently, this tag is used in only one
691 case: If an attempt to get credentials fails because of an invalid
692 password, the client software will attempt to contact the master KDC,
693 in case the user's password has just been changed, and the updated
694 database has not been propagated to the slave servers yet.
695
696 @itemx database_module
697
698 This relation indicates the name of the configuration section under [dbmodules] for database specific parameters used by the loadable database library.
699
700
701 @itemx admin_server
702 Identifies the host where the administration server is running.
703 Typically, this is the master Kerberos server.  This tag must be given
704 a value in order to communicate with the kadmin server for the realm.
705
706 @ignore
707 this doesn't seem to be used in the code
708 @itemx application defaults
709 Application defaults that are specific to a particular realm may be
710 specified within that realm's tag.  Realm-specific application defaults
711 override the global defaults specified in the [appdefaults] section.
712 @end ignore
713
714 @itemx default_domain
715 This tag is used for Kerberos 4 compatibility.  Kerberos 4 does not
716 require the entire hostname of a server to be in its principal like
717 Kerberos 5 does.  This tag provides the domain name needed to produce a
718 full hostname when translating V4 principal names into V5 principal
719 names.  All servers in this realm are assumed to be in the domain given
720 as the value of this tag
721
722 @itemx v4_instance_convert
723 This subsection allows the administrator to configure exceptions to the
724 default_domain mapping rule.  It contains V4 instances (the tag name)
725 which should be translated to some specific hostname (the tag value) as
726 the second component in a Kerberos V5 principal name.
727
728 @itemx v4_realm
729 This relation is used by the krb524 library routines when converting a
730 V5 principal name to a V4 principal name.  It is used when the V4 realm
731 name and the V5 realm name are not the same, but still share the same
732 principal names and passwords.  The tag value is the Kerberos V4 realm
733 name.
734
735 @itemx auth_to_local_names
736 This subsection allows you to set explicit mappings from principal
737 names to local user names.  The tag is the mapping name, and the value
738 is the corresponding local user name.
739
740 @itemx auth_to_local
741 This tag allows you to set a general rule for mapping principal names
742 to local user names.  It will be used if there is not an explicit
743 mapping for the principal name that is being translated.  The possible
744 values are:
745
746 @table @b
747
748 @item DB:@i{filename}
749 The principal will be looked up in the database @i{filename}.  Support
750 for this is not currently compiled in by default.
751
752 @item RULE:@i{exp}
753 The local name will be formulated from @i{exp}.
754
755 The format for @i{exp} is
756 @code{[@i{n}:$@i{d}..@i{string}](@i{regexp})s/@i{pattern}/@i{replacement}/g}.
757 The integer @i{n} indicates how many components the target principal
758 should have.  If this matches, then a string will be formed by putting
759 together the components of the principal in the order indicated by each
760 integer @i{d}, and the arbitrary string @i{string} (i.e. if the
761 principal was @value{RANDOMUSER}/admin then [2:$2$1foo] would result in
762 the string "admin@value{RANDOMUSER}foo".  If this string matches
763 @i{regexp}, then the @code{s//[g]} substitution command will be run over the
764 string.  The optional g will cause the substitution to be global over
765 the string, instead of replacing only the first match in the string.
766
767 @item DEFAULT
768 The principal name will be used as the local user name.  If the
769 principal has more than one component or is not in the default realm,
770 this rule is not applicable and the conversion will fail.
771
772 @end table
773
774 For example:
775
776 @smallexample
777 @group
778 [realms]
779     @value{PRIMARYREALM} = @{
780         auth_to_local = @{
781             RULE:[2:$1](@value{RANDOMUSER})s/^.*$/guest/
782             RULE:[2:$1;$2](^.*;admin$)s/;admin$//
783             RULE:[2:$2](^.*;root)s/^.*$/root/
784             DEFAULT
785             @}
786         @}
787 @end group
788 @end smallexample
789
790 would result in any principal without @code{root} or @code{admin} as
791 the second component to be translated with the default rule.  A
792 principal with a second component of @code{admin} will become its first
793 component.  @code{root} will be used as the local name for any
794 principal with a second component of @code{root}.  The exception to
795 these two rules are any principals @value{RANDOMUSER}/*, which will
796 always get the local name @code{guest}.
797
798 @end table
799
800 @node domain_realm, logging, realms (krb5.conf), krb5.conf
801 @subsection [domain_realm]
802
803 The [domain_realm] section provides a translation from a domain name or
804 hostname to a Kerberos realm name.  The tag name can be a host name, or
805 a domain name, where domain names are indicated by a prefix of a period
806 (@samp{.}).  The value of the relation is the Kerberos realm name for
807 that particular host or domain.  Host names and domain names should be
808 in lower case.
809
810 If no translation entry applies, the host's realm is considered to be
811 the hostname's domain portion converted to upper case.  For example, the
812 following [domain_realm] section:
813
814 @smallexample
815 @group
816 [domain_realm]
817 @ifset MIT
818     .mit.edu = ATHENA.MIT.EDU
819 @end ifset
820     @value{PRIMARYDOMAIN} = @value{PRIMARYREALM}
821     crash.@value{PRIMARYDOMAIN} = TEST.@value{PRIMARYREALM}
822     @value{SECONDDOMAIN} = @value{SECONDREALM}
823 @end group
824 @end smallexample
825
826 @noindent
827 maps crash.@value{PRIMARYDOMAIN} into the TEST.@value{PRIMARYREALM}
828 realm.  All other hosts in the @value{PRIMARYDOMAIN} domain will map by
829 default to the @value{PRIMARYREALM} realm, and all hosts in the
830 @value{SECONDDOMAIN} domain will map by default into the
831 @value{SECONDREALM} realm.  Note the entries for the hosts
832 @value{PRIMARYDOMAIN} and @value{SECONDDOMAIN}.  Without these entries,
833 @ifset CYGNUS
834 these hosts would be mapped into the Kerberos realms @samp{COM} and
835 @end ifset
836 @ifclear CYGNUS
837 these hosts would be mapped into the Kerberos realms @samp{EDU} and
838 @end ifclear
839 @samp{ORG}, respectively.
840
841 @node logging, capaths, domain_realm, krb5.conf
842 @subsection [logging]
843 The [logging] section indicates how a particular entity is to perform
844 its logging.  The relations in this section assign one or more values to
845 the entity name.  Currently, the following entities are used:
846
847 @table @b
848
849 @itemx kdc
850 These entries specify how the KDC is to perform its logging.
851
852 @itemx admin_server
853 These entries specify how the administrative server
854 is to perform its logging.
855
856 @itemx default
857 These entries specify how to perform logging in the
858 absence of explicit specifications otherwise.
859 @end table
860
861 Values are of the following forms:
862
863 @table @b
864 @itemx FILE=<filename>
865
866 @itemx FILE:<filename> 
867 This value causes the entity's logging messages to go to the specified
868 file.  If the @samp{=} form is used, the file is overwritten.  If the
869 @samp{:} form is used, the file is appended to.
870
871 @itemx STDERR
872 This value causes the entity's logging messages to go to its standard
873 error stream.
874
875 @itemx CONSOLE
876 This value causes the entity's logging messages to go to the console, if
877 the system supports it.
878
879 @itemx DEVICE=<devicename>
880 This causes the entity's logging messages to go to the specified device.
881
882 @itemx SYSLOG[:<severity>[:<facility>]]
883 This causes the entity's logging messages to go to the system log.
884
885 The @dfn{severity} argument specifies the default severity of system log
886 messages.  This may be any of the following severities supported by the
887 @code{syslog(3)} call, minus the LOG_ prefix:  LOG_EMERG, LOG_ALERT,
888 LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, and LOG_DEBUG.
889 For example, a value of @samp{CRIT} would specify LOG_CRIT severity.
890
891 The facility argument specifies the facility under which the messages
892 are logged.  This may be any of the following facilities supported by
893 the syslog(3) call minus the LOG_ prefix:  LOG_KERN, LOG_USER, LOG_MAIL,
894 LOG_DAEMON, LOG_AUTH, LOG_LPR, LOG_NEWS, LOG_UUCP, LOG_CRON, and
895 LOG_LOCAL0 through LOG_LOCAL7.
896
897 If no severity is specified, the default is ERR.  If no facility is
898 specified, the default is AUTH.
899 @end table
900
901 In the following example, the logging messages from the KDC will go to
902 the console and to the system log under the facility LOG_DAEMON with
903 default severity of LOG_INFO; and the logging messages from the
904 administrative server will be appended to the file /var/adm/kadmin.log
905 and sent to the device /dev/tty04.
906
907 @smallexample
908 @group
909 [logging]
910     kdc = CONSOLE
911     kdc = SYSLOG:INFO:DAEMON
912     admin_server = FILE:/var/adm/kadmin.log
913     admin_server = DEVICE=/dev/tty04
914 @end group
915 @end smallexample
916
917 @node capaths, dbdefaults, logging, krb5.conf
918 @subsection [capaths]
919
920 In order to perform direct (non-hierarchical) cross-realm
921 authentication, a database is needed to construct the authentication
922 paths between the realms.  This section defines that database.
923
924 A client will use this section to find the authentication path between
925 its realm and the realm of the server.  The server will use this section
926 to verify the authentication path used by the client, by checking the
927 transited field of the received ticket.
928
929 There is a tag for each participating realm, and each tag has subtags
930 for each of the realms.  The value of the subtags is an intermediate
931 realm which may participate in the cross-realm authentication.  The
932 subtags may be repeated if there is more then one intermediate realm.  A
933 value of "."  means that the two realms share keys directly, and no
934 intermediate realms should be allowed to participate.
935
936 There are n**2 possible entries in this table, but only those entries
937 which will be needed on the client or the server need to be present.
938 The client needs a tag for its local realm, with subtags for all the
939 realms of servers it will need to authenticate with.  A server needs a
940 tag for each realm of the clients it will serve.
941
942 For example, ANL.GOV, PNL.GOV, and NERSC.GOV all wish to use the ES.NET
943 realm as an intermediate realm.  ANL has a sub realm of TEST.ANL.GOV
944 which will authenticate with NERSC.GOV but not PNL.GOV.  The [capaths]
945 section for ANL.GOV systems would look like this:
946
947 @smallexample
948 @group
949 [capaths]
950     ANL.GOV = @{
951         TEST.ANL.GOV = .
952         PNL.GOV = ES.NET
953         NERSC.GOV = ES.NET
954         ES.NET = .
955     @}
956     TEST.ANL.GOV = @{
957         ANL.GOV = .
958     @}
959     PNL.GOV = @{
960         ANL.GOV = ES.NET
961     @}
962     NERSC.GOV = @{
963         ANL.GOV = ES.NET
964     @}
965     ES.NET = @{
966         ANL.GOV = .
967     @}
968 @end group
969 @end smallexample
970
971 The [capaths] section of the configuration file used on NERSC.GOV systems
972 would look like this:
973
974 @smallexample
975 @group
976 [capaths]
977     NERSC.GOV = @{
978         ANL.GOV = ES.NET
979         TEST.ANL.GOV = ES.NET
980         TEST.ANL.GOV = ANL.GOV
981         PNL.GOV = ES.NET
982         ES.NET = .
983     @}
984     ANL.GOV = @{
985         NERSC.GOV = ES.NET
986     @}
987     PNL.GOV = @{
988         NERSC.GOV = ES.NET
989     @}
990     ES.NET = @{
991         NERSC.GOV = .
992     @}
993     TEST.ANL.GOV = @{
994         NERSC.GOV = ANL.GOV
995         NERSC.GOV = ES.NET
996     @}
997 @end group
998 @end smallexample
999
1000 In the above examples, the ordering is not important, except when the
1001 same subtag name is used more then once.  The client will use this to
1002 determine the path.  (It is not important to the server, since the
1003 transited field is not sorted.)
1004
1005 This feature is not currently supported by DCE.  DCE security servers
1006 can be used with Kerberized clients and servers, but versions prior to
1007 DCE 1.1 did not fill in the transited field, and should be used with
1008 caution.
1009
1010 @node dbdefaults, dbmodules, capaths, krb5.conf
1011 @subsection [dbdefaults]
1012
1013 The [dbdefaults] section provides default values for the database specific parameters. It can also specify the configuration section under [dbmodules] section for database specific parameters used by the database library.(@pxref{dbmodules}). 
1014
1015 The following tags are used in this section:
1016
1017 @table @b
1018 @itemx database_module
1019 This relation indicates the name of the configuration section under the [dbmodules] for database specific parameters used by the loadable database library. 
1020
1021 @itemx ldap_kerberos_container_dn 
1022 This LDAP specific tag indicates the DN of the container object where the realm objects will be located. This value is used if the container object is not mentioned in the configuration section under [dbmodules].
1023
1024 @itemx ldap_kdc_dn
1025 This LDAP specific tag indicates the default bind DN for the KDC server. The KDC server does a login to the directory as this object. This object should have the rights to read the Kerberos data in the LDAP database. This value is used if the bind DN for the KDC is not mentioned in the configuration section under [dbmodules].
1026
1027 @itemx ldap_kadmind_dn
1028 This LDAP specific tag indicates the default bind DN for the Administration server. The administration server does a login to the directory as this object. This object should have the rights to read and write the Kerberos data in the LDAP database. This value is used if the bind DN for the Administration server is not mentioned in the configuration section under [dbmodules].
1029
1030 @itemx ldap_service_password_file
1031
1032 This LDAP specific tag indicates the file containing the stashed passwords (created by @code{kdb5_ldap_util stashsrvpw}) for the objects used by the Kerberos servers to bind to the LDAP server. This file must be kept secure. This value is used if no service password file is mentioned in the configuration section under [dbmodules].
1033
1034 @itemx ldap_server
1035
1036 This LDAP specific tag indicates the list of LDAP servers that the Kerberos servers can connect to. The list of LDAP servers is whitespace-separated. The LDAP server is specified by a LDAP URI. This value is used if no LDAP servers are mentioned in the configuration section under [dbmodules]. It is recommended to use the ldapi:// or ldaps:// interface and not to use ldap:// interface.
1037
1038 @itemx ldap_conns_per_server
1039 This LDAP specific tag indicates the number of connections to be maintained per LDAP server. This value is used if the number of connections per LDAP server are not mentioned in the configuration section under [dbmodules]. The default value is 5.
1040 @end table
1041
1042 @node dbmodules, pkinit client options, dbdefaults, krb5.conf
1043 @subsection [dbmodules]
1044
1045 Contains database specific parameters used by the database library. Each tag in the [dbmodules] section of the file names a configuration section for database specific parameters that can be referred to by a realm. The value of the tag is a subsection where the relations in that subsection define the database specific parameters.
1046
1047 For each section, the following tags may be specified in the subsection:
1048
1049 @table @b
1050 @itemx db_library
1051 This tag indicates the name of the loadable database library. The value should be @samp{db2} for DB2 database and @samp{kldap} for LDAP database.
1052
1053 @itemx ldap_kerberos_container_dn 
1054 This LDAP specific tag indicates the DN of the container object where the realm objects will be located.
1055
1056 @itemx ldap_kdc_dn
1057 This LDAP specific tag indicates the default bind DN for the KDC server. The KDC server does a login to the directory as this object. This object should have the rights to read the Kerberos data in the LDAP database.
1058
1059 @itemx ldap_kadmind_dn
1060 This LDAP specific tag indicates the default bind DN for the Administration server. The administration server does a login to the directory as this object. This object should have the rights to read and write the Kerberos data in the LDAP database.
1061
1062 @itemx ldap_service_password_file
1063 This LDAP specific tag indicates the file containing the stashed passwords (created by @code{kdb5_ldap_util stashsrvpw}) for the objects used by the Kerberos servers to bind to the LDAP server. This file must be kept secure.
1064
1065 @itemx ldap_server
1066 This LDAP specific tag indicates the list of LDAP servers that the Kerberos servers can connect to. The list of LDAP servers is whitespace-separated. The LDAP server is specified by a LDAP URI. It is recommended to use ldapi:// or ldaps:// interface to connect to the LDAP server.
1067
1068 @itemx ldap_conns_per_server
1069 This LDAP specific tags indicates the number of connections to be maintained per LDAP server. 
1070
1071 @end table
1072
1073 @node pkinit client options, Sample krb5.conf File, dbmodules, krb5.conf
1074 @subsection pkinit options
1075
1076 @menu
1077 * pkinit identity syntax::
1078 * pkinit krb5.conf options::
1079 @end menu
1080
1081 The following are @b{pkinit-specific} options.
1082 Note that these values may be specified in @code{[libdefaults]}
1083 as global defaults,
1084 or within a realm-specific subsection of @code{[libdefaults]},
1085 or may be specified as realm-specific values in the
1086 @code{[realms]} section.
1087 Also note that a realm-specific value over-rides, does not add to,
1088 a generic @code{[libdefaults]} specification.
1089 The search order is:
1090 @enumerate
1091 @item realm-specific subsection of @code{[libdefaults]}
1092 @smallexample
1093 @group
1094 [libdefaults]
1095     EXAMPLE.COM = @{
1096         pkinit_anchors = FILE:/usr/local/example.com.crt
1097     @}
1098 @end group
1099 @end smallexample
1100
1101 @item realm-specific value in the @code{[realms]} section,
1102 @smallexample
1103 @group
1104 [realms]
1105     OTHERREALM.ORG = @{
1106         pkinit_anchors = FILE:/usr/local/otherrealm.org.crt
1107     @}
1108 @end group
1109 @end smallexample
1110
1111 @item generic value in the @code{[libdefaults]} section.
1112 @smallexample
1113 @group
1114 [libdefaults]
1115     pkinit_anchors = DIR:/usr/local/generic_trusted_cas/
1116
1117 @end group
1118 @end smallexample
1119 @end enumerate
1120
1121 @node pkinit identity syntax, pkinit krb5.conf options, pkinit client options, pkinit client options
1122 @subsubsection Specifying pkinit identity information
1123
1124 The syntax for specifying Public Key identity, trust, and revocation
1125 information for pkinit is as follows: 
1126 @table @b
1127
1128 @item FILE:@i{file-name}[,@i{key-file-name}]
1129 This option has context-specific behavior.
1130 @table @b
1131 @item pkinit_identity
1132 @itemx pkinit_identities
1133 @i{file-name} specifies the name of a PEM-format file
1134 containing the user's certificate.  If @i{key-file-name} is
1135 not specified, the user's private key is expected to be
1136 in @i{file-name} as well.  Otherwise, @i{key-file-name}
1137 is the name of the file containing the private key.
1138 @item pkinit_anchors
1139 @itemx pkinit_pool
1140 @i{file-name} is assumed to be the name of an OpenSSL-style
1141 ca-bundle file.
1142 @end table
1143
1144 @item DIR:@i{directory-name}
1145 This option has context-specific behavior.
1146 @table @b
1147 @item pkinit_identity
1148 @itemx pkinit_identities
1149 @i{directory-name} specifies a directory with files named
1150 @code{*.crt} and @code{*.key}, where the first part of the
1151 file name is the same for matching pairs of certificate and
1152 private key files.  When a file with a name ending with @code{.crt}
1153 is found, a matching file ending with @code{.key} is assumed
1154 to contain the private key.  If no such file is found, then
1155 the certificate in the @code{.crt} is not used. 
1156 @item pkinit_anchors
1157 @itemx pkinit_pool
1158 @i{directory-name} is assumed to be an OpenSSL-style hashed CA directory
1159 where each CA cert is stored in a file named @i{hash-of-ca-cert}.@i{#}.
1160 This infrastructure is encouraged, but all files in the directory
1161 will be examined and if they contain certificates (in PEM format),
1162 they will be used.
1163 @item pkinit_revoke
1164 @i{directory-name} is assumed to be an OpenSSL-style hashed CA directory
1165 where each revocation list is stored in a file named @i{hash-of-ca-cert}.@b{r}@i{#}.
1166 This infrastructure is encouraged, but all files in the directory
1167 will be examined and if they contain a revocation list (in PEM format),
1168 they will be used.
1169 @end table
1170
1171 @item PKCS12:@i{pkcs12-file-name}
1172 @i{pkcs12-file-name} is the name of a @code{PKCS #12} format file, containing
1173 the user's certificate and private key.
1174
1175 @item PKCS11:[@b{module_name=}]@i{module-name}[@b{:slotid=}@i{slot-id}][@b{:token=}@i{token-label}][@b{:certid=}@i{cert-id}][@b{:certlabel=}@i{cert-label}]
1176 All keyword/values are optional.
1177 @i{module-name} specifies the location of a library implementing
1178 @code{PKCS #11}.  If a value is encountered with no keyword, it
1179 is assumed to be the @i{module-name}.  If no @i{module-name} is
1180 specified, the default is @code{opensc-pkcs11.so}. 
1181 @b{slotid=} and/or @b{token=} may be specified to force the use of a
1182 particular smard card reader or token if there is more than one
1183 available.
1184 @b{certid=} and/or @b{certlabel=} may be specified to force the selection
1185 of a particular certificate on the device.  See the @code{pkinit_cert_match}
1186 configuration option for more ways to select a particular certificate to
1187 use for pkinit.
1188
1189 @item ENV:@i{environment-variable-name}
1190 @i{environment-variable-name} specifies the name of an environment
1191 variable which has been set to a value conforming to one of the
1192 previous values.  For example, @code{ENV:X509_PROXY}, where environment
1193 variable @code{X509_PROXY} has been set to @code{FILE:/tmp/my_proxy.pem}.
1194 @end table
1195
1196 @node pkinit krb5.conf options,  , pkinit identity syntax, pkinit client options
1197 @subsubsection pkinit krb5.conf options
1198 @table @b
1199
1200 @item pkinit_identities
1201 Specifies the location(s) to be used to find the user's X.509 identity
1202 information.  This option may be specified multiple times.
1203 Each value is attempted in order until identity information is found
1204 and authentication is attempted.  Note that these values are @b{not}
1205 used if the user specifies @b{X509_user_identity} on the command line.
1206
1207 @item pkinit_anchors
1208 Specifies the location of trusted anchor (root) certificates which
1209 the client trusts to sign KDC certificates.  This option may be
1210 specified multiple times.  These values from the config file are
1211 @b{not} used if the user specifies @b{X509_anchors} on the command line.
1212
1213 @item pkinit_pool
1214 Specifies the location of intermediate certificates which may be
1215 used by the client to complete the trust chain between a KDC
1216 certificate and a trusted anchor.  This option may be specified
1217 multiple times.
1218
1219 @item pkinit_revoke
1220 Specifies the location of Certificate Revocation List (CRL) information
1221 to be used by the client when verifying the validity of the KDC
1222 certificate presented.  This option may be specified multiple times.
1223
1224 @item pkinit_require_crl_checking
1225 The default certificate verification process will always check
1226 the available revocation information to see if a certificate has
1227 been revoked.  If a match is found for the certificate in a CRL,
1228 verification fails.  If the certificate being verified is not listed
1229 in a CRL, or there is no CRL present for its issuing CA,
1230 and @code{pkinit_require_crl_checking} is @code{false},
1231 then verification succeeds.
1232
1233 However, if @code{pkinit_require_crl_checking} is @code{true} and
1234 there is no CRL information available for the issuing CA,
1235 then verification fails.
1236
1237 @code{pkinit_require_crl_checking} should be set to @code{true}
1238 if the policy is such that up-to-date CRLs @b{must} be present for
1239 every CA.
1240
1241 @item pkinit_dh_min_bits
1242 Specifies the size of the Diffie-Hellman key the client will
1243 attempt to use.  The acceptable values are currently 1024, 2048,
1244 and 4096.  The default is 2048.
1245
1246 @item pkinit_win2k
1247 This flag specifies whether the target realm is assumed
1248 to support only the @i{old}, pre-RFC version of the protocol.
1249 The default is false.
1250
1251 @item pkinit_win2k_require_binding
1252 If this flag is set to true, it expects that the target
1253 KDC is patched to return a reply with a checksum rather than a
1254 nonce.  The default is false.
1255
1256 @item pkinit_eku_checking
1257 This option specifies what Extended Key Usage value the KDC certificate
1258 presented to the client must contain.
1259 (@b{Note} that if the KDC certificate has the pkinit
1260 SubjectAlternativeName encoded as the Kerberos TGS name, EKU checking
1261 is not necessary since the issuing CA has certified this as a KDC
1262 certificate.)
1263 The values recognized in the @code{krb5.conf} file are:
1264 @table @b
1265 @item kpKDC
1266 This is the default value and specifies that the KDC must have the
1267 id-pkinit-KPKdc EKU as defined in RFC4556.
1268 @item kpServerAuth
1269 If @code{kpServerAuth} is specified, a KDC certificate with the
1270 id-kp-serverAuth EKU as used by Microsoft will be accepted.
1271 @item none
1272 If @code{none} is specified, then the KDC certificate will not be
1273 checked to verify it has an acceptable EKU.  The use of this option
1274 is @b{not recommended}.
1275 @end table
1276
1277 @item pkinit_kdc_hostname
1278 The presense of this option indicates that the client is willing to
1279 accept a KDC certificate with a dNSName SAN (Subject Alternative Name)
1280 rather than requiring the id-pkinit-san as defined in RFC4556.  This
1281 option may be specified multiple times.  Its value should contain
1282 the acceptable hostname for the KDC (as contained in its certificate).
1283
1284 @item pkinit_cert_match
1285 Specifies matching rules that the client certificate must match before
1286 it is used to attempt pkinit authentication.  If a user has multiple
1287 certificates available (on a smart card, or via other media), there
1288 must be exactly one certificate chosen before attempting pkinit
1289 authentication.  This option may be specified multiple times.  All the
1290 available certificates are checked against each rule in order until
1291 there is a match of exactly one certificate.
1292
1293 The Subject and Issuer comparison strings are the RFC2253 string
1294 representations from the certificate Subject DN and Issuer DN values.
1295
1296 The syntax of the matching rules is:
1297 @example
1298 [@i{relation-operator}]@i{component-rule} @code{...}
1299 @end example
1300 where
1301 @table @i
1302 @item relation-operator
1303 can be either @code{&&}, meaning all component rules must match,
1304 or @code{||}, meaning only one component rule must match.
1305 The default is @code{&&} if not specified.
1306
1307 @item component-rule
1308 can be one of the following.  Note that there is no punctuation
1309 or whitespace between component rules.
1310 @table @b
1311 @item @code{<SUBJECT>}@i{regular-expression}
1312 @item @code{<ISSUER>}@i{regular-expression}
1313 @item @code{<SAN>}@i{regular-expression}
1314 @item @code{<EKU>}@i{extended-key-usage-list}
1315 where @i{extended-key-usage-list} is a comma-separated list of
1316 required Extended Key Usage values.  All values in the list must
1317 be present in the certificate.
1318 @smallexample
1319 @group
1320 @code{pkinit}
1321 @code{msScLogin}
1322 @code{clientAuth}
1323 @code{emailProtection}
1324 @end group
1325 @end smallexample
1326 @item @code{<KU>}@i{key-usage-list}
1327 where @i{key-usage-list} is a comma-separated list of required
1328 Key Usage values.  All values in the list must be present in
1329 the certificate.
1330 @smallexample
1331 @group
1332 @code{digitalSignature}
1333 @code{keyEncipherment}
1334 @end group
1335 @end smallexample
1336 @end table
1337 @end table
1338 Examples:
1339 @example
1340 pkinit_cert_match = ||<SUBJECT>.*DoE.*<SAN>.*@@EXAMPLE.COM
1341 pkinit_cert_match = &&<EKU>msScLogin,clientAuth<ISSUER>.*DoE.*
1342 pkinit_cert_match = <EKU>msScLogin,clientAuth<KU>digitalSignature
1343 @end example
1344 @end table
1345
1346 @node Sample krb5.conf File,  , pkinit client options, krb5.conf
1347 @subsection Sample krb5.conf File
1348
1349 Here is an example of a generic @code{krb5.conf} file:
1350
1351 @smallexample
1352 @group
1353 [libdefaults]
1354     default_realm = @value{PRIMARYREALM}
1355     default_tkt_enctypes = des3-hmac-sha1 des-cbc-crc
1356     default_tgs_enctypes = des3-hmac-sha1 des-cbc-crc
1357     dns_lookup_kdc = true
1358     dns_lookup_realm = false
1359
1360 [realms]
1361     @value{PRIMARYREALM} = @{
1362         kdc = @value{KDCSERVER}.@value{PRIMARYDOMAIN}
1363         kdc = @value{KDCSLAVE1}.@value{PRIMARYDOMAIN}
1364         kdc = @value{KDCSLAVE2}.@value{PRIMARYDOMAIN}:750
1365         admin_server = @value{KDCSERVER}.@value{PRIMARYDOMAIN}
1366         master_kdc = @value{KDCSERVER}.@value{PRIMARYDOMAIN}
1367         default_domain = @value{PRIMARYDOMAIN}
1368     @}
1369     @value{SECONDREALM} = @{
1370         kdc = @value{KDCSERVER}.@value{SECONDDOMAIN}
1371         kdc = @value{KDCSLAVE1}.@value{SECONDDOMAIN}
1372         admin_server = @value{KDCSERVER}.@value{SECONDDOMAIN}
1373     @}
1374     OPENLDAP.MIT.EDU = @{
1375         kdc = @value{KDCSERVER}.@value{PRIMARYDOMAIN}
1376         admin_server = @value{KDCSERVER}.@value{PRIMARYDOMAIN}
1377         database_module = openldap_ldapconf
1378     @}
1379
1380 [domain_realm]
1381 @ifset MIT
1382     .mit.edu = ATHENA.MIT.EDU
1383 @end ifset
1384     @value{PRIMARYDOMAIN} = @value{PRIMARYREALM}
1385
1386 [capaths]
1387     @value{PRIMARYREALM} = @{
1388         @value{SECONDREALM} = .
1389     @}
1390     @value{SECONDREALM} = @{
1391         @value{PRIMARYREALM} = .
1392     @}
1393
1394 [logging]
1395     kdc = SYSLOG:INFO
1396     admin_server = FILE=/var/kadm5.log
1397 [dbdefaults]
1398     ldap_kerberos_container_dn = cn=krbcontainer,dc=example,dc=com
1399 [dbmodules]
1400     openldap_ldapconf = @{
1401         db_library = kldap
1402         ldap_kerberos_container_dn = cn=krbcontainer,dc=example,dc=com
1403         ldap_kdc_dn = "cn=krbadmin,dc=example,dc=com"
1404             # this object needs to have read rights on
1405             # the realm container and principal subtrees
1406         ldap_kadmind_dn = "cn=krbadmin,dc=example,dc=com"
1407             # this object needs to have read and write rights on
1408             # the realm container and principal subtrees
1409         ldap_service_password_file = /etc/kerberos/service.keyfile
1410         ldap_servers = ldaps://kerberos.mit.edu
1411         ldap_conns_per_server = 5
1412 @}
1413
1414
1415
1416 @end group
1417 @end smallexample
1418
1419 @iftex
1420 @vfill
1421 @end iftex
1422
1423 @node kdc.conf,  , krb5.conf, Configuration Files
1424 @section kdc.conf
1425
1426 @include kdcconf.texinfo
1427
1428 @menu
1429 * kdcdefaults::                 
1430 * realms (kdc.conf)::           
1431 * pkinit kdc options::
1432 * Sample kdc.conf File::        
1433 @end menu
1434
1435 @node kdcdefaults, realms (kdc.conf), kdc.conf, kdc.conf
1436 @subsection [kdcdefaults]
1437
1438 The following relation is defined in the [kdcdefaults] section:
1439
1440 @table @b
1441 @itemx kdc_ports
1442 This relation lists the ports on which the Kerberos server should
1443 listen for UDP requests by default.  This list is a comma separated
1444 list of integers.
1445 If this relation is not specified, the compiled-in default is
1446 @value{DefaultKdcPorts}, the first being the assigned Kerberos port
1447 and the second which was used by Kerberos V4.
1448
1449 @itemx kdc_tcp_ports
1450 This relation lists the ports on which the Kerberos server should
1451 listen for TCP connections by default.  This list is a comma separated
1452 list of integers.
1453 If this relation is not specified, the compiled-in default is not to
1454 listen for TCP connections at all.
1455
1456 If you wish to change this (which we do not recommend, because the
1457 current implementation has little protection against denial-of-service
1458 attacks), the standard port number assigned for Kerberos TCP traffic
1459 is port 88.
1460 -@end table
1461
1462 @node realms (kdc.conf), pkinit kdc options, kdcdefaults, kdc.conf
1463 @subsection [realms]
1464
1465 Each tag in the [realms] section of the file names a Kerberos realm.
1466 The value of the tag is a subsection where the relations in that
1467 subsection define KDC parameters for that particular realm.
1468
1469 For each realm, the following tags may be specified in the [realms]
1470 subsection:
1471
1472 @table @b
1473 @itemx acl_file
1474 (String.)  Location of the access control list (acl) file that kadmin
1475 uses to determine which principals are allowed which permissions on the
1476 database.  The default is @code{@value{DefaultAclFile}}.
1477
1478 @itemx admin_keytab
1479 (String.)  Location of the keytab file that the legacy administration
1480 daemons @code{kadmind4} and @code{v5passwdd} use to authenticate to
1481 the database.  The default is @code{@value{DefaultAdminKeytab}}.
1482
1483 @itemx database_name
1484 (String.)  Location of the Kerberos database for this realm.  The
1485 default is @* @code{@value{DefaultDatabaseName}}.
1486
1487 @itemx default_principal_expiration
1488 (Absolute time string.)  Specifies the default expiration date of
1489 principals created in this realm.  The default value for this tag is
1490 @value{DefaultDefaultPrincipalExpiration}.
1491
1492 @itemx default_principal_flags 
1493 (Flag string.)  Specifies the default attributes of principals created
1494 in this realm.  The format for this string is a comma-separated list of
1495 flags, with '+' before each flag that should be enabled and '-' before
1496 each flag that should be disabled.   The default is
1497 @value{DefaultDefaultPrincipalFlags}.
1498
1499 There are a number of possible flags:
1500
1501 @table @b
1502 @itemx postdateable
1503 Enabling this flag allows the principal to obtain postdateable tickets.
1504
1505 @itemx forwardable
1506 Enabling this flag allows the principal to obtain forwardable tickets.
1507
1508 @itemx tgt-based
1509 Enabling this flag allows a principal to obtain tickets based on a
1510 ticket-granting-ticket, rather than repeating the authentication
1511 process that was used to obtain the TGT.
1512
1513 @itemx renewable
1514 Enabling this flag allows the principal to obtain renewable tickets.
1515
1516 @itemx proxiable
1517 Enabling this flag allows the principal to obtain proxy tickets.
1518
1519 @itemx dup-skey
1520 Enabling this flag allows the principal to obtain a session key for
1521 another user, permitting user-to-user authentication for this principal.
1522
1523 @itemx allow-tickets
1524 Enabling this flag means that the KDC will issue tickets for this
1525 principal.  Disabling this flag essentially deactivates the principal
1526 within this realm.
1527
1528 @itemx preauth
1529 If this flag is enabled on a client principal, then that principal is
1530 required to preauthenticate to the KDC before receiving any tickets.
1531 On a service principal, enabling this flag means that service tickets
1532 for this principal will only be issued to clients with a TGT that has
1533 the preauthenticated ticket set.
1534
1535 @itemx hwauth
1536 If this flag is enabled, then the principal is required to
1537 preauthenticate using a hardware device before receiving any tickets.
1538
1539 @itemx pwchange
1540 Enabling this flag forces a password change for this principal.
1541
1542 @itemx service
1543 Enabling this flag allows the the KDC to issue service tickets for this
1544 principal.
1545
1546 @itemx pwservice
1547 If this flag is enabled, it marks this principal as a password change
1548 service.  This should only be used in special cases, for example, if a
1549 user's password has expired, then the user has to get tickets for that
1550 principal without going through the normal password authentication in
1551 order to be able to change the password.
1552
1553 @end table
1554
1555 @itemx dict_file
1556 (String.)  Location of the dictionary file containing strings that are
1557 not allowed as passwords.  If none is specified or if there is no
1558 policy assigned to the principal, no dictionary checks of passwords
1559 will be performed.
1560
1561 @itemx kadmind_port
1562 (Port number.)  Specifies the port on which the kadmind daemon is to
1563 listen for this realm.  The assigned port for kadmind is
1564 @value{DefaultKadmindPort}.
1565
1566 @itemx kpasswd_port
1567 (Port number.)  Specifies the port on which the kpasswd daemon is to
1568 listen for this realm.  The default is @value{DefaultKpasswdPort}.
1569
1570 @itemx key_stash_file
1571 (String.)  Specifies the location where the master key has been stored
1572 (via @code{kdb5_util stash}).  The default is
1573 @code{@value{DefaultKeyStashFileStub}@i{REALM}}, where @i{REALM} is the
1574 Kerberos realm.
1575
1576 @itemx kdc_ports
1577 (String.)  Specifies the list of ports that the KDC is to listen to
1578 for UDP requests for this realm.  By default, the value of kdc_ports
1579 as specified in the [kdcdefaults] section is used.
1580
1581 @itemx kdc_tcp_ports
1582 (String.)  Specifies the list of ports that the KDC is to listen to
1583 for TCP requests for this realm.  By default, the value of
1584 kdc_tcp_ports as specified in the [kdcdefaults] section is used.
1585
1586 @itemx master_key_name
1587 (String.)  Specifies the name of the principal associated with the
1588 master key.  The default is @value{DefaultMasterKeyName}.
1589
1590 @itemx master_key_type
1591 (Key type string.)  Specifies the master key's key type.  The default
1592 value for this is @value{DefaultMasterKeyType}.  For a list of all
1593 possible values, see @ref{Supported Encryption Types}.
1594
1595 @itemx max_life
1596 (Delta time string.)  Specifes the maximum time period for which a
1597 ticket may be valid in this realm.  The default value is
1598 @value{DefaultMaxLife}.
1599
1600 @itemx max_renewable_life
1601 (Delta time string.)  Specifies the maximum time period during which a
1602 valid ticket may be renewed in this realm.  The default value is
1603 @value{DefaultMaxRenewableLife}.
1604
1605 @itemx supported_enctypes
1606 List of key:salt strings.  Specifies the default key/salt combinations of
1607 principals for this realm.  Any principals created through @code{kadmin}
1608 will have keys of these types.  The default value for this tag is
1609 @value{DefaultSupportedEnctypes}. For lists of possible values, see
1610 @ref{Supported Encryption Types} and @ref{Salts}.
1611
1612 @itemx reject_bad_transit
1613 A boolean value (@code{true}, @code{false}).  If set to @code{true}, the
1614 KDC will check the list of transited realms for cross-realm tickets
1615 against the transit path computed from the realm names and the
1616 @code{capaths} section of its @code{krb5.conf} file; if the path in the
1617 ticket to be issued contains any realms not in the computed path, the
1618 ticket will not be issued, and an error will be returned to the client
1619 instead.  If this value is set to @code{false}, such tickets will be
1620 issued anyways, and it will be left up to the application server to
1621 validate the realm transit path.
1622
1623 If the @code{disable-transited-check} flag is set in the incoming
1624 request, this check is not performed at all.  Having the
1625 @code{reject_bad_transit} option will cause such ticket requests to be
1626 rejected always.
1627
1628 This transit path checking and config file option currently apply only
1629 to TGS requests.
1630
1631 Earlier versions of the MIT release (before 1.2.3) had bugs in the
1632 application server support such that the server-side checks may not be
1633 performed correctly.  We recommend turning this option on, unless you
1634 know that all application servers in this realm have been updated to
1635 fixed versions of the software, and for whatever reason, you don't want
1636 the KDC to do the validation.
1637
1638 This is a per-realm option so that multiple-realm KDCs may control it
1639 separately for each realm, in case (for example) one realm has had the
1640 software on its application servers updated but another has not.
1641
1642 This option defaults to @code{true}.
1643
1644 @end table
1645
1646 @node pkinit kdc options, Sample kdc.conf File, realms (kdc.conf), kdc.conf
1647 @subsection pkinit options
1648
1649 @menu
1650 * pkinit kdc.conf options::
1651 @end menu
1652
1653 The following are @b{pkinit-specific} options.
1654 Note that these values may be specified in @code{[kdcdefaults]}
1655 as global defaults,
1656 or within a realm-specific subsection of @code{[realms]}.
1657 Also note that a realm-specific value over-rides, does not add to,
1658 a generic @code{[kdcdefaults]} specification.
1659 The search order is:
1660 @enumerate
1661 @item realm-specific subsection of @code{[realms]}
1662 @smallexample
1663 @group
1664 [realms]
1665     EXAMPLE.COM = @{
1666         pkinit_anchors = FILE:/usr/local/example.com.crt
1667     @}
1668 @end group
1669 @end smallexample
1670
1671 @item generic value in the @code{[kdcdefaults]} section.
1672 @smallexample
1673 @group
1674 [kdcdefaults]
1675     pkinit_anchors = DIR:/usr/local/generic_trusted_cas/
1676 @end group
1677 @end smallexample
1678 @end enumerate
1679
1680 @node pkinit kdc.conf options,  , pkinit kdc options, pkinit kdc options
1681 @subsubsection pkinit kdc.conf options
1682
1683 For information about the syntax of some of these options,
1684 see @xref{pkinit identity syntax}.
1685
1686 @table @b
1687 @item pkinit_identity
1688 Specifies the location of the KDC's X.509 identity information.
1689 This option is @b{required} if pkinit is to be supported by the
1690 KDC.
1691
1692 @item pkinit_anchors
1693 Specifies the location of trusted anchor (root) certificates
1694 which the KDC trusts to sign client certificates.
1695 This option is @b{required} if pkinit is to be supported by the
1696 KDC.
1697 This option may be specified multiple times.
1698
1699 @item pkinit_pool
1700 Specifies the location of intermediate certificates which may be
1701 used by the KDC to complete the trust chain between a client's
1702 certificate and a trusted anchor.
1703 This option may be specified multiple times.
1704
1705 @item pkinit_revoke
1706 Specifies the location of Certificate Revocation List (CRL)
1707 information to be used by the KDC when verifying the validity
1708 of client certificates.
1709 This option may be specified multiple times.
1710
1711 @item pkinit_require_crl_checking
1712 The default certificate verification process will always check
1713 the available revocation information to see if a certificate has
1714 been revoked.  If a match is found for the certificate in a CRL,
1715 verification fails.  If the certificate being verified is not listed
1716 in a CRL, or there is no CRL present for its issuing CA,
1717 and @code{pkinit_require_crl_checking} is @code{false},
1718 then verification succeeds.
1719
1720 However, if @code{pkinit_require_crl_checking} is @code{true} and
1721 there is no CRL information available for the issuing CA,
1722 then verification fails.
1723
1724 @code{pkinit_require_crl_checking} should be set to @code{true}
1725 if the policy is such that up-to-date CRLs @b{must} be present for
1726 every CA.
1727
1728 @item pkinit_dh_min_bits
1729 Specifies the minimum number of bits the KDC is willing to accept
1730 for a client's Diffie-Hellman key.  The default is 2048.
1731
1732 @item pkinit_allow_upn
1733 Specifies that the KDC is willing to accept client certificates with
1734 the Microsoft UserPrincipalName (UPN) Subject Alternative Name
1735 (SAN).  This means the KDC accepts the binding of the UPN in the
1736 certificate to the Kerberos principal name.
1737
1738 The default is false.
1739
1740 Without this option, the KDC will only
1741 accept certificates with the id-pkinit-san as defined in RFC4556.
1742 There is currently no option to disable SAN checking in the KDC.
1743
1744 @item pkinit_eku_checking
1745 This option specifies what Extended Key Usage (EKU) values the
1746 KDC is willing to accept in client certificates.
1747 The values recognized in the @code{kdc.conf} file are:
1748 @table @b
1749 @item kpClientAuth
1750 This is the default value and specifies that client certificates must
1751 have the id-pkinit-KPClientAuth EKU as defined in RFC4556.
1752 @item scLogin
1753 If @code{scLogin} is specified, client certificates with the
1754 Microsoft Smart Card Login EKU (id-ms-kp-sc-logon) will be accepted.
1755 @item none
1756 If @code{none} is specified, then client certificates will not be
1757 checked to verify they have an acceptable EKU.
1758 The use of this option is @b{not recommended}.
1759 @end table
1760 @end table
1761
1762 @node Sample kdc.conf File,  , pkinit kdc options, kdc.conf
1763 @subsection Sample kdc.conf File
1764
1765 Here's an example of a @code{kdc.conf} file:
1766
1767 @smallexample
1768 @group
1769 [kdcdefaults]
1770     kdc_ports = 88
1771
1772 [realms]
1773     @value{PRIMARYREALM} = @{
1774         kadmind_port = 749
1775         max_life = 12h 0m 0s
1776         max_renewable_life = 7d 0h 0m 0s
1777         master_key_type = des3-hmac-sha1
1778         supported_enctypes = des3-hmac-sha1:normal des-cbc-crc:normal des-cbc-crc:v4
1779     @}
1780
1781 [logging]
1782     kdc = FILE:@value{ROOTDIR}/var/krb5kdc/kdc.log
1783     admin_server = FILE:@value{ROOTDIR}/var/krb5kdc/kadmin.log
1784
1785 @end group
1786 @end smallexample
1787
1788 @node Using DNS, Administrating the Kerberos Database, Configuration Files, Top
1789 @chapter Using DNS
1790
1791 @menu
1792 * Mapping Hostnames onto Kerberos Realms::  
1793 * Hostnames for KDCs::          
1794 @end menu
1795
1796 @node Mapping Hostnames onto Kerberos Realms, Hostnames for KDCs, Using DNS, Using DNS
1797 @section Mapping Hostnames onto Kerberos Realms
1798
1799 @include dnstxt.texinfo
1800
1801 @node Hostnames for KDCs,  , Mapping Hostnames onto Kerberos Realms, Using DNS
1802 @section Hostnames for KDCs
1803
1804 @include dnssrv.texinfo
1805
1806 @node Administrating the Kerberos Database, Configuring Kerberos with OpenLDAP back-end, Using DNS, Top
1807 @chapter Administrating the Kerberos Database
1808
1809 Your Kerberos database contains all of your realm's Kerberos principals,
1810 their passwords, and other administrative information about each
1811 principal.  For the most part, you will use the @code{kdb5_util} program
1812 to manipulate the Kerberos database as a whole, and the @code{kadmin}
1813 program to make changes to the entries in the database.  (One notable
1814 exception is that users will use the @code{kpasswd} program to change
1815 their own passwords.)  The @code{kadmin} program has its own
1816 command-line interface, to which you type the database administrating
1817 commands.
1818
1819 @code{Kdb5_util} provides a means to create, delete, load, or dump a
1820 Kerberos database.  It also includes a command to stash a copy of the
1821 master database key in a file on a KDC, so that the KDC can authenticate
1822 itself to the @code{kadmind} and @code{krb5kdc} daemons at boot time.
1823
1824 @code{Kadmin} provides for the maintenance of Kerberos principals, KADM5
1825 policies, and service key tables (keytabs).  It exists as both a
1826 Kerberos client, @code{kadmin}, using Kerberos authentication and an
1827 RPC, to operate securely from anywhere on the network, and as a local
1828 client, @code{kadmin.local}, intended to run directly on the KDC without
1829 Kerberos authentication.  @code{kadmin.local} need not run on the kdc if 
1830 the database is LDAP. Other than the fact that the remote client uses 
1831 Kerberos to authenticate the person using it, the functionalities of the two
1832 versions are identical. The local version is necessary to enable you to set up 
1833 enough of the database to be able to use the remote version. 
1834 It replaces the now obsolete @code{kdb5_edit} (except for
1835 database dump and load, which are provided by @code{kdb5_util}).
1836
1837 The remote version authenticates to the KADM5 server using the service
1838 principal @code{kadmin/admin}.  If the credentials cache contains a
1839 ticket for the @code{kadmin/admin} principal, and the @samp{-c ccache}
1840 option is specified, that ticket is used to authenticate to KADM5.
1841 Otherwise, the @samp{-p} and @samp{-k} options are used to specify the
1842 client Kerberos principal name used to authenticate.  Once kadmin has
1843 determined the principal name, it requests a @code{kadmin/admin}
1844 Kerberos service ticket from the KDC, and uses that service ticket to
1845 authenticate to KADM5.
1846
1847 @menu
1848 * Kadmin Options::              
1849 * Date Format::                 
1850 * Principals::                  
1851 * Policies::                    
1852 * Global Operations on the Kerberos Database::  
1853 * Global Operations on the Kerberos LDAP Database::  
1854 * Cross-realm Authentication::  
1855 * Changing the krbtgt Key::     
1856 @end menu
1857
1858 @node Kadmin Options, Date Format, Administrating the Kerberos Database, Administrating the Kerberos Database
1859 @section Kadmin Options
1860
1861 You can invoke @code{kadmin} or @code{kadmin.local} with any of the
1862 following options:
1863
1864 @table @b
1865 @item @b{-r} @i{REALM}
1866 Use @i{REALM} as the default Kerberos realm for the database.
1867
1868 @item @b{-p} @i{principal}
1869 Use the Kerberos principal @i{principal} to authenticate to Kerberos.
1870 If this option is not given, @code{kadmin} will append @code{admin} to
1871 either the primary principal name, the environment variable USER, or to
1872 the username obtained from @code{getpwuid}, in order of preference.
1873
1874 @item @b{-q} @i{query}
1875 Pass @i{query} directly to @code{kadmin}.  This is useful for writing
1876 scripts that pass specific queries to @code{kadmin}.
1877
1878 @noindent
1879 You can invoke @code{kadmin} with any of the following options:
1880
1881 @item @b{-k} [@b{-t} @i{keytab}]
1882 Use the keytab @i{keytab} to decrypt the KDC response instead of
1883 prompting for a password on the TTY.  In this case, the principal will
1884 be @samp{host/@i{hostname}}.  If @b{-t} is not used to specify a keytab,
1885 then the default keytab will be used.
1886
1887 @item @b{-c} @i{credentials cache}
1888 Use @i{credentials_cache} as the credentials cache.  The credentials
1889 cache should contain a service ticket for the @code{kadmin/admin}
1890 service, which can be acquired with the @code{kinit} program.  If this
1891 option is not specified, @code{kadmin} requests a new service ticket
1892 from the KDC, and stores it in its own temporary ccache.
1893
1894 @item @b{-w} @i{password}
1895 Use @i{password} as the password instead of prompting for one on the
1896 TTY.  Note:  placing the password for a Kerberos principal with
1897 administration access into a shell script can be dangerous if
1898 unauthorized users gain read access to the script.
1899
1900 @item @b{-x} @i{db_args}
1901 Specifies the database specific arguments.
1902
1903 @item @b{-x} @i{host=<hostname>}
1904 Specifies the LDAP server to connect to by a LDAP URI. It is recommend to use 
1905 ldapi:// or ldaps:// interface to connect to the LDAP server.
1906
1907 @item @b{-x} @i{binddn=<bind_dn>}
1908 Specifies the Distinguished Name (DN) of the object used by the administration server to bind to the LDAP server. This object should have the read and write rights on the realm container, principal container and realm subtree.
1909
1910 @item @b{-x} @i{bindpwd=<bind_password>}
1911 Specifies the password for the above mentioned binddn. It is recommended not to 
1912 use this option. Instead, the password can be stashed using the 
1913 stashsrvpw command of kdb5_ldap_util. 
1914
1915 Note: This database specific argument is applicable only to kadmin.local 
1916 and the KADM5 server. 
1917
1918 @item @b{-s} @i{admin_server[:port]}
1919 Specifies the admin server that kadmin should contact.
1920
1921 @noindent
1922 You can invoke @code{kadmin.local} with an of the follwing options:
1923
1924 @item @b{-d_ @i{dbname}}
1925 Specifies the name of the Kerberos database.
1926
1927 @item @b{-e} @i{"enctypes ..."}
1928 Sets the list of cryptosystem and salt types to be used for any new
1929 keys created.  See @ref{Supported Encryption Types} and @ref{Salts} for
1930 available types.
1931
1932 @item @b{-m}
1933 Do not authenticate using a keytab.  This option will cause kadmin to
1934 prompt for the master database password.
1935  
1936 @end table
1937
1938 @node Date Format, Principals, Kadmin Options, Administrating the Kerberos Database
1939 @section Date Format
1940
1941 Many of the @code{kadmin} commands take a duration or time as an
1942 argument.  The date can appear in a wide variety of formats, such as:
1943
1944 @smallexample
1945 @group
1946 "15 minutes"
1947 "7 days"
1948 "1 month"
1949 "2 hours"
1950 "400000 seconds"
1951 "next year"
1952 "this Monday"
1953 "next Monday"
1954 yesterday
1955 tomorrow
1956 now
1957 "second Monday"
1958 fortnight
1959 "3/31/1992 10:00:07 PST"
1960 "January 23, 2007 10:05pm"
1961 "22:00 GMT"
1962 @end group
1963 @end smallexample
1964
1965 Note that if the date specification contains spaces, you must enclose it
1966 in double quotes.  Note also that you cannot use a number without a
1967 unit.  (I.e., ``"60 seconds"'' is correct, but ``60'' is incorrect.)
1968 All keywords are case-insensitive.  The following is a list of all of
1969 the allowable keywords.
1970
1971 @table @b
1972 @item Months
1973 january, jan, february, feb, march, mar, april, apr, may, june, jun,
1974 july, jul, august, aug, september, sep, sept, october, oct, november,
1975 nov, december, dec
1976
1977 @item Days
1978 sunday, sun, monday, mon, tuesday, tues, tue, wednesday, wednes, wed,
1979 thursday, thurs, thur, thu, friday, fri, saturday, sat
1980
1981 @item Units
1982 year, month, fortnight, week, day, hour, minute, min, second, sec
1983
1984 @item Relative 
1985 tomorrow, yesterday, today, now, last, this, next, first, second,
1986 third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh,
1987 twelfth, ago
1988
1989 @item Time Zones
1990 @code{kadmin} recognizes abbreviations for most of the world's time
1991 zones.  A complete listing appears in @ref{kadmin Time Zones}.
1992
1993 @item 12-hour Time Delimiters
1994 am, pm
1995 @end table
1996
1997 @node Principals, Policies, Date Format, Administrating the Kerberos Database
1998 @section Principals
1999
2000 Each entry in the Kerberos database contains a Kerberos principal
2001 (@pxref{Definitions}) and the attributes and policies associated with
2002 that principal.
2003
2004 @menu
2005 * Retrieving Information About a Principal::  
2006 * Privileges::                  
2007 * Adding or Modifying Principals::  
2008 * Deleting Principals::         
2009 * Changing Passwords::          
2010 @end menu
2011
2012 @node Retrieving Information About a Principal, Privileges, Principals, Principals
2013 @subsection Retrieving Information About a Principal
2014
2015 @menu
2016 * Attributes::                  
2017 * Retrieving a List of Principals::  
2018 @end menu
2019
2020 @node Attributes, Retrieving a List of Principals, Retrieving Information About a Principal, Retrieving Information About a Principal
2021 @subsubsection Attributes
2022
2023 To retrieve a listing of the attributes and/or policies associated with
2024 a principal, use the @code{kadmin} @code{get_principal} command, which
2025 requires the ``inquire'' administrative privilege.  The syntax is:
2026
2027 @smallexample
2028 @b{get_principal} @i{principal}
2029 @end smallexample
2030
2031 @noindent 
2032 The @code{get_principal} command has the alias @code{getprinc}.
2033
2034 For example, suppose you wanted to view the attributes of the
2035 principal @* @code{@value{RANDOMUSER1}/root@@@value{PRIMARYREALM}}.
2036   You would type:
2037
2038 @smallexample
2039 @group
2040 @b{shell%} kadmin
2041 @b{kadmin:} getprinc @value{RANDOMUSER1}/root
2042 @b{Principal: @value{RANDOMUSER1}/root@@@value{PRIMARYREALM}
2043 Expiration date: [never]
2044 Last password change: Mon Jan 31 02:06:40 EDT 2002
2045 Password Expiration date: [none]
2046 Maximum ticket life: 0 days 10:00:00
2047 Maximum renewable life: 7 days 00:00:00
2048 Last modified: Wed Jul 24 14:46:25 EDT 2002 (@value{ADMINUSER}/admin@@@value{PRIMARYREALM})
2049 Last successful authentication: Mon Jul 29 18:20:17 EDT 2002
2050 Last failed authentication: Mon Jul 29 18:18:54 EDT 2002
2051 Failed password attempts: 3
2052 Number of keys: 2
2053 Key: vno 2, Triple DES cbc mode with HMAC/sha1, no salt
2054 Key: vno 2, DES cbc mode with CRC-32, no salt
2055 Attributes: DISALLOW_FORWARDABLE, DISALLOW_PROXIABLE
2056 Policy: [none]
2057 kadmin:}
2058 @end group
2059 @end smallexample
2060
2061 The @code{get_principal} command has a @code{-terse} option, which lists
2062 the fields as a quoted, tab-separated string.  For example:
2063
2064 @smallexample
2065 @group
2066 @b{kadmin:} getprinc -terse @value{RANDOMUSER1}/root
2067 @b{@value{RANDOMUSER1}/root@@@value{PRIMARYREALM}       0       1027458564
2068 0       36000    (@value{ADMINUSER}/admin@@@value{PRIMARYREALM}
2069 1027536385      18      2       0       [none]  604800  1027980137
2070 1027980054      3       2       1       2       16      0       1
2071 2       1       0
2072 kadmin:}
2073 @end group
2074 @end smallexample
2075
2076 @node Retrieving a List of Principals,  , Attributes, Retrieving Information About a Principal
2077 @subsubsection Retrieving a List of Principals
2078
2079 To generate a listing of principals, use the @code{kadmin}
2080 @code{list_principals} command, which requires the ``list'' privilege.
2081 The syntax is:
2082
2083 @smallexample
2084 @b{list_principals} [@i{expression}]
2085 @end smallexample
2086
2087 @noindent where @i{expression} is a shell-style glob expression that
2088 can contain the characters @samp{*}, @samp{?}, @samp{[}, and @samp{]}.
2089 All policy names matching the expression are displayed.  The
2090 @code{list_principals} command has the aliases @code{listprincs},
2091 @code{get_principals}, and @code{getprincs}.  For example:
2092
2093 @smallexample
2094 @group
2095 @b{kadmin:} listprincs test*
2096 @b{test3@@@value{PRIMARYREALM}
2097 test2@@@value{PRIMARYREALM}
2098 test1@@@value{PRIMARYREALM}
2099 testuser@@@value{PRIMARYREALM}
2100 kadmin:}
2101 @end group
2102 @end smallexample
2103
2104 @noindent 
2105 If no expression is provided, all principals are printed.
2106
2107 @node Privileges, Adding or Modifying Principals, Retrieving Information About a Principal, Principals
2108 @subsection Privileges
2109
2110 Administrative privileges for the Kerberos database are stored in the
2111 file @code{kadm5.acl}.  
2112
2113 @include kadm5acl.texinfo
2114
2115 @node Adding or Modifying Principals, Deleting Principals, Privileges, Principals
2116 @subsection Adding or Modifying Principals
2117
2118 To add a principal to the database, use the kadmin @code{add_principal}
2119 command, which requires the ``add'' administrative privilege.  This
2120 function creates the new principal, prompting twice for a password, and,
2121 if neither the -policy nor -clearpolicy options are specified and the
2122 policy ``default'' exists, assigns it that policy.  The syntax is:
2123
2124 @smallexample
2125 @b{kadmin:} add_principal [@i{options}] @i{principal}
2126 @end smallexample
2127
2128 To modify attributes of a principal, use the kadmin
2129 @code{modify_principal} command, which requires the ``modify''
2130 administrative privilege.  The syntax is:
2131
2132 @smallexample
2133 @b{kadmin:} modify_principal [@i{options}] @i{principal}
2134 @end smallexample
2135
2136 @noindent
2137 @code{add_principal} has the aliases @code{addprinc} and
2138 @code{ank}@footnote{@code{ank} was the short form of the equivalent
2139 command using the deprecated @code{kadmin5} database administrative tool.
2140 It has been kept}.  @code{modify_principal} has the alias @code{modprinc}.
2141
2142 The @code{add_principal} and @code{modify_principal} commands take the
2143 following switches:
2144
2145 @table @b
2146 @item @b{-x} @i{db_princ_args}
2147 Denotes the database specific options. 
2148 @noindent 
2149 The options for LDAP database are:
2150 @table @b
2151 @item @b{-x} @i{dn=<dn>}
2152 Specifies the  LDAP object that will contain the Kerberos principal being created.
2153
2154 @item @b{-x} @i{linkdn=<dn>}
2155 Specifies the LDAP object  to which the newly created Kerberos principal object will point to.
2156
2157 @item @b{-x} @i{containerdn=<container_dn>}
2158 Specifies the  container object under which the Kerberos principal is to be created. 
2159
2160 @item @b{-x} @i{tktpolicy=<policy>}
2161 Associates a ticket policy to the Kerberos principal. Specifying an empty string 
2162 value clears the ticket policy associated with the principal.
2163 @noindent
2164 Note: 
2165 @noindent
2166 * dn and containerdn options are not valid while modifying the principal.
2167 @noindent
2168 * containerdn and linkdn options cannot be specified with dn option.      
2169 @noindent
2170 *  If dn or containerdn options are not specified while adding the principal, the principals are created   
2171    under the prinicipal container configured in the realm or the realm container.
2172 * dn and containerdn should be within the subtrees or principal container configured in the realm.
2173 @end table
2174  
2175 @item -expire @i{date}
2176 Sets the expiration date of the principal to @i{date}.
2177
2178 @item -pwexpire @i{date}
2179 Sets the expiration date of the password to @i{date}.
2180
2181 @item -maxlife @i{maxlife}
2182 Sets the maximum ticket life of the principal to @i{maxlife}.
2183
2184 @item -maxrenewlife @i{maxrenewlife}
2185 Sets the maximum renewable life of tickets for the principal to
2186 @i{maxrenewlife}.
2187
2188 @item -kvno @i{number}
2189 Explicity sets the key version number to @i{number}.  @value{COMPANY}
2190 does not recommend doing this unless there is a specific reason.
2191
2192 @item -policy @i{policy}
2193 Sets the policy used by this principal.  (@xref{Policies}.)  With
2194 @code{modify_principal}, the current policy assigned to the principal is
2195 set or changed.  With @code{add_principal}, if this option is not
2196 supplied, the -clearpolicy is not specified, and the policy ``default''
2197 exists, that policy is assigned.  If a principal is created with no
2198 policy, @code{kadmin} will print a warning message.
2199
2200 @item -clearpolicy
2201 For @code{modify_principal}, removes the current policy from a
2202 principal.  For @code{add_principal}, suppresses the automatic
2203 assignment of the policy ``default''.
2204
2205 @item @{-|+@}allow_postdated
2206 The ``-allow_postdated'' option prohibits this principal from obtaining
2207 postdated tickets.  ``+allow_postdated'' clears this flag.  In effect,
2208 ``-allow_postdated'' sets the KRB5_KDB_DISALLOW_POSTDATED flag on the
2209 principal in the database.
2210
2211 @item @{-|+@}allow_forwardable
2212 The ``-allow_forwardable'' option prohibits this principal from
2213 obtaining forwardable tickets.  ``+allow_forwardable'' clears this flag.
2214 In effect, ``-allow_forwardable'' sets the KRB5_KDB_DISALLOW_FORWARDABLE
2215 flag on the principal in the database.
2216
2217 @item @{-|+@}allow_renewable
2218 The ``-allow_renewable'' option prohibits this principal from obtaining
2219 renewable tickets.  ``+allow_renewable'' clears this flag.  In effect,
2220 ``-allow_renewable'' sets the KRB5_KDB_DISALLOW_RENEWABLE flag on the
2221 principal in the database.
2222
2223 @item @{-|+@}allow_proxiable
2224 The ``-allow_proxiable'' option prohibits this principal from obtaining
2225 proxiable tickets.  ``+allow_proxiable'' clears this flag.  In effect,
2226 ``-allow_proxiable'' sets the @* KRB5_KDB_DISALLOW_PROXIABLE flag. on
2227 the principal in the database.
2228
2229 @item @{-|+@}allow_dup_skey
2230 The ``-allow_dup_skey'' option disables user-to-user authentication for
2231 this principal by prohibiting this principal from obtaining a session
2232 key for another user.  ``+allow_dup_skey'' clears this flag.  In effect,
2233 ``-allow_dup_skey'' sets the @* KRB5_KDB_DISALLOW_DUP_SKEY flag on the
2234 principal in the database.
2235
2236 @item @{-|+@}requires_preauth
2237 The ``+requires_preauth'' option requires this principal to
2238 preauthenticate before being allowed to kinit.  -requires_preauth clears
2239 this flag.  In effect, +requires_preauth sets the
2240 KRB5_KDB_REQUIRES_PRE_AUTH flag on the principal in the database.
2241
2242 @item @{-|+@}requires_hwauth
2243 The ``+requires_hwauth'' flag requires the principal to preauthenticate
2244 using a hardware device before being allowed to kinit.
2245 ``-requires_hwauth'' clears this flag.  In effect, ``+requires_hwauth''
2246 sets the KRB5_KDB_REQUIRES_HW_AUTH flag on the principal in the
2247 database.
2248
2249 @item @{-|+@}allow_svr
2250 The ``-allow_svr'' flag prohibits the issuance of service tickets for
2251 this principal.  ``+allow_svr'' clears this flag.  In effect,
2252 ``-allow_svr'' sets the @* KRB5_KDB_DISALLOW_SVR flag on the principal
2253 in the database.
2254
2255 @item @{-|+@}allow_tgs_req
2256 The ``-allow_tgs_req'' option specifies that a Ticket-Granting Service
2257 (TGS) request for a service ticket for this principal is not permitted.
2258 You will probably never need to use this option.  ``+allow_tgs_req''
2259 clears this flag.  The default is ``+allow_tgs_req''.  In effect,
2260 ``-allow_tgs_req'' sets the KRB5_KDB_DISALLOW_TGT_BASED flag on the
2261 principal in the database.
2262
2263 @item @{-|+@}allow_tix
2264 The ``-allow_tix'' option forbids the issuance of any tickets for this
2265 principal.  ``+allow_tix'' clears this flag.  The default is
2266 ``+allow_tix''.  In effect, ``-allow_tix'' sets the @*
2267 KRB5_KDB_DISALLOW_ALL_TIX flag on the principal in the database.
2268
2269 @item @{-|+@}needchange
2270 The ``+needchange'' option sets a flag in attributes field to force a
2271 password change; ``-needchange'' clears it.  The default is
2272 ``-needchange''.  In effect, ``+needchange'' sets the
2273 KRB5_KDB_REQUIRES_PWCHANGE flag on the principal in the database.
2274
2275 @item @{-|+@}password_changing_service
2276 The ``+password_changing_service'' option sets a flag in the attributes
2277 field marking this principal as a password change service. (Again, you
2278 will probably never need to use this option.)
2279 ``-password_changing_service'' clears the flag.  The default is
2280 ``-password_changing_service''.  In effect, the
2281 ``+password_changing_service'' option sets the KRB5_KDB_PWCHANGE_SERVICE
2282 flag on the principal in the database.
2283
2284 @item @{-|+@}ok_as_delegate
2285 The ``+ok_as_delegate'' option sets a flag in tickets issued for the
2286 service principal.  Some client programs may recognize this flag as
2287 indicating that it is okay to delegate credentials to the service.  If
2288 ok_as_delegate is set on a cross-realm TGT, it indicates that the
2289 foreign realm's ok_as_delegate flags should be honored by clients in
2290 the local realm.  The default is ``-ok_as_delegate''.
2291
2292 @item -randkey
2293 Sets the key for the principal to a random value (@code{add_principal}
2294 only).  @value{COMPANY} recommends using this option for host keys.
2295
2296 @item -pw @i{password}
2297 Sets the key of the principal to the specified string and does not
2298 prompt for a password (@code{add_principal} only).  @value{COMPANY} does
2299 not recommend using this option.
2300
2301 @item -e @i{enc:salt...}
2302 Uses the specified list of enctype-salttype pairs for setting the key
2303 of the principal.  The quotes are necessary if there are multiple
2304 enctype-salttype pairs.  This will not function against kadmin daemons
2305 earlier than krb5-1.2.  See @ref{Supported Encryption Types} and
2306 @ref{Salts} for available types.
2307 @end table
2308
2309 If you want to just use the default values, all you need to do is:
2310
2311 @smallexample
2312 @group
2313 @b{kadmin:} addprinc @value{RANDOMUSER1}
2314 @b{WARNING: no policy specified for "@value{RANDOMUSER1}@@@value{PRIMARYREALM}";
2315 defaulting to no policy.}
2316 @iftex
2317 @b{Enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type the password.}
2318 @b{Re-enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type it again.}
2319 @end iftex
2320 @ifinfo
2321 @b{Enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{<= Type the password.}
2322 @b{Re-enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{<=Type it again.}
2323 @end ifinfo
2324 @ifhtml
2325 @b{Enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{<= Type the password.}
2326 @b{Re-enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{<=Type it again.}
2327 @end ifhtml
2328 @b{Principal "@value{RANDOMUSER1}@@@value{PRIMARYREALM}" created.
2329 kadmin:}
2330 @end group
2331 @end smallexample
2332
2333 If you want to create a principal which is contained by a  LDAP object, all you need to do is:
2334
2335 @smallexample
2336 @group
2337 @b{kadmin:} addprinc -x dn=cn=@value{RANDOMUSER1},dc=example,dc=com @value{RANDOMUSER1}
2338 @b{WARNING: no policy specified for "@value{RANDOMUSER1}@@@value{PRIMARYREALM}";
2339 defaulting to no policy.}
2340 @iftex
2341 @b{Enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type the password.}
2342 @b{Re-enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type it again.}
2343 @end iftex
2344 @ifinfo
2345 @b{Enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{<= Type the password.}
2346 @b{Re-enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{<=Type it again.}
2347 @end ifinfo
2348 @ifhtml
2349 @b{Enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{<= Type the password.}
2350 @b{Re-enter password for principal @value{RANDOMUSER1}@@@value{PRIMARYREALM}:}  @i{<=Type it again.}
2351 @end ifhtml
2352 @b{Principal "@value{RANDOMUSER1}@@@value{PRIMARYREALM}" created.
2353 kadmin:}
2354 @end group
2355 @end smallexample
2356
2357 If you want to create a principal under a specific LDAP container and link to an existing LDAP object, all you need to do is:
2358
2359 @smallexample
2360 @group
2361 @b{kadmin:} addprinc -x containerdn=dc=example,dc=com -x linkdn=cn=@value{RANDOMUSER2},dc=example,dc=com @value{RANDOMUSER2}
2362 @b{WARNING: no policy specified for "@value{RANDOMUSER2}@@@value{PRIMARYREALM}";
2363 defaulting to no policy.}
2364 @iftex
2365 @b{Enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type the password.}
2366 @b{Re-enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type it again.}
2367 @end iftex
2368 @ifinfo
2369 @b{Enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type the password.}
2370 @b{Re-enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<=Type it again.}
2371 @end ifinfo
2372 @ifhtml
2373 @b{Enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type the password.}
2374 @b{Re-enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<=Type it again.}
2375 @end ifhtml
2376 @b{Principal "@value{RANDOMUSER2}@@@value{PRIMARYREALM}" created.
2377 kadmin:}
2378 @end group
2379 @end smallexample
2380
2381 If you want to associate a ticket policy to a principal, all you need to do is:
2382
2383 @smallexample
2384 @group
2385 @b{kadmin:} modprinc -x tktpolicy=userpolicy @value{RANDOMUSER2}
2386 @b{Principal "@value{RANDOMUSER2}@@@value{PRIMARYREALM}" modified.
2387 kadmin:}
2388 @end group
2389 @end smallexample
2390
2391 If, on the other hand, you want to set up an account that expires on
2392 January 1, 2000, that uses a policy called ``stduser'', with a temporary
2393 password (which you want the user to change immediately), you would type
2394 the following.  (Note:  each line beginning with @result{} is a
2395 continuation of the previous line.)
2396
2397 @smallexample
2398 @group
2399
2400 @b{kadmin:} addprinc @value{RANDOMUSER2} -expire "1/1/2000 12:01am EST" -policy stduser 
2401 @result{}  +needchange 
2402 @iftex
2403 @b{Enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type the password.}
2404 @b{Re-enter password for principal
2405 @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type it again.}
2406 @end iftex
2407 @ifinfo
2408 @b{Enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type the password.}
2409 @b{Re-enter password for principal
2410 @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type it again.}
2411 @end ifinfo
2412 @ifhtml
2413 @b{Enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type the password.}
2414 @b{Re-enter password for principal
2415 @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type it again.}
2416 @end ifhtml
2417 @b{Principal "@value{RANDOMUSER2}@@@value{PRIMARYREALM}" created.
2418 kadmin:}
2419
2420 @end group
2421 @end smallexample
2422
2423 If you will need cross-realm authentication, you need to add principals
2424 for the other realm's TGT to each realm.  For example, if you need to
2425 do cross-realm authentication between the realms @value{PRIMARYREALM}
2426 and @value{SECONDREALM}, you would need to add the principals @*
2427 @samp{krbtgt/@value{SECONDREALM}@@@value{PRIMARYREALM}} and
2428 @samp{krbtgt/@value{PRIMARYREALM}@@@value{SECONDREALM}} to both
2429 databases.  You need to be sure the passwords and the key version
2430 numbers (kvno) are the same in both databases.  This may require
2431 explicitly setting the kvno with the @samp{-kvno} option.  See
2432 @ref{Cross-realm Authentication} for more details.
2433
2434 @node Deleting Principals, Changing Passwords, Adding or Modifying Principals, Principals
2435 @subsection Deleting Principals
2436
2437 To delete a principal, use the kadmin @code{delete_principal} command,
2438 which requires the ``delete'' administrative privilege.  The syntax is:
2439
2440 @smallexample
2441 @b{delete_principal} [@b{-force}] @i{principal}
2442 @end smallexample
2443
2444 @noindent @code{delete_principal} has the alias @code{delprinc}.  The
2445 @code{-force} option causes @code{delete_principal} not to ask if you're
2446 sure.  For example:
2447
2448 @smallexample
2449 @group
2450 @b{kadmin:} delprinc @value{RANDOMUSER1}
2451 @b{Are you sure you want to delete the principal
2452 "@value{RANDOMUSER1}@@@value{PRIMARYREALM}"? (yes/no):} yes
2453 @b{Principal "@value{RANDOMUSER1}@@@value{PRIMARYREALM}" deleted.
2454 Make sure that you have removed this principal from
2455 all ACLs before reusing.
2456 kadmin:}
2457 @end group
2458 @end smallexample
2459
2460 @node Changing Passwords,  , Deleting Principals, Principals
2461 @subsection Changing Passwords
2462
2463 To change a principal's password use the kadmin @code{change_password}
2464 command, which requires the ``modify'' administrative privilege (unless
2465 the principal is changing his/her own password).  The syntax is:
2466
2467 @smallexample
2468 @b{change_password} [@i{options}] @i{principal}
2469 @end smallexample
2470
2471 @noindent The @code{change_password} option has the alias @code{cpw}.
2472 @code{change_password} takes the following options:
2473
2474 @table @b
2475 @item -randkey
2476 Sets the key of the principal to a random value.
2477
2478 @item @b{-pw} @i{password}
2479 Sets the password to the string @i{password}.  @value{COMPANY} does not
2480 recommend using this option.
2481
2482 @item @b{-e} @i{"enc:salt..."}
2483 Uses the specified list of enctype-salttype pairs for setting the key
2484 of the principal.  The quotes are necessary if there are multiple
2485 enctype-salttype pairs.  This will not function against kadmin daemons
2486 earlier than krb5-1.2.  See @ref{Supported Encryption Types} and
2487 @ref{Salts} for possible values.
2488
2489 @item @b{-keepold}
2490 Keeps the previous kvno's keys around.  There is no easy way to delete
2491 the old keys, and this flag is usually not necessary except perhaps for
2492 TGS keys.  Don't use this flag unless you know what you're doing. This 
2493 option is not supported for the LDAP database
2494
2495
2496
2497 @end table
2498
2499 For example:
2500
2501 @smallexample
2502 @group
2503 @b{kadmin:} cpw @value{RANDOMUSER2}
2504 @iftex
2505 @b{Enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type the new password.}
2506 @b{Re-enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{@doubleleftarrow{} Type it again.}
2507 @end iftex
2508 @ifinfo
2509 @b{Enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type the new password.}
2510 @b{Re-enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type it again.}
2511 @end ifinfo
2512 @ifhtml
2513 @b{Enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type the new password.}
2514 @b{Re-enter password for principal @value{RANDOMUSER2}@@@value{PRIMARYREALM}:}  @i{<= Type it again.}
2515 @end ifhtml
2516 @b{Password for @value{RANDOMUSER2}@@@value{PRIMARYREALM} changed.
2517 kadmin:}
2518 @end group
2519 @end smallexample
2520
2521 Note that @code{change_password} will not let you change the password to
2522 one that is in the principal's password history.
2523
2524 @node Policies, Global Operations on the Kerberos Database, Principals, Administrating the Kerberos Database
2525 @section Policies
2526
2527 A policy is a set of rules governing passwords.  Policies can dictate
2528 minimum and maximum password lifetimes, minimum number of characters and
2529 character classes a password must contain, and the number of old
2530 passwords kept in the database.
2531
2532 @menu
2533 * Retrieving Policies::         
2534 * Retrieving the List of Policies::  
2535 * Adding or Modifying Policies::  
2536 * Deleting Policies::           
2537 @end menu
2538
2539 @node Retrieving Policies, Retrieving the List of Policies, Policies, Policies
2540 @subsection Retrieving Policies
2541
2542 To retrieve a policy, use the kadmin @code{get_policy} command, which
2543 requires the ``inquire'' administrative privilege.  The syntax is:
2544
2545 @smallexample
2546 @b{get_policy} [@b{-terse}] @i{policy}
2547 @end smallexample
2548
2549 The @code{get_policy} command has the alias @code{getpol}.  For example:
2550
2551 @smallexample
2552 @group
2553 @b{kadmin:} get_policy admin
2554 @b{Policy: admin
2555 Maximum password life: 180 days 00:00:00
2556 Minimum password life: 00:00:00
2557 Minimum password length: 6
2558 Minimum number of password character classes: 2
2559 Number of old keys kept: 5
2560 Reference count: 17
2561 kadmin:}
2562 @end group
2563 @end smallexample
2564
2565 @noindent The @dfn{reference count} is the number of principals using
2566 that policy.
2567
2568 The @code{get_policy} command has a @code{-terse} option, which lists
2569 each field as a quoted, tab-separated string.  For example:
2570
2571 @smallexample
2572 @group
2573 @b{kadmin:} get_policy -terse admin
2574 @b{admin   15552000        0       6       2       5       17
2575 kadmin:}
2576 @end group
2577 @end smallexample
2578
2579 @node Retrieving the List of Policies, Adding or Modifying Policies, Retrieving Policies, Policies
2580 @subsection Retrieving the List of Policies
2581
2582 You can retrieve the list of policies with the kadmin
2583 @code{list_policies} command, which requires the ``list'' privilege.  The
2584 syntax is:
2585
2586 @smallexample
2587 @b{list_policies} [@i{expression}]
2588 @end smallexample
2589
2590 @noindent where @i{expression} is a shell-style glob expression that can
2591 contain the characters *, ?, and [].  All policy names matching the
2592 expression are displayed.  The @code{list_policies} command has the aliases
2593 @code{listpols}, @code{get_policies}, and @code{getpols}.  For example:
2594
2595 @smallexample
2596 @group
2597 @b{kadmin:}  listpols
2598 @b{test-pol
2599 dict-only
2600 once-a-min
2601 test-pol-nopw}
2602
2603 @b{kadmin:}  listpols t*
2604 @b{test-pol
2605 test-pol-nopw
2606 kadmin:}
2607 @end group
2608 @end smallexample
2609
2610
2611 @node Adding or Modifying Policies, Deleting Policies, Retrieving the List of Policies, Policies
2612 @subsection Adding or Modifying Policies
2613
2614 To add a new policy, use the kadmin @code{add_policy} command, which
2615 requires the ``add'' administrative privilege.  The syntax is:
2616
2617 @smallexample
2618 @b{add_policy} [@i{options}] @i{policy_name}
2619 @end smallexample
2620
2621 To modify attributes of a principal, use the kadmin @code{modify_policy}
2622 command, which requires the ``modify'' administrative privilege.  The
2623 syntax is:
2624
2625 @smallexample
2626 @b{modify_policy} [@i{options}] @i{policy_name}
2627 @end smallexample
2628
2629 @noindent @code{add_policy} has the alias @code{addpol}.
2630 @code{modify_poilcy} has the alias @code{modpol}.
2631
2632 The @code{add_policy} and @code{modify_policy} commands take the
2633 following switches:
2634
2635 @table @b
2636 @item -maxlife @i{time}
2637 Sets the maximum lifetime of a password to @i{time}.
2638
2639 @item -minlife @i{time}
2640 Sets the minimum lifetime of a password to @i{time}.
2641
2642 @item -minlength @i{length}
2643 Sets the minimum length of a password to @i{length} characters.
2644
2645 @item -minclasses @i{number}
2646 Requires at least @i{number} of character classes in a password.
2647
2648 @item -history @i{number}
2649 Sets the number of past keys kept for a principal to @i{number}. This option is not supported for LDAP database.
2650 @end table 
2651 @c **** An example here would be nice.  ****
2652
2653 @noindent
2654 Note: The policies are created under realm container in the LDAP database.
2655
2656 @node Deleting Policies,  , Adding or Modifying Policies, Policies
2657 @subsection Deleting Policies
2658
2659 To delete a policy, use the @code{kadmin} @code{delete_policy} command,
2660 which requires the ``delete'' administrative privilege.  The syntax is:
2661
2662 @smallexample
2663 @b{delete_policy [-force]} @i{policy_name}
2664 @end smallexample
2665
2666 @noindent The @code{delete_policy} command has the alias @code{delpol}.
2667 It prompts for confirmation before deletion.
2668 For example:
2669
2670 @smallexample
2671 @group
2672 @b{kadmin:} delete_policy guests
2673 @b{Are you sure you want to delete the policy "guests"?
2674 (yes/no):} yes
2675 @b{kadmin:}
2676 @end group
2677 @end smallexample
2678
2679 Note that you must cancel the policy from all principals before deleting
2680 it.  The @code{delete_policy} command will fail if it is in use by any
2681 principals.
2682
2683 @node Global Operations on the Kerberos Database, Global Operations on the Kerberos LDAP Database, Policies, Administrating the Kerberos Database
2684 @section Global Operations on the Kerberos Database
2685
2686 @menu
2687 * Dumping a Kerberos Database to a File::  
2688 * Restoring a Kerberos Database from a Dump File::  
2689 * Creating a Stash File::       
2690 * Creating and Destroying a Kerberos Database::  
2691 @end menu
2692
2693 The @code{kdb5_util} command is the primary tool for administrating the
2694 Kerberos database.  The syntax is:
2695
2696 @smallexample
2697 @b{kdb5_util} @i{command} [@i{kdb5_util_options}] [@i{command_options}]
2698 @end smallexample
2699
2700 The @code{kdb5_util} command takes the following options, which override
2701 the defaults specified in the configuration files:
2702
2703 @table @b
2704 @itemx -r @i{realm}
2705 specifies the the Kerberos realm of the database.
2706
2707 @itemx -d @i{database_name}
2708 specifies the name under which the principal database is stored.  
2709
2710 @itemx -k @i{master_key_type}
2711 specifies the key type of the master key in the database.
2712
2713 @itemx -M @i{master_key_name}
2714 specifies the principal name of the master key in the database.
2715
2716 @itemx -m
2717 indicates that the master database password should be read from the TTY
2718 rather than fetched from a file on disk.
2719
2720 @itemx -sf @i{stash_file}
2721 specifies the stash file of the master database password
2722
2723 @itemx -P @i{password}
2724 specifies the master database password.  @value{COMPANY} does not
2725 recommend using this option.
2726
2727 @end table
2728
2729 @node Dumping a Kerberos Database to a File, Restoring a Kerberos Database from a Dump File, Global Operations on the Kerberos Database, Global Operations on the Kerberos Database
2730 @subsection Dumping a Kerberos Database to a File
2731
2732 To dump a Kerberos database into a file, use the @code{kdb5_util}
2733 @code{dump} command on one of the KDCs.  The syntax is:
2734
2735 @smallexample
2736 @b{kdb5_util dump} [@b{-old}] [@b{-b6}] [@b{-b7}] [@b{-ov}] 
2737 [@b{-verbose}] [-mkey_convert] [-new_mkey_file] [@i{filename} 
2738 [@i{principals...}]]
2739 @end smallexample
2740
2741 The @code{kdb5_util dump} command takes the following options:
2742
2743 @table @b
2744 @itemx -old
2745 causes the dump to be in the Kerberos 5 Beta 5 and earlier dump format
2746 (``kdb5_edit load_dump version 2.0'').
2747 @itemx -b6
2748 causes the dump to be in the Kerberos 5 Beta 6 format (``kdb5_edit
2749 load_dump version 3.0'').
2750 @itemx -b7
2751 causes the dump to be in the Kerberos 5 Beta 7 format (``kdbt_edit
2752 load_dump version 4'').
2753 @itemx -ov
2754 causes the dump to be in ovsec_adm_export format.  Currently, the only
2755 way to preserve per-principal policy information is to use this in
2756 conjunction with a normal dump.
2757 @itemx -verbose
2758 causes the name of each principal and policy to be printed as it is
2759 dumped.
2760 @itemx -mkey_convert
2761 prompts for a new master password, and then dumps the database with
2762 all keys reencrypted in this new master key
2763 @itemx -new_mkey_file
2764 reads a new key from the default keytab and then dumps the database
2765 with all keys reencrypted in this new master key
2766 @end table
2767
2768 For example:
2769
2770 @smallexample
2771 @group
2772 @b{shell%} kdb5_util dump dumpfile
2773 @b{shell%}
2774 @end group
2775 @end smallexample
2776
2777 @smallexample
2778 @group
2779 @b{shell%} kbd5_util dump -verbose dumpfile
2780 @b{kadmin/admin@@@value{PRIMARYREALM}
2781 krbtgt/@value{PRIMARYREALM}@@@value{PRIMARYREALM}
2782 kadmin/history@@@value{PRIMARYREALM}
2783 K/M@@@value{PRIMARYREALM}
2784 kadmin/changepw@@@value{PRIMARYREALM}
2785 shell%}
2786 @end group
2787 @end smallexample
2788
2789 @noindent
2790 If you specify which principals to dump, you must use the full
2791 principal, as in the following example.  (The line beginning with
2792 @result{} is a continuation of the previous line.):
2793
2794 @smallexample
2795 @group
2796 @b{shell%} kdb5_util dump -verbose dumpfile K/M@@@value{PRIMARYREALM} 
2797 @result{} kadmin/admin@@@value{PRIMARYREALM}
2798 @b{kadmin/admin@@@value{PRIMARYREALM}
2799 K/M@@@value{PRIMARYREALM}
2800 shell%}
2801 @end group
2802 @end smallexample
2803
2804 @noindent
2805 Otherwise, the principals will not match those in the database and will
2806 not be dumped:
2807
2808 @smallexample
2809 @group
2810 @b{shell%} kdb5_util dump -verbose dumpfile K/M kadmin/admin
2811 @b{shell%}
2812 @end group
2813 @end smallexample
2814
2815 @noindent
2816 If you do not specify a dump file, @code{kdb5_util} will dump the
2817 database to the standard output.
2818
2819 There is currently a bug where the default dump format omits the
2820 per-principal policy information.  In order to dump all the data
2821 contained in the Kerberos database, you must perform a normal dump (with
2822 no option flags) and an additional dump using the ``-ov'' flag to a
2823 different file.
2824
2825 @node Restoring a Kerberos Database from a Dump File, Creating a Stash File, Dumping a Kerberos Database to a File, Global Operations on the Kerberos Database
2826 @subsection Restoring a Kerberos Database from a Dump File
2827
2828 To restore a Kerberos database dump from a file, use the
2829 @code{kdb5_util} @code{load} command on one of the KDCs.  The syntax
2830 is:
2831
2832 @smallexample
2833 @b{kdb5_util load} [@b{-old}] [@b{-b6}] [@b{-b7}] [@b{-ov}] [@b{-verbose}]
2834 [@b{-update}] [@b{-hash}] @i{dumpfilename} @i{dbname} [@i{admin_dbname}]
2835 @end smallexample
2836
2837 The @code{kdb5_util load} command takes the following options:
2838
2839 @table @b
2840 @itemx -old
2841 requires the dump to be in the Kerberos 5 Beta 5 and earlier dump format
2842 (``kdb5_edit load_dump version 2.0'').
2843 @itemx -b6
2844 requires the dump to be in the Kerberos 5 Beta 6 format (``kdb5_edit
2845 load_dump version 3.0'').
2846 @itemx -b7
2847 requires the dump to be in the Kerberos 5 Beta 7 format (``kdb5_edit
2848 load_dump version 4'').
2849 @itemx -ov
2850 requires the dump to be in ovsec_adm_export format.
2851 @itemx -verbose
2852 causes the name of each principal and policy to be printed as it is
2853 loaded.
2854 @itemx -update
2855 causes records from the dump file to be updated in or added to the
2856 existing database.  This is useful in conjunction with an
2857 ovsec_adm_export format dump if you want to preserve per-principal
2858 policy information, since the current default format does not contain
2859 this data.
2860 @itemx -hash
2861 causes the database to be stored as a hash rather than a binary tree.
2862 @end table
2863
2864 For example:
2865
2866 @smallexample
2867 @group
2868 @b{shell%} kdb5_util load dumpfile principal
2869 @b{shell%}
2870 @end group
2871 @end smallexample
2872
2873 @smallexample
2874 @group
2875 @b{shell%} kdb5_util load -update dumpfile principal
2876 @b{shell%}
2877 @end group
2878 @end smallexample
2879
2880 @noindent
2881 If the database file exists, and the @b{-update} flag was not given,
2882 @code{kdb5_util} will overwrite the existing database.
2883
2884 @node Creating a Stash File, Creating and Destroying a Kerberos Database, Restoring a Kerberos Database from a Dump File, Global Operations on the Kerberos Database
2885 @subsection Creating a Stash File
2886
2887 A stash file allows a KDC to authenticate itself to the database
2888 utilities, such as @code{kadmin}, @code{kadmind}, @code{krb5kdc}, and
2889 @code{kdb5_util}.
2890
2891 To create a stash file, use the @code{kdb5_util} @code{stash} command.
2892 The syntax is:
2893
2894 @smallexample
2895 @b{kdb5_util stash} [@b{-f} @i{keyfile}]
2896 @end smallexample
2897
2898 For example:
2899
2900 @smallexample
2901 @group
2902 @b{shell%} kdb5_util stash
2903 @b{kdb5_util: Cannot find/read stored master key while reading master key
2904 kdb5_util: Warning: proceeding without master key}
2905 @iftex
2906 @b{Enter KDC database master key:}  @i{@doubleleftarrow{} Type the KDC database master password.}
2907 @end iftex
2908 @ifinfo
2909 @b{Enter KDC database master key:}  @i{<= Type the KDC database master password.}
2910 @end ifinfo
2911 @ifhtml
2912 @b{Enter KDC database master key:}  @i{<= Type the KDC database master password.}
2913 @end ifhtml
2914 @b{shell%}
2915 @end group
2916 @end smallexample
2917
2918 @noindent
2919 If you do not specify a stash file, @code{kdb5_util} will stash the key
2920 in the file specified in your @code{kdc.conf} file.
2921
2922 @node Creating and Destroying a Kerberos Database,  , Creating a Stash File, Global Operations on the Kerberos Database
2923 @subsection Creating and Destroying a Kerberos Database
2924
2925 If you need to create a new Kerberos database, use the @code{kdb5_util}
2926 @code{create} command.  The syntax is:
2927
2928 @smallexample
2929 @b{kdb5_util create} [@b{-s}]
2930 @end smallexample
2931
2932 If you specify the @samp{-s} option, @code{kdb5_util} will stash a copy
2933 of the master key in a stash file.  (@xref{Creating a Stash File}.)  For
2934 example:
2935
2936 @smallexample
2937 @group
2938 @b{shell%} @value{ROOTDIR}/sbin/kdb5_util -r @value{PRIMARYREALM} create -s
2939 @b{kdb5_util: No such file or directory while setting active database to
2940 @result{} '@value{ROOTDIR}/var/krb5kdc/principal'
2941 Initializing database '@value{ROOTDIR}/var/krb5kdc/principal' for
2942 @result{} realm '@value{PRIMARYREALM}',
2943 master key name 'K/M@@@value{PRIMARYREALM}'
2944 You will be prompted for the database Master Password.
2945 It is important that you NOT FORGET this password.}
2946 @iftex
2947 @b{Enter KDC database master key:}  @i{@doubleleftarrow{} Type the master password.}
2948 @b{Re-enter KDC database master key to verify:}  @i{@doubleleftarrow{} Type it again.}
2949 @end iftex
2950 @ifinfo
2951 @b{Enter KDC database master key:}  @i{<= Type the master password.}
2952 @b{Re-enter KDC database master key to verify:}  @i{<= Type it again.}
2953 @end ifinfo
2954 @ifhtml
2955 @b{Enter KDC database master key:}  @i{<= Type the master password.}
2956 @b{Re-enter KDC database master key to verify:}  @i{<= Type it again.}
2957 @end ifhtml
2958 @b{shell%}
2959 @end group
2960 @end smallexample
2961
2962 If you need to destroy the current Kerberos database, use the
2963 @code{kdb5_util} @code{destroy} command.  The syntax is:
2964
2965 @smallexample
2966 @b{kdb5_util destroy} [@b{-f}]
2967 @end smallexample
2968
2969 The @code{destroy} command destroys the database, first overwriting the
2970 disk sectors and then unlinking the files.  If you specify the
2971 @samp{-f} option, @code{kdb5_util} will not prompt you for a
2972 confirmation before destroying the database.
2973
2974 @smallexample
2975 @group
2976 @b{shell%} @value{ROOTDIR}/sbin/kdb5_util -r @value{PRIMARYREALM} destroy
2977 @iftex
2978 @b{kdb5_util: Deleting KDC database stored in @value{DefaultDatabaseName}, are you sure 
2979 (type yes to confirm)?} @i{@doubleleftarrow{}yes}
2980 @end iftex
2981 @ifinfo
2982 @b{kdb5_util: Deleting KDC database stored in @value{DefaultDatabaseName}, are you sure 
2983 (type yes to confirm)?} @i{<== yes}
2984 @end ifinfo
2985 @ifhtml
2986 @b{kdb5_util: Deleting KDC database stored in @value{DefaultDatabaseName}, are you sure
2987 (type yes to confirm)?} @i{<== yes}
2988 @end ifhtml
2989 @b{OK, deleting database '@value{DefaultDatabaseName}'...}
2990
2991 @b{shell%}
2992 @end group
2993 @end smallexample
2994
2995 @node Global Operations on the Kerberos LDAP Database, Cross-realm Authentication, Global Operations on the Kerberos Database, Administrating the Kerberos Database
2996 @section Global Operations on the Kerberos LDAP Database
2997
2998
2999 The @code{kdb5_ldap_util} is the primary tool for administrating the Kerberos LDAP database. It allows an administrator to manage realms, Kerberos services ( KDC and Admin Server) and ticket policies.
3000 @noindent
3001 The syntax is: 
3002 @smallexample
3003 @b{kdb5_ldap_util} [@b{-D user_dn} [@i{-w passwd]}] [@b{-H} @i{ldap_uri}] command @i{[command_options]}
3004 @end smallexample
3005
3006 @table @b
3007 @itemx -D @i{user_dn}
3008 Specifies the Distinguished Name (DN) of the user who has sufficient rights to perform the operation on the LDAP server.
3009 @itemx @b{-w} @i{passwd}
3010 Specifies the password of user_dn. This option is not recommended.
3011 @itemx @b{-H} @i{ldap_uri}
3012 Specifies the URI of the LDAP server. It is recommended to use ldapi:// or ldaps:// to connect to the LDAP server.
3013 @end table
3014 @menu
3015 * Creating a Kerberos Realm::   
3016 * Modifying a Kerberos Realm::  
3017 * Retrieving Information about a Kerberos Realm::  
3018 * Destroying a Kerberos Realm::  
3019 * Listing available Kerberos Realms::  
3020 * Stashing Service Object's Password::  
3021 * Creating and Modifying a Ticket Policy::  
3022 * Retrieving Information About a Ticket Policy::  
3023 * Destroying a Ticket Policy::  
3024 * Listing available Ticket Policies::  
3025 * Creating a Service Object (eDirectory)::  
3026 * Modifying a Service Object (eDirectory)::  
3027 * Retrieving Service Object Information (eDirectory)::  
3028 * Destroying a Service Object (eDirectory)::  
3029 * Listing Available Service Objects (eDirectory)::  
3030 * Passwords for Service Objects (eDirectory)::  
3031 @end menu
3032
3033 @node Creating a Kerberos Realm, Modifying a Kerberos Realm, Global Operations on the Kerberos LDAP Database, Global Operations on the Kerberos LDAP Database
3034 @subsection Creating a Kerberos Realm
3035
3036 If you need to create a new realm, use the command as follows: 
3037 @smallexample
3038
3039 @b{create}  [@b{-r} @i{realm}]  [@b{-subtrees} @i{subtree_dn_list}] [@b{-sscope} @i{search_scope}] [@b{-containerref} @i{container_reference_dn}]
3040 [@b{-k} @i{ mkeytype}] [@b{-m}|@b{-P} @i{password}][@b{-sf} @i{stashlename}] [@b{-s}] [@b{-maxtktlife} @i{max_ticket_life}]
3041 [@b{-maxrenewlife} @i{ max_renewable_ticket_life}] [@b{ticket_flags}] 
3042
3043 @end smallexample
3044
3045 @noindent
3046 Options to create realm in directory are as follows: 
3047
3048 @table @b
3049
3050 @itemx @b{-r} @i{realm}
3051 Specifies the Kerberos realm of the database; by default the realm returned by @samp{krb5_default_local_realm} (3) is used.
3052
3053 @itemx @b{-subtrees} @i{subtree_dn_list}
3054 Specifies the list of subtrees containing principals of a realm. The list contains the DN of the subtree objects separated by colon(:).
3055
3056 @itemx @b{-sscope} @i{search_scope}
3057 Specifies the scope for searching the principals under the subtree. The possible values are 1 or one (one level), 2 or sub (subtree).
3058
3059 @itemx @b{-containerref} @i{container_reference_dn}
3060 Specfies the DN of the container object in which the principals of a realm will be created. If the container reference is not configured for a realm, the principals will be created in the realm container.
3061
3062 @itemx @b{-k} @i{mkeytype}
3063 Specifies the key type of the master key in the database; the default
3064 is that given in @file{kdc.conf}.
3065
3066 @itemx @b{-m} @i{}
3067 Specifies that the master database password should be read from the TTY rather than fetched from a file on disk.
3068
3069 @itemx @b{-p} @i{password}
3070 Specifies the master database password. This option is not recommended.
3071
3072 @itemx @b{-sf} @i{stashfilename}
3073 Specifies the stash file of the master database password.
3074
3075 @itemx @b{-s} @i{}
3076 Specifies that the stash file is to be created.
3077
3078 @itemx @b{-maxtktlife} @i{max_ticket_life}
3079 Specifies maximum ticket life for principals in this realm. This value is used, if it is not set on the principal.
3080
3081 @itemx @b{-maxrenewlife} @i{max_renewable_ticket_life}
3082 Specifies maximum renewable life of tickets for principals in this realm. This value is used, if it is not set on the principal.
3083
3084 @itemx @b{ticket_flags} @i{}
3085 Specifies the ticket flags. If this option is not specified, by default, none of the flags are set. This means all the ticket options will be allowed and no restriction will be set. This value is used, if it is not set on the principal.
3086 @noindent
3087
3088 The various flags are:
3089 @table @b
3090
3091 @itemx @{-|+@}allow_postdated
3092 @code{-allow_postdated} prohibits principals from obtaining postdated tickets. (Sets the @samp{KRB5_KDB_DISALLOW_POSTDATED} flag.).@code{+allow_postdated} clears this flag.
3093
3094 @itemx @{-|+@}allow_forwardable
3095 @code{-allow_forwardable} prohibits principals from obtaining forwardable tickets. (Sets the 
3096 @samp{KRB5_KDB_DISALLOW_FORWARDABLE} flag.) @code{+allow_forwardable} clears this flag.
3097
3098 @itemx @{-|+@}allow_renewable
3099 @code{-allow_renewable} prohibits principals from obtaining renewable tickets. (Sets the @samp{KRB5_KDB_DISALLOW_RENEWABLE} flag.) @code{+allow_renewable} clears this flag.
3100
3101 @itemx @{-|+@}allow_proxiable
3102 @code{-allow_proxiable} prohibits principals from obtaining proxiable tickets. (Sets the @samp{KRB5_KDB_DISALLOW_PROXABLE} flag.) @code{+allow_proxiable} clears this flag.
3103
3104 @itemx @{-|+@}allow_dup_skey
3105 @code{-allow_dup_skey} disables user-to-user authentication for
3106 principals by prohibiting principals from obtaining a sessions key for
3107 another user.  (Sets the @samp{KRB5_KDB_DISALLOW_DUP_SKEY} flag.)
3108 @code{+allow_dup_skey} clears this flag.
3109
3110 @itemx @{-|+@}requires_preauth
3111 @code{+requires_preauth} requires principals to preauthenticate before being allowed to kinit. (Sets the @samp{KRB5_KDB_REQURES_PRE_AUTH} flag.) @code{-requires_preauth} clears this flag.
3112
3113 @itemx @{-|+@}requires_hwauth
3114 @code{+requires_hwauth} requires principals to preauthenticate using a
3115 hardware device before being allowed to kinit. (Sets the
3116 @samp{KRB5_KDB_REQURES_HW_AUTH} flag.)  @code{-requires_hwauth} clears
3117 this flag.
3118
3119 @itemx @{-|+@}ok_as_delegate
3120 @code{+ok_as_delegate} sets the OK-AS-DELEGATE flag on tickets issued for use
3121 with this principal as the service, which clients may use as a hint that
3122 credentials can and should be delegated when authenticating to the service.
3123 (Sets the @samp{KRB5_KDB_OK_AS_DELEGATE} flag.) @code{-ok_as_delegate} clears
3124 this flag.
3125
3126 @itemx @{-|+@}allow_svr
3127 @code{-allow_svr} prohibits the issuance of service tickets for principals. (Sets the @samp{KRB5_KDB_DISALLOW_SVR} flag.) @code{+allow_svr} clears this flag.
3128
3129 @itemx @{-|+@}allow_tgs_req
3130 @code{-allow_tgs_req} specifies that a @dfn{Ticket-Granting Service
3131 (TGS)} request for a service ticket for principals is not
3132 permitted. This option is useless for most
3133 things.@code{+allow_tgs_req} clears this flag.  The default is
3134 @code{+allow_tgs_req}. In effect, @code{-allow_tgs_req} sets the
3135 @samp{KRB5_KDB_DISALLOW_TGT_BASED} flag on principals in the
3136 database.
3137
3138 @itemx @{-|+@}allow_tix
3139 @code{-allow_tix} forbids the issuance of any tickets for
3140 principals. @code{+allow_tix} clears this flag. The default is
3141 @code{+allow_tix}.  In effect, @code{-allow_tix} sets the
3142 @samp{KRB5_KDB_DISALLOW_ALL_TIX} flag on principals in the database.
3143
3144 @itemx @{-|+@}needchange
3145 @code{+needchange} sets a flag in attributes field to force a password change; 
3146 @code{-needchange} clears it. The default is @code{-needchange}. In effect,
3147 @code{+needchange} sets the @samp{KRB5_KDB_REQURES_PWCHANGE} flag on
3148 principals in the database.
3149
3150 @itemx @{-|+@}password_changing_service
3151 @code{+password_changing_service} sets a flag in the attributes field
3152 marking principal as a password change service principal (useless for
3153 most things). @code{-password_changing_service} clears the flag. This
3154 flag intentionally has a long name. The default is
3155 @code{-password_changing_service}. In effect,
3156 @code{+password_changing_service} sets the
3157 @samp{KRB5_KDB_PWCHANGE_SERVICE} flag on principals in the database.
3158
3159 @end table
3160
3161 @end table
3162
3163 @smallexample
3164 @group
3165 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu create -sscope 2
3166 -subtree ou=users,dc=example,dc=com -r ATHENA.MIT.EDU
3167 @b{Password for "cn=admin,dc=example,dc=com":}
3168 @b{Initializing database for realm 'ATHENA.MIT.EDU'}
3169 @b{You will be prompted for the database Master Password.}
3170 @b{It is important that you NOT FORGET this password.}
3171 @b{Enter KDC database master key:}
3172 @b{Re-enter KDC database master key to verify:}
3173 shell% 
3174 @end group
3175 @end smallexample
3176 @menu
3177 * eDirectory Options (Creating a Kerberos Realm)::
3178 @end menu
3179 @node eDirectory Options (Creating a Kerberos Realm),  , Creating a Kerberos Realm, Creating a Kerberos Realm
3180  
3181 @subsubsection eDirectory Options
3182
3183 @table @b
3184 @itemx @b{-kdcdn} @i{kdc_servce_list}
3185 Specifies the list of KDC service objects serving the realm. The list contains the DNs of the KDC service objects separated by colon(:).
3186
3187 @itemx @b{-admindn} @i{admin_service_list}
3188 Specifies the  list of Administration service objects serving the realm. The list contains the DNs of the Administration service objects separated by colon(:).
3189 @end table
3190
3191 @smallexample
3192 @group
3193 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu create -sscope 2
3194 -subtree ou=users,dc=example,dc=com -kdcdn cn=krbkdc,dc=example,dc=com -admindn cn=krbadmin,dc=example,dc=com -r ATHENA.MIT.EDU
3195 @b{Password for "cn=admin,dc=example,dc=com":}
3196 @b{Initializing database for realm 'ATHENA.MIT.EDU'}
3197 @b{You will be prompted for the database Master Password.}
3198 @b{It is important that you NOT FORGET this password.}
3199 @b{Enter KDC database master key:}
3200 @b{Re-enter KDC database master key to verify:}
3201 shell% 
3202 @end group
3203 @end smallexample
3204
3205 @node Modifying a Kerberos Realm, Retrieving Information about a Kerberos Realm, Creating a Kerberos Realm, Global Operations on the Kerberos LDAP Database
3206 @subsection Modifying a Kerberos Realm
3207
3208 If you need to modify a realm, use the command as follows: 
3209
3210 @smallexample
3211
3212 @b{modify}  [@b{-r} @i{realm}] [@b{-subtrees} @i{subtree_dn}] [@b{-sscope} @i{search_scope}][@b{-containerref} @i{container_reference_dn}]
3213 [@b{-maxtktlife}@i{max_ticket_life}][@b{-maxrenewlife} @i{max_renewable_ticket_life}] [@b{-ticket_flags}]
3214
3215 @end smallexample
3216 Options to modify realm in directory are as follows: 
3217
3218 @table @b
3219
3220 @itemx @b{-r} @i{realm}
3221 Specifies the Kerberos realm of the database; by default the realm returned by krb5_default_local_realm (3) is used.
3222
3223 @itemx @b{-subtrees} @i{subtree_dn_list}
3224 Specifies the list of subtrees containing principal objects in the realm.The list contains the DN of the subtree objects separated by colon(:). This list replaces the existing list. 
3225
3226 @itemx @b{-sscope} @i{search_scope}
3227 Specifies the scope for searching the principals under the subtrees. The possible values are 1 or one (one level), 2 or sub (subtrees).
3228
3229 @itemx @b{-containerref} @i{container_reference_dn}
3230 Specifies the Distinguished Name (DN) of the container object in which the principals of a realm will be created. 
3231
3232 @itemx @b{-maxtktlife} @i{max_ticket_life}
3233 Specifies maximum ticket life for principals in this realm. This value is used, if it is not set on the principal.
3234
3235 @itemx @b{-maxrenewlife} @i{max_renewable_ticket_life}
3236 Specifies maximum renewable life of tickets for principals in this realm.  This value is used, if it is not set on the principal. 
3237
3238 @itemx @b{-ticket_flags} @i{}
3239 Specifies the ticket flags. If this option is not specified, by default, none of the flags are set. This means all the ticket options will be allowed and no restriction will be set.  This value is used, if it is not set on the principal.
3240 @noindent
3241
3242 The various flags are:
3243 @table @b
3244
3245 @itemx @{-|+@}allow_postdated
3246 @code{-allow_postdated} prohibits principals from obtaining postdated tickets. (Sets the @samp{KRB5_KDB_DISALLOW_POSTDATED} flag.).@code{+allow_postdated} clears this flag.
3247 @itemx @{-|+@}allow_forwardable
3248 @code{-allow_forwardable} prohibits principals from obtaining forwardable tickets. 
3249 (Sets the @samp{KRB5_KDB_DISALLOW_FORWARDABLE} flag.) @code{+allow_forwardable} clears this flag.
3250 @itemx @{-|+@}allow_renewable
3251 @code{-allow_renewable} prohibits principals from obtaining renewable tickets. (Sets the @samp{KRB5_KDB_DISALLOW_RENEWABLE} flag.) @code{+allow_renewable} clears this flag.
3252 @itemx @{-|+@}allow_proxiable
3253 @code{-allow_proxiable} prohibits principals from obtaining proxiable tickets. (Sets the @samp{KRB5_KDB_DISALLOW_PROXABLE} flag.) @code{+allow_proxiable} clears this flag.
3254 @itemx @{-|+@}allow_dup_skey
3255 @code{-allow_dup_skey} Disables user-to-user authentication for principals by prohibiting principals from obtaining a sessions key for another user. (Sets the @samp{KRB5_KDB_DISALLOW_DUP_SKEY} flag.). @code{+allow_dup_skey} clears This flag.
3256 @itemx @{-|+@}requires_preauth
3257 @code{+requires_preauth} requires principals to preauthenticate before being allowed to kinit. Sets the 
3258 @samp{KRB5_KDB_REQURES_PRE_AUTH} flag.@code{-requires_preauth} clears this flag.
3259 @itemx @{-|+@}requires_hwauth
3260 @code{+requires_hwauth} requires principals to preauthenticate using a hardware device before being allowed to kinit. (Sets the 
3261 @samp{KRB5_KDB_REQURES_HW_AUTH} flag.)@code{-requires_hwauth} clears this flag.
3262 @itemx @{-|+@}allow_svr
3263 @code{-allow_svr} prohibits the issuance of service tickets for principals. (Sets the @samp{KRB5_KDB_DISALLOW_SVR} flag.) @code{+allow_svr} clears This flag.
3264 @itemx @{-|+@}allow_tgs_req
3265 @code{-allow_tgs_req} specifies that a @dfn{Ticket-Granting Service (TGS)} request for a service ticket for principals is not permitted. This option is useless for most things.@code{+allow_tgs_req} clears this flag. 
3266 The default is. @code{+allow_tgs_req}.  In effect,
3267 @code{-allow_tgs_req} sets the @samp{KRB5_KDB_DISALLOW_TGT_BASED} flag
3268 on principals in the database.
3269 @itemx @{-|+@}allow_tix
3270 @code{-allow_tix} forbids the issuance of any tickets for
3271 principals. @code{+allow_tix} clears this flag. The default is
3272 @code{+allow_tix}.  In effect, @code{-allow_tix} sets the
3273 @samp{KRB5_KDB_DISALLOW_ALL_TIX} flag on principals in the database.
3274 @itemx @{-|+@}needchange
3275 @code{+needchange} sets a flag in attributes field to force a password change; @code{-needchange} clears it. 
3276 The default is @code{-needchange}.  In effect,@code{+needchange} sets
3277 the @samp{KRB5_KDB_REQURES_PWCHANGE} flag on principals in the
3278 database.
3279 @itemx @{-|+@}password_changing_service
3280 @code{+password_changing_service} sets a flag in the attributes field marking principal as a password change service principal (useless for most things).@code{-password_changing_service} clears the flag. This flag intentionally has a long name. The default is @code{-password_changing_service} 
3281 In effect, @code{+password_changing_service} sets the @samp{KRB5_KDB_PWCHANGE_SERVICE} flag on principals in the database.
3282
3283 @end table
3284
3285 @noindent
3286 @noindent
3287 For example:
3288 @smallexample
3289 @group
3290 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu 
3291 modify -r ATHENA.MIT.EDU +requires_preauth
3292 @b{Password for "cn=admin,dc=example,dc=com":}
3293 shell%
3294 @end group
3295 @end smallexample
3296
3297 @menu
3298 * eDirectory Options (Modifying a Kerberos Realm)::  
3299 @end menu
3300
3301 @end table
3302
3303 @node eDirectory Options (Modifying a Kerberos Realm),  , Modifying a Kerberos Realm, Modifying a Kerberos Realm
3304 @subsubsection eDirectory Options
3305
3306 @table @b
3307 @itemx @b{-kdcdn} @i{kdc_service_list}
3308 Specifies the list of KDC service objects serving the realm. The list contains the DNs of the KDC service objects separated by a colon (:). This list replaces the existing list.
3309
3310 @itemx @b{-clearkdcdn} @i{kdc_service_list}
3311 Specifies the list of KDC service objects that need to be removed from the existing list. The list contains the DNs of the KDC service objects separated by a colon (:).
3312
3313 @itemx @b{-addkdcdn} @i{kdc_service_list}
3314 Specifies the list of KDC service objects that need to be added to the existing list. The list contains the DNs of the KDC service objects separated by a colon (:).
3315
3316 @itemx @b{-admindn} @i{admin_service_list}
3317 Specifies the list of Administration service objects serving the realm. The list contains the DNs of the Administration service objects separated by a colon (:). This list replaces the existing list.
3318
3319 @itemx @b{-clearadmindn} @i{admin_service_list} 
3320 Specifies the list of Administration service objects that need to be removed from the existing list. The list contains the DNs of the Administration service objects separated by a colon (:). 
3321
3322 @itemx @b{-addadmindn} @i{admin_service_list}
3323 Specifies the list of Administration service objects that need to be added to the existing list. The list contains the DNs of the Administration service objects separated by a colon (:).
3324
3325 @end table
3326
3327 @node Retrieving Information about a Kerberos Realm, Destroying a Kerberos Realm, Modifying a Kerberos Realm, Global Operations on the Kerberos LDAP Database
3328 @subsection Retrieving Information about a Kerberos Realm
3329
3330 @table @b
3331 @itemx @b{view} [@b{-r} @i{realm}]
3332 Displays the attributes of a realm. Option is as follows:
3333 @itemx @b{-r} @i{realm}
3334 specifies the Kerberos realm of the database; by default the realm returned by krb5_default_local_realm (3)is used.
3335 @end table
3336 @noindent
3337 For example:
3338 @smallexample
3339 @group
3340 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu view -r ATHENA.MIT.EDU
3341 @b{Password for "cn=admin,dc=example,dc=com":}
3342 @b{Realm Name: ATHENA.MIT.EDU}
3343 @b{Subtree: ou=users,dc=example,dc=com}
3344 @b{Subtree: ou=servers,dc=example,dc=com}
3345 @b{SearchScope: ONE}
3346 @b{Maximum ticket life: 0 days 01:00:00}
3347 @b{Maximum renewable life: 0 days 10:00:00}
3348 @b{Ticket flags: DISALLOW_FORWARDABLE}
3349 shell%
3350 @end group
3351 @end smallexample
3352
3353
3354 @node Destroying a Kerberos Realm, Listing available Kerberos Realms, Retrieving Information about a Kerberos Realm, Global Operations on the Kerberos LDAP Database
3355 @subsection Destroying a Kerberos Realm
3356
3357 @table @b
3358 @itemx destroy @b{[-f]} [@i{-r} @b{realm}]
3359 Destroys an existing realm. Options are as follows:
3360 @table @b
3361 @itemx @i{-f} 
3362 If specified, will not prompt the user for confirmation. 
3363 @itemx @b{-r} @i{realm}
3364 specifies the Kerberos realm of the database; by default the realm returned by 
3365 @samp{krb5_default_local_realm} (3)is used.
3366
3367 @end table
3368 @end table
3369 @noindent
3370 For example:
3371 @smallexample
3372 @group
3373 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldap-server1.mit.edu destroy -r ATHENA.MIT.EDU 
3374 @b{Password for "cn=admin,dc=example,dc=com":}
3375 @b{Deleting KDC database of 'ATHENA.MIT.EDU', are you sure?}
3376 @b{type 'yes' to confirm)? Yes}
3377 @b{OK, deleting database of 'ATHENA.MIT.EDU'...}
3378 shell%
3379 @end group
3380 @end smallexample
3381
3382 @node Listing available Kerberos Realms, Stashing Service Object's Password, Destroying a Kerberos Realm, Global Operations on the Kerberos LDAP Database
3383 @subsection Listing available Kerberos Realms
3384
3385 @table @b
3386 @itemx @i{list}
3387 This option lists the name of the realms.
3388 @end table
3389 @noindent
3390 For example:
3391 @smallexample
3392 @group
3393 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu list 
3394 @b{Password for "cn=admin,dc=example,dc=com":}
3395 @b{ATHENA.MIT.EDU}
3396 @b{OPENLDAP.MIT.EDU}
3397 @b{MEDIA-LAB.MIT.EDU}
3398 shell%
3399 @end group
3400 @end smallexample
3401
3402 @node Stashing Service Object's Password, Creating and Modifying a Ticket Policy, Listing available Kerberos Realms, Global Operations on the Kerberos LDAP Database
3403 @subsection Stashing Service Object's Password
3404
3405 @b{stashsrvpw} [@b{-f} @i{filename}] @b{servicedn}
3406
3407 This command allows an administrator to store the password of service object in a file. The KDC and Administration server uses this password to authenticate to the LDAP server. 
3408 @noindent
3409 Options are as follows:
3410
3411 @table @b
3412 @itemx @b{-f} @i{filename}
3413 Specifies the complete path of the service password file. By default, @code{/usr/local/var/service_passwd} is used.
3414 @itemx servicedn
3415 Specifies the Distinguished Name (DN) of the service object whose password is to be stored in file.
3416 @end table
3417 @noindent
3418 For example:
3419 @smallexample
3420 @group
3421 shell% kdb5_ldap_util stashsrvpw -f /home/andrew/conf_keyle cn=service-kdc,dc=example,dc=com
3422 @b{Password for "cn=service-kdc,dc=example,dc=com"}:
3423 @b{Re-enter password for "cn=service-kdc,dc=example,dc=com"}:
3424 shell%
3425 @end group
3426 @end smallexample
3427
3428 @node Creating and Modifying a Ticket Policy, Retrieving Information About a Ticket Policy, Stashing Service Object's Password, Global Operations on the Kerberos LDAP Database
3429 @subsection Creating and Modifying a Ticket Policy
3430
3431 This command creates a ticket policy in directory. 
3432
3433 @smallexample
3434 @b{create_policy} [@b{-r} @i{realm}] [@b{-maxrenewlife} @i{max_renewable_ticket_life}] [@b{ticket_flags}] @b{policy_name}
3435 @end smallexample
3436 Ticket policy objects are created under the realm container.
3437
3438 This command modifies a ticket policy in directory. 
3439 @smallexample
3440 @b{modify_policy} [@b{-r} @i{realm}] [@b{-maxrenewlife} @i{max_renewable_ticket_life}] [@b{ticket_flags}] @b{policy_name}
3441 @end smallexample
3442 @noindent
3443 Options are as follows:
3444
3445 @table @b
3446
3447 @itemx @b{-r} @i{realm}
3448 Specifies the Kerberos realm of the database; by default the realm returned by krb5_default_local_realm(3) is used.
3449 @itemx @b{-maxtktlife} @i{max_ticket_life}
3450 specifies maximum ticket life for principals.
3451 @itemx @b{-maxrenewlife} @i{max_renewable_ticket_life}
3452 specifies maximum renewable life of tickets for principals.
3453
3454 @itemx @b{ticket_flags}
3455 Specifies the ticket flags. If this option is not specified, by default, none of the flags are set. This means all the ticket options will be allowed and no restriction will be set.
3456
3457 @noindent
3458 The various flags are:
3459 @table @b
3460 @itemx @{-|+@}allow_postdated
3461 @code{-allow_postdated} prohibits principals from obtaining postdated tickets. (Sets the @samp{KRB5_KDB_DISALLOW_POSTDATED} flag.).@code{+allow_postdated} clears this flag.
3462
3463 @itemx @{-|+@}allow_forwardable
3464
3465 @code{-allow_forwardable} prohibits principals from obtaining forwardable tickets. (Sets the 
3466 @samp{KRB5_KDB_DISALLOW_FORWARDABLE} flag.) @code{+allow_forwardable} clears this flag.
3467
3468 @itemx @{-|+@}allow_renewable
3469 @code{-allow_renewable} prohibits principals from obtaining renewable tickets. (Sets the @samp{KRB5_KDB_DISALLOW_RENEWABLE} flag.) @code{+allow_renewable} clears this flag.
3470 @itemx @{-|+@}allow_proxiable
3471 @code{-allow_proxiable} prohibits principals from obtaining proxiable tickets. (Sets the @samp{KRB5_KDB_DISALLOW_PROXABLE} flag.) @code{+allow_proxiable} clears this flag.
3472 @itemx @{-|+@}allow_dup_skey
3473 @code{-allow_dup_skey} Disables user-to-user authentication for principals by prohibiting principals from obtaining a sessions key for another user. (Sets the @samp{KRB5_KDB_DISALLOW_DUP_SKEY} flag.). @code{+allow_dup_skey} clears This flag.
3474 @itemx @{-|+@}requires_preauth
3475 @code{+requires_preauth} requires principals to preauthenticate before being allowed to kinit. (Sets the @samp{KRB5_KDB_REQURES_PRE_AUTH} flag.) 
3476 @code{-requires_preauth} clears this flag.
3477
3478 @itemx @{-|+@}requires_hwauth
3479 @code{+requires_hwauth} requires principals to preauthenticate using a
3480 hardware device before being allowed to kinit. (Sets the
3481 @samp{KRB5_KDB_REQURES_HW_AUTH} flag.)  @code{-requires_hwauth} clears
3482 this flag.
3483
3484 @itemx @{-|+@}allow_svr
3485 @code{-allow_svr} prohibits the issuance of service tickets for principals. (Sets the @samp{KRB5_KDB_DISALLOW_SVR} flag.) @code{+allow_svr} clears This flag.
3486 @itemx @{-|+@}allow_tgs_req
3487 @code{-allow_tgs_req} specifies that a @dfn{Ticket-Granting Service (TGS)} request for a service ticket for principals is not permitted. This option is useless for most things.@code{+allow_tgs_req} clears this flag. 
3488 The default is @code{+allow_tgs_req}.  In effect,
3489 @code{-allow_tgs_req} sets the @samp{KRB5_KDB_DISALLOW_TGT_BASED} flag
3490 on principals in the database.
3491
3492 @itemx @{-|+@}allow_tix
3493 @code{-allow_tix} forbids the issuance of any tickets for
3494 principals.  @code{+allow_tix} clears this flag.  The default is
3495 @code{+allow_tix}.  In effect, @code{-allow_tix} sets the
3496 @samp{KRB5_KDB_DISALLOW_ALL_TIX} flag on principals in the database.
3497
3498 @itemx @{-|+@}needchange
3499 @code{+needchange} sets a flag in attributes field to force a password change; 
3500 @code{-needchange} clears it. The default is @code{-needchange}.  In
3501 effect, @code{+needchange} sets the @samp{KRB5_KDB_REQURES_PWCHANGE}
3502 flag on principals in the database.
3503
3504 @itemx @{-|+@}password_changing_service
3505 @code{+password_changing_service} sets a flag in the attributes field
3506 marking principal as a password change service principal (useless for
3507 most things).  @code{-password_changing_service} clears the flag.
3508 This flag intentionally has a long name.  The default is
3509 @code{-password_changing_service}.  In effect,
3510 @code{+password_changing_service} sets the
3511 @samp{KRB5_KDB_PWCHANGE_SERVICE} flag on principals in the database.
3512 @end table
3513
3514 @itemx policy_name
3515 Specifies the name of the ticket policy.
3516
3517 @end table
3518 @noindent
3519 For example:
3520 @smallexample
3521 @group
3522 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu create_policy 
3523 -r ATHENA.MIT.EDU -maxtktlife "1 day" -maxrenewlife "1 week" -allow_forwardable usertktpolicy
3524 @b{Password for "cn=admin,dc=example,dc=com":}
3525 shell%
3526 @end group
3527 @end smallexample
3528
3529 @node Retrieving Information About a Ticket Policy, Destroying a Ticket Policy, Creating and Modifying a Ticket Policy, Global Operations on the Kerberos LDAP Database
3530 @subsection Retrieving Information About a Ticket Policy
3531
3532 @table @b
3533 @b{view_policy} [@b{-r} @i{realm}] @b{policy_name}
3534
3535 @itemx view_policy 
3536 This option displays the attributes of a ticket policy. Option is as follows:
3537
3538 @itemx @b{-r} @i{realm}
3539 Specifies the Kerberos realm of the database; by default the realm returned by krb5_default_local_realm(3) is used.
3540 @itemx policy_name
3541 Specifies the name of the ticket policy.
3542 @end table
3543
3544 For example:
3545 @smallexample
3546 @group
3547 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu view_policy 
3548 -r ATHENA.MIT.EDU usertktpolicy
3549 @b{Password for "cn=admin,dc=example,dc=com":}
3550 @b{Ticket policy: usertktpolicy}
3551 @b{Maxmum ticket life: 0 days 01:00:00}
3552 @b{Maxmum renewable life: 0 days 10:00:00}
3553 @b{Ticket flags: DISALLOW_FORWARDABLE REQUIRES_PWCHANGE}
3554 shell% 
3555 @end group
3556 @end smallexample
3557
3558
3559 @node Destroying a Ticket Policy, Listing available Ticket Policies, Retrieving Information About a Ticket Policy, Global Operations on the Kerberos LDAP Database
3560 @subsection Destroying a Ticket Policy
3561
3562 @table @b
3563 @itemx @b{destroy_policy} @b{[-force]} @b{[-r} @i{realm}@b{]} @b{policy_name}
3564 Destroys an existing ticket policy. Options are as follows:
3565
3566 @table @b
3567
3568 @itemx -force
3569 Forces the deletion of the policy object. If not specified, will be prompted for confirmation while deleting the policy. Enter yes to confirm the deletion.
3570
3571 @itemx -r realm
3572 Specifies the Kerberos realm of the database; by default the realm returned by krb5_default_local_realm(3) is used.
3573
3574 @itemx policy_name
3575 Specifies the name of the ticket policy.
3576 @end table
3577 @end table
3578 @noindent
3579 For example:
3580 @smallexample
3581 @group
3582 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu
3583 destroy_policy -r ATHENA.MIT.EDU usertktpolicy
3584 @b{Password for "cn=admin,dc=example,dc=com":}
3585 @b{This will delete the policy object 'usertktpolicy', are you sure?}
3586 @b{(type 'yes' to confirm)? Yes}
3587 @b{** policy object 'usertktpolicy' deleted.}
3588 shell% 
3589 @end group
3590 @end smallexample
3591
3592 @node Listing available Ticket Policies, Creating a Service Object (eDirectory), Destroying a Ticket Policy, Global Operations on the Kerberos LDAP Database
3593 @subsection Listing available Ticket Policies
3594
3595
3596 @table @b
3597 @itemx @b{list_policy} [@b{-r} @i{realm}]
3598 Lists the name of ticket policies in a realm.
3599
3600 Option are as follows:
3601
3602 @itemx -r realm
3603 Specifies the Kerberos realm of the database; by default the realm returned by krb5_default_local_realm(3) is used.
3604
3605 @end table
3606
3607 @noindent
3608 For example:
3609 @smallexample
3610 @group
3611 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu list_policy -r ATHENA.MIT.EDU 
3612 @b{Password for "cn=admin,dc=example,dc=com":}
3613 @b{usertktpolicy}
3614 @b{tempusertktpolicy}
3615 @b{krbtktpolicy}
3616 shell% 
3617 @end group
3618 @end smallexample
3619
3620 @node Creating a Service Object (eDirectory), Modifying a Service Object (eDirectory), Listing available Ticket Policies, Global Operations on the Kerberos LDAP Database
3621 @subsection Creating a Service Object (eDirectory)
3622 @smallexample
3623 @b{create_service} @i{-kdc|-admin|-pwd} [@b{-servicehost} @i{service_host_list}] [@b{-realm} @i{realm_list}] [@b{-randpw}|
3624 @i{-fileonly}] [@i{-filename}] @b{service_dn}
3625 @end smallexample
3626 @noindent
3627 Creates a service object in directory and assigns appropriate rights on the container holding kerberos data.
3628  
3629 Options are as follows:
3630
3631 @table @b
3632 @itemx -kdc 
3633 Specifies the KDC service
3634 @itemx -admin 
3635 Specifies the Administration service
3636 @itemx -pwd 
3637 Specifies the Password service
3638
3639 @itemx @b{-servicehost} @i{service_host_list}
3640 Specifies the list of entries separated by a colon (:). Each entry consists of the hostname or IP address of the server hosting the service, transport protocol and the port number of the service separated by a pound sign (#).
3641 @noindent 
3642 For example,
3643 @smallexample
3644 server1#tcp#88:server2#udp#89.
3645 @end smallexample
3646 @itemx @b{-realm} @i{realm_list}
3647 Specifies the list of realms that are to be associated with this service. The list contains the name of the realms separated by a colon (:). 
3648 @itemx -randpw 
3649 Generates and sets a random password. This option is used to set the random password for the service object in directory and also to store it in the file. @code{-fileonly} option cannot be used with @code{-randpw} option.
3650
3651 @itemx -fileonly
3652 Stores the password only in a file and not in directory. The @code{-randpw} option can not be used when @code{-fileonly} option is specified.
3653 @itemx @i{-f} @b{filename}
3654 Specifies the complete path of the file where the service object password is stashed. If this option is not specified, the default file will be /usr/local/var/service_passwd
3655 @itemx service_dn
3656 Specifies the Distinguished Name (DN) of the Kerberos service to be created.
3657
3658 @noindent
3659 For example:
3660 @smallexample
3661 @group
3662 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu
3663 create_service -kdc -randpw -f /home/andrew/service_passwd cn=service-kdc,dc=example,dc=com
3664 @b{Password for "cn=admin,dc=example,dc=com":}
3665 @b{File does not exist. Creating the file /home/andrew/service_passwd...}
3666 shell% 
3667 @end group
3668 @end smallexample
3669 @end table
3670
3671 @node Modifying a Service Object (eDirectory), Retrieving Service Object Information (eDirectory), Creating a Service Object (eDirectory), Global Operations on the Kerberos LDAP Database
3672 @subsection Modifying a Service Object (eDirectory)
3673 @smallexample
3674 @b{modify_service} [@b{-servicehost} @i{service_host_list} |[@b{-clearservicehost} @i{service_host_list}] [@b{-addservicehost} @i{service_host_list}]] [@b{-realm} @i{realm_list} | [@b{-clearrealm} @i{realm_list}] [@b{-addrealm} @i{realm_list}]] service_dn
3675 @end smallexample
3676
3677 Modifies the attributes of a service and assigns appropriate rights, if realm associations are changed.
3678
3679 Options are as follows:
3680
3681 @table @b
3682 @itemx @b{-servicehost} @i{service_host_list}
3683 List of entries separated by a colon (:) where each entry consists of host name or IP address of the server hosting the service, transport protocol, and port number of the service separated by a pound sign (#). This list replaces the existing list.
3684 For example, 
3685 @smallexample
3686 server1#tcp#88:server2#udp#89
3687 @end smallexample
3688 @itemx @b{-clearservicehost} @i{service_host_list}
3689 Specifies the list of servicehost entries to be removed from the existing list. This is a colon separated list. 
3690 @itemx @b{-addservicehost} @i{service_host_list}
3691 Specifies the list of servicehost entries to be added to the existing list. This is a colon separated list.
3692 @itemx @b{-realm} @i{realm_list}
3693 Specifies the list of realms that are to be associated with this service. The list contains the name of the realms separated by a colon (:). This list replaces the existing list.
3694 @itemx @b{-clearrealm} @i{realm_list}
3695 Specifies the list of realms to be removed from the existing list. The list contains the name of the realms separated by a colon (:).
3696 @itemx @b{-addrealm} @i{realm_list}
3697 Specifies the list of realms to be added to the existing list. The list contains the name of the realms separated by a colon (:).
3698 @itemx service_dn
3699 Specifies the Distinguished Name (DN) of the Kerberos service to be modified.
3700
3701 @end table
3702
3703 @noindent
3704 For example:
3705
3706 @smallexample
3707 @group
3708 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu
3709 modify_service -realm ATHENA.MIT.EDU cn=service-kdc,dc=example,dc=com
3710 @b{Password for "cn=admin,dc=example,dc=com":}
3711 @b{Changing rights for the service object. Please wait ... done}
3712 shell% 
3713 @end group
3714 @end smallexample
3715 @node Retrieving Service Object Information (eDirectory), Destroying a Service Object (eDirectory), Modifying a Service Object (eDirectory), Global Operations on the Kerberos LDAP Database
3716 @subsection Retrieving Service Object Information (eDirectory)
3717
3718 @table @b
3719 @itemx view_service service_dn
3720 Displays the attributes of a service. Options are as follows:
3721
3722 @itemx service_dn
3723 Specifies the Distinguished name (DN) of the Kerberos service to be viewed.
3724 @end table
3725
3726 For example:
3727 @smallexample
3728 @group
3729 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu 
3730 view_service cn=service-kdc,dc=example,dc=com
3731 @b{Password for "cn=admin,dc=example,dc=com":}
3732 @b{Service dn: cn=service-kdc,dc=example,dc=com}
3733 @b{Service type: kdc}
3734 @b{Service host list:}
3735 @b{Realm DN list: cn=ATHENA.MIT.EDU,cn=Kerberos,dc=example,dc=com}
3736 shell% 
3737 @end group
3738 @end smallexample
3739
3740 @node Destroying a Service Object (eDirectory), Listing Available Service Objects (eDirectory), Retrieving Service Object Information (eDirectory), Global Operations on the Kerberos LDAP Database
3741 @subsection Destroying a Service Object (eDirectory)
3742 @smallexample
3743 @b{destroy_service} [@b{-force}] [@b{-f} @i{stashfilename}] service_dn
3744 @end smallexample
3745 @noindent
3746 Destroys an existing service. Options are as follows :
3747
3748 @table @b
3749 @itemx -force
3750 If specified, will not prompt for user's confirmation, instead will force destruction of service.
3751 @itemx @b{-f} @i{stashfilename}
3752 Complete path of the service password file from where the entry corresponding to the service_dn needs to be removed.
3753 @itemx service_dn
3754 Distinguished Name (DN) of the Kerberos service to be destroyed.
3755 @end table
3756 @noindent
3757 For example:
3758 @smallexample
3759 @group
3760 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu
3761 destroy_service cn=service-kdc,dc=example,dc=com
3762 @b{Password for "cn=admin,dc=example,dc=com":}
3763 @b{This will delete the service object 'cn=service-kdc,dc=example,dc=com', are you sure?}
3764 @b{(type 'yes' to confirm)? Yes}
3765 @b{** service object 'cn=service-kdc,dc=example,dc=com' deleted.}
3766 shell% 
3767 @end group
3768 @end smallexample
3769
3770 @node Listing Available Service Objects (eDirectory), Passwords for Service Objects (eDirectory), Destroying a Service Object (eDirectory), Global Operations on the Kerberos LDAP Database
3771 @subsection Listing Available Service Objects (eDirectory)
3772
3773 @table @b
3774 @itemx list_service [-basedn base_dn]
3775 Lists the name of services under a given base in directory. Options is as follows:
3776
3777 @itemx @b{-basedn} @i{base_dn}
3778 Specifies the base DN for searching the policies, limiting the search to a particular subtree. If this option is not provided, LDAP Server specific search base will be used. For e.g., in the case of OpenLDAP, value of @code{defaultsearchbase} from @file{slapd.conf} file will be used, where as in the case of eDirectory, the default value for the base DN is Root.
3779 @end table
3780
3781 @noindent
3782 For example:
3783 @smallexample
3784 @group
3785 shell% kdb5_ldap_util -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu list_service
3786 @b{Password for "cn=admin,dc=example,dc=com":}
3787 @b{cn=service-kdc,dc=example,dc=com}
3788 @b{cn=service-adm,dc=example,dc=com}
3789 @b{cn=service-pwd,dc=example,dc=com}
3790 shell% 
3791 @end group
3792 @end smallexample
3793
3794 @node Passwords for Service Objects (eDirectory),  , Listing Available Service Objects (eDirectory), Global Operations on the Kerberos LDAP Database
3795 @subsection Passwords for Service Objects (eDirectory)
3796
3797 @b{setsrvpw} @b{[-randpw|-fileonly]}@b{[-f} @i{ filename}@b{]} @b{service_dn}
3798
3799 Allows an administrator to set password for service objects such as KDC and Administration server in eDirectory and store them in a file. The 
3800 @code{-fileonly} command stores the password in a file and not in the eDirectory object. 
3801 Options are as follows:
3802 @table @b
3803 @itemx @b{-randpw} 
3804 Generates and sets a random password on the directory object and stores it in the file. The @code{-fileonly} option can not be used if @code{-randpw} option is already specified.
3805 @itemx @b{-fileonly}
3806 Stores the password only in a file and not in eDirectory. The @code{-randpw} option can not be used when @code{-fileonly} option is specified.
3807 @itemx @b{-f} @i{filename}
3808 Specifies the complete path of the file where the service object password is stashed. If this option is not specified, the default file will be /usr/local/var/service_passwd.
3809 @itemx service_dn
3810 Specifies the Distinguished Name (DN) of the service object whose password is to be set.
3811
3812 @end table
3813
3814
3815 @noindent
3816 For example:
3817
3818 @smallexample
3819 @group
3820 shell% kdb5_ldap_util setsrvpw -D cn=admin,dc=example,dc=com -H ldaps://ldap-server1.mit.edu
3821 setsrvpw -f /home/andrew/conf_keyfile cn=service-kdc,dc=example,dc=com
3822 @b{Password for "cn=admin,dc=example,dc=com":}
3823 @b{Password for "cn=service-kdc,dc=example,dc=com":}
3824 @b{Re-enter password for "cn=service-kdc,dc=example,dc=com":}
3825 shell% 
3826 @end group
3827 @end smallexample
3828
3829 @ignore
3830 @c @node The KDC Logs,  , GLobal operations on the Kerberos LDAP Database, Administrating the Kerberos Database
3831 @c @section The KDC Logs
3832
3833 This will have to wait until the next release.  *sigh*
3834 @end ignore
3835
3836 @node Cross-realm Authentication, Changing the krbtgt Key, Global Operations on the Kerberos LDAP Database, Administrating the Kerberos Database
3837 @section Cross-realm Authentication
3838
3839 In order for a KDC in one realm to authenticate Kerberos users in a
3840 different realm, it must share a key with the KDC in the other realm.
3841 In both databases, there must be krbtgt service principals for realms.
3842 These principals should all have the same passwords, key version
3843 numbers, and encryption types.  For example, if the administrators of
3844 @value{PRIMARYREALM} and @value{SECONDREALM} wanted to authenticate
3845 across the realms, they would run the following commands on the KDCs in
3846 @i{both} realms:
3847
3848 @smallexample
3849 @group
3850 @b{shell%:} kadmin.local -e "des3-hmac-sha1:normal des-cbc-crc:v4"
3851 @b{kadmin:} addprinc -requires_preauth krbtgt/@value{PRIMARYREALM}@@@value{SECONDREALM}
3852 @b{Enter password for principal krbtgt/@value{PRIMARYREALM}@@@value{SECONDREALM}:} 
3853 @b{Re-enter password for principal krbtgt/@value{PRIMARYREALM}@@@value{SECONDREALM}:}
3854 @b{kadmin:} addprinc -requires_preauth krbtgt/@value{SECONDREALM}@@@value{PRIMARYREALM}
3855 @b{Enter password for principal krbtgt/@value{SECONDREALM}@@@value{PRIMARYREALM}:}
3856 @b{Enter password for principal krbtgt/@value{SECONDREALM}@@@value{PRIMARYREALM}:}
3857 @b{kadmin:}
3858 @end group
3859 @end smallexample
3860
3861 Even if most principals in a realm are generally created with the
3862 requires_preauth flag enabled, this flag is not desirable on
3863 cross-realm authentication keys because doing so makes it impossible to
3864 disable preauthentication on a service-by-service basis.  Disabling it
3865 as in the example above is recommended.
3866
3867 It is also very important that these principals have good passwords.
3868 @value{COMPANY} recommends that TGT principal passwords be at least 26
3869 characters of random ASCII text.
3870
3871 @node Changing the krbtgt Key,  , Cross-realm Authentication, Administrating the Kerberos Database
3872 @section Changing the krbtgt Key
3873
3874 A Kerberos Ticket Granting Ticket (TGT) is a service ticket for the
3875 principal krbtgt/@i{REALM}.  The key for this principal is created when
3876 the Kerberos database is initialized and need not be changed.  However,
3877 it will only have the encryption types supported by the KDC at the time
3878 of the initial database creation.  To allow use of newer encryption
3879 types for the TGT, this key has to be changed.
3880
3881 Changing this key using the normal @code{kadmin change_password} command
3882 would invalidate any previously issued TGTs.  Therefore, when changing
3883 this key, normally one should use the @b{-keepold} flag to
3884 @code{change_password} to retain the previous key in the database as
3885 well as the new key.  For example:
3886
3887 @smallexample
3888 @group
3889 @b{kadmin:} change_password -randkey -keepold krbtgt/@value{PRIMARYREALM}@@@value{PRIMARYREALM}
3890 @end group
3891 @end smallexample
3892
3893 There is currently no way to remove the old key without running
3894 @code{change_password} without the @b{-keepold} flag (and thereby
3895 invalidating all existing TGTs).  After issuing this command, the old
3896 key is still valid and is still vulnerable to (for instance) brute force
3897 attacks.  To completely retire an old key or encryption type, it's
3898 therefore currently necessary to declare a flag day, run
3899 @code{change_password} without the @b{-keepold} flag, and force all
3900 users to acquire new tickets.
3901
3902 @node Configuring Kerberos with OpenLDAP back-end, Application Servers, Administrating the Kerberos Database, Top
3903 @chapter Configuring Kerberos with OpenLDAP back-end
3904
3905 @enumerate
3906 @item
3907 Set up SSL on the OpenLDAP server and client to ensure secure
3908 communication when the KDC service and LDAP server are on different
3909 machines. @code{ldapi://} can be used if the LDAP server and KDC
3910 service are running on the same machine.
3911
3912 @enumerate A
3913 @item
3914 Setting up SSL on the OpenLDAP server:
3915
3916 @enumerate a
3917 @item
3918 Get a CA certificate using OpenSSL tools
3919
3920 @item
3921 Configure OpenLDAP server for using SSL/TLS
3922
3923 @noindent
3924    For the latter, you need to specify the location of CA certificate location in slapd.conf file.
3925
3926 @noindent
3927    Refer to the following link for more information:
3928
3929 @noindent
3930 @uref{http://www.openldap.org/doc/admin23/tls.html}
3931 @end enumerate
3932
3933 @item
3934 Setting up SSL on OpenLDAP Client:
3935
3936 @enumerate a
3937 @item
3938 For the KDC and Admin Server, you need to do the client-side configuration in ldap.conf.
3939
3940 @noindent
3941 For example,
3942 @smallexample
3943 TLS_CACERT @code{/etc/openldap/certs/cacert.pem}
3944 @end smallexample
3945 @end enumerate
3946 @end enumerate
3947
3948 @item
3949 Include the Kerberos schema file (kerberos.schema) in the
3950 configuration file (slapd.conf) on the LDAP Server, by providing the
3951 location where it is stored.
3952
3953 @smallexample
3954 include @code{/etc/openldap/schema/kerberos.schema}
3955 @end smallexample
3956
3957 @item
3958 Choose DNs for the KDC and kadmin servers to bind to the LDAP server,
3959 and create them if necessary.  These DNs will be specified with the
3960 @code{ldap_kdc_dn} and @code{ldap_kadmind_dn} directives in krb5.conf;
3961 their passwords can be stashed with @code{kdb5_ldap_util stashsrvpw}
3962 and the resulting file specified with the
3963 @code{ldap_service_password_file} directive.
3964
3965 @item
3966 Choose a DN for the global Kerberos container entry (but do not create
3967 the entry at this time).  This DN will be specified with the
3968 @code{ldap_kerberos_container_dn} directive in krb5.conf.  Realm
3969 container entries will be created underneath this DN.  Principal
3970 entries may exist either underneath the realm container (the default)
3971 or in separate trees referenced from the realm container.
3972
3973 @item
3974 Configure the LDAP server ACLs to enable the KDC and kadmin server DNs
3975 to read and write the Kerberos data.
3976
3977 @subheading
3978 Sample access control information
3979
3980 @smallexample
3981 access to dn.base=""
3982         by * read
3983                                                                                                                                                              
3984 access to dn.base="cn=Subschema"
3985         by * read
3986                                                                                                                                                              
3987 access to attrs=userPassword,userPKCS12
3988         by self write
3989         by * auth
3990                                                                                                                                                              
3991 access to attrs=shadowLastChange
3992         by self write
3993         by * read
3994
3995 # Providing access to realm container
3996 access to @code{dn.subtree}= @i{"cn=EXAMPLE.COM,cn=krbcontainer,dc=example,dc=com"} 
3997         by @code{dn.exact}=@i{"cn=kdc-service,dc=example,dc=com"} read
3998         by @code{dn.exact}=@i{"cn=adm-service,dc=example,dc=com"} write
3999         by * none
4000
4001 # Providing access to principals, if not underneath realm container
4002 access to @code{dn.subtree}= @i{"ou=users,dc=example,dc=com"} 
4003         by @code{dn.exact}=@i{"cn=kdc-service,dc=example,dc=com"} read
4004         by @code{dn.exact}=@i{"cn=adm-service,dc=example,dc=com"} write
4005         by * none
4006
4007 access to *
4008         by * read
4009 @end smallexample
4010
4011 @noindent
4012 If the locations of the container and principals or the DNs of the
4013 service objects for a realm are changed then this information should
4014 be updated.
4015
4016 @item
4017 Start the LDAP server as follows: 
4018 @smallexample
4019 slapd -h "ldapi:/// ldaps:///"
4020 @end smallexample
4021  
4022 @item
4023 Modify the krb5.conf file to include LDAP specific items listed below:
4024 @smallexample
4025 @samp{realms}
4026 @noindent  @samp{database_module}
4027 @noindent
4028 @samp{dbmodules}
4029 @noindent  @samp{db_library}
4030 @noindent  @samp{db_module_dir}
4031 @noindent  @samp{ldap_kdc_dn}
4032 @noindent  @samp{ldap_kadmind_dn}
4033 @noindent  @samp{ldap_service_password_file}
4034 @noindent  @samp{ldap_servers}
4035 @noindent  @samp{ldap_conns_per_server}
4036 @end smallexample
4037
4038 @noindent
4039 For the sample @file{krb5.conf} file, refer to @ref{Sample krb5.conf File}.
4040 @noindent
4041 For more details, refer to the section @file{krb5.conf}
4042
4043 @item
4044 Create the realm using @samp{kdb5_ldap_util}.
4045
4046 @smallexample
4047 @b{kdb5_ldap_util} @b{-D} @i{cn=admin,dc=example,dc=com} create @b{-subtrees} @i{ou=users,dc=example,dc=com} @b{-r} @i{EXAMPLE.COM} @b{-s}
4048 @end smallexample
4049
4050 @noindent
4051 Use the @code{-subtrees} option if the principals are to exist in a separate subtree from the realm container.  Before executing the command, make sure that the subtree mentioned above @samp{(ou=users,dc=example,dc=com)} exists.  If the principals will exist underneath the realm container, omit the @code{-subtrees} option and do not worry about creating the principal subtree.
4052
4053 For more information, refer to the section @dfn{Global Operations on the Kerberos LDAP Database}.
4054
4055 @noindent
4056 The realm object is created under the ldap_kerberos_container_dn specified in the configuration file. This operation will also create the Kerberos container, if not present already. This will be used to store information related to all realms.
4057
4058 @item 
4059 Stash the password of the service object used by the KDC and
4060 Administration service to bind to the LDAP server using the stashsrvpw
4061 command of kdb5_ldap_util. The object DN should be the same as
4062 ldap_kdc_dn and ldap_kadmind_dn values specified in the krb5.conf
4063 file.
4064
4065 @smallexample
4066 @b{kdb5_ldap_util} @b{-D} @i{cn=admin,dc=example,dc=com} @i{stashsrvpw} @b{-f} @code{/etc/kerberos/service.keyfile} @i{cn=krbadmin,dc=example,dc=com}
4067 @end smallexample
4068
4069 @item
4070 Add krb5principalname to the indexes in slapd.conf to speed up the access.
4071 @end enumerate
4072
4073 With the LDAP back end it is possible to provide aliases for principal
4074 entries.  Currently we provide no mechanism provided for creating
4075 aliases, so it must be done by direct manipulation of the LDAP
4076 entries.
4077
4078 An entry with aliases contains multiple values of the krbPrincipalName
4079 attribute.  Since LDAP attribute values are not ordered, it is
4080 necessary to specify which principal name is canonical, by using the
4081 krbCanonicalName attribute.  Therefore, to create aliases for an
4082 entry, first set the krbCanonicalName attribute of the entry to the
4083 canonical principal name (which should be identical to the
4084 pre-existing krbPrincipalName value), and then add additional
4085 krbPrincipalName attributes for the aliases.
4086
4087 Principal aliases are only returned by the KDC when the client
4088 requests canonicalization.  Canonicalization is normally requested for
4089 service principals; for client principals, an explicit flag is often
4090 required (e.g. @code{kinit -C}) and canonicalization is only performed
4091 for initial ticket requests.
4092
4093 @node Application Servers, Backups of Secure Hosts, Configuring Kerberos with OpenLDAP back-end, Top
4094 @chapter Application Servers
4095
4096 If you need to install the @value{PRODUCT} programs on an application
4097 server, please refer to the @value{PRODUCT} Installation Guide.  Once
4098 you have installed the software, you need to add that host to the
4099 Kerberos database (@pxref{Adding or Modifying Principals}), and generate
4100 a @dfn{keytab} for that host, that contains the host's key.  You also
4101 need to make sure the host's clock is within your maximum clock skew of
4102 the KDCs.
4103
4104 @menu
4105 * Keytabs::                     
4106 * Clock Skew::                  
4107 * Getting DNS Information Correct::  
4108 * Configuring Your Firewall to Work With Kerberos V5::  
4109 @end menu
4110
4111 @node Keytabs, Clock Skew, Application Servers, Application Servers
4112 @section Keytabs
4113
4114 A @dfn{keytab} is a host's copy of its own keylist, which is analogous
4115 to a user's password.  An application server that needs to authenticate
4116 itself to the KDC has to have a keytab that contains its own principal
4117 and key.  Just as it is important for users to protect their passwords,
4118 it is equally important for hosts to protect their keytabs.  You should
4119 always store keytab files on local disk, and make them readable only by
4120 root, and you should never send a keytab file over a network in the
4121 clear.  Ideally, you should run the @code{kadmin} command to extract a
4122 keytab on the host on which the keytab is to reside.
4123
4124 @menu
4125 * Adding Principals to Keytabs::  
4126 * Removing Principals from Keytabs::  
4127 @end menu
4128
4129 @node Adding Principals to Keytabs, Removing Principals from Keytabs, Keytabs, Keytabs
4130 @subsection Adding Principals to Keytabs
4131
4132 To generate a keytab, or to add a principal to an existing keytab, use
4133 the @code{ktadd} command from @code{kadmin}, which requires the
4134 ``inquire'' administrative privilege.  (If you use the @b{-glob}
4135 @i{princ_exp} option, it also requires the ``list'' administrative
4136 privilege.)  The syntax is:
4137
4138 @smallexample
4139 @b{ktadd} [@b{-k[eytab]} @i{keytab}] [@b{-q}] [@b{-e}
4140 @i{key:salt_list}] [@i{principal} | @b{-glob} @i{princ_exp}]
4141 [@i{@dots{}}]
4142 @end smallexample
4143
4144 The @code{ktadd} command takes the following switches:
4145
4146 @table @b
4147 @item -k[eytab] @i{keytab}
4148 use @i{keytab} as the keytab file.  Otherwise, @code{ktadd} will use the
4149 default keytab file (@code{@value{DefaultDefaultKeytabName}}).
4150
4151 @item @b{-e} @i{"enc:salt..."} 
4152 Uses the specified list of enctype-salttype pairs for setting the key
4153 of the principal.  The quotes are necessary if there are multiple
4154 enctype-salttype pairs.  This will not function against kadmin daemons
4155 earlier than krb5-1.2.  See @ref{Supported Encryption Types} and
4156 @ref{Salts} for all possible values.
4157
4158 @item -q
4159 run in quiet mode.  This causes @code{ktadd} to display less verbose
4160 information.
4161
4162 @item @i{principal} | -glob @i{principal expression}
4163 add @i{principal}, or all principals matching @i{principal expression}
4164 to the keytab.  The rules for @i{principal expression} are the same as
4165 for the kadmin @code{list_principals} (@pxref{Retrieving a List of
4166 Principals}) command.
4167 @end table
4168
4169 Here is a sample session, using configuration files that enable only
4170 @samp{des-cbc-crc} encryption. (The line beginning with @result{} is a
4171 continuation of the previous line.)
4172
4173 @smallexample
4174 @group
4175 @b{kadmin:} ktadd host/@value{RANDOMHOST1}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}
4176 @b{kadmin: Entry for principal host/@value{RANDOMHOST1}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM} with
4177      kvno 2, encryption type DES-CBC-CRC added to keytab
4178      WRFILE:/etc/krb5.keytab.
4179 kadmin:}
4180 @end group
4181 @end smallexample
4182
4183 @smallexample
4184 @group
4185 @b{kadmin:} ktadd -k @value{ROOTDIR}/var/krb5kdc/kadmind.keytab
4186 @result{} kadmin/admin kadmin/changepw
4187 @b{kadmin: Entry for principal kadmin/admin@@@value{PRIMARYREALM} with
4188      kvno 3, encryption type DES-CBC-CRC added to keytab
4189      WRFILE:@value{ROOTDIR}/var/krb5kdc/kadmind.keytab.
4190 kadmin:}
4191 @end group
4192 @end smallexample
4193
4194 @node Removing Principals from Keytabs,  , Adding Principals to Keytabs, Keytabs
4195 @subsection Removing Principals from Keytabs
4196
4197 To remove a principal from an existing keytab, use the kadmin
4198 @code{ktremove} command.  The syntax is:
4199
4200 @smallexample
4201 @b{ktremove} [@b{-k[eytab]} @i{keytab}] [@b{-q}] @i{principal} [@i{kvno} | @b{all} | @b{old}]
4202 @end smallexample
4203
4204 The @code{ktremove} command takes the following switches:
4205
4206 @table @b
4207 @item -k[eytab] @i{keytab}
4208 use @i{keytab} as the keytab file.  Otherwise, @code{ktremove} will use
4209 the default keytab file (@code{/etc/krb5.keytab}).
4210
4211 @item -q
4212 run in quiet mode.  This causes @code{ktremove} to display less verbose
4213 information.
4214
4215 @item @i{principal}
4216 the principal to remove from the keytab.  (Required.)
4217
4218 @item @i{kvno}
4219 remove all entries for the specified principal whose Key Version Numbers
4220 match @i{kvno}.
4221
4222 @item all
4223 remove all entries for the specified principal
4224
4225 @item old
4226 remove all entries for the specified principal except those with the
4227 highest kvno.
4228 @end table
4229
4230 For example:
4231
4232 @smallexample
4233 @group
4234 @b{kadmin:} ktremove -k @value{ROOTDIR}/var/krb5kdc/kadmind.keytab kadmin/admin
4235 @b{kadmin: Entry for principal kadmin/admin with kvno 3 removed
4236      from keytab WRFILE:@value{ROOTDIR}/var/krb5kdc/kadmind.keytab.
4237 kadmin:}
4238 @end group
4239 @end smallexample
4240
4241 @node Clock Skew, Getting DNS Information Correct, Keytabs, Application Servers
4242 @section Clock Skew
4243
4244 In order to prevent intruders from resetting their system clocks in
4245 order to continue to use expired tickets, @value{PRODUCT} is set up to
4246 reject ticket requests from any host whose clock is not within the
4247 specified maximum clock skew of the KDC (as specified in the
4248 @code{kdc.conf} file).  Similarly, hosts are configured to reject
4249 responses from any KDC whose clock is not within the specified maximum
4250 clock skew of the host (as specified in the @code{krb5.conf} file).  The
4251 default value for maximum clock skew is @value{DefaultClockskew}.
4252
4253 @value{COMPANY} suggests that you add a line to client machines'
4254 @code{/etc/rc} files to synchronize the machine's clock to your KDC at
4255 boot time.  On UNIX hosts, assuming you had a kdc called
4256 @code{@value{KDCSERVER}} in your realm, this would be:
4257
4258 @smallexample
4259 gettime -s @value{KDCSERVER}
4260 @end smallexample
4261
4262 If the host is not likely to be rebooted frequently, you may also want
4263 to set up a cron job that adjusts the time on a regular basis.
4264
4265 @node Getting DNS Information Correct, Configuring Your Firewall to Work With Kerberos V5, Clock Skew, Application Servers
4266 @section Getting DNS Information Correct
4267
4268 Several aspects of Kerberos rely on name service.  In order for Kerberos
4269 to provide its high level of security, it is less forgiving of name
4270 service problems than some other parts of your network.  It is important
4271 that your Domain Name System (DNS) entries and your hosts have the
4272 correct information.
4273
4274 Each host's canonical name must be the fully-qualified host name
4275 (including the domain), and each host's IP address must reverse-resolve
4276 to the canonical name.
4277
4278 Other than the @code{localhost} entry, make all entries in each
4279 machine's @code{/etc/hosts} file in the following form:
4280
4281 @smallexample
4282 IP address      fully-qualified hostname        aliases
4283 @end smallexample
4284
4285 Here is a sample @code{/etc/hosts} file:
4286
4287 @smallexample
4288 @group
4289 # this is a comment
4290 127.0.0.1       localhost localhost@@@value{PRIMARYDOMAIN}
4291 @value{RANDOMHOST1IP}       @value{RANDOMHOST1}.@value{PRIMARYDOMAIN} trillium wake-robin
4292 @end group
4293 @end smallexample
4294
4295 Additionally, on Solaris machines, you need to be sure the ``hosts''
4296 entry in the file @* @code{/etc/nsswitch.conf} includes the source
4297 ``dns'' as well as ``file''.
4298
4299 Finally, each host's keytab file must include a host/key pair for the
4300 host's canonical name.  You can list the keys in a keytab file by
4301 issuing the command @code{klist -k}.  For example:
4302
4303 @smallexample
4304 @group
4305 viola# klist -k
4306 Keytab name: /etc/krb5.keytab
4307 KVNO Principal
4308 ---- ------------------------------------------------------------
4309    1 host/@value{RANDOMHOST1}.@value{PRIMARYDOMAIN}@@@value{PRIMARYREALM}
4310 @end group
4311 @end smallexample
4312
4313 If you telnet to the host with a fresh credentials cache (ticket file),
4314 and then @code{klist}, the host's service principal should be
4315 @i{host/fully-qualified-hostname@@REALM_NAME}.
4316
4317 @node Configuring Your Firewall to Work With Kerberos V5,  , Getting DNS Information Correct, Application Servers
4318 @section Configuring Your Firewall to Work With @value{PRODUCT}
4319
4320 If you need off-site users to be able to get Kerberos tickets in your
4321 realm, they must be able to get to your KDC.  This requires either that
4322 you have a slave KDC outside your firewall, or you configure your
4323 firewall to allow UDP requests into at least one of your KDCs, on
4324 whichever port the KDC is running.  (The default is port
4325 @value{DefaultPort}; other ports may be specified in the KDC's kdc.conf
4326 file.)  Similarly, if you need off-site users to be able to change
4327 their passwords in your realm, they must be able to get to your
4328 Kerberos admin server.  The default port for the admin server is
4329 @value{DefaultKadmindPort}.
4330
4331 If your on-site users inside your firewall will need to get to KDCs in
4332 other realms, you will also need to configure your firewall to allow
4333 outgoing TCP and UDP requests to port @value{DefaultPort}.
4334 Additionally, if they will need to get to any Kerberos V4 KDCs, you may
4335 also need to allow TCP and UDP requests to port
4336 @value{DefaultSecondPort}.  If your on-site users inside your firewall
4337 will need to get to Kerberos admin servers in other realms, you will
4338 also need to allow outgoing TCP and UDP requests to port
4339 @value{DefaultKadmindPort}.
4340
4341 If any of your KDCs are outside your firewall, you will need to allow
4342 @code{kprop} requests to get through to the remote KDC.  @code{Kprop}
4343 uses the krb5_prop service on port @value{DefaultKrbPropPort} (tcp).
4344
4345 If you need your off-site users to have access to machines inside your
4346 firewall, you need to allow TCP connections from their off-site hosts on
4347 the appropriate ports for the programs they will be using.  The
4348 following lines from @code{/etc/services} show the default port numbers
4349 for the @value{PRODUCT} programs:
4350
4351 @smallexample
4352 @group
4353 ftp           @value{DefaultFTPPort}/tcp           # Kerberos ftp and telnet use the
4354 telnet        @value{DefaultTelnetPort}/tcp           # default ports
4355 kerberos      @value{DefaultPort}/udp    kdc    # Kerberos V5 KDC
4356 kerberos      @value{DefaultPort}/tcp    kdc    # Kerberos V5 KDC
4357 klogin        @value{DefaultKloginPort}/tcp          # Kerberos authenticated rlogin
4358 kshell        @value{DefaultKshellPort}/tcp   cmd    # and remote shell
4359 kerberos-adm  @value{DefaultKadmindPort}/tcp          # Kerberos 5 admin/changepw
4360 kerberos-adm  @value{DefaultKadmindPort}/udp          # Kerberos 5 admin/changepw
4361 krb5_prop     @value{DefaultKrbPropPort}/tcp          # Kerberos slave propagation
4362 @c kpop          1109/tcp         # Pop with Kerberos
4363 eklogin       @value{DefaultEkloginPort}/tcp         # Kerberos auth. & encrypted rlogin
4364 @end group
4365 @end smallexample
4366
4367 By default, @value{PRODUCT} @code{telnet} and @code{ftp} use the same
4368 ports as the standard @code{telnet} and @code{ftp} programs, so if you
4369 already allow telnet and ftp connections through your firewall, the
4370 @value{PRODUCT} versions will get through as well.  If you do not
4371 already allow telnet and ftp connections through your firewall, but need
4372 your users to be able to use @value{PRODUCT} telnet and ftp, you can
4373 either allow ftp and telnet connections on the standard ports, or switch
4374 these programs to non-default port numbers and allow ftp and telnet
4375 connections on those ports to get through.
4376
4377 @value{PRODUCT} @code{rlogin} uses the @code{klogin} service, which by
4378 default uses port @value{DefaultKloginPort}.  Encrypted @value{PRODUCT}
4379 rlogin uses the @code{eklogin} service, which by default uses port
4380 @value{DefaultEkloginPort}.
4381
4382 @value{PRODUCT} @code{rsh} uses the @code{kshell} service, which by
4383 default uses port @value{DefaultKshellPort}.  However, the server must
4384 be able to make a TCP connection from the kshell port to an arbitrary
4385 port on the client, so if your users are to be able to use @code{rsh}
4386 from outside your firewall, the server they connect to must be able to
4387 send outgoing packets to arbitrary port numbers.  Similarly, if your
4388 users need to run @code{rsh} from inside your firewall to hosts outside
4389 your firewall, the outside server needs to be able to connect to an
4390 arbitrary port on the machine inside your firewall.  Because
4391 @value{PRODUCT} @code{rcp} uses @code{rsh}, the same issues apply.  If
4392 you need to use @code{rsh} (or @code{rcp}) through your firewall and
4393 are concerned with the security implications of allowing connections to
4394 arbitrary ports, @value{COMPANY} suggests that you have rules that
4395 specifically name these applications and, if possible, list the allowed
4396 hosts.
4397
4398 The book @cite{UNIX System Security}, by David Curry, is a good
4399 starting point for learning to configure firewalls.
4400
4401 @ignore
4402 @c @node Enabling Users to Connect from Off-Site,  , Configuring Your Firewall to Work With @value{PRODUCT}, Application Servers
4403 @c @section Enabling Users to Connect from Off-Site
4404
4405 This will have to wait until the next release.  *sigh*
4406 @end ignore
4407
4408 @node Backups of Secure Hosts, Bug Reporting, Application Servers, Top
4409 @chapter Backups of Secure Hosts
4410
4411 When you back up a secure host, you should exclude the host's keytab
4412 file from the backup.  If someone obtained a copy of the keytab from a
4413 backup, that person could make any host masquerade as the host whose
4414 keytab was compromised.  This could be particularly dangerous if the
4415 compromised keytab was from one of your KDCs.  If the machine has a disk
4416 crash and the keytab file is lost, it is easy to generate another keytab
4417 file.  (@xref{Adding Principals to Keytabs}.)  If you are unable to
4418 exclude particular files from backups, you should ensure that the
4419 backups are kept as secure as the host's root password.
4420
4421 @menu
4422 * Backing Up the Kerberos Database::  
4423 @end menu
4424
4425 @node Backing Up the Kerberos Database,  , Backups of Secure Hosts, Backups of Secure Hosts
4426 @section Backing Up the Kerberos Database
4427
4428 As with any file, it is possible that your Kerberos database could
4429 become corrupted.  If this happens on one of the slave KDCs, you might
4430 never notice, since the next automatic propagation of the database would
4431 install a fresh copy.  However, if it happens to the master KDC, the
4432 corrupted database would be propagated to all of the slaves during the
4433 next propagation.  For this reason, @value{COMPANY} recommends that you
4434 back up your Kerberos database regularly.  Because the master KDC is
4435 continuously dumping the database to a file in order to propagate it to
4436 the slave KDCs, it is a simple matter to have a cron job periodically
4437 copy the dump file to a secure machine elsewhere on your network.  (Of
4438 course, it is important to make the host where these backups are stored
4439 as secure as your KDCs, and to encrypt its transmission across your
4440 network.)  Then if your database becomes corrupted, you can load the
4441 most recent dump onto the master KDC.  (@xref{Restoring a Kerberos
4442 Database from a Dump File}.)
4443
4444 @node Bug Reporting, Appendix, Backups of Secure Hosts, Top
4445 @chapter Bug Reporting
4446
4447 @include send-pr.texinfo
4448
4449 @node Appendix,  , Bug Reporting, Top
4450 @appendix Appendix
4451
4452 @menu
4453 * Errors::                      
4454 * kadmin Time Zones::           
4455 @end menu
4456
4457 @node Errors, kadmin Time Zones, Appendix, Appendix
4458 @appendixsec Kerberos Error Messages
4459
4460 @menu
4461 * Kerberos V5 Library Error Codes::  
4462 * Kerberos V5 Database Library Error Codes::  
4463 * Kerberos V5 Magic Numbers Error Codes::  
4464 * ASN.1 Error Codes::           
4465 * GSSAPI Error Codes::          
4466 @end menu
4467
4468 @node Kerberos V5 Library Error Codes, Kerberos V5 Database Library Error Codes, Errors, Errors
4469 @appendixsubsec Kerberos V5 Library Error Codes
4470
4471 This is the Kerberos v5 library error code table.  Protocol error codes
4472 are @* ERROR_TABLE_BASE_krb5 + the protocol error code number; other
4473 error codes start at ERROR_TABLE_BASE_krb5 + 128.
4474
4475 @c error table numbering starts at 0
4476 @enumerate 0
4477 @item
4478 KRB5KDC_ERR_NONE:  No error
4479 @item
4480 KRB5KDC_ERR_NAME_EXP:  Client's entry in database has expired
4481 @item
4482 KRB5KDC_ERR_SERVICE_EXP:  Server's entry in database has expired
4483 @item
4484 KRB5KDC_ERR_BAD_PVNO:  Requested protocol version not supported
4485 @item
4486 KRB5KDC_ERR_C_OLD_MAST_KVNO:  Client's key is encrypted in an old master
4487 key
4488 @item
4489 KRB5KDC_ERR_S_OLD_MAST_KVNO:  Server's key is encrypted in an old master
4490 key
4491 @item
4492 KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN:  Client not found in Kerberos database
4493 @item
4494 KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN:  Server not found in Kerberos database
4495 @item
4496 KRB5KDC_ERR_PRINCIPAL_NOT_UNIQUE:  Principal has multiple entries in
4497 Kerberos database
4498 @item
4499 KRB5KDC_ERR_NULL_KEY:  Client or server has a null key
4500 @item
4501 KRB5KDC_ERR_CANNOT_POSTDATE:  Ticket is ineligible for postdating
4502 @item
4503 KRB5KDC_ERR_NEVER_VALID:  Requested effective lifetime is negative or
4504 too short
4505 @item
4506 KRB5KDC_ERR_POLICY:  KDC policy rejects request
4507 @item
4508 KRB5KDC_ERR_BADOPTION:  KDC can't fulfill requested option
4509 @item
4510 KRB5KDC_ERR_ETYPE_NOSUPP:  KDC has no support for encryption type
4511 @item
4512 KRB5KDC_ERR_SUMTYPE_NOSUPP:  KDC has no support for checksum type
4513 @item
4514 KRB5KDC_ERR_PADATA_TYPE_NOSUPP:  KDC has no support for padata type
4515 @item
4516 KRB5KDC_ERR_TRTYPE_NOSUPP:  KDC has no support for transited type
4517 @item
4518 KRB5KDC_ERR_CLIENT_REVOKED:  Clients credentials have been revoked
4519 @item
4520 KRB5KDC_ERR_SERVICE_REVOKED:  Credentials for server have been revoked
4521 @item
4522 KRB5KDC_ERR_TGT_REVOKED:  TGT has been revoked
4523 @item
4524 KRB5KDC_ERR_CLIENT_NOTYET:  Client not yet valid - try again later
4525 @item
4526 KRB5KDC_ERR_SERVICE_NOTYET:  Server not yet valid - try again later
4527 @item
4528 KRB5KDC_ERR_KEY_EXP:  Password has expired
4529 @item
4530 KRB5KDC_ERR_PREAUTH_FAILED:  Preauthentication failed
4531 @item
4532 KRB5KDC_ERR_PREAUTH_REQUIRED:  Additional pre-auth@-en@-ti@-ca@-tion required
4533 @item
4534 KRB5KDC_ERR_SERVER_NOMATCH:  Requested server and ticket don't match
4535 @item
4536 KRB5PLACEHOLD_27:  KRB5 error code 27
4537 @item
4538 KRB5PLACEHOLD_28:  KRB5 error code 28
4539 @item
4540 KRB5PLACEHOLD_29:  KRB5 error code 29
4541 @item
4542 KRB5PLACEHOLD_30:  KRB5 error code 30
4543 @item
4544 KRB5KRB_AP_ERR_BAD_INTEGRITY:  Decrypt integrity check failed
4545 @item
4546 KRB5KRB_AP_ERR_TKT_EXPIRED:  Ticket expired
4547 @item
4548 KRB5KRB_AP_ERR_TKT_NYV:  Ticket not yet valid
4549 @item
4550 KRB5KRB_AP_ERR_REPEAT:  Request is a replay
4551 @item
4552 KRB5KRB_AP_ERR_NOT_US:  The ticket isn't for us
4553 @item
4554 KRB5KRB_AP_ERR_BADMATCH:  Ticket/authenticator don't match
4555 @item
4556 KRB5KRB_AP_ERR_SKEW:  Clock skew too great
4557 @item
4558 KRB5KRB_AP_ERR_BADADDR:  Incorrect net address
4559 @item
4560 KRB5KRB_AP_ERR_BADVERSION:  Protocol version mismatch
4561 @item
4562 KRB5KRB_AP_ERR_MSG_TYPE:  Invalid message type
4563 @item
4564 KRB5KRB_AP_ERR_MODIFIED:  Message stream modified
4565 @item
4566 KRB5KRB_AP_ERR_BADORDER:  Message out of order
4567 @item
4568 KRB5KRB_AP_ERR_ILL_CR_TKT:  Illegal cross-realm ticket
4569 @item
4570 KRB5KRB_AP_ERR_BADKEYVER:  Key version is not available
4571 @item
4572 KRB5KRB_AP_ERR_NOKEY:  Service key not available
4573 @item
4574 KRB5KRB_AP_ERR_MUT_FAIL:  Mutual authentication failed
4575 @item
4576 KRB5KRB_AP_ERR_BADDIRECTION:  Incorrect message direction
4577 @item
4578 KRB5KRB_AP_ERR_METHOD:  Alternative authentication method required
4579 @item
4580 KRB5KRB_AP_ERR_BADSEQ:  Incorrect sequence number in message
4581 @item
4582 KRB5KRB_AP_ERR_INAPP_CKSUM:  Inappropriate type of checksum in message
4583 @item
4584 KRB5KRB_AP_PATH_NOT_ACCEPTED: Policy rejects transited path
4585 @item
4586 KRB5KRB_ERR_RESPONSE_TOO_BIG: Response too big for UDP, retry with TCP
4587 @item
4588 KRB5PLACEHOLD_53:  KRB5 error code 53
4589 @item
4590 KRB5PLACEHOLD_54:  KRB5 error code 54
4591 @item
4592 KRB5PLACEHOLD_55:  KRB5 error code 55
4593 @item
4594 KRB5PLACEHOLD_56:  KRB5 error code 56
4595 @item
4596 KRB5PLACEHOLD_57:  KRB5 error code 57
4597 @item
4598 KRB5PLACEHOLD_58:  KRB5 error code 58
4599 @item
4600 KRB5PLACEHOLD_59:  KRB5 error code 59
4601 @item
4602 KRB5KRB_ERR_GENERIC:  Generic error (see e-text)
4603 @item
4604 KRB5KRB_ERR_FIELD_TOOLONG:  Field is too long for this implementation
4605 @item
4606 KRB5PLACEHOLD_62:  KRB5 error code 62
4607 @item
4608 KRB5PLACEHOLD_63:  KRB5 error code 63
4609 @item
4610 KRB5PLACEHOLD_64:  KRB5 error code 64
4611 @item
4612 KRB5PLACEHOLD_65:  KRB5 error code 65
4613 @item
4614 KRB5PLACEHOLD_66:  KRB5 error code 66
4615 @item
4616 KRB5PLACEHOLD_67:  KRB5 error code 67
4617 @item
4618 KRB5PLACEHOLD_68:  KRB5 error code 68
4619 @item
4620 KRB5PLACEHOLD_69:  KRB5 error code 69
4621 @item
4622 KRB5PLACEHOLD_70:  KRB5 error code 70
4623 @item
4624 KRB5PLACEHOLD_71:  KRB5 error code 71
4625 @item
4626 KRB5PLACEHOLD_72:  KRB5 error code 72
4627 @item
4628 KRB5PLACEHOLD_73:  KRB5 error code 73
4629 @item
4630 KRB5PLACEHOLD_74:  KRB5 error code 74
4631 @item
4632 KRB5PLACEHOLD_75:  KRB5 error code 75
4633 @item
4634 KRB5PLACEHOLD_76:  KRB5 error code 76
4635 @item
4636 KRB5PLACEHOLD_77:  KRB5 error code 77
4637 @item
4638 KRB5PLACEHOLD_78:  KRB5 error code 78
4639 @item
4640 KRB5PLACEHOLD_79:  KRB5 error code 79
4641 @item
4642 KRB5PLACEHOLD_80:  KRB5 error code 80
4643 @item
4644 KRB5PLACEHOLD_81:  KRB5 error code 81
4645 @item
4646 KRB5PLACEHOLD_82:  KRB5 error code 82
4647 @item
4648 KRB5PLACEHOLD_83:  KRB5 error code 83
4649 @item
4650 KRB5PLACEHOLD_84:  KRB5 error code 84
4651 @item
4652 KRB5PLACEHOLD_85:  KRB5 error code 85
4653 @item
4654 KRB5PLACEHOLD_86:  KRB5 error code 86
4655 @item
4656 KRB5PLACEHOLD_87:  KRB5 error code 87
4657 @item
4658 KRB5PLACEHOLD_88:  KRB5 error code 88
4659 @item
4660 KRB5PLACEHOLD_89:  KRB5 error code 89
4661 @item
4662 KRB5PLACEHOLD_90:  KRB5 error code 90
4663 @item
4664 KRB5PLACEHOLD_91:  KRB5 error code 91
4665 @item
4666 KRB5PLACEHOLD_92:  KRB5 error code 92
4667 @item
4668 KRB5PLACEHOLD_93:  KRB5 error code 93
4669 @item
4670 KRB5PLACEHOLD_94:  KRB5 error code 94
4671 @item
4672 KRB5PLACEHOLD_95:  KRB5 error code 95
4673 @item
4674 KRB5PLACEHOLD_96:  KRB5 error code 96
4675 @item
4676 KRB5PLACEHOLD_97:  KRB5 error code 97
4677 @item
4678 KRB5PLACEHOLD_98:  KRB5 error code 98
4679 @item
4680 KRB5PLACEHOLD_99:  KRB5 error code 99
4681 @item
4682 KRB5PLACEHOLD_100:  KRB5 error code 100
4683 @item
4684 KRB5PLACEHOLD_101:  KRB5 error code 101
4685 @item
4686 KRB5PLACEHOLD_102:  KRB5 error code 102
4687 @item
4688 KRB5PLACEHOLD_103:  KRB5 error code 103
4689 @item
4690 KRB5PLACEHOLD_104:  KRB5 error code 104
4691 @item
4692 KRB5PLACEHOLD_105:  KRB5 error code 105
4693 @item
4694 KRB5PLACEHOLD_106:  KRB5 error code 106
4695 @item
4696 KRB5PLACEHOLD_107:  KRB5 error code 107
4697 @item
4698 KRB5PLACEHOLD_108:  KRB5 error code 108
4699 @item
4700 KRB5PLACEHOLD_109:  KRB5 error code 109
4701 @item
4702 KRB5PLACEHOLD_110:  KRB5 error code 110
4703 @item
4704 KRB5PLACEHOLD_111:  KRB5 error code 111
4705 @item
4706 KRB5PLACEHOLD_112:  KRB5 error code 112
4707 @item
4708 KRB5PLACEHOLD_113:  KRB5 error code 113
4709 @item
4710 KRB5PLACEHOLD_114:  KRB5 error code 114
4711 @item
4712 KRB5PLACEHOLD_115:  KRB5 error code 115
4713 @item
4714 KRB5PLACEHOLD_116:  KRB5 error code 116
4715 @item
4716 KRB5PLACEHOLD_117:  KRB5 error code 117
4717 @item
4718 KRB5PLACEHOLD_118:  KRB5 error code 118
4719 @item
4720 KRB5PLACEHOLD_119:  KRB5 error code 119
4721 @item
4722 KRB5PLACEHOLD_120:  KRB5 error code 120
4723 @item
4724 KRB5PLACEHOLD_121:  KRB5 error code 121
4725 @item
4726 KRB5PLACEHOLD_122:  KRB5 error code 122
4727 @item
4728 KRB5PLACEHOLD_123:  KRB5 error code 123
4729 @item
4730 KRB5PLACEHOLD_124:  KRB5 error code 124
4731 @item
4732 KRB5PLACEHOLD_125:  KRB5 error code 125
4733 @item
4734 KRB5PLACEHOLD_126:  KRB5 error code 126
4735 @item
4736 KRB5PLACEHOLD_127:  KRB5 error code 127
4737 @item
4738 KRB5_ERR_RCSID:  (RCS Id string for the krb5 error table)
4739 @item
4740 KRB5_LIBOS_BADLOCKFLAG:  Invalid flag for file lock mode
4741 @item
4742 KRB5_LIBOS_CANTREADPWD:  Cannot read password
4743 @item
4744 KRB5_LIBOS_BADPWDMATCH:  Password mismatch
4745 @item
4746 KRB5_LIBOS_PWDINTR:  Password read interrupted
4747 @item
4748 KRB5_PARSE_ILLCHAR:  Illegal character in component name
4749 @item
4750 KRB5_PARSE_MALFORMED:  Malformed representation of principal
4751 @item
4752 KRB5_CONFIG_CANTOPEN:  Can't open/find Kerberos configuration file
4753 @item
4754 KRB5_CONFIG_BADFORMAT:  Improper format of Kerberos configuration file
4755 @item
4756 KRB5_CONFIG_NOTENUFSPACE:  Insufficient space to return complete
4757 information
4758 @item
4759 KRB5_BADMSGTYPE:  Invalid message type specified for encoding
4760 @item
4761 KRB5_CC_BADNAME:  Credential cache name malformed
4762 @item
4763 KRB5_CC_UNKNOWN_TYPE:  Unknown credential cache type
4764 @item
4765 KRB5_CC_NOTFOUND:  Matching credential not found
4766 @item
4767 KRB5_CC_END:  End of credential cache reached
4768 @item
4769 KRB5_NO_TKT_SUPPLIED:  Request did not supply a ticket
4770 @item
4771 KRB5KRB_AP_WRONG_PRINC:  Wrong principal in request
4772 @item
4773 KRB5KRB_AP_ERR_TKT_INVALID:  Ticket has invalid flag set
4774 @item
4775 KRB5_PRINC_NOMATCH:  Requested principal and ticket don't match
4776 @item
4777 KRB5_KDCREP_MODIFIED:  KDC reply did not match expectations
4778 @item
4779 KRB5_KDCREP_SKEW:  Clock skew too great in KDC reply
4780 @item
4781 KRB5_IN_TKT_REALM_MISMATCH:  Client/server realm mismatch in initial
4782 ticket request
4783 @item
4784 KRB5_PROG_ETYPE_NOSUPP:  Program lacks support for encryption type
4785 @item
4786 KRB5_PROG_KEYTYPE_NOSUPP:  Program lacks support for key type
4787 @item
4788 KRB5_WRONG_ETYPE:  Requested encryption type not used in message
4789 @item
4790 KRB5_PROG_SUMTYPE_NOSUPP:  Program lacks support for checksum type
4791 @item
4792 KRB5_REALM_UNKNOWN:  Cannot find KDC for requested realm
4793 @item
4794 KRB5_SERVICE_UNKNOWN:  Kerberos service unknown
4795 @item
4796 KRB5_KDC_UNREACH:  Cannot contact any KDC for requested realm
4797 @item
4798 KRB5_NO_LOCALNAME:  No local name found for principal name
4799 @item
4800 KRB5_MUTUAL_FAILED:  Mutual authentication failed
4801 @item
4802 KRB5_RC_TYPE_EXISTS:  Replay cache type is already registered
4803 @item
4804 KRB5_RC_MALLOC:  No more memory to allocate (in replay cache code)
4805 @item
4806 KRB5_RC_TYPE_NOTFOUND:  Replay cache type is unknown
4807 @item
4808 KRB5_RC_UNKNOWN:  Generic unknown RC error
4809 @item
4810 KRB5_RC_REPLAY:  Message is a replay
4811 @item
4812 KRB5_RC_IO:  Replay I/O operation failed XXX
4813 @item
4814 KRB5_RC_NOIO:  Replay cache type does not support non-volatile storage
4815 @item
4816 KRB5_RC_PARSE:  Replay cache name parse/format error
4817 @item
4818 KRB5_RC_IO_EOF:  End-of-file on replay cache I/O
4819 @item
4820 KRB5_RC_IO_MALLOC:  No more memory to allocate (in replay cache I/O
4821 code)
4822 @item
4823 KRB5_RC_IO_PERM:  Permission denied in replay cache code
4824 @item
4825 KRB5_RC_IO_IO:  I/O error in replay cache i/o code
4826 @item
4827 KRB5_RC_IO_UNKNOWN:  Generic unknown RC/IO error
4828 @item
4829 KRB5_RC_IO_SPACE:  Insufficient system space to store replay information
4830 @item
4831 KRB5_TRANS_CANTOPEN:  Can't open/find realm translation file
4832 @item
4833 KRB5_TRANS_BADFORMAT:  Improper format of realm translation file
4834 @item
4835 KRB5_LNAME_CANTOPEN:  Can't open/find lname translation database
4836 @item
4837 KRB5_LNAME_NOTRANS:  No translation available for requested principal
4838 @item
4839 KRB5_LNAME_BADFORMAT:  Improper format of translation database entry
4840 @item
4841 KRB5_CRYPTO_INTERNAL:  Cryptosystem internal error
4842 @item
4843 KRB5_KT_BADNAME:  Key table name malformed
4844 @item
4845 KRB5_KT_UNKNOWN_TYPE:  Unknown Key table type
4846 @item
4847 KRB5_KT_NOTFOUND:  Key table entry not found
4848 @item
4849 KRB5_KT_END:  End of key table reached
4850 @item
4851 KRB5_KT_NOWRITE:  Cannot write to specified key table
4852 @item
4853 KRB5_KT_IOERR:  Error writing to key table
4854 @item
4855 KRB5_NO_TKT_IN_RLM:  Cannot find ticket for requested realm
4856 @item
4857 KRB5DES_BAD_KEYPAR:  DES key has bad parity
4858 @item
4859 KRB5DES_WEAK_KEY:  DES key is a weak key
4860 @item
4861 KRB5_BAD_ENCTYPE:  Bad encryption type
4862 @item
4863 KRB5_BAD_KEYSIZE:  Key size is incompatible with encryption type
4864 @item
4865 KRB5_BAD_MSIZE:  Message size is incompatible with encryption type
4866 @item
4867 KRB5_CC_TYPE_EXISTS:  Credentials cache type is already registered.
4868 @item
4869 KRB5_KT_TYPE_EXISTS:  Key table type is already registered.
4870 @item
4871 KRB5_CC_IO:  Credentials cache I/O operation failed XXX
4872 @item
4873 KRB5_FCC_PERM:  Credentials cache file permissions incorrect
4874 @item
4875 KRB5_FCC_NOFILE:  No credentials cache found
4876 @item
4877 KRB5_FCC_INTERNAL:  Internal credentials cache error
4878 @item
4879 KRB5_CC_WRITE:  Error writing to credentials cache
4880 @item
4881 KRB5_CC_NOMEM:  No more memory to allocate (in credentials cache code)
4882 @item
4883 KRB5_CC_FORMAT:  Bad format in credentials cache
4884 @item
4885 KRB5_INVALID_FLAGS:  Invalid KDC option combination (library internal
4886 error) [for dual tgt library calls]
4887 @item
4888 KRB5_NO_2ND_TKT:  Request missing second ticket [for dual tgt library
4889 calls]
4890 @item
4891 KRB5_NOCREDS_SUPPLIED:  No credentials supplied to library routine
4892 @item
4893 KRB5_SENDAUTH_BADAUTHVERS:  Bad sendauth version was sent
4894 @item
4895 KRB5_SENDAUTH_BADAPPLVERS:  Bad application version was sent (via
4896 sendauth)
4897 @item
4898 KRB5_SENDAUTH_BADRESPONSE:  Bad response (during sendauth exchange)
4899 @item
4900 KRB5_SENDAUTH_REJECTED:  Server rejected authentication (during sendauth
4901 exchange)
4902 @item
4903 KRB5_PREAUTH_BAD_TYPE:  Unsupported preauthentication type
4904 @item
4905 KRB5_PREAUTH_NO_KEY:  Required preauthentication key not supplied
4906 @item
4907 KRB5_PREAUTH_FAILED:  Generic preauthentication failure
4908 @item
4909 KRB5_RCACHE_BADVNO:  Unsupported replay cache format version number
4910 @item
4911 KRB5_CCACHE_BADVNO:  Unsupported credentials cache format version number
4912 @item
4913 KRB5_KEYTAB_BADVNO:  Unsupported key table format version number
4914 @item
4915 KRB5_PROG_ATYPE_NOSUPP:  Program lacks support for address type
4916 @item
4917 KRB5_RC_REQUIRED:  Message replay detection requires rcache parameter
4918 @item
4919 KRB5_ERR_BAD_HOSTNAME:  Hostname cannot be canonicalized
4920 @item
4921 KRB5_ERR_HOST_REALM_UNKNOWN:  Cannot determine realm for host
4922 @item
4923 KRB5_SNAME_UNSUPP_NAMETYPE:  Conversion to service principal undefined
4924 for name type
4925 @item
4926 KRB5KRB_AP_ERR_V4_REPLY:  Initial Ticket response appears to be Version
4927 4 error
4928 @item
4929 KRB5_REALM_CANT_RESOLVE:  Cannot resolve KDC for requested realm
4930 @item
4931 KRB5_TKT_NOT_FORWARDABLE:  Requesting ticket can't get forwardable
4932 tickets
4933 @item
4934 KRB5_FWD_BAD_PRINCIPAL:  Bad principal name while trying to forward
4935 credentials
4936 @item
4937 KRB5_GET_IN_TKT_LOOP:  Looping detected inside krb5_get_in_tkt
4938 @item
4939 KRB5_CONFIG_NODEFREALM:  Configuration file does not specify default realm
4940 @item
4941 KRB5_SAM_UNSUPPORTED:  Bad SAM flags in obtain_sam_padata
4942 @item
4943 KRB5_KT_NAME_TOOLONG: Keytab name too long
4944 @item
4945 KRB5_KT_KVNONOTFOUND: Key version number for principal in key table is incorrect
4946 @item
4947 KRB5_APPL_EXPIRED: This application has expired
4948 @item
4949 KRB5_LIB_EXPIRED: This Krb5 library has expired
4950 @item
4951 KRB5_CHPW_PWDNULL: New password cannot be zero length
4952 @item
4953 KRB5_CHPW_FAIL: Password change failed
4954 @item
4955 KRB5_KT_FORMAT: Bad format in keytab
4956 @item
4957 KRB5_NOPERM_ETYPE: Encryption type not permitted
4958 @item
4959 KRB5_CONFIG_ETYPE_NOSUPP: No supported encryption types (config file error?)
4960 @item
4961 KRB5_OBSOLETE_FN: Program called an obsolete, deleted function
4962 @item
4963 KRB5_EAI_FAIL: unknown getaddrinfo failure
4964 @item
4965 KRB5_EAI_NODATA: no data available for host/domain name
4966 @item
4967 KRB5_EAI_NONAME: host/domain name not found
4968 @item
4969 KRB5_EAI_SERVICE: service name unknown
4970 @item
4971 KRB5_ERR_NUMERIC_REALM: Cannot determine realm for numeric host address
4972 @end enumerate
4973
4974 @node Kerberos V5 Database Library Error Codes, Kerberos V5 Magic Numbers Error Codes, Kerberos V5 Library Error Codes, Errors
4975 @appendixsubsec Kerberos V5 Database Library Error Codes
4976
4977 This is the Kerberos v5 database library error code table.
4978
4979 @c error table numbering starts at 0
4980 @enumerate 0
4981 @item
4982 KRB5_KDB_RCSID:  (RCS Id string for the kdb error table)
4983 @item
4984 KRB5_KDB_INUSE:  Entry already exists in database
4985 @item
4986 KRB5_KDB_UK_SERROR:  Database store error
4987 @item
4988 KRB5_KDB_UK_RERROR:  Database read error
4989 @item
4990 KRB5_KDB_UNAUTH:  Insufficient access to perform requested operation
4991 @item
4992 KRB5_KDB_NOENTRY:  No such entry in the database
4993 @item
4994 KRB5_KDB_ILL_WILDCARD:  Illegal use of wildcard
4995 @item
4996 KRB5_KDB_DB_INUSE:  Database is locked or in use--try again later
4997 @item
4998 KRB5_KDB_DB_CHANGED:  Database was modified during read
4999 @item
5000 KRB5_KDB_TRUNCATED_RECORD:  Database record is incomplete or corrupted
5001 @item
5002 KRB5_KDB_RECURSIVELOCK:  Attempt to lock database twice
5003 @item
5004 KRB5_KDB_NOTLOCKED:  Attempt to unlock database when not locked
5005 @item
5006 KRB5_KDB_BADLOCKMODE:  Invalid kdb lock mode
5007 @item
5008 KRB5_KDB_DBNOTINITED:  Database has not been initialized
5009 @item
5010 KRB5_KDB_DBINITED:  Database has already been initialized
5011 @item
5012 KRB5_KDB_ILLDIRECTION:  Bad direction for converting keys
5013 @item
5014 KRB5_KDB_NOMASTERKEY:  Cannot find master key record in database
5015 @item
5016 KRB5_KDB_BADMASTERKEY:  Master key does not match database
5017 @item
5018 KRB5_KDB_INVALIDKEYSIZE:  Key size in database is invalid
5019 @item
5020 KRB5_KDB_CANTREAD_STORED:  Cannot find/read stored master key
5021 @item
5022 KRB5_KDB_BADSTORED_MKEY:  Stored master key is corrupted
5023 @item
5024 KRB5_KDB_CANTLOCK_DB:  Insufficient access to lock database
5025 @item
5026 KRB5_KDB_DB_CORRUPT:  Database format error
5027 @item
5028 KRB5_KDB_BAD_VERSION:  Unsupported version in database entry
5029 @item
5030 KRB5_KDB_BAD_SALTTYPE:  Unsupported salt type
5031 @item
5032 KRB5_KDB_BAD_ENCTYPE:  Unsupported encryption type
5033 @item
5034 KRB5_KDB_BAD_CREATEFLAGS: Bad database creation flags
5035 @item
5036 KRB5_KDB_NO_PERMITTED_KEY: No matching key in entry having a permitted enc type
5037 @item
5038 KRB5_KDB_NO_MATCHING_KEY: No matching key in entry
5039 @item
5040 KRB5_KDB_SERVER_INTERNAL_ERR: Server error
5041 @item
5042 KRB5_KDB_ACCESS_ERROR: Unable to access Kerberos database
5043 @item
5044 KRB5_KDB_INTERNAL_ERROR:Kerberos database internal error
5045 @item
5046 KRB5_KDB_CONSTRAINT_VIOLATION:Kerberos database constraints violated
5047 @end enumerate
5048
5049 @node Kerberos V5 Magic Numbers Error Codes, ASN.1 Error Codes, Kerberos V5 Database Library Error Codes, Errors
5050 @appendixsubsec Kerberos V5 Magic Numbers Error Codes
5051
5052 This is the Kerberos v5 magic numbers error code table.
5053
5054 @c error table numbering starts at 0
5055 @enumerate 0
5056 @item
5057 KV5M_NONE:  Kerberos V5 magic number table
5058 @item
5059 KV5M_PRINCIPAL:  Bad magic number for krb5_principal structure
5060 @item
5061 KV5M_DATA:  Bad magic number for krb5_data structure
5062 @item
5063 KV5M_KEYBLOCK:  Bad magic number for krb5_keyblock structure
5064 @item
5065 KV5M_CHECKSUM:  Bad magic number for krb5_checksum structure
5066 @item
5067 KV5M_ENCRYPT_BLOCK:  Bad magic number for krb5_encrypt_block structure
5068 @item
5069 KV5M_ENC_DATA:  Bad magic number for krb5_enc_data structure
5070 @item
5071 KV5M_CRYPTOSYSTEM_ENTRY:  Bad magic number for krb5_cryp@-to@-sys@-tem_entry
5072 structure
5073 @item
5074 KV5M_CS_TABLE_ENTRY:  Bad magic number for krb5_cs_table_entry structure
5075 @item
5076 KV5M_CHECKSUM_ENTRY:  Bad magic number for krb5_check@-sum_en@-try structure
5077 @item
5078 KV5M_AUTHDATA:  Bad magic number for krb5_authdata structure
5079 @item
5080 KV5M_TRANSITED:  Bad magic number for krb5_transited structure
5081 @item
5082 KV5M_ENC_TKT_PART:  Bad magic number for krb5_enc_tkt_part structure
5083 @item
5084 KV5M_TICKET:  Bad magic number for krb5_ticket structure
5085 @item
5086 KV5M_AUTHENTICATOR:  Bad magic number for krb5_authenticator structure
5087 @item
5088 KV5M_TKT_AUTHENT:  Bad magic number for krb5_tkt_authent structure
5089 @item
5090 KV5M_CREDS:  Bad magic number for krb5_creds structure
5091 @item
5092 KV5M_LAST_REQ_ENTRY:  Bad magic number for krb5_last_req_entry structure
5093 @item
5094 KV5M_PA_DATA:  Bad magic number for krb5_pa_data structure
5095 @item
5096 KV5M_KDC_REQ:  Bad magic number for krb5_kdc_req structure
5097 @item
5098 KV5M_ENC_KDC_REP_PART:  Bad magic number for @*
5099 krb5_enc_kdc_rep_part structure
5100 @item
5101 KV5M_KDC_REP:  Bad magic number for krb5_kdc_rep structure
5102 @item
5103 KV5M_ERROR:  Bad magic number for krb5_error structure
5104 @item
5105 KV5M_AP_REQ:  Bad magic number for krb5_ap_req structure
5106 @item
5107 KV5M_AP_REP:  Bad magic number for krb5_ap_rep structure
5108 @item
5109 KV5M_AP_REP_ENC_PART:  Bad magic number for @*
5110 krb5_ap_rep_enc_part structure
5111 @item
5112 KV5M_RESPONSE:  Bad magic number for krb5_response structure
5113 @item
5114 KV5M_SAFE:  Bad magic number for krb5_safe structure
5115 @item
5116 KV5M_PRIV:  Bad magic number for krb5_priv structure
5117 @item
5118 KV5M_PRIV_ENC_PART:  Bad magic number for krb5_priv_enc_part structure
5119 @item
5120 KV5M_CRED:  Bad magic number for krb5_cred structure
5121 @item
5122 KV5M_CRED_INFO:  Bad magic number for krb5_cred_info structure
5123 @item
5124 KV5M_CRED_ENC_PART:  Bad magic number for krb5_cred_enc_part structure
5125 @item
5126 KV5M_PWD_DATA:  Bad magic number for krb5_pwd_data structure
5127 @item
5128 KV5M_ADDRESS:  Bad magic number for krb5_address structure
5129 @item
5130 KV5M_KEYTAB_ENTRY:  Bad magic number for krb5_keytab_entry structure
5131 @item
5132 KV5M_CONTEXT:  Bad magic number for krb5_context structure
5133 @item
5134 KV5M_OS_CONTEXT:  Bad magic number for krb5_os_context structure
5135 @item
5136 KV5M_ALT_METHOD:  Bad magic number for krb5_alt_method structure
5137 @item
5138 KV5M_ETYPE_INFO_ENTRY:  Bad magic number for @*
5139 krb5_etype_info_entry structure
5140 @item
5141 KV5M_DB_CONTEXT:  Bad magic number for krb5_db_context structure
5142 @item
5143 KV5M_AUTH_CONTEXT:  Bad magic number for krb5_auth_context structure
5144 @item
5145 KV5M_KEYTAB:  Bad magic number for krb5_keytab structure
5146 @item
5147 KV5M_RCACHE:  Bad magic number for krb5_rcache structure
5148 @item
5149 KV5M_CCACHE:  Bad magic number for krb5_ccache structure
5150 @item
5151 KV5M_PREAUTH_OPS:  Bad magic number for krb5_preauth_ops
5152 @item
5153 KV5M_SAM_CHALLENGE:  Bad magic number for krb5_sam_challenge
5154 @item
5155 KV5M_SAM_KEY:  Bad magic number for krb5_sam_key
5156 @item
5157 KV5M_ENC_SAM_RESPONSE_ENC:  Bad magic number for @*
5158 krb5_enc_sam_response_enc
5159 @item
5160 KV5M_SAM_RESPONSE:  Bad magic number for krb5_sam_response
5161 @item
5162 KV5M_PREDICTED_SAM_RESPONSE:  Bad magic number for
5163 krb5_predicted_sam_response
5164 @item
5165 KV5M_PASSWD_PHRASE_ELEMENT:  Bad magic number for passwd_phrase_element
5166 @item
5167 KV5M_GSS_OID: Bad magic number for GSSAPI OID
5168 @item
5169 KV5M_GSS_QUEUE: Bad magic number for GSSAPI QUEUE
5170 @end enumerate
5171
5172 @node ASN.1 Error Codes, GSSAPI Error Codes, Kerberos V5 Magic Numbers Error Codes, Errors
5173 @appendixsubsec ASN.1 Error Codes
5174
5175 @c error table numbering starts at 0
5176 @enumerate 0
5177 @item
5178 ASN1_BAD_TIMEFORMAT:  ASN.1 failed call to system time library
5179 @item
5180 ASN1_MISSING_FIELD:  ASN.1 structure is missing a required field
5181 @item
5182 ASN1_MISPLACED_FIELD:  ASN.1 unexpected field number
5183 @item
5184 ASN1_TYPE_MISMATCH:  ASN.1 type numbers are inconsistent
5185 @item
5186 ASN1_OVERFLOW:  ASN.1 value too large
5187 @item
5188 ASN1_OVERRUN:  ASN.1 encoding ended unexpectedly
5189 @item
5190 ASN1_BAD_ID:  ASN.1 identifier doesn't match expected value
5191 @item
5192 ASN1_BAD_LENGTH:  ASN.1 length doesn't match expected value
5193 @item
5194 ASN1_BAD_FORMAT:  ASN.1 badly-formatted encoding
5195 @item
5196 ASN1_PARSE_ERROR:  ASN.1 parse error
5197 @item
5198 ASN1_BAD_GMTIME: ASN.1 bad return from gmtime
5199 @item
5200 ASN1_MISMATCH_INDEF: ASN.1 non-constructed indefinite encoding
5201 @item
5202 ASN1_MISSING_EOC: ASN.1 missing expected EOC
5203 @end enumerate
5204
5205 @node GSSAPI Error Codes,  , ASN.1 Error Codes, Errors
5206 @appendixsubsec GSSAPI Error Codes
5207
5208 Generic GSSAPI Errors:
5209
5210 @c error table numbering starts at 0
5211 @enumerate 0
5212 @item
5213 G_BAD_SERVICE_NAME:  No @ in SERVICE-NAME name string
5214 @item
5215 G_BAD_STRING_UID: STRING-UID-NAME contains nondigits
5216 @item
5217 G_NOUSER:  UID does not resolve to username
5218 @item
5219 G_VALIDATE_FAILED:  Validation error
5220 @item
5221 G_BUFFER_ALLOC:  Couldn't allocate gss_buffer_t data
5222 @item
5223 G_BAD_MSG_CTX:  Message context invalid
5224 @item
5225 G_WRONG_SIZE:  Buffer is the wrong size
5226 @item
5227 G_BAD_USAGE:  Credential usage type is unknown
5228 @item
5229 G_UNKNOWN_QOP:  Unknown quality of protection specified
5230 @item
5231 G_BAD_HOSTNAME:  Hostname in SERVICE-NAME string could not be
5232 canonicalized
5233 @item
5234 G_WRONG_MECH: Mechanism is incorrect
5235 @item
5236 G_BAD_TOK_HEADER: Token header is malformed or corrupt
5237 @item
5238 G_BAD_DIRECTION: Packet was replayed in wrong direction
5239 @item
5240 G_TOK_TRUNC: Token is missing data
5241 @item
5242 G_REFLECT: Token was reflected
5243 @item
5244 G_WRONG_TOKID: Received token ID does not match expected token ID
5245 @end enumerate
5246
5247 Kerberos 5 GSSAPI Errors:
5248
5249 @c error table numbering starts at 0
5250 @enumerate 0
5251 @item
5252 KG_CCACHE_NOMATCH:  Principal in credential cache does not match desired
5253 name
5254 @item
5255 KG_KEYTAB_NOMATCH:  No principal in keytab matches desired name
5256 @item
5257 KG_TGT_MISSING:  Credential cache has no TGT
5258 @item
5259 KG_NO_SUBKEY:  Authenticator has no subkey
5260 @item
5261 KG_CONTEXT_ESTABLISHED:  Context is already fully established
5262 @item
5263 KG_BAD_SIGN_TYPE:  Unknown signature type in token
5264 @item
5265 KG_BAD_LENGTH:  Invalid field length in token
5266 @item
5267 KG_CTX_INCOMPLETE:  Attempt to use incomplete security context
5268 @item
5269 KG_CONTEXT:  Bad magic number for krb5_gss_ctx_id_t
5270 @item
5271 KG_CRED:  Bad magic number for krb5_gss_cred_id_t
5272 @item
5273 KG_ENC_DESC:  Bad magic number for krb5_gss_enc_desc
5274 @item
5275 KG_BAD_SEQ: Sequence number in token is corrupt
5276 @item
5277 KG_EMPTY_CCACHE: Credential cache is empty
5278 @item
5279 KG_NO_CTYPES: Acceptor and Initiator share no checksum types
5280 @end enumerate
5281
5282 @node kadmin Time Zones,  , Errors, Appendix
5283 @appendixsec kadmin Time Zones
5284
5285 This is a complete listing of the time zones recognized by the
5286 @code{kadmin} command.
5287
5288 @table @b
5289 @itemx gmt
5290 Greenwich Mean Time
5291 @itemx ut, utc
5292 Universal Time (Coordinated).
5293 @itemx wet
5294 Western European Time.  (Same as GMT.)
5295 @itemx bst
5296 British Summer Time.  (1 hour ahead of GMT.)
5297 @itemx wat
5298 West Africa Time.  (1 hour behind GMT.)
5299 @itemx at
5300 Azores Time.  (2 hours behind GMT.)
5301 @itemx bst
5302 Brazil Standard Time.  (3 hours behind GMT.)  Note that the abbreviation
5303 BST also stands for British Summer Time.
5304 @itemx gst
5305 Greenland Standard Time.  (3 hours behind GMT.)  Note that the
5306 abbreviation GST also stands for Guam Standard Time.
5307 @itemx nft
5308 Newfoundland Time.  (3.5 hours behind GMT.)
5309 @itemx nst
5310 Newfoundland Standard Time.  (3.5 hours behind GMT.)
5311 @itemx ndt
5312 Newfoundland Daylight Time.  (2.5 hours behind GMT.)
5313 @itemx ast
5314 Atlantic Standard Time.  (4 hours behind GMT.)
5315 @itemx adt
5316 Atlantic Daylight Time.  (3 hours behind GMT.)
5317 @itemx est
5318 Eastern Standard Time.  (5 hours behind GMT.)
5319 @itemx edt
5320 Eastern Daylight Time.  (4 hours behind GMT.)
5321 @itemx cst
5322 Central Standard Time.  (6 hours behind GMT.)
5323 @itemx cdt
5324 Central Daylight Time.  (5 hours behind GMT.)
5325 @itemx mst
5326 Mountain Standard Time.  (7 hours behind GMT.)
5327 @itemx mdt
5328 Mountain Daylight Time.  (6 hours behind GMT.)
5329 @itemx pst
5330 Pacific Standard Time.  (8 hours behind GMT.)
5331 @itemx pdt
5332 Pacific Daylight Time.  (7 hours behind GMT.)
5333 @itemx yst
5334 Yukon Standard Time.  (9 hours behind GMT.)
5335 @itemx ydt
5336 Yukon Daylight Time.  (8 hours behind GMT.)
5337 @itemx hst
5338 Hawaii Standard Time.  (10 hours behind GMT.)
5339 @itemx hdt
5340 Hawaii Daylight Time.  (9 hours behind GMT.)
5341 @itemx cat
5342 Central Alaska Time.  (10 hours behind GMT.)
5343 @itemx ahst
5344 Alaska-Hawaii Standard Time.  (10 hours behind GMT.)
5345 @itemx nt
5346 Nome Time.  (11 hours behind GMT.)
5347 @itemx idlw
5348 International Date Line West Time.  (12 hours behind GMT.)
5349 @itemx cet
5350 Central European Time.  (1 hour ahead of GMT.)
5351 @itemx met
5352 Middle European Time.  (1 hour ahead of GMT.)
5353 @itemx mewt
5354 Middle European Winter Time.  (1 hour ahead of GMT.)
5355 @itemx mest
5356 Middle European Summer Time.  (2 hours ahead of GMT.)
5357 @itemx swt
5358 Swedish Winter Time.  (1 hour ahead of GMT.)
5359 @itemx sst
5360 Swedish Summer Time.  (1 hours ahead of GMT.)
5361 @itemx fwt
5362 French Winter Time.  (1 hour ahead of GMT.)
5363 @itemx fst
5364 French Summer Time.  (2 hours ahead of GMT.)
5365 @itemx eet
5366 Eastern Europe Time; Russia Zone 1.  (2 hours ahead of GMT.)
5367 @itemx bt
5368 Baghdad Time; Russia Zone 2.  (3 hours ahead of GMT.)
5369 @itemx it
5370 Iran Time.  (3.5 hours ahead of GMT.)
5371 @itemx zp4
5372 Russia Zone 3.  (4 hours ahead of GMT.)
5373 @itemx zp5
5374 Russia Zone 4.  (5 hours ahead of GMT.)
5375 @itemx ist
5376 Indian Standard Time.  (5.5 hours ahead of GMT.)
5377 @itemx zp6
5378 Russia Zone 5.  (6 hours ahead of GMT.)
5379 @itemx nst
5380 North Sumatra Time.  (6.5 hours ahead of GMT.)  Note that the
5381 abbreviation NST is also used for Newfoundland Stanard Time.
5382 @itemx sst
5383 South Sumatra Time; Russia Zone 6.  (7 hours ahead of GMT.)  Note that
5384 SST is also Swedish Summer Time.
5385 @itemx wast
5386 West Australian Standard Time.  (7 hours ahead of GMT.)
5387 @itemx wadt
5388 West Australian Daylight Time.  (8 hours ahead of GMT.)
5389 @itemx jt
5390 Java Time.  (7.5 hours ahead of GMT.)
5391 @itemx cct
5392 China Coast Time; Russia Zone 7.  (8 hours ahead of GMT.)
5393 @itemx jst
5394 Japan Standard time; Russia Zone 8.  (9 hours ahead of GMT.)
5395 @itemx kst
5396 Korean Standard Time.  (9 hours ahead of GMT.)
5397 @itemx cast
5398 Central Australian Standard Time.  (9.5 hours ahead of GMT.)
5399 @itemx cadt
5400 Central Australian Daylight Time.  (10.5 hours ahead of GMT.)
5401 @itemx east
5402 Eastern Australian Standard Time.  (10 hours ahead of GMT.)
5403 @itemx eadt
5404 Eastern Australian Daylight Time.  (11 hours ahead of GMT.)
5405 @itemx gst
5406 Guam Standard Time; Russia Zone 9.  (10 hours ahead of GMT.)
5407 @itemx kdt
5408 Korean Daylight Time.  (10 hours ahead of GMT.)
5409 @itemx nzt
5410 New Zealand Time.  (12 hours ahead of GMT.)
5411 @itemx nzst
5412 New Zealand Standard Time.  (12 hours ahead of GMT.)
5413 @itemx nzdt
5414 New Zealand Daylight Time.  (13 hours ahead of GMT.)
5415 @itemx idle
5416 International Date Line East.  (12 hours ahead of GMT.)
5417 @end table
5418
5419 @contents
5420 @bye
5421