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