Imported Upstream version 1.15.1
[platform/upstream/krb5.git] / doc / html / _sources / admin / admin_commands / kadmin_local.txt
1 .. _kadmin(1):
2
3 kadmin
4 ======
5
6 SYNOPSIS
7 --------
8
9 .. _kadmin_synopsis:
10
11 **kadmin**
12 [**-O**\|\ **-N**]
13 [**-r** *realm*]
14 [**-p** *principal*]
15 [**-q** *query*]
16 [[**-c** *cache_name*]\|[**-k** [**-t** *keytab*]]\|\ **-n**]
17 [**-w** *password*]
18 [**-s** *admin_server*\ [:*port*]]
19 [command args...]
20
21 **kadmin.local**
22 [**-r** *realm*]
23 [**-p** *principal*]
24 [**-q** *query*]
25 [**-d** *dbname*]
26 [**-e** *enc*:*salt* ...]
27 [**-m**]
28 [**-x** *db_args*]
29 [command args...]
30
31 .. _kadmin_synopsis_end:
32
33
34 DESCRIPTION
35 -----------
36
37 kadmin and kadmin.local are command-line interfaces to the Kerberos V5
38 administration system.  They provide nearly identical functionalities;
39 the difference is that kadmin.local directly accesses the KDC
40 database, while kadmin performs operations using :ref:`kadmind(8)`.
41 Except as explicitly noted otherwise, this man page will use "kadmin"
42 to refer to both versions.  kadmin provides for the maintenance of
43 Kerberos principals, password policies, and service key tables
44 (keytabs).
45
46 The remote kadmin client uses Kerberos to authenticate to kadmind
47 using the service principal ``kadmin/ADMINHOST`` (where *ADMINHOST* is
48 the fully-qualified hostname of the admin server) or ``kadmin/admin``.
49 If the credentials cache contains a ticket for one of these
50 principals, and the **-c** credentials_cache option is specified, that
51 ticket is used to authenticate to kadmind.  Otherwise, the **-p** and
52 **-k** options are used to specify the client Kerberos principal name
53 used to authenticate.  Once kadmin has determined the principal name,
54 it requests a service ticket from the KDC, and uses that service
55 ticket to authenticate to kadmind.
56
57 Since kadmin.local directly accesses the KDC database, it usually must
58 be run directly on the master KDC with sufficient permissions to read
59 the KDC database.  If the KDC database uses the LDAP database module,
60 kadmin.local can be run on any host which can access the LDAP server.
61
62
63 OPTIONS
64 -------
65
66 .. _kadmin_options:
67
68 **-r** *realm*
69     Use *realm* as the default database realm.
70
71 **-p** *principal*
72     Use *principal* to authenticate.  Otherwise, kadmin will append
73     ``/admin`` to the primary principal name of the default ccache,
74     the value of the **USER** environment variable, or the username as
75     obtained with getpwuid, in order of preference.
76
77 **-k**
78     Use a keytab to decrypt the KDC response instead of prompting for
79     a password.  In this case, the default principal will be
80     ``host/hostname``.  If there is no keytab specified with the
81     **-t** option, then the default keytab will be used.
82
83 **-t** *keytab*
84     Use *keytab* to decrypt the KDC response.  This can only be used
85     with the **-k** option.
86
87 **-n**
88     Requests anonymous processing.  Two types of anonymous principals
89     are supported.  For fully anonymous Kerberos, configure PKINIT on
90     the KDC and configure **pkinit_anchors** in the client's
91     :ref:`krb5.conf(5)`.  Then use the **-n** option with a principal
92     of the form ``@REALM`` (an empty principal name followed by the
93     at-sign and a realm name).  If permitted by the KDC, an anonymous
94     ticket will be returned.  A second form of anonymous tickets is
95     supported; these realm-exposed tickets hide the identity of the
96     client but not the client's realm.  For this mode, use ``kinit
97     -n`` with a normal principal name.  If supported by the KDC, the
98     principal (but not realm) will be replaced by the anonymous
99     principal.  As of release 1.8, the MIT Kerberos KDC only supports
100     fully anonymous operation.
101
102 **-c** *credentials_cache*
103     Use *credentials_cache* as the credentials cache.  The
104     cache should contain a service ticket for the ``kadmin/ADMINHOST``
105     (where *ADMINHOST* is the fully-qualified hostname of the admin
106     server) or ``kadmin/admin`` service; it can be acquired with the
107     :ref:`kinit(1)` program.  If this option is not specified, kadmin
108     requests a new service ticket from the KDC, and stores it in its
109     own temporary ccache.
110
111 **-w** *password*
112     Use *password* instead of prompting for one.  Use this option with
113     care, as it may expose the password to other users on the system
114     via the process list.
115
116 **-q** *query*
117     Perform the specified query and then exit.
118
119 **-d** *dbname*
120     Specifies the name of the KDC database.  This option does not
121     apply to the LDAP database module.
122
123 **-s** *admin_server*\ [:*port*]
124     Specifies the admin server which kadmin should contact.
125
126 **-m**
127     If using kadmin.local, prompt for the database master password
128     instead of reading it from a stash file.
129
130 **-e** "*enc*:*salt* ..."
131     Sets the keysalt list to be used for any new keys created.  See
132     :ref:`Keysalt_lists` in :ref:`kdc.conf(5)` for a list of possible
133     values.
134
135 **-O**
136     Force use of old AUTH_GSSAPI authentication flavor.
137
138 **-N**
139     Prevent fallback to AUTH_GSSAPI authentication flavor.
140
141 **-x** *db_args*
142     Specifies the database specific arguments.  See the next section
143     for supported options.
144
145 .. _kadmin_options_end:
146
147 Starting with release 1.14, if any command-line arguments remain after
148 the options, they will be treated as a single query to be executed.
149 This mode of operation is intended for scripts and behaves differently
150 from the interactive mode in several respects:
151
152 * Query arguments are split by the shell, not by kadmin.
153 * Informational and warning messages are suppressed.  Error messages
154   and query output (e.g. for **get_principal**) will still be
155   displayed.
156 * Confirmation prompts are disabled (as if **-force** was given).
157   Password prompts will still be issued as required.
158 * The exit status will be non-zero if the query fails.
159
160 The **-q** option does not carry these behavior differences; the query
161 will be processed as if it was entered interactively.  The **-q**
162 option cannot be used in combination with a query in the remaining
163 arguments.
164
165 .. _dboptions:
166
167 DATABASE OPTIONS
168 ----------------
169
170 Database options can be used to override database-specific defaults.
171 Supported options for the DB2 module are:
172
173     **-x dbname=**\ \*filename*
174         Specifies the base filename of the DB2 database.
175
176     **-x lockiter**
177         Make iteration operations hold the lock for the duration of
178         the entire operation, rather than temporarily releasing the
179         lock while handling each principal.  This is the default
180         behavior, but this option exists to allow command line
181         override of a [dbmodules] setting.  First introduced in
182         release 1.13.
183
184     **-x unlockiter**
185         Make iteration operations unlock the database for each
186         principal, instead of holding the lock for the duration of the
187         entire operation.  First introduced in release 1.13.
188
189 Supported options for the LDAP module are:
190
191     **-x host=**\ *ldapuri*
192         Specifies the LDAP server to connect to by a LDAP URI.
193
194     **-x binddn=**\ *bind_dn*
195         Specifies the DN used to bind to the LDAP server.
196
197     **-x bindpwd=**\ *password*
198         Specifies the password or SASL secret used to bind to the LDAP
199         server.  Using this option may expose the password to other
200         users on the system via the process list; to avoid this,
201         instead stash the password using the **stashsrvpw** command of
202         :ref:`kdb5_ldap_util(8)`.
203
204     **-x sasl_mech=**\ *mechanism*
205         Specifies the SASL mechanism used to bind to the LDAP server.
206         The bind DN is ignored if a SASL mechanism is used.  New in
207         release 1.13.
208
209     **-x sasl_authcid=**\ *name*
210         Specifies the authentication name used when binding to the
211         LDAP server with a SASL mechanism, if the mechanism requires
212         one.  New in release 1.13.
213
214     **-x sasl_authzid=**\ *name*
215         Specifies the authorization name used when binding to the LDAP
216         server with a SASL mechanism.  New in release 1.13.
217
218     **-x sasl_realm=**\ *realm*
219         Specifies the realm used when binding to the LDAP server with
220         a SASL mechanism, if the mechanism uses one.  New in release
221         1.13.
222
223     **-x debug=**\ *level*
224         sets the OpenLDAP client library debug level.  *level* is an
225         integer to be interpreted by the library.  Debugging messages
226         are printed to standard error.  New in release 1.12.
227
228
229 COMMANDS
230 --------
231
232 When using the remote client, available commands may be restricted
233 according to the privileges specified in the :ref:`kadm5.acl(5)` file
234 on the admin server.
235
236 .. _add_principal:
237
238 add_principal
239 ~~~~~~~~~~~~~
240
241     **add_principal** [*options*] *newprinc*
242
243 Creates the principal *newprinc*, prompting twice for a password.  If
244 no password policy is specified with the **-policy** option, and the
245 policy named ``default`` is assigned to the principal if it exists.
246 However, creating a policy named ``default`` will not automatically
247 assign this policy to previously existing principals.  This policy
248 assignment can be suppressed with the **-clearpolicy** option.
249
250 This command requires the **add** privilege.
251
252 Aliases: **addprinc**, **ank**
253
254 Options:
255
256 **-expire** *expdate*
257     (:ref:`getdate` string) The expiration date of the principal.
258
259 **-pwexpire** *pwexpdate*
260     (:ref:`getdate` string) The password expiration date.
261
262 **-maxlife** *maxlife*
263     (:ref:`duration` or :ref:`getdate` string) The maximum ticket life
264     for the principal.
265
266 **-maxrenewlife** *maxrenewlife*
267     (:ref:`duration` or :ref:`getdate` string) The maximum renewable
268     life of tickets for the principal.
269
270 **-kvno** *kvno*
271     The initial key version number.
272
273 **-policy** *policy*
274     The password policy used by this principal.  If not specified, the
275     policy ``default`` is used if it exists (unless **-clearpolicy**
276     is specified).
277
278 **-clearpolicy**
279     Prevents any policy from being assigned when **-policy** is not
280     specified.
281
282 {-\|+}\ **allow_postdated**
283     **-allow_postdated** prohibits this principal from obtaining
284     postdated tickets.  **+allow_postdated** clears this flag.
285
286 {-\|+}\ **allow_forwardable**
287     **-allow_forwardable** prohibits this principal from obtaining
288     forwardable tickets.  **+allow_forwardable** clears this flag.
289
290 {-\|+}\ **allow_renewable**
291     **-allow_renewable** prohibits this principal from obtaining
292     renewable tickets.  **+allow_renewable** clears this flag.
293
294 {-\|+}\ **allow_proxiable**
295     **-allow_proxiable** prohibits this principal from obtaining
296     proxiable tickets.  **+allow_proxiable** clears this flag.
297
298 {-\|+}\ **allow_dup_skey**
299     **-allow_dup_skey** disables user-to-user authentication for this
300     principal by prohibiting this principal from obtaining a session
301     key for another user.  **+allow_dup_skey** clears this flag.
302
303 {-\|+}\ **requires_preauth**
304     **+requires_preauth** requires this principal to preauthenticate
305     before being allowed to kinit.  **-requires_preauth** clears this
306     flag.  When **+requires_preauth** is set on a service principal,
307     the KDC will only issue service tickets for that service principal
308     if the client's initial authentication was performed using
309     preauthentication.
310
311 {-\|+}\ **requires_hwauth**
312     **+requires_hwauth** requires this principal to preauthenticate
313     using a hardware device before being allowed to kinit.
314     **-requires_hwauth** clears this flag.  When **+requires_hwauth** is
315     set on a service principal, the KDC will only issue service tickets
316     for that service principal if the client's initial authentication was
317     performed using a hardware device to preauthenticate.
318
319 {-\|+}\ **ok_as_delegate**
320     **+ok_as_delegate** sets the **okay as delegate** flag on tickets
321     issued with this principal as the service.  Clients may use this
322     flag as a hint that credentials should be delegated when
323     authenticating to the service.  **-ok_as_delegate** clears this
324     flag.
325
326 {-\|+}\ **allow_svr**
327     **-allow_svr** prohibits the issuance of service tickets for this
328     principal.  **+allow_svr** clears this flag.
329
330 {-\|+}\ **allow_tgs_req**
331     **-allow_tgs_req** specifies that a Ticket-Granting Service (TGS)
332     request for a service ticket for this principal is not permitted.
333     **+allow_tgs_req** clears this flag.
334
335 {-\|+}\ **allow_tix**
336     **-allow_tix** forbids the issuance of any tickets for this
337     principal.  **+allow_tix** clears this flag.
338
339 {-\|+}\ **needchange**
340     **+needchange** forces a password change on the next initial
341     authentication to this principal.  **-needchange** clears this
342     flag.
343
344 {-\|+}\ **password_changing_service**
345     **+password_changing_service** marks this principal as a password
346     change service principal.
347
348 {-\|+}\ **ok_to_auth_as_delegate**
349     **+ok_to_auth_as_delegate** allows this principal to acquire
350     forwardable tickets to itself from arbitrary users, for use with
351     constrained delegation.
352
353 {-\|+}\ **no_auth_data_required**
354     **+no_auth_data_required** prevents PAC or AD-SIGNEDPATH data from
355     being added to service tickets for the principal.
356
357 {-\|+}\ **lockdown_keys**
358     **+lockdown_keys** prevents keys for this principal from leaving
359     the KDC via kadmind.  The chpass and extract operations are denied
360     for a principal with this attribute.  The chrand operation is
361     allowed, but will not return the new keys.  The delete and rename
362     operations are also denied if this attribute is set, in order to
363     prevent a malicious administrator from replacing principals like
364     krbtgt/* or kadmin/* with new principals without the attribute.
365     This attribute can be set via the network protocol, but can only
366     be removed using kadmin.local.
367
368 **-randkey**
369     Sets the key of the principal to a random value.
370
371 **-nokey**
372     Causes the principal to be created with no key.  New in release
373     1.12.
374
375 **-pw** *password*
376     Sets the password of the principal to the specified string and
377     does not prompt for a password.  Note: using this option in a
378     shell script may expose the password to other users on the system
379     via the process list.
380
381 **-e** *enc*:*salt*,...
382     Uses the specified keysalt list for setting the keys of the
383     principal.  See :ref:`Keysalt_lists` in :ref:`kdc.conf(5)` for a
384     list of possible values.
385
386 **-x** *db_princ_args*
387     Indicates database-specific options.  The options for the LDAP
388     database module are:
389
390     **-x dn=**\ *dn*
391         Specifies the LDAP object that will contain the Kerberos
392         principal being created.
393
394     **-x linkdn=**\ *dn*
395         Specifies the LDAP object to which the newly created Kerberos
396         principal object will point.
397
398     **-x containerdn=**\ *container_dn*
399         Specifies the container object under which the Kerberos
400         principal is to be created.
401
402     **-x tktpolicy=**\ *policy*
403         Associates a ticket policy to the Kerberos principal.
404
405     .. note::
406
407         - The **containerdn** and **linkdn** options cannot be
408           specified with the **dn** option.
409         - If the *dn* or *containerdn* options are not specified while
410           adding the principal, the principals are created under the
411           principal container configured in the realm or the realm
412           container.
413         - *dn* and *containerdn* should be within the subtrees or
414           principal container configured in the realm.
415
416 Example::
417
418     kadmin: addprinc jennifer
419     WARNING: no policy specified for "jennifer@ATHENA.MIT.EDU";
420     defaulting to no policy.
421     Enter password for principal jennifer@ATHENA.MIT.EDU:
422     Re-enter password for principal jennifer@ATHENA.MIT.EDU:
423     Principal "jennifer@ATHENA.MIT.EDU" created.
424     kadmin:
425
426 .. _add_principal_end:
427
428 .. _modify_principal:
429
430 modify_principal
431 ~~~~~~~~~~~~~~~~
432
433     **modify_principal** [*options*] *principal*
434
435 Modifies the specified principal, changing the fields as specified.
436 The options to **add_principal** also apply to this command, except
437 for the **-randkey**, **-pw**, and **-e** options.  In addition, the
438 option **-clearpolicy** will clear the current policy of a principal.
439
440 This command requires the *modify* privilege.
441
442 Alias: **modprinc**
443
444 Options (in addition to the **addprinc** options):
445
446 **-unlock**
447     Unlocks a locked principal (one which has received too many failed
448     authentication attempts without enough time between them according
449     to its password policy) so that it can successfully authenticate.
450
451 .. _modify_principal_end:
452
453 .. _rename_principal:
454
455 rename_principal
456 ~~~~~~~~~~~~~~~~
457
458     **rename_principal** [**-force**] *old_principal* *new_principal*
459
460 Renames the specified *old_principal* to *new_principal*.  This
461 command prompts for confirmation, unless the **-force** option is
462 given.
463
464 This command requires the **add** and **delete** privileges.
465
466 Alias: **renprinc**
467
468 .. _rename_principal_end:
469
470 .. _delete_principal:
471
472 delete_principal
473 ~~~~~~~~~~~~~~~~
474
475     **delete_principal** [**-force**] *principal*
476
477 Deletes the specified *principal* from the database.  This command
478 prompts for deletion, unless the **-force** option is given.
479
480 This command requires the **delete** privilege.
481
482 Alias: **delprinc**
483
484 .. _delete_principal_end:
485
486 .. _change_password:
487
488 change_password
489 ~~~~~~~~~~~~~~~
490
491     **change_password** [*options*] *principal*
492
493 Changes the password of *principal*.  Prompts for a new password if
494 neither **-randkey** or **-pw** is specified.
495
496 This command requires the **changepw** privilege, or that the
497 principal running the program is the same as the principal being
498 changed.
499
500 Alias: **cpw**
501
502 The following options are available:
503
504 **-randkey**
505     Sets the key of the principal to a random value.
506
507 **-pw** *password*
508     Set the password to the specified string.  Using this option in a
509     script may expose the password to other users on the system via
510     the process list.
511
512 **-e** *enc*:*salt*,...
513     Uses the specified keysalt list for setting the keys of the
514     principal.  See :ref:`Keysalt_lists` in :ref:`kdc.conf(5)` for a
515     list of possible values.
516
517 **-keepold**
518     Keeps the existing keys in the database.  This flag is usually not
519     necessary except perhaps for ``krbtgt`` principals.
520
521 Example::
522
523     kadmin: cpw systest
524     Enter password for principal systest@BLEEP.COM:
525     Re-enter password for principal systest@BLEEP.COM:
526     Password for systest@BLEEP.COM changed.
527     kadmin:
528
529 .. _change_password_end:
530
531 .. _purgekeys:
532
533 purgekeys
534 ~~~~~~~~~
535
536     **purgekeys** [**-all**\|\ **-keepkvno** *oldest_kvno_to_keep*] *principal*
537
538 Purges previously retained old keys (e.g., from **change_password
539 -keepold**) from *principal*.  If **-keepkvno** is specified, then
540 only purges keys with kvnos lower than *oldest_kvno_to_keep*.  If
541 **-all** is specified, then all keys are purged.  The **-all** option
542 is new in release 1.12.
543
544 This command requires the **modify** privilege.
545
546 .. _purgekeys_end:
547
548 .. _get_principal:
549
550 get_principal
551 ~~~~~~~~~~~~~
552
553     **get_principal** [**-terse**] *principal*
554
555 Gets the attributes of principal.  With the **-terse** option, outputs
556 fields as quoted tab-separated strings.
557
558 This command requires the **inquire** privilege, or that the principal
559 running the the program to be the same as the one being listed.
560
561 Alias: **getprinc**
562
563 Examples::
564
565     kadmin: getprinc tlyu/admin
566     Principal: tlyu/admin@BLEEP.COM
567     Expiration date: [never]
568     Last password change: Mon Aug 12 14:16:47 EDT 1996
569     Password expiration date: [none]
570     Maximum ticket life: 0 days 10:00:00
571     Maximum renewable life: 7 days 00:00:00
572     Last modified: Mon Aug 12 14:16:47 EDT 1996 (bjaspan/admin@BLEEP.COM)
573     Last successful authentication: [never]
574     Last failed authentication: [never]
575     Failed password attempts: 0
576     Number of keys: 2
577     Key: vno 1, des-cbc-crc
578     Key: vno 1, des-cbc-crc:v4
579     Attributes:
580     Policy: [none]
581
582     kadmin: getprinc -terse systest
583     systest@BLEEP.COM   3    86400     604800    1
584     785926535 753241234 785900000
585     tlyu/admin@BLEEP.COM     786100034 0    0
586     kadmin:
587
588 .. _get_principal_end:
589
590 .. _list_principals:
591
592 list_principals
593 ~~~~~~~~~~~~~~~
594
595     **list_principals** [*expression*]
596
597 Retrieves all or some principal names.  *expression* is a shell-style
598 glob expression that can contain the wild-card characters ``?``,
599 ``*``, and ``[]``.  All principal names matching the expression are
600 printed.  If no expression is provided, all principal names are
601 printed.  If the expression does not contain an ``@`` character, an
602 ``@`` character followed by the local realm is appended to the
603 expression.
604
605 This command requires the **list** privilege.
606
607 Alias: **listprincs**, **get_principals**, **get_princs**
608
609 Example::
610
611     kadmin:  listprincs test*
612     test3@SECURE-TEST.OV.COM
613     test2@SECURE-TEST.OV.COM
614     test1@SECURE-TEST.OV.COM
615     testuser@SECURE-TEST.OV.COM
616     kadmin:
617
618 .. _list_principals_end:
619
620 .. _get_strings:
621
622 get_strings
623 ~~~~~~~~~~~
624
625     **get_strings** *principal*
626
627 Displays string attributes on *principal*.
628
629 This command requires the **inquire** privilege.
630
631 Alias: **getstr**
632
633 .. _get_strings_end:
634
635 .. _set_string:
636
637 set_string
638 ~~~~~~~~~~
639
640     **set_string** *principal* *name* *value*
641
642 Sets a string attribute on *principal*.  String attributes are used to
643 supply per-principal configuration to the KDC and some KDC plugin
644 modules.  The following string attribute names are recognized by the
645 KDC:
646
647 **require_auth**
648     Specifies an authentication indicator which is required to
649     authenticate to the principal as a service.  Multiple indicators
650     can be specified, separated by spaces; in this case any of the
651     specified indicators will be accepted.  (New in release 1.14.)
652
653 **session_enctypes**
654     Specifies the encryption types supported for session keys when the
655     principal is authenticated to as a server.  See
656     :ref:`Encryption_types` in :ref:`kdc.conf(5)` for a list of the
657     accepted values.
658
659 **otp**
660     Enables One Time Passwords (OTP) preauthentication for a client
661     *principal*.  The *value* is a JSON string representing an array
662     of objects, each having optional ``type`` and ``username`` fields.
663
664 This command requires the **modify** privilege.
665
666 Alias: **setstr**
667
668 Example::
669
670     set_string host/foo.mit.edu session_enctypes aes128-cts
671     set_string user@FOO.COM otp "[{""type"":""hotp"",""username"":""al""}]"
672
673 .. _set_string_end:
674
675 .. _del_string:
676
677 del_string
678 ~~~~~~~~~~
679
680     **del_string** *principal* *key*
681
682 Deletes a string attribute from *principal*.
683
684 This command requires the **delete** privilege.
685
686 Alias: **delstr**
687
688 .. _del_string_end:
689
690 .. _add_policy:
691
692 add_policy
693 ~~~~~~~~~~
694
695     **add_policy** [*options*] *policy*
696
697 Adds a password policy named *policy* to the database.
698
699 This command requires the **add** privilege.
700
701 Alias: **addpol**
702
703 The following options are available:
704
705 **-maxlife** *time*
706     (:ref:`duration` or :ref:`getdate` string) Sets the maximum
707     lifetime of a password.
708
709 **-minlife** *time*
710     (:ref:`duration` or :ref:`getdate` string) Sets the minimum
711     lifetime of a password.
712
713 **-minlength** *length*
714     Sets the minimum length of a password.
715
716 **-minclasses** *number*
717     Sets the minimum number of character classes required in a
718     password.  The five character classes are lower case, upper case,
719     numbers, punctuation, and whitespace/unprintable characters.
720
721 **-history** *number*
722     Sets the number of past keys kept for a principal.  This option is
723     not supported with the LDAP KDC database module.
724
725 .. _policy_maxfailure:
726
727 **-maxfailure** *maxnumber*
728     Sets the number of authentication failures before the principal is
729     locked.  Authentication failures are only tracked for principals
730     which require preauthentication.  The counter of failed attempts
731     resets to 0 after a successful attempt to authenticate.  A
732     *maxnumber* value of 0 (the default) disables lockout.
733
734 .. _policy_failurecountinterval:
735
736 **-failurecountinterval** *failuretime*
737     (:ref:`duration` or :ref:`getdate` string) Sets the allowable time
738     between authentication failures.  If an authentication failure
739     happens after *failuretime* has elapsed since the previous
740     failure, the number of authentication failures is reset to 1.  A
741     *failuretime* value of 0 (the default) means forever.
742
743 .. _policy_lockoutduration:
744
745 **-lockoutduration** *lockouttime*
746     (:ref:`duration` or :ref:`getdate` string) Sets the duration for
747     which the principal is locked from authenticating if too many
748     authentication failures occur without the specified failure count
749     interval elapsing.  A duration of 0 (the default) means the
750     principal remains locked out until it is administratively unlocked
751     with ``modprinc -unlock``.
752
753 **-allowedkeysalts**
754     Specifies the key/salt tuples supported for long-term keys when
755     setting or changing a principal's password/keys.  See
756     :ref:`Keysalt_lists` in :ref:`kdc.conf(5)` for a list of the
757     accepted values, but note that key/salt tuples must be separated
758     with commas (',') only.  To clear the allowed key/salt policy use
759     a value of '-'.
760
761 Example::
762
763     kadmin: add_policy -maxlife "2 days" -minlength 5 guests
764     kadmin:
765
766 .. _add_policy_end:
767
768 .. _modify_policy:
769
770 modify_policy
771 ~~~~~~~~~~~~~
772
773     **modify_policy** [*options*] *policy*
774
775 Modifies the password policy named *policy*.  Options are as described
776 for **add_policy**.
777
778 This command requires the **modify** privilege.
779
780 Alias: **modpol**
781
782 .. _modify_policy_end:
783
784 .. _delete_policy:
785
786 delete_policy
787 ~~~~~~~~~~~~~
788
789     **delete_policy** [**-force**] *policy*
790
791 Deletes the password policy named *policy*.  Prompts for confirmation
792 before deletion.  The command will fail if the policy is in use by any
793 principals.
794
795 This command requires the **delete** privilege.
796
797 Alias: **delpol**
798
799 Example::
800
801     kadmin: del_policy guests
802     Are you sure you want to delete the policy "guests"?
803     (yes/no): yes
804     kadmin:
805
806 .. _delete_policy_end:
807
808 .. _get_policy:
809
810 get_policy
811 ~~~~~~~~~~
812
813     **get_policy** [ **-terse** ] *policy*
814
815 Displays the values of the password policy named *policy*.  With the
816 **-terse** flag, outputs the fields as quoted strings separated by
817 tabs.
818
819 This command requires the **inquire** privilege.
820
821 Alias: getpol
822
823 Examples::
824
825     kadmin: get_policy admin
826     Policy: admin
827     Maximum password life: 180 days 00:00:00
828     Minimum password life: 00:00:00
829     Minimum password length: 6
830     Minimum number of password character classes: 2
831     Number of old keys kept: 5
832     Reference count: 17
833
834     kadmin: get_policy -terse admin
835     admin     15552000  0    6    2    5    17
836     kadmin:
837
838 The "Reference count" is the number of principals using that policy.
839 With the LDAP KDC database module, the reference count field is not
840 meaningful.
841
842 .. _get_policy_end:
843
844 .. _list_policies:
845
846 list_policies
847 ~~~~~~~~~~~~~
848
849     **list_policies** [*expression*]
850
851 Retrieves all or some policy names.  *expression* is a shell-style
852 glob expression that can contain the wild-card characters ``?``,
853 ``*``, and ``[]``.  All policy names matching the expression are
854 printed.  If no expression is provided, all existing policy names are
855 printed.
856
857 This command requires the **list** privilege.
858
859 Aliases: **listpols**, **get_policies**, **getpols**.
860
861 Examples::
862
863     kadmin:  listpols
864     test-pol
865     dict-only
866     once-a-min
867     test-pol-nopw
868
869     kadmin:  listpols t*
870     test-pol
871     test-pol-nopw
872     kadmin:
873
874 .. _list_policies_end:
875
876 .. _ktadd:
877
878 ktadd
879 ~~~~~
880
881     | **ktadd** [options] *principal*
882     | **ktadd** [options] **-glob** *princ-exp*
883
884 Adds a *principal*, or all principals matching *princ-exp*, to a
885 keytab file.  Each principal's keys are randomized in the process.
886 The rules for *princ-exp* are described in the **list_principals**
887 command.
888
889 This command requires the **inquire** and **changepw** privileges.
890 With the **-glob** form, it also requires the **list** privilege.
891
892 The options are:
893
894 **-k[eytab]** *keytab*
895     Use *keytab* as the keytab file.  Otherwise, the default keytab is
896     used.
897
898 **-e** *enc*:*salt*,...
899     Uses the specified keysalt list for setting the new keys of the
900     principal.  See :ref:`Keysalt_lists` in :ref:`kdc.conf(5)` for a
901     list of possible values.
902
903 **-q**
904     Display less verbose information.
905
906 **-norandkey**
907     Do not randomize the keys. The keys and their version numbers stay
908     unchanged.  This option cannot be specified in combination with the
909     **-e** option.
910
911 An entry for each of the principal's unique encryption types is added,
912 ignoring multiple keys with the same encryption type but different
913 salt types.
914
915 Example::
916
917     kadmin: ktadd -k /tmp/foo-new-keytab host/foo.mit.edu
918     Entry for principal host/foo.mit.edu@ATHENA.MIT.EDU with kvno 3,
919          encryption type aes256-cts-hmac-sha1-96 added to keytab
920          FILE:/tmp/foo-new-keytab
921     kadmin:
922
923 .. _ktadd_end:
924
925 .. _ktremove:
926
927 ktremove
928 ~~~~~~~~
929
930     **ktremove** [options] *principal* [*kvno* | *all* | *old*]
931
932 Removes entries for the specified *principal* from a keytab.  Requires
933 no permissions, since this does not require database access.
934
935 If the string "all" is specified, all entries for that principal are
936 removed; if the string "old" is specified, all entries for that
937 principal except those with the highest kvno are removed.  Otherwise,
938 the value specified is parsed as an integer, and all entries whose
939 kvno match that integer are removed.
940
941 The options are:
942
943 **-k[eytab]** *keytab*
944     Use *keytab* as the keytab file.  Otherwise, the default keytab is
945     used.
946
947 **-q**
948     Display less verbose information.
949
950 Example::
951
952     kadmin: ktremove kadmin/admin all
953     Entry for principal kadmin/admin with kvno 3 removed from keytab
954          FILE:/etc/krb5.keytab
955     kadmin:
956
957 .. _ktremove_end:
958
959 lock
960 ~~~~
961
962 Lock database exclusively.  Use with extreme caution!  This command
963 only works with the DB2 KDC database module.
964
965 unlock
966 ~~~~~~
967
968 Release the exclusive database lock.
969
970 list_requests
971 ~~~~~~~~~~~~~
972
973 Lists available for kadmin requests.
974
975 Aliases: **lr**, **?**
976
977 quit
978 ~~~~
979
980 Exit program.  If the database was locked, the lock is released.
981
982 Aliases: **exit**, **q**
983
984
985 HISTORY
986 -------
987
988 The kadmin program was originally written by Tom Yu at MIT, as an
989 interface to the OpenVision Kerberos administration program.
990
991
992 SEE ALSO
993 --------
994
995 :ref:`kpasswd(1)`, :ref:`kadmind(8)`