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