e8716592bb77aea770d6f34cb1f16e6012cbd2cd
[krb5.git] / doc / rst_source / krb_admins / admin_commands / kadmin_local.rst
1 .. _kadmin(1):
2
3 .. _kadmin.local(1):
4
5 kadmin, kadmin.local
6 ===========================
7
8
9 SYNOPSYS
10 --------------
11
12 .. _kadmin_synopsys:
13       
14 **kadmin** 
15          [ **-O** | **-N** ] 
16          [**-r** *realm*] 
17          [**-p** *principal*] 
18          [**-q** *query*]
19          [[**-c** *cache_name*] | [**-k** [**-t** *keytab* ]] | **-n**]
20          [**-w** *password*] 
21          [**-s** *admin_server* [:*port*]
22
23
24 **kadmin.local**
25                  [**-r** *realm*]
26                  [**-p** *principal*] 
27                  [**-q** *query*]
28                  [**-d** *dbname*] 
29                  [**-e** "enc:salt ..."] 
30                  [**-m**] 
31                  [**-x** *db_args*]
32
33
34 .. _kadmin_synopsys_end:
35       
36 DESCRIPTION
37 ------------
38
39 *kadmin* and *kadmin.local* are command-line interfaces to the Kerberos V5 KADM5 administration system.
40 Both *kadmin* and *kadmin.local* provide identical functionalities; 
41 the difference is that *kadmin.local* runs on the master KDC if the database is db2 and does not use Kerberos to authenticate to the database. 
42 Except as explicitly noted otherwise, this man page will use *kadmin* to refer to both versions.
43 *kadmin* provides for the maintenance of Kerberos principals, KADM5 policies, and service key tables (keytabs).
44
45 The remote version uses Kerberos authentication and an encrypted RPC, to operate securely from anywhere on the network.   
46 It authenticates to the KADM5 server using the service principal *kadmin/admin*.  
47 If the credentials cache contains a ticket for the *kadmin/admin* principal, and the *-c* credentials_cache option is specified, 
48 that ticket is used to authenticate to KADM5.  
49 Otherwise, the *-p* and *-k* options are used to specify the client Kerberos principal name used to authenticate.  
50 Once *kadmin* has determined the principal name, it requests a *kadmin/admin* Kerberos service ticket from the KDC, 
51 and uses that service ticket to authenticate to KADM5.
52
53 If the database is db2, the local client *kadmin.local*, is intended to run directly on the master KDC without Kerberos authentication.
54 The local version provides all of the functionality of the now obsolete kdb5_edit(8), except for database dump and load, 
55 which is now provided by the :ref:`kdb5_util(8)` utility.
56
57 If the database is LDAP, *kadmin.local* need not be run on the KDC.
58
59 *kadmin.local* can be configured to log updates for incremental database propagation.  
60 Incremental propagation allows slave KDC servers to receive principal and policy updates incrementally instead of receiving full dumps of the database.  
61 This facility can be enabled in the :ref:`kdc.conf` file with the *iprop_enable* option.  
62 See the :ref:`kdc.conf` documentation for other options for tuning incremental propagation parameters.
63
64
65 OPTIONS
66 ------------
67
68 .. _kadmin_options:
69
70        **-r** *realm*
71               Use *realm* as the default database realm.
72
73        **-p** *principal*
74               Use  *principal* to authenticate.  Otherwise, *kadmin* will append "/admin" to the primary principal name of the default ccache, the
75               value of the *USER* environment variable, or the username as obtained with *getpwuid*, in order of preference.
76
77        **-k**     
78               Use a *keytab* to decrypt the KDC response instead of prompting for a password on the TTY.  In this case, the default principal
79               will be *host/hostname*.  If there is not a *keytab* specified with the **-t** option, then the default *keytab* will be used.
80
81        **-t** *keytab*
82               Use *keytab* to decrypt the KDC response.  This can only be used with the **-k** option.  
83
84        **-n**
85               Requests anonymous processing.  Two types of anonymous principals are supported.  
86               For fully anonymous Kerberos, configure pkinit on the KDC and configure *pkinit_anchors* in the client's :ref:`krb5.conf`.  
87               Then use the *-n* option with a principal of the form *@REALM* (an empty principal name followed by the at-sign and a realm name).  
88               If permitted by the KDC, an anonymous ticket will be returned.  
89               A second form of anonymous tickets is supported; these realm-exposed tickets hide the identity of the client but not the client's realm.  
90               For this mode, use *kinit -n* with a normal principal name.  
91               If supported by the KDC, the principal (but not realm) will be replaced by the anonymous principal.  
92               As of release 1.8, the MIT Kerberos KDC only supports fully anonymous operation.
93
94        **-c** *credentials_cache*
95               Use *credentials_cache* as the credentials cache.  The *credentials_cache* should contain a service ticket for the *kadmin/admin* service; 
96               it can be acquired with the :ref:`kinit(1)` program.  If this option is not specified, *kadmin* requests a new service ticket from
97               the KDC, and stores it in its own temporary ccache.
98
99        **-w** *password*
100               Use *password* instead of prompting for one on the TTY. 
101           
102               .. note::  Placing the password for a Kerberos principal with administration access into a shell script can be dangerous if 
103                          unauthorized users gain read access to the script.
104
105        **-q** *query*
106               pass query directly to kadmin, which will perform query and then exit.  This can be useful for writing scripts.
107
108        **-d** *dbname*
109               Specifies the name of the Kerberos database.  This option does not apply to the LDAP database.
110
111        **-s** *admin_server* [:port]
112               Specifies the admin server which *kadmin* should contact.
113
114        **-m**     Do not authenticate using a *keytab*.  This option will cause *kadmin* to prompt for the master database password.
115
116        **-e** enc:salt_list
117               Sets the list of encryption types and salt types to be used for any new keys created.
118
119        **-O**     Force use of old AUTH_GSSAPI authentication flavor.
120
121        **-N**     Prevent fallback to AUTH_GSSAPI authentication flavor.
122
123        **-x** *db_args*
124               Specifies the database specific arguments.
125
126               Options supported for LDAP database are:
127
128               **-x** host=<hostname>
129                      specifies the LDAP server to connect to by a LDAP URI.
130
131               **-x** binddn=<bind_dn>
132                      specifies the DN of the object used by the administration server to bind to the LDAP server.  This object should have the
133                      read and write rights on the realm container, principal container and the subtree that is referenced by the realm.
134
135               **-x** bindpwd=<bind_password>
136                      specifies the password for the above mentioned binddn. It is recommended not to use this option.  
137                      Instead, the password can be stashed using the stashsrvpw command of :ref:`kdb5_ldap_util(8)`
138
139
140 .. _kadmin_options_end:
141
142
143 DATE FORMAT
144 --------------
145
146 .. _date_format:
147
148 Many of the *kadmin* commands take a duration or time as an argument. The date can appear in a wide variety of formats, such as::
149
150               1 month ago
151               2 hours ago
152               400000 seconds ago
153               last year
154               this Monday
155               next Monday
156               yesterday
157               tomorrow
158               now
159               second Monday
160               fortnight ago
161               3/31/92 10:00:07 PST
162               January 23, 1987 10:05pm
163               22:00 GMT
164
165 Dates which do not have the "ago" specifier default to being absolute dates, unless they appear in a field where a duration is expected.   
166 In that case the time specifier will be interpreted as relative.  
167 Specifying "ago" in a duration may result in unexpected behavior.
168
169
170 The following is a list of all of the allowable keywords.
171
172 ========================== ============================================
173 Months                      january, jan, february, feb, march, mar, april, apr, may, june, jun, july, jul, august, aug, september, sep, sept, october, oct, november, nov, december, dec 
174 Days                        sunday, sun, monday, mon, tuesday, tues, tue, wednesday, wednes, wed, thursday, thurs, thur, thu, friday, fri, saturday, sat 
175 Units                       year, month, fortnight, week, day, hour, minute, min, second, sec 
176 Relative                    tomorrow, yesterday, today, now, last, this, next, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, ago 
177 Time Zones                  kadmin recognizes abbreviations for most of the world's time zones. A complete listing appears in kadmin Time Zones. 
178 12-hour Time Delimiters     am, pm
179 ========================== ============================================
180
181 .. _date_format_end:
182
183
184
185 COMMANDS
186 -----------
187
188 .. _add_principal:
189
190 add_principal
191 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192
193        **add_principal** [options] *newprinc*
194               creates the principal *newprinc*, prompting twice for a password.  If no policy is specified with the *-policy* option, 
195               and the policy named "default" exists, then that policy is assigned to the principal; 
196               note that the assignment of the policy "default" only occurs automatically when a principal is first created, 
197               so the policy "default" must already exist for the assignment to occur.
198               This assignment of "default" can be suppressed with the *-clearpolicy* option. 
199
200                 .. note:: This command requires the *add* privilege. 
201
202               Aliases::
203
204                         addprinc ank
205
206               The options are:
207
208               **-x** *db_princ_args*
209                      Denotes the database specific options. 
210
211                      The options for LDAP database are:
212
213                      **-x** dn=<dn>
214                             Specifies the LDAP object that will contain the Kerberos principal being created.
215
216                      **-x** linkdn=<dn>
217                             Specifies the LDAP object to which the newly created Kerberos principal object will point to.
218
219                      **-x** containerdn=<container_dn>
220                             Specifies the container object under which the Kerberos principal is to be created.
221
222                      **-x** tktpolicy=<policy>
223                             Associates a ticket policy to the Kerberos principal.
224
225
226                     .. note:: 
227                             - *containerdn* and *linkdn* options cannot be specified with dn option.  
228                             - If *dn* or *containerdn* options are not specified while adding the principal, the principals are created under the prinicipal container configured in the realm or the realm container. 
229                             - *dn* and *containerdn* should be within the subtrees or principal container configured in the realm.
230
231
232               **-expire** *expdate*
233                      expiration date of the principal
234
235               **-pwexpire** *pwexpdate*
236                      password expiration date
237
238               **-maxlife** *maxlife*
239                      maximum ticket life for the principal
240
241               **-maxrenewlife** *maxrenewlife*
242                      maximum renewable life of tickets for the principal
243
244               **-kvno** *kvno*
245                      explicity set the key version number.
246
247               **-policy** *policy*
248                      policy used by this principal.  
249                      If no policy is supplied, then if the policy "default" exists and the *-clearpolicy* is not also specified,  
250                      then the policy "default" is used; 
251                      otherwise, the principal will have no policy, and a warning message will be printed.
252
253               **-clearpolicy**
254                      *-clearpolicy* prevents the policy "default" from being assigned when *-policy* is not specified.  
255                      This option has no effect if the policy "default" does not exist.
256
257               {- | +} **allow_postdated**
258                      *-allow_postdated* prohibits this principal from obtaining postdated tickets.
259                      (Sets the KRB5_*KDB_DISALLOW_POSTDATED* flag.) *+allow_postdated* clears this flag.
260
261               {- | +} **allow_forwardable**
262                      *-allow_forwardable* prohibits this principal from obtaining forwardable tickets.  
263                      (Sets the  *KRB5_KDB_DISALLOW_FORWARDABLE* flag.) 
264                      *+allow_forwardable* clears this flag.
265
266               {- | +} **allow_renewable**
267                      *-allow_renewable* prohibits this principal from obtaining renewable tickets.  
268                      (Sets the *KRB5_KDB_DISALLOW_RENEWABLE* flag.) 
269                      *+allow_renewable* clears this flag.
270
271               {- | +} **allow_proxiable**
272                      *-allow_proxiable* prohibits this principal from obtaining proxiable tickets.  
273                      (Sets the *KRB5_KDB_DISALLOW_PROXIABLE* flag.)
274                      *+allow_proxiable* clears this flag.
275
276               {- | +} **allow_dup_skey**
277                      *-allow_dup_skey*  disables  user-to-user  authentication for this principal by prohibiting this principal from obtaining a
278                      session key for another user.  
279                      (Sets the *KRB5_KDB_DISALLOW_DUP_SKEY* flag.)  
280                      *+allow_dup_skey* clears this flag.
281
282               {- | +} **requires_preauth**
283                      *+requires_preauth*  requires  this  principal  to  preauthenticate   before   being   allowed   to   kinit.    
284                      (Sets   the *KRB5_KDB_REQUIRES_PRE_AUTH* flag.)  
285                      *-requires_preauth* clears this flag.
286
287               {- | +} **requires_hwauth**
288                      *+requires_hwauth* requires this principal to preauthenticate using a hardware device before being allowed to kinit.  
289                      (Sets the *KRB5_KDB_REQUIRES_HW_AUTH* flag.)  
290                      *-requires_hwauth* clears this flag.
291
292               {- | +} **ok_as_delegate**
293                      *+ok_as_delegate* sets the OK-AS-DELEGATE flag on tickets issued for use with this principal as the service, 
294                      which clients may use as a hint that credentials can and should be delegated when authenticating to the service.  
295                      (Sets the *KRB5_KDB_OK_AS_DELEGATE* flag.)  
296                      *-ok_as_delegate* clears this flag.
297
298               {- | +} **allow_svr**
299                      *-allow_svr* prohibits the issuance of service tickets for this principal.   
300                      (Sets  the  *KRB5_KDB_DISALLOW_SVR*  flag.)
301                      *+allow_svr* clears this flag.
302
303               {- | +} **allow_tgs_req**
304                      *-allow_tgs_req* specifies that a Ticket-Granting Service (TGS) request for a service ticket for this principal is not permitted.  
305                      This option is useless for most things.  
306                      *+allow_tgs_req* clears this flag.  
307                      The default  is  +allow_tgs_req.   
308                      In effect, *-allow_tgs_req sets* the *KRB5_KDB_DISALLOW_TGT_BASED* flag on the principal in the database.
309
310               {- | +} **allow_tix**
311                      *-allow_tix* forbids the issuance of any tickets for this principal.  
312                      *+allow_tix* clears this flag.  
313                      The default is *+allow_tix*.  In effect, *-allow_tix* sets the *KRB5_KDB_DISALLOW_ALL_TIX* flag on the principal in the database.
314
315               {- | +} **needchange**
316                      *+needchange* sets a flag in attributes field to force a password change; 
317                      *-needchange* clears it.   
318                      The  default  is  *-needchange*.  
319                      In effect, *+needchange* sets the *KRB5_KDB_REQUIRES_PWCHANGE* flag on the principal in the database.
320
321               {- | +} **password_changing_service**
322                      *+password_changing_service*  sets a flag in the attributes field marking this as a password change service principal 
323                      (useless for most things).  
324                      *-password_changing_service* clears the flag.  This  flag  intentionally  has  a  long  name.   
325                      The default  is *-password_changing_service*.  
326                      In effect, *+password_changing_service* sets the *KRB5_KDB_PWCHANGE_SERVICE* flag on the principal in the database.
327
328               **-randkey**
329                      sets the key of the principal to a random value
330
331               **-pw** *password*
332                      sets the key of the principal to the specified string and does not prompt for a password.  Note:  using this option in  a
333                      shell script can be dangerous if unauthorized users gain read access to the script.
334
335               **-e** "enc:salt ..."
336                      uses the specified list of enctype-salttype pairs for setting the key of the principal. The quotes are necessary if
337                      there are multiple enctype-salttype pairs.  This will not function against *kadmin* daemons earlier than krb5-1.2.
338
339               EXAMPLE::
340   
341                     kadmin: addprinc jennifer
342                     WARNING: no policy specified for "jennifer@ATHENA.MIT.EDU";
343                     defaulting to no policy.
344                     Enter password for principal jennifer@ATHENA.MIT.EDU:  <= Type the password.
345                     Re-enter password for principal jennifer@ATHENA.MIT.EDU:  <=Type it again.
346                     Principal "jennifer@ATHENA.MIT.EDU" created.
347                     kadmin:
348
349
350               ERRORS::
351
352                      KADM5_AUTH_ADD (requires "add" privilege)
353                      KADM5_BAD_MASK (shouldn't happen)
354                      KADM5_DUP (principal exists already)
355                      KADM5_UNK_POLICY (policy does not exist)
356                      KADM5_PASS_Q_* (password quality violations)
357
358 .. _add_principal_end:
359
360 .. _modify_principal:
361
362 modify_principal
363 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
364
365        **modify_principal** [options] *principal*
366               Modifies the specified principal, changing the fields as specified. The options are as above for *add_principal*, except that
367               password changing and flags related to password changing are forbidden by this command.  
368               In addition, the option *-clearpolicy* will clear the current policy of a principal.  
369
370                  .. note:: This command requires the *modify* privilege.  
371
372               Alias:: 
373
374                         modprinc
375
376               The options are:
377
378               **-x** *db_princ_args*
379                      Denotes the database specific options. 
380
381                      The options for LDAP database are:
382
383                      **-x** tktpolicy=<policy>
384                             Associates a ticket policy to the Kerberos principal.
385
386                      **-x** linkdn=<dn>
387                             Associates  a  Kerberos principal with a LDAP object. This option is honored only if the Kerberos principal is not
388                             already associated with a LDAP object.
389
390               **-unlock**
391                      Unlocks a locked principal (one which has received too many failed authentication attempts without  enough  time  between
392                      them according to its password policy) so that it can successfully authenticate.
393
394               ERRORS::
395
396                      KADM5_AUTH_MODIFY  (requires "modify" privilege) 
397                      KADM5_UNK_PRINC (principal does not exist) 
398                      KADM5_UNK_POLICY (policy does not exist) 
399                      KADM5_BAD_MASK (shouldn't happen)
400
401 .. _modify_principal_end:
402
403 .. _delete_principal:
404
405 delete_principal
406 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
407
408        **delete_principal** [ *-force* ] *principal*
409               Deletes the specified *principal* from the database.  This command prompts for deletion, unless the *-force* option is  given.  
410
411                  .. note:: This command requires the *delete* privilege.  
412
413               Alias:: 
414
415                      delprinc
416
417
418               ERRORS::
419
420                      KADM5_AUTH_DELETE (reequires "delete" privilege)
421                      KADM5_UNK_PRINC (principal does not exist)
422
423 .. _delete_principal_end:
424
425 .. _change_password:
426
427 change_password
428 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
429
430        **change_password** [options] *principal*
431               Changes the password of *principal*.  Prompts for a new password if neither *-randkey* or *-pw* is specified.  
432
433                  .. note:: Requires  the  *changepw* privilege,  or that the principal that is running the program to be the same as the one changed.  
434
435               Alias::
436
437                       cpw
438
439               The following options are available:
440
441               **-randkey**
442                      Sets the key of the principal to a random value
443
444               **-pw** *password*
445                      Set the password to the specified string.  Not recommended.
446
447               **-e** "enc:salt ..."
448                      Uses the specified list of enctype-salttype pairs for setting the key of the principal.   The quotes are necessary if
449                      there are multiple enctype-salttype pairs.  This will not function against *kadmin* daemons earlier than krb5-1.2.
450                      See :ref:`Supported_Encryption_Types_and_Salts` for possible values.
451
452               **-keepold**
453                      Keeps the previous kvno's keys around.  This flag is usually not necessary except perhaps for TGS keys.  Don't use this
454                      flag unless you know what you're doing. This option is not supported for the LDAP database.
455
456               EXAMPLE::
457
458                      kadmin: cpw systest
459                      Enter password for principal systest@BLEEP.COM:
460                      Re-enter password for principal systest@BLEEP.COM:
461                      Password for systest@BLEEP.COM changed.
462                      kadmin:
463
464               ERRORS::
465
466                      KADM5_AUTH_MODIFY (requires the modify privilege)
467                      KADM5_UNK_PRINC (principal does not exist)
468                      KADM5_PASS_Q_* (password policy violation errors)
469                      KADM5_PADD_REUSE (password is in principal's password
470                      history)
471                      KADM5_PASS_TOOSOON (current password minimum life not
472                      expired)
473
474
475 .. _change_password_end:
476
477 .. _purgekeys:
478
479 purgekeys
480 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
481
482        **purgekeys** [*-keepkvno oldest_kvno_to_keep* ] *principal*
483               Purges previously retained old keys (e.g., from *change_password -keepold*) from *principal*.  
484               If **-keepkvno** is specified, then only purges keys with kvnos lower than *oldest_kvno_to_keep*.
485
486 .. _purgekeys_end:
487
488 .. _get_principal:
489
490 get_principal
491 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
492
493        **get_principal** [*-terse*] *principal*
494               Gets  the  attributes of principal.  
495               With the **-terse** option, outputs fields as quoted tab-separated strings.  
496  
497                  .. note:: Requires the *inquire* privilege, or that the principal that is running the the program to be the same as the one being listed.  
498
499               Alias::
500
501                      getprinc
502
503
504               EXAMPLES::
505
506                      kadmin: getprinc tlyu/admin
507                      Principal: tlyu/admin@BLEEP.COM
508                      Expiration date: [never]
509                      Last password change: Mon Aug 12 14:16:47 EDT 1996
510                      Password expiration date: [none]
511                      Maximum ticket life: 0 days 10:00:00
512                      Maximum renewable life: 7 days 00:00:00
513                      Last modified: Mon Aug 12 14:16:47 EDT 1996 (bjaspan/admin@BLEEP.COM)
514                      Last successful authentication: [never]
515                      Last failed authentication: [never]
516                      Failed password attempts: 0
517                      Number of keys: 2
518                      Key: vno 1, DES cbc mode with CRC-32, no salt
519                      Key: vno 1, DES cbc mode with CRC-32, Version 4
520                      Attributes:
521                      Policy: [none]
522
523
524                      kadmin: getprinc -terse systest
525                      systest@BLEEP.COM   3    86400     604800    1
526                      785926535 753241234 785900000
527                      tlyu/admin@BLEEP.COM     786100034 0    0
528                      kadmin:
529
530
531               ERRORS::
532
533                      KADM5_AUTH_GET (requires the get (inquire) privilege)
534                      KADM5_UNK_PRINC (principal does not exist)
535
536 .. _get_principal_end:
537
538 .. _list_principals:
539
540 list_principals
541 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
542
543        **list_principals** [expression]
544               Retrieves all or some principal names.  
545               Expression is a shell-style glob expression that can contain the wild-card characters ?, \*,  and  []'s.  
546               All principal names matching the expression are printed.
547               If no expression is provided, all principal names are printed.  
548               If the expression does not contain an "@" character, an "@" character followed by the local realm is appended  to  the expression.  
549               
550                  .. note:: Requires the *list* priviledge.  
551
552               Aliases::
553                 
554                        listprincs get_principals get_princs 
555
556               EXAMPLES::
557  
558                      kadmin:  listprincs test* 
559                      test3@SECURE-TEST.OV.COM
560                      test2@SECURE-TEST.OV.COM
561                      test1@SECURE-TEST.OV.COM
562                      testuser@SECURE-TEST.OV.COM
563                      kadmin:
564
565 .. _list_principals_end:
566
567 .. _get_strings:
568
569 get_strings
570 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
571
572        **get_strings** *principal*
573               Displays string attributes on *principal*.
574               String attributes are used to supply per-principal configuration to some KDC plugin modules.
575
576               Alias::
577
578                      getstr
579
580 .. _set_string:
581
582 set_string
583 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
584
585        **set_string** *principal* *key* *value*
586               Sets a string attribute on *principal*.
587
588               Alias::
589
590                      setstr
591
592 .. _del_string:
593
594 del_string
595 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
596
597        **del_string** *principal* *key*
598               Deletes a string attribute from *principal*.
599
600               Alias::
601
602                      delstr
603
604 .. _add_policy:
605
606 add_policy
607 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
608
609        **add_policy** [options] *policy*
610               Adds the named *policy* to the policy database.  
611
612                  .. note:: Requires the *add* privilege.  
613
614               Alias::
615
616                         addpol
617
618               The following options are available:
619
620               **-maxlife time**
621                      sets the maximum lifetime of a password
622
623               **-minlife time**
624                      sets the minimum lifetime of a password
625
626               **-minlength length**
627                      sets the minimum length of a password
628
629               **-minclasses number**
630                      sets the minimum number of character classes allowed in a password
631
632               **-history number**
633                      sets the number of past keys kept for a principal. This option is not supported for LDAP database
634
635               **-maxfailure maxnumber**
636                      sets the maximum number of authentication failures before the principal is  locked.
637                      Authentication failures are only tracked for principals which require preauthentication.
638
639               **-failurecountinterval failuretime**
640                      sets  the  allowable  time  between  authentication failures.  
641                      If an authentication failure happens after *failuretime* has elapsed since the previous failure, 
642                      the number of authentication failures is reset to 1.
643
644               **-lockoutduration lockouttime**
645                      sets the duration for which the principal is locked from authenticating if too many authentication failures occur without
646                      the specified failure count interval elapsing.
647
648
649               EXAMPLES::
650
651                      kadmin: add_policy -maxlife "2 days" -minlength 5 guests
652                      kadmin:
653
654               ERRORS::
655
656                      KADM5_AUTH_ADD (requires the add privilege)
657                      KADM5_DUP (policy already exists)
658
659 .. _add_policy_end:
660
661 .. _modify_policy:
662
663 modify_policy
664 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
665
666        **modify_policy** [options] *policy*
667               modifies the named *policy*.  Options are as above for *add_policy*.  
668
669                  .. note:: Requires the *modify* privilege.  
670
671               Alias::
672
673                       modpol
674
675
676               ERRORS::
677
678                      KADM5_AUTH_MODIFY (requires the modify privilege)
679                      KADM5_UNK_POLICY (policy does not exist)
680
681 .. _modify_policy_end:
682
683 .. _delete_policy:
684
685 delete_policy
686 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
687
688        **delete_policy** [ *-force* ] *policy*
689               deletes the named *policy*.  Prompts for confirmation before deletion.  
690               The command will fail if the policy is in use by any principals.  
691
692                  .. note:: Requires the *delete* privilege.  
693
694               Alias::
695
696                       delpol
697
698
699               EXAMPLE::
700
701                      kadmin: del_policy guests
702                      Are you sure you want to delete the policy "guests"?
703                      (yes/no): yes
704                      kadmin:
705
706               ERRORS::
707
708                      KADM5_AUTH_DELETE (requires the delete privilege)
709                      KADM5_UNK_POLICY (policy does not exist)
710                      KADM5_POLICY_REF (reference count on policy is not zero)
711
712 .. _delete_policy_end:
713
714 .. _get_policy:
715
716 get_policy
717 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
718
719        **get_policy** [ **-terse** ] *policy*
720               displays the values of the named *policy*.  
721               With the **-terse** flag, outputs the fields as quoted strings separated by tabs.  
722
723                  .. note:: Requires the *inquire* privilege.  
724
725
726               Alias::
727
728                        getpol
729
730
731               EXAMPLES::
732
733                      kadmin: get_policy admin
734                      Policy: admin
735                      Maximum password life: 180 days 00:00:00
736                      Minimum password life: 00:00:00
737                      Minimum password length: 6
738                      Minimum number of password character classes: 2
739                      Number of old keys kept: 5
740                      Reference count: 17
741
742                      kadmin: get_policy -terse admin
743                      admin     15552000  0    6    2    5    17
744                      kadmin:
745
746 The *Reference count* is the number of principals using that policy.
747
748               ERRORS::
749
750                      KADM5_AUTH_GET (requires the get privilege)
751                      KADM5_UNK_POLICY (policy does not exist)
752
753 .. _get_policy_end:
754
755 .. _list_policies:
756
757 list_policies
758 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
759
760        **list_policies** [expression]
761               Retrieves all or some policy names.  Expression is a shell-style glob expression that can contain the wild-card characters ?, \*, and []'s.  
762               All policy names matching the expression are printed.  
763               If no expression is provided, all existing policy names are printed.  
764
765                  .. note:: Requires the *list* priviledge.  
766
767               Alias::
768
769                       listpols, get_policies, getpols.
770
771
772               EXAMPLES::
773
774                      kadmin:  listpols
775                      test-pol
776                      dict-only
777                      once-a-min
778                      test-pol-nopw
779
780                      kadmin:  listpols t*
781                      test-pol
782                      test-pol-nopw
783                      kadmin:
784
785 .. _list_policies_end:
786
787 .. _ktadd:
788
789 ktadd
790 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
791
792        **ktadd**  [[*principal* | **-glob** *princ-exp*]
793               Adds a *principal* or all principals matching *princ-exp* to a keytab file.  
794               It randomizes each principal's key in the process, to prevent a compromised admin account from reading out all of the keys from the database.  
795               The rules for principal expression are the same as for the *kadmin* :ref:`list_principals` command. 
796
797                  .. note:: Requires the  *inquire* and *changepw* privileges.  
798                            
799                            If you use the *-glob* option, it also requires the *list* administrative privilege. 
800
801               The options are:
802
803               **-k[eytab]**  *keytab*  
804                      Use *keytab* as the keytab file. Otherwise, *ktadd* will use the default keytab file (*/etc/krb5.keytab*).
805
806               **-e** *"enc:salt..."*
807                      Use the specified list of enctype-salttype pairs for setting the key of the principal. 
808                      The enctype-salttype pairs may be delimited with commas or whitespace.
809                      The quotes are necessary for whitespace-delimited list.
810                      If this option is not specified, then *supported_enctypes* from :ref:`krb5.conf` will be used.
811                      This will not function against kadmin daemons earlier than krb5-1.2. 
812                      See :ref:`Supported_Encryption_Types_and_Salts` for all possible values.
813
814               **-q**
815                      Run in quiet mode. This causes *ktadd* to display less verbose information.
816
817               **-norandkey**
818                      Do not randomize the keys. The keys and their version numbers stay unchanged.
819                      That allows users to continue to use the passwords they know to login normally, 
820                      while simultaneously allowing scripts to login to the same account using a *keytab*.  
821                      There is no significant security risk added since *kadmin.local* must be run by root on the KDC anyway.
822                      This option is only available in *kadmin.local* and cannot be specified in combination with *-e* option.
823
824
825               .. note:: An entry for each of the principal's unique encryption types is added, ignoring multiple keys with the same encryption type but different salt types.
826
827
828               EXAMPLE::
829
830                      kadmin: ktadd -k /tmp/foo-new-keytab host/foo.mit.edu
831                      Entry for principal host/foo.mit.edu@ATHENA.MIT.EDU with
832                           kvno 3, encryption type DES-CBC-CRC added to keytab
833                           WRFILE:/tmp/foo-new-keytab
834                      kadmin:
835
836 .. _ktadd_end:
837
838 .. _ktremove:
839
840 ktremove
841 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
842
843        **ktremove**  *principal* [*kvno* | *all* | *old*]
844               Removes entries for the specified *principal* from a keytab.  Requires no permissions, since this does not require database access. 
845
846
847               If the string "all" is specified, all entries for that principal are removed; 
848               if the string "old" is specified, all entries for that principal except those with the highest kvno are removed.  
849               Otherwise, the value specified is parsed as an integer, and all entries whose *kvno* match that integer are removed.
850
851               The options are:
852
853               **-k[eytab]**  *keytab*  
854                      Use keytab as the keytab file. Otherwise, *ktremove* will use the default keytab file (*/etc/krb5.keytab*).
855
856               **-q**
857                      Run in quiet mode. This causes *ktremove* to display less verbose information.
858
859               EXAMPLE::
860
861                      kadmin: ktremove -k /usr/local/var/krb5kdc/kadmind.keytab kadmin/admin all
862                      Entry for principal kadmin/admin with kvno 3 removed
863                           from keytab WRFILE:/usr/local/var/krb5kdc/kadmind.keytab.
864                      kadmin:
865
866 .. _ktremove_end:
867
868
869 FILES
870 -----------
871
872 .. note::  The first three files are specific to db2 database.
873
874 ====================== =================================================
875 principal.db            default name for Kerberos principal database
876 <dbname>.kadm5          KADM5 administrative database. (This would be "principal.kadm5", if you use the default database name.)  Contains policy information.
877 <dbname>.kadm5.lock     Lock file for the KADM5 administrative database.  This file works backwards from most other lock files. I.e., *kadmin* will exit with an error if this file does not exist.
878 kadm5.acl               File containing list of principals and their *kadmin* administrative privileges.  See kadmind(8) for a description.
879 kadm5.keytab            *keytab* file for *kadmin/admin* principal.
880 kadm5.dict              file containing dictionary of strings explicitly disallowed as passwords.
881 ====================== =================================================
882
883
884
885 HISTORY
886 -------------
887
888 The *kadmin* prorgam was originally written by Tom Yu at MIT, as an interface to the OpenVision Kerberos administration program.
889
890
891 SEE ALSO
892 ------------
893
894 kerberos(1), kpasswd(1), kadmind(8)
895
896