Imported Upstream version 1.20.1
[platform/upstream/krb5.git] / doc / html / _sources / admin / admin_commands / kadmin_local.rst.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/admin`` or ``kadmin/ADMINHOST``
48 (where *ADMINHOST* is the fully-qualified hostname of the admin
49 server).  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 primary 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 cache
104     should contain a service ticket for the ``kadmin/admin`` or
105     ``kadmin/ADMINHOST`` (where *ADMINHOST* is the fully-qualified
106     hostname of the admin server) 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 others from obtaining a service ticket
301     encrypted in this principal's TGT session key.
302     **+allow_dup_skey** clears this flag.
303
304 {-\|+}\ **requires_preauth**
305     **+requires_preauth** requires this principal to preauthenticate
306     before being allowed to kinit.  **-requires_preauth** clears this
307     flag.  When **+requires_preauth** is set on a service principal,
308     the KDC will only issue service tickets for that service principal
309     if the client's initial authentication was performed using
310     preauthentication.
311
312 {-\|+}\ **requires_hwauth**
313     **+requires_hwauth** requires this principal to preauthenticate
314     using a hardware device before being allowed to kinit.
315     **-requires_hwauth** clears this flag.  When **+requires_hwauth** is
316     set on a service principal, the KDC will only issue service tickets
317     for that service principal if the client's initial authentication was
318     performed using a hardware device to preauthenticate.
319
320 {-\|+}\ **ok_as_delegate**
321     **+ok_as_delegate** sets the **okay as delegate** flag on tickets
322     issued with this principal as the service.  Clients may use this
323     flag as a hint that credentials should be delegated when
324     authenticating to the service.  **-ok_as_delegate** clears this
325     flag.
326
327 {-\|+}\ **allow_svr**
328     **-allow_svr** prohibits the issuance of service tickets for this
329     principal.  In release 1.17 and later, user-to-user service
330     tickets are still allowed unless the **-allow_dup_skey** flag is
331     also set.  **+allow_svr** clears this flag.
332
333 {-\|+}\ **allow_tgs_req**
334     **-allow_tgs_req** specifies that a Ticket-Granting Service (TGS)
335     request for a service ticket for this principal is not permitted.
336     **+allow_tgs_req** clears this flag.
337
338 {-\|+}\ **allow_tix**
339     **-allow_tix** forbids the issuance of any tickets for this
340     principal.  **+allow_tix** clears this flag.
341
342 {-\|+}\ **needchange**
343     **+needchange** forces a password change on the next initial
344     authentication to this principal.  **-needchange** clears this
345     flag.
346
347 {-\|+}\ **password_changing_service**
348     **+password_changing_service** marks this principal as a password
349     change service principal.
350
351 {-\|+}\ **ok_to_auth_as_delegate**
352     **+ok_to_auth_as_delegate** allows this principal to acquire
353     forwardable tickets to itself from arbitrary users, for use with
354     constrained delegation.
355
356 {-\|+}\ **no_auth_data_required**
357     **+no_auth_data_required** prevents PAC or AD-SIGNEDPATH data from
358     being added to service tickets for the principal.
359
360 {-\|+}\ **lockdown_keys**
361     **+lockdown_keys** prevents keys for this principal from leaving
362     the KDC via kadmind.  The chpass and extract operations are denied
363     for a principal with this attribute.  The chrand operation is
364     allowed, but will not return the new keys.  The delete and rename
365     operations are also denied if this attribute is set, in order to
366     prevent a malicious administrator from replacing principals like
367     krbtgt/* or kadmin/* with new principals without the attribute.
368     This attribute can be set via the network protocol, but can only
369     be removed using kadmin.local.
370
371 **-randkey**
372     Sets the key of the principal to a random value.
373
374 **-nokey**
375     Causes the principal to be created with no key.  New in release
376     1.12.
377
378 **-pw** *password*
379     Sets the password of the principal to the specified string and
380     does not prompt for a password.  Note: using this option in a
381     shell script may expose the password to other users on the system
382     via the process list.
383
384 **-e** *enc*:*salt*,...
385     Uses the specified keysalt list for setting the keys of the
386     principal.  See :ref:`Keysalt_lists` in :ref:`kdc.conf(5)` for a
387     list of possible values.
388
389 **-x** *db_princ_args*
390     Indicates database-specific options.  The options for the LDAP
391     database module are:
392
393     **-x dn=**\ *dn*
394         Specifies the LDAP object that will contain the Kerberos
395         principal being created.
396
397     **-x linkdn=**\ *dn*
398         Specifies the LDAP object to which the newly created Kerberos
399         principal object will point.
400
401     **-x containerdn=**\ *container_dn*
402         Specifies the container object under which the Kerberos
403         principal is to be created.
404
405     **-x tktpolicy=**\ *policy*
406         Associates a ticket policy to the Kerberos principal.
407
408     .. note::
409
410         - The **containerdn** and **linkdn** options cannot be
411           specified with the **dn** option.
412         - If the *dn* or *containerdn* options are not specified while
413           adding the principal, the principals are created under the
414           principal container configured in the realm or the realm
415           container.
416         - *dn* and *containerdn* should be within the subtrees or
417           principal container configured in the realm.
418
419 Example::
420
421     kadmin: addprinc jennifer
422     No policy specified for "jennifer@ATHENA.MIT.EDU";
423     defaulting to no policy.
424     Enter password for principal jennifer@ATHENA.MIT.EDU:
425     Re-enter password for principal jennifer@ATHENA.MIT.EDU:
426     Principal "jennifer@ATHENA.MIT.EDU" created.
427     kadmin:
428
429 .. _add_principal_end:
430
431 .. _modify_principal:
432
433 modify_principal
434 ~~~~~~~~~~~~~~~~
435
436     **modify_principal** [*options*] *principal*
437
438 Modifies the specified principal, changing the fields as specified.
439 The options to **add_principal** also apply to this command, except
440 for the **-randkey**, **-pw**, and **-e** options.  In addition, the
441 option **-clearpolicy** will clear the current policy of a principal.
442
443 This command requires the *modify* privilege.
444
445 Alias: **modprinc**
446
447 Options (in addition to the **addprinc** options):
448
449 **-unlock**
450     Unlocks a locked principal (one which has received too many failed
451     authentication attempts without enough time between them according
452     to its password policy) so that it can successfully authenticate.
453
454 .. _modify_principal_end:
455
456 .. _rename_principal:
457
458 rename_principal
459 ~~~~~~~~~~~~~~~~
460
461     **rename_principal** [**-force**] *old_principal* *new_principal*
462
463 Renames the specified *old_principal* to *new_principal*.  This
464 command prompts for confirmation, unless the **-force** option is
465 given.
466
467 This command requires the **add** and **delete** privileges.
468
469 Alias: **renprinc**
470
471 .. _rename_principal_end:
472
473 .. _delete_principal:
474
475 delete_principal
476 ~~~~~~~~~~~~~~~~
477
478     **delete_principal** [**-force**] *principal*
479
480 Deletes the specified *principal* from the database.  This command
481 prompts for deletion, unless the **-force** option is given.
482
483 This command requires the **delete** privilege.
484
485 Alias: **delprinc**
486
487 .. _delete_principal_end:
488
489 .. _change_password:
490
491 change_password
492 ~~~~~~~~~~~~~~~
493
494     **change_password** [*options*] *principal*
495
496 Changes the password of *principal*.  Prompts for a new password if
497 neither **-randkey** or **-pw** is specified.
498
499 This command requires the **changepw** privilege, or that the
500 principal running the program is the same as the principal being
501 changed.
502
503 Alias: **cpw**
504
505 The following options are available:
506
507 **-randkey**
508     Sets the key of the principal to a random value.
509
510 **-pw** *password*
511     Set the password to the specified string.  Using this option in a
512     script may expose the password to other users on the system via
513     the process list.
514
515 **-e** *enc*:*salt*,...
516     Uses the specified keysalt list for setting the keys of the
517     principal.  See :ref:`Keysalt_lists` in :ref:`kdc.conf(5)` for a
518     list of possible values.
519
520 **-keepold**
521     Keeps the existing keys in the database.  This flag is usually not
522     necessary except perhaps for ``krbtgt`` principals.
523
524 Example::
525
526     kadmin: cpw systest
527     Enter password for principal systest@BLEEP.COM:
528     Re-enter password for principal systest@BLEEP.COM:
529     Password for systest@BLEEP.COM changed.
530     kadmin:
531
532 .. _change_password_end:
533
534 .. _purgekeys:
535
536 purgekeys
537 ~~~~~~~~~
538
539     **purgekeys** [**-all**\|\ **-keepkvno** *oldest_kvno_to_keep*] *principal*
540
541 Purges previously retained old keys (e.g., from **change_password
542 -keepold**) from *principal*.  If **-keepkvno** is specified, then
543 only purges keys with kvnos lower than *oldest_kvno_to_keep*.  If
544 **-all** is specified, then all keys are purged.  The **-all** option
545 is new in release 1.12.
546
547 This command requires the **modify** privilege.
548
549 .. _purgekeys_end:
550
551 .. _get_principal:
552
553 get_principal
554 ~~~~~~~~~~~~~
555
556     **get_principal** [**-terse**] *principal*
557
558 Gets the attributes of principal.  With the **-terse** option, outputs
559 fields as quoted tab-separated strings.
560
561 This command requires the **inquire** privilege, or that the principal
562 running the the program to be the same as the one being listed.
563
564 Alias: **getprinc**
565
566 Examples::
567
568     kadmin: getprinc tlyu/admin
569     Principal: tlyu/admin@BLEEP.COM
570     Expiration date: [never]
571     Last password change: Mon Aug 12 14:16:47 EDT 1996
572     Password expiration date: [never]
573     Maximum ticket life: 0 days 10:00:00
574     Maximum renewable life: 7 days 00:00:00
575     Last modified: Mon Aug 12 14:16:47 EDT 1996 (bjaspan/admin@BLEEP.COM)
576     Last successful authentication: [never]
577     Last failed authentication: [never]
578     Failed password attempts: 0
579     Number of keys: 1
580     Key: vno 1, aes256-cts-hmac-sha384-192
581     MKey: vno 1
582     Attributes:
583     Policy: [none]
584
585     kadmin: getprinc -terse systest
586     systest@BLEEP.COM   3    86400     604800    1
587     785926535 753241234 785900000
588     tlyu/admin@BLEEP.COM     786100034 0    0
589     kadmin:
590
591 .. _get_principal_end:
592
593 .. _list_principals:
594
595 list_principals
596 ~~~~~~~~~~~~~~~
597
598     **list_principals** [*expression*]
599
600 Retrieves all or some principal names.  *expression* is a shell-style
601 glob expression that can contain the wild-card characters ``?``,
602 ``*``, and ``[]``.  All principal names matching the expression are
603 printed.  If no expression is provided, all principal names are
604 printed.  If the expression does not contain an ``@`` character, an
605 ``@`` character followed by the local realm is appended to the
606 expression.
607
608 This command requires the **list** privilege.
609
610 Alias: **listprincs**, **get_principals**, **getprincs**
611
612 Example::
613
614     kadmin:  listprincs test*
615     test3@SECURE-TEST.OV.COM
616     test2@SECURE-TEST.OV.COM
617     test1@SECURE-TEST.OV.COM
618     testuser@SECURE-TEST.OV.COM
619     kadmin:
620
621 .. _list_principals_end:
622
623 .. _get_strings:
624
625 get_strings
626 ~~~~~~~~~~~
627
628     **get_strings** *principal*
629
630 Displays string attributes on *principal*.
631
632 This command requires the **inquire** privilege.
633
634 Alias: **getstrs**
635
636 .. _get_strings_end:
637
638 .. _set_string:
639
640 set_string
641 ~~~~~~~~~~
642
643     **set_string** *principal* *name* *value*
644
645 Sets a string attribute on *principal*.  String attributes are used to
646 supply per-principal configuration to the KDC and some KDC plugin
647 modules.  The following string attribute names are recognized by the
648 KDC:
649
650 **require_auth**
651     Specifies an authentication indicator which is required to
652     authenticate to the principal as a service.  Multiple indicators
653     can be specified, separated by spaces; in this case any of the
654     specified indicators will be accepted.  (New in release 1.14.)
655
656 **session_enctypes**
657     Specifies the encryption types supported for session keys when the
658     principal is authenticated to as a server.  See
659     :ref:`Encryption_types` in :ref:`kdc.conf(5)` for a list of the
660     accepted values.
661
662 **otp**
663     Enables One Time Passwords (OTP) preauthentication for a client
664     *principal*.  The *value* is a JSON string representing an array
665     of objects, each having optional ``type`` and ``username`` fields.
666
667 **pkinit_cert_match**
668     Specifies a matching expression that defines the certificate
669     attributes required for the client certificate used by the
670     principal during PKINIT authentication.  The matching expression
671     is in the same format as those used by the **pkinit_cert_match**
672     option in :ref:`krb5.conf(5)`.  (New in release 1.16.)
673
674 This command requires the **modify** privilege.
675
676 Alias: **setstr**
677
678 Example::
679
680     set_string host/foo.mit.edu session_enctypes aes128-cts
681     set_string user@FOO.COM otp "[{""type"":""hotp"",""username"":""al""}]"
682
683 .. _set_string_end:
684
685 .. _del_string:
686
687 del_string
688 ~~~~~~~~~~
689
690     **del_string** *principal* *key*
691
692 Deletes a string attribute from *principal*.
693
694 This command requires the **delete** privilege.
695
696 Alias: **delstr**
697
698 .. _del_string_end:
699
700 .. _add_policy:
701
702 add_policy
703 ~~~~~~~~~~
704
705     **add_policy** [*options*] *policy*
706
707 Adds a password policy named *policy* to the database.
708
709 This command requires the **add** privilege.
710
711 Alias: **addpol**
712
713 The following options are available:
714
715 **-maxlife** *time*
716     (:ref:`duration` or :ref:`getdate` string) Sets the maximum
717     lifetime of a password.
718
719 **-minlife** *time*
720     (:ref:`duration` or :ref:`getdate` string) Sets the minimum
721     lifetime of a password.
722
723 **-minlength** *length*
724     Sets the minimum length of a password.
725
726 **-minclasses** *number*
727     Sets the minimum number of character classes required in a
728     password.  The five character classes are lower case, upper case,
729     numbers, punctuation, and whitespace/unprintable characters.
730
731 **-history** *number*
732     Sets the number of past keys kept for a principal.  This option is
733     not supported with the LDAP KDC database module.
734
735 .. _policy_maxfailure:
736
737 **-maxfailure** *maxnumber*
738     Sets the number of authentication failures before the principal is
739     locked.  Authentication failures are only tracked for principals
740     which require preauthentication.  The counter of failed attempts
741     resets to 0 after a successful attempt to authenticate.  A
742     *maxnumber* value of 0 (the default) disables lockout.
743
744 .. _policy_failurecountinterval:
745
746 **-failurecountinterval** *failuretime*
747     (:ref:`duration` or :ref:`getdate` string) Sets the allowable time
748     between authentication failures.  If an authentication failure
749     happens after *failuretime* has elapsed since the previous
750     failure, the number of authentication failures is reset to 1.  A
751     *failuretime* value of 0 (the default) means forever.
752
753 .. _policy_lockoutduration:
754
755 **-lockoutduration** *lockouttime*
756     (:ref:`duration` or :ref:`getdate` string) Sets the duration for
757     which the principal is locked from authenticating if too many
758     authentication failures occur without the specified failure count
759     interval elapsing.  A duration of 0 (the default) means the
760     principal remains locked out until it is administratively unlocked
761     with ``modprinc -unlock``.
762
763 **-allowedkeysalts**
764     Specifies the key/salt tuples supported for long-term keys when
765     setting or changing a principal's password/keys.  See
766     :ref:`Keysalt_lists` in :ref:`kdc.conf(5)` for a list of the
767     accepted values, but note that key/salt tuples must be separated
768     with commas (',') only.  To clear the allowed key/salt policy use
769     a value of '-'.
770
771 Example::
772
773     kadmin: add_policy -maxlife "2 days" -minlength 5 guests
774     kadmin:
775
776 .. _add_policy_end:
777
778 .. _modify_policy:
779
780 modify_policy
781 ~~~~~~~~~~~~~
782
783     **modify_policy** [*options*] *policy*
784
785 Modifies the password policy named *policy*.  Options are as described
786 for **add_policy**.
787
788 This command requires the **modify** privilege.
789
790 Alias: **modpol**
791
792 .. _modify_policy_end:
793
794 .. _delete_policy:
795
796 delete_policy
797 ~~~~~~~~~~~~~
798
799     **delete_policy** [**-force**] *policy*
800
801 Deletes the password policy named *policy*.  Prompts for confirmation
802 before deletion.  The command will fail if the policy is in use by any
803 principals.
804
805 This command requires the **delete** privilege.
806
807 Alias: **delpol**
808
809 Example::
810
811     kadmin: del_policy guests
812     Are you sure you want to delete the policy "guests"?
813     (yes/no): yes
814     kadmin:
815
816 .. _delete_policy_end:
817
818 .. _get_policy:
819
820 get_policy
821 ~~~~~~~~~~
822
823     **get_policy** [ **-terse** ] *policy*
824
825 Displays the values of the password policy named *policy*.  With the
826 **-terse** flag, outputs the fields as quoted strings separated by
827 tabs.
828
829 This command requires the **inquire** privilege.
830
831 Alias: **getpol**
832
833 Examples::
834
835     kadmin: get_policy admin
836     Policy: admin
837     Maximum password life: 180 days 00:00:00
838     Minimum password life: 00:00:00
839     Minimum password length: 6
840     Minimum number of password character classes: 2
841     Number of old keys kept: 5
842     Reference count: 17
843
844     kadmin: get_policy -terse admin
845     admin     15552000  0    6    2    5    17
846     kadmin:
847
848 The "Reference count" is the number of principals using that policy.
849 With the LDAP KDC database module, the reference count field is not
850 meaningful.
851
852 .. _get_policy_end:
853
854 .. _list_policies:
855
856 list_policies
857 ~~~~~~~~~~~~~
858
859     **list_policies** [*expression*]
860
861 Retrieves all or some policy names.  *expression* is a shell-style
862 glob expression that can contain the wild-card characters ``?``,
863 ``*``, and ``[]``.  All policy names matching the expression are
864 printed.  If no expression is provided, all existing policy names are
865 printed.
866
867 This command requires the **list** privilege.
868
869 Aliases: **listpols**, **get_policies**, **getpols**.
870
871 Examples::
872
873     kadmin:  listpols
874     test-pol
875     dict-only
876     once-a-min
877     test-pol-nopw
878
879     kadmin:  listpols t*
880     test-pol
881     test-pol-nopw
882     kadmin:
883
884 .. _list_policies_end:
885
886 .. _ktadd:
887
888 ktadd
889 ~~~~~
890
891     | **ktadd** [options] *principal*
892     | **ktadd** [options] **-glob** *princ-exp*
893
894 Adds a *principal*, or all principals matching *princ-exp*, to a
895 keytab file.  Each principal's keys are randomized in the process.
896 The rules for *princ-exp* are described in the **list_principals**
897 command.
898
899 This command requires the **inquire** and **changepw** privileges.
900 With the **-glob** form, it also requires the **list** privilege.
901
902 The options are:
903
904 **-k[eytab]** *keytab*
905     Use *keytab* as the keytab file.  Otherwise, the default keytab is
906     used.
907
908 **-e** *enc*:*salt*,...
909     Uses the specified keysalt list for setting the new keys of the
910     principal.  See :ref:`Keysalt_lists` in :ref:`kdc.conf(5)` for a
911     list of possible values.
912
913 **-q**
914     Display less verbose information.
915
916 **-norandkey**
917     Do not randomize the keys. The keys and their version numbers stay
918     unchanged.  This option cannot be specified in combination with the
919     **-e** option.
920
921 An entry for each of the principal's unique encryption types is added,
922 ignoring multiple keys with the same encryption type but different
923 salt types.
924
925 Alias: **xst**
926
927 Example::
928
929     kadmin: ktadd -k /tmp/foo-new-keytab host/foo.mit.edu
930     Entry for principal host/foo.mit.edu@ATHENA.MIT.EDU with kvno 3,
931          encryption type aes256-cts-hmac-sha1-96 added to keytab
932          FILE:/tmp/foo-new-keytab
933     kadmin:
934
935 .. _ktadd_end:
936
937 .. _ktremove:
938
939 ktremove
940 ~~~~~~~~
941
942     **ktremove** [options] *principal* [*kvno* | *all* | *old*]
943
944 Removes entries for the specified *principal* from a keytab.  Requires
945 no permissions, since this does not require database access.
946
947 If the string "all" is specified, all entries for that principal are
948 removed; if the string "old" is specified, all entries for that
949 principal except those with the highest kvno are removed.  Otherwise,
950 the value specified is parsed as an integer, and all entries whose
951 kvno match that integer are removed.
952
953 The options are:
954
955 **-k[eytab]** *keytab*
956     Use *keytab* as the keytab file.  Otherwise, the default keytab is
957     used.
958
959 **-q**
960     Display less verbose information.
961
962 Alias: **ktrem**
963
964 Example::
965
966     kadmin: ktremove kadmin/admin all
967     Entry for principal kadmin/admin with kvno 3 removed from keytab
968          FILE:/etc/krb5.keytab
969     kadmin:
970
971 .. _ktremove_end:
972
973 lock
974 ~~~~
975
976 Lock database exclusively.  Use with extreme caution!  This command
977 only works with the DB2 KDC database module.
978
979 unlock
980 ~~~~~~
981
982 Release the exclusive database lock.
983
984 list_requests
985 ~~~~~~~~~~~~~
986
987 Lists available for kadmin requests.
988
989 Aliases: **lr**, **?**
990
991 quit
992 ~~~~
993
994 Exit program.  If the database was locked, the lock is released.
995
996 Aliases: **exit**, **q**
997
998
999 HISTORY
1000 -------
1001
1002 The kadmin program was originally written by Tom Yu at MIT, as an
1003 interface to the OpenVision Kerberos administration program.
1004
1005
1006 ENVIRONMENT
1007 -----------
1008
1009 See :ref:`kerberos(7)` for a description of Kerberos environment
1010 variables.
1011
1012
1013 SEE ALSO
1014 --------
1015
1016 :ref:`kpasswd(1)`, :ref:`kadmind(8)`, :ref:`kerberos(7)`