Windows: define __func__ in terms of __FUNCTION__
[heimdal.git] / kadmin / kadmin.1
blobded599794616bde9c579514fad269a18a482426b
1 .\" Copyright (c) 2000 - 2007 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\"
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" $Id$
33 .\"
34 .Dd Feb  22, 2007
35 .Dt KADMIN 1
36 .Os HEIMDAL
37 .Sh NAME
38 .Nm kadmin
39 .Nd Kerberos administration utility
40 .Sh SYNOPSIS
41 .Nm
42 .Bk -words
43 .Op Fl p Ar string \*(Ba Fl Fl principal= Ns Ar string
44 .Op Fl K Ar string \*(Ba Fl Fl keytab= Ns Ar string
45 .Op Fl c Ar file \*(Ba Fl Fl config-file= Ns Ar file
46 .Op Fl k Ar file \*(Ba Fl Fl key-file= Ns Ar file
47 .Op Fl r Ar realm \*(Ba Fl Fl realm= Ns Ar realm
48 .Op Fl a Ar host \*(Ba Fl Fl admin-server= Ns Ar host
49 .Op Fl s Ar port number \*(Ba Fl Fl server-port= Ns Ar port number
50 .Op Fl l | Fl Fl local
51 .Op Fl h | Fl Fl help
52 .Op Fl v | Fl Fl version
53 .Op Ar command
54 .Ek
55 .Sh DESCRIPTION
56 The
57 .Nm
58 program is used to make modifications to the Kerberos database, either remotely via the
59 .Xr kadmind 8
60 daemon, or locally (with the
61 .Fl l
62 option).
63 .Pp
64 Supported options:
65 .Bl -tag -width Ds
66 .It Fl p Ar string , Fl Fl principal= Ns Ar string
67 principal to authenticate as
68 .It Fl K Ar string , Fl Fl keytab= Ns Ar string
69 keytab for authentication principal
70 .It Fl c Ar file , Fl Fl config-file= Ns Ar file
71 location of config file
72 .It Fl H Ar HDB , Fl Fl hdb= Ns Ar HDB
73 location of HDB
74 .It Fl k Ar file , Fl Fl key-file= Ns Ar file
75 location of master key file
76 .It Fl r Ar realm , Fl Fl realm= Ns Ar realm
77 realm to use
78 .It Fl a Ar host , Fl Fl admin-server= Ns Ar host
79 server to contact
80 .It Fl s Ar port number , Fl Fl server-port= Ns Ar port number
81 port to use
82 .It Fl l , Fl Fl local
83 local admin mode
84 .El
85 .Pp
86 If no
87 .Ar command
88 is given on the command line,
89 .Nm
90 will prompt for commands to process. Some of the commands that take
91 one or more principals as argument
92 .Ns ( Nm delete ,
93 .Nm ext_keytab ,
94 .Nm get ,
95 .Nm modify ,
96 and
97 .Nm passwd )
98 will accept a glob style wildcard, and perform the operation on all
99 matching principals.
101 Commands include:
102 .\" not using a list here, since groff apparently gets confused
103 .\" with nested Xo/Xc
105 .Nm add
106 .Op Fl r | Fl Fl random-key
107 .Op Fl Fl enctypes= Ns Ar string
108 .Op Fl Fl random-password
109 .Op Fl p Ar string \*(Ba Fl Fl password= Ns Ar string
110 .Op Fl Fl key= Ns Ar string
111 .Op Fl Fl max-ticket-life= Ns Ar lifetime
112 .Op Fl Fl max-renewable-life= Ns Ar lifetime
113 .Op Fl Fl attributes= Ns Ar attributes
114 .Op Fl Fl expiration-time= Ns Ar time
115 .Op Fl Fl pw-expiration-time= Ns Ar time
116 .Op Fl Fl policy= Ns Ar policy-name
117 .Ar principal...
118 .Bd -ragged -offset indent
119 Adds a new principal to the database. The options not passed on the
120 command line will be promped for.
121 If enctypes to use are not given, then the
122 .Ar [libdefaults] supported_enctypes
123 configuration parameter will be used on the client side to select
124 enctypes, defaulting to
125 .Ar aes128-cts-hmac-sha1-96.
126 For compatibility with MIT, the enctypes string is a space- or
127 comma-separated list of enctype:salttype.
129 .Fl Fl keepold
130 is given, then old keys needed to decrypt extant tickets are
131 kept, and all other old keys are deleted.
133 .Fl Fl keepallold
134 is given then all old keys are kept.  If
135 .Fl Fl pruneall is given then all old keys are removed.
137 .Fl Fl keepold
138 behavior is the default if none of these are given.
139 The only policy supported by Heimdal servers is
140 .Ql default .
142 This command has the following aliases:
143 .Nm ank ,
144 .Nm add_new_key .
147 .Nm add_alias
148 .Ar principal
149 .Ar alias...
150 .Bd -ragged -offset indent
151 Adds one or more aliases to the given principal.
153 There are two types of aliases: hard, and soft.
154 A soft alias is an alias of a principal of the form
155 .Ar WELLKNOWN/REFERRALS/TARGET@target_realm
157 .Ar WELLKNOWN/REFERRALS/TARGET/arbitrary-component@target_realm .
158 A hard alias is an alias of any normal principal, even if in a
159 different realm.
161 Hard aliases are treated as distinct principals sharing
162 attributes and keys with their canonical principals.
163 If a client requests canonicalization of a hard alias name, the
164 KDC will use the canonical name in the ticket issued as long as
165 the alias and canonical names are in the same realm.
166 Conversely, if a client does not request canonicalization, or if
167 the hard alias and the canonical name have different realms, then
168 the KDC will issue a ticket for the alias name.
170 Soft aliases can only be used to configure the production of
171 referrals by the KDC.
172 When a client requests a ticket for a principal that turns out to
173 be a soft alias, the KDC will respond with a referral to the
174 alias' canonical name's realm.
176 Soft aliasing compares favorably to using
177 .Ar [domain_realm]
178 entries in the KDC's
179 .Ar krb5.conf :
180 soft aliases may be managed via the
181 .Nm kadmin
182 command and its
183 .Nm add_alias
185 .Nm del_alias
186 sub-commands rather than having to edit the KDC's configuration
187 file and having to restart the KDC.
189 There are two methods for configuring the issuance of referrals
190 for entire namespaces of hostnames.
191 A soft alias of the form
192 .Ar  WELLKNOWN/HOSTBASED-NAMESPACE/service/namespace-fqdn@REALM
193 (see
194 .Nm add_namespace
195 below) will cause all requests for host-based principals in the
196 given namespace to be referred to the given realm.
197 Alternatively, the KDC will issue referrals for all host-based
198 service principals whose hostname component matches a
199 .Ar [domain_realm]
200 entry in the KDC's
201 .Ar krb5.conf
202 file referring to a different realm.
205 .Nm add_namespace
206 .Ar Fl Fl key-rotation-epoch= Ns Ar time
207 .Ar Fl Fl key-rotation-period= Ns Ar time
208 .Op Fl Fl enctypes= Ns Ar string
209 .Op Fl Fl max-ticket-life= Ns Ar lifetime
210 .Op Fl Fl max-renewable-life= Ns Ar lifetime
211 .Op Fl Fl attributes= Ns Ar attributes
212 .Ar host-based-principal...
213 .Bd -ragged -offset indent
214 Adds a new namespace of virtual host-based or domain-based
215 principals to the database, whose keys will be automatically
216 derived from base keys stored in the namespace record, and which
217 keys will be rotated automatically.
218 The namespace names are of the same form as host-based principal
219 names:
220 .Ar service/hostname@REALM
221 and these will match all host-based or domain-based service names
222 where hostname component of such a principal ends in the labels
223 of the hostname in the namespace name.
225 The service name component may be a wild-card (underscore,
226 .Ar _ ),
227 in which case it will match any service.
229 For example,
230 .Ar bar.baz.example@BAZ.EXAMPLE
231 will match
232 .Ar host/foo.bar.baz.example@BAZ.EXAMPLE
233 but not
234 .Ar host/foobar.baz.example@BAZ.EXAMPLE .
236 Note well that services are expected to
237 .Ar ext_keytab
238 or otherwise re-fetch their keytabs at least as often as one
239 quarter of the key rotation period, otherwise they risk not
240 having keys they need to decrypt tickets with.
242 The epoch must be given as either an absolute time,
243 .Ar "now",
244 or as
245 .Ar "+<N>[<unit>]"
246 where
247 .Ar N
248 is a natural and
249 .Ar unit
250 is one "s", "m", "h", "day", "week", "month", defaulting to
251 "month".
252 The default key rotation period is
253 .Ar 7d .
254 The default enctypes is as for the
255 .Nm add
256 command.
258 Note that namespaces are stored as principals whose names are of the form
259 .Ar WELLKNOWN/HOSTBASED-NAMESPACE/service/namespace.fqdn@REALM ,
260 with the
261 .Ar service
263 This command has the following alias:
264 .Nm add_ns .
267 .Nm add_enctype
268 .Op Fl r | Fl Fl random-key
269 .Ar principal enctypes...
271 .Bd -ragged -offset indent
272 Adds a new encryption type to the principal, only random key are
273 supported.
276 .Nm delete
277 .Ar principal...
278 .Bd -ragged -offset indent
279 Removes a principal.
280 It is an error to delete an alias.
281 To remove a principal's alias or aliases, use the
282 .Nm del_alias
283 command.
284 To remove a principal given an alias, first
285 .Nm get
286 the principal to get its canonical name and then delete that.
289 .Nm del_alias
290 .Ar alias...
291 .Bd -ragged -offset indent
292 Deletes the given aliases, but not their canonical principals.
294 This command has the following aliases:
295 .Nm del ,
296 .Nm del_entry .
299 .Nm del_enctype
300 .Ar principal enctypes...
301 .Bd -ragged -offset indent
302 Removes some enctypes from a principal; this can be useful if the
303 service belonging to the principal is known to not handle certain
304 enctypes.
307 .Nm prune
308 .Ar principal [kvno]
309 .Bd -ragged -offset indent
310 Deletes the named principal's keys of the given kvno.  If a kvno is
311 not given then this deletes all the named principals keys that are
312 too old to be needed for decrypting tickets issued using those keys
313 (i.e., any such tickets are necessarily expired).  The determination
314 of "too old" is made using the max-ticket-life attribute of the
315 principal; though in practice that max ticket life is also constrained
316 by the max-ticket-life of the client principals and the krbtgt
317 principals, those are not consulted here.
320 .Nm ext_keytab
321 .Oo Fl k Ar keytab \*(Ba Xo
322 .Op Fl Fl keepold | Fl Fl keepallold | Fl Fl pruneall
323 .Op Fl Fl enctypes= Ns Ar string
324 .Fl Fl keytab= Ns Ar string
327 .Ar principal...
328 .Bd -ragged -offset indent
329 Creates a keytab with the keys of the specified principals.  Requires
330 get-keys rights, otherwise the principal's keys are changed and saved in
331 the keytab.
332 If enctypes to use are not given, then the
333 .Ar [libdefaults] supported_enctypes
334 configuration parameter will be used on the client side to select
335 enctypes, defaulting to
336 .Ar aes128-cts-hmac-sha1-96.
337 For compatibility with MIT, the enctypes string is a space- or
338 comma-separated list of enctype:salttype.
340 .Fl Fl keepold
341 is given, then old keys needed to decrypt extant tickets are
342 kept, and all other old keys are deleted.
344 .Fl Fl keepallold
345 is given then all old keys are kept.  If
346 .Fl Fl pruneall is given then all old keys are removed.
348 .Fl Fl keepold
349 behavior is the default if none of these are given.
352 .Nm get
353 .Op Fl l | Fl Fl long
354 .Op Fl s | Fl Fl short
355 .Op Fl t | Fl Fl terse
356 .Op Fl o Ar string | Fl Fl column-info= Ns Ar string
357 .Op Fl C Ar path | Fl Fl krb5-config-file= Ns Ar path
358 .Ar principal...
359 .Bd -ragged -offset indent
360 Lists the matching principals, short prints the result as a table,
361 while long format produces a more verbose output. Which columns to
362 print can be selected with the
363 .Fl o
364 option. The argument is a comma separated list of column names
365 optionally appended with an equal sign
366 .Pq Sq =
367 and a column header. Which columns are printed by default differ
368 slightly between short and long output.
370 The default terse output format is similar to
371 .Fl s o Ar principal= ,
372 just printing the names of matched principals.
375 .Fl C
377 .Fl Fl krb5-config-file
378 is given and the principal has krb5 config file contents saved
379 in its HDB entry, then that will be saved in the given file.
380 Note that if multiple principals are requested, then the second,
381 third, and so on will have -1, -2, and so on appended to the
382 given filename unless the given filename is a device name.
384 Possible column names include:
385 .Li principal ,
386 .Li princ_expire_time ,
387 .Li pw_expiration ,
388 .Li last_pwd_change ,
389 .Li max_life ,
390 .Li max_rlife ,
391 .Li mod_time ,
392 .Li mod_name ,
393 .Li attributes ,
394 .Li kvno ,
395 .Li mkvno ,
396 .Li last_success ,
397 .Li last_failed ,
398 .Li fail_auth_count ,
399 .Li policy ,
401 .Li keytypes .
404 .Nm modify
405 .Oo Fl a Ar attributes \*(Ba Xo
406 .Fl Fl attributes= Ns Ar attributes
409 .Op Fl Fl max-ticket-life= Ns Ar lifetime
410 .Op Fl Fl max-renewable-life= Ns Ar lifetime
411 .Op Fl Fl expiration-time= Ns Ar time
412 .Op Fl Fl pw-expiration-time= Ns Ar time
413 .Op Fl Fl kvno= Ns Ar number
414 .Op Fl Fl policy= Ns Ar policy-name
415 .Op Fl Fl alias= Ns Ar alias-name
416 .Op Fl C Ar path | Fl Fl krb5-config-file= Ns Ar path
417 .Ar principal...
418 .Bd -ragged -offset indent
419 Modifies certain attributes of a principal. If run without command
420 line options, you will be prompted. With command line options, it will
421 only change the ones specified.
424 .Fl Fl alias= Ns Ar alias-name
425 option may be given multiple times.
426 If this option is used at all, the complete list of aliases must
427 be given, with one option per-alias.
428 If the list given has fewer aliases than the principal had prior
429 to the modification, then the missing aliases will be deleted.
431 Use the
432 .Nm add_alias
433 command instead to add an alias to avoid having to list all
434 existing aliases to keep.
437 .Fl Fl alias=
438 option without a value allows the user to set an empty list of
439 aliases.
440 Use the
441 .Nm del_alias
442 command to delete one or more aliases.
444 The only policy supported by Heimdal is
445 .Ql default .
447 If a krb5 config file is given, it will be saved in the entry.
449 Possible attributes are:
450 .Li new-princ ,
451 .Li support-desmd5 ,
452 .Li pwchange-service ,
453 .Li disallow-client ,
454 .Li disallow-svr ,
455 .Li requires-pw-change ,
456 .Li requires-hw-auth ,
457 .Li requires-pre-auth ,
458 .Li allow-digest ,
459 .Li trusted-for-delegation ,
460 .Li ok-as-delegate ,
461 .Li disallow-all-tix ,
462 .Li disallow-dup-skey ,
463 .Li disallow-proxiable ,
464 .Li disallow-renewable ,
465 .Li disallow-tgt-based ,
466 .Li disallow-forwardable ,
467 .Li disallow-postdated ,
468 .Li no-auth-data-reqd
470 Attributes may be negated with a "-", e.g.,
472 kadmin -l modify -a -disallow-proxiable user
474 This command has the following alias:
475 .Nm mod .
478 .Nm passwd
479 .Op Fl Fl keepold | Fl Fl keepallold | Fl Fl pruneall
480 .Op Fl Fl enctypes= Ns Ar string
481 .Op Fl r | Fl Fl random-key
482 .Op Fl Fl random-password
483 .Oo Fl p Ar string \*(Ba Xo
484 .Fl Fl password= Ns Ar string
487 .Op Fl Fl key= Ns Ar string
488 .Ar principal...
489 .Bd -ragged -offset indent
490 Changes the password of an existing principal.
491 If enctypes to use are not given, then the
492 .Ar [libdefaults] supported_enctypes
493 configuration parameter will be used on the client side to select
494 enctypes, defaulting to
495 .Ar aes128-cts-hmac-sha1-96.
496 For compatibility with MIT, the enctypes string is a space- or
497 comma-separated list of enctype:salttype.
499 .Fl Fl keepold
500 is given, then old keys needed to decrypt extant tickets are
501 kept, and all other old keys are deleted.
503 .Fl Fl keepallold
504 is given then all old keys are kept.  If
505 .Fl Fl pruneall is given then all old keys are removed.
507 .Fl Fl keepold
508 behavior is the default if none of these are given.
510 This command has the following aliases:
511 .Nm cpw ,
512 .Nm change_password .
515 .Nm verify-password-quality
516 .Ar principal
517 .Ar password
518 .Bd -ragged -offset indent
519 Run the password quality check function locally.
520 You can run this on the host that is configured to run the kadmind
521 process to verify that your configuration file is correct.
522 The verification is done locally, if kadmin is run in remote mode,
523 no rpc call is done to the server. NOTE: if the environment has
524 verify-password-quality configured to use a back-end that stores
525 password history (such as heimdal-history), running
526 verify-quality-password will cause an update to the password
527 database meaning that merely verifying the quality of the password
528 using verify-quality-password invalidates the use of that
529 principal/password in the future.
531 This command has the following alias:
532 .Nm pwq .
535 .Nm privileges
536 .Bd -ragged -offset indent
537 Lists the operations you are allowed to perform. These include
538 .Li add ,
539 .Li add_enctype ,
540 .Li change-password ,
541 .Li delete ,
542 .Li del_enctype ,
543 .Li get ,
544 .Li get-keys ,
545 .Li list ,
547 .Li modify .
549 This command has the following alias:
550 .Nm privs .
553 .Nm rename
554 .Ar from to
555 .Bd -ragged -offset indent
556 Renames a principal. This is normally transparent, but since keys are
557 salted with the principal name, they will have a non-standard salt,
558 and clients which are unable to cope with this will fail. Kerberos 4
559 suffers from this.
562 .Nm check
563 .Op Ar realm
565 .Bd -ragged -offset indent
566 Check database for strange configurations on important principals. If
567 no realm is given, the default realm is used.
570 When running in local mode, the following commands can also be used:
572 .Nm dump
573 .Op Fl d | Fl Fl decrypt
574 .Op Fl f Ns Ar format | Fl Fl format= Ns Ar format
575 .Op Ar dump-file
576 .Bd -ragged -offset indent
577 Writes the database in
578 .Dq machine readable text
579 form to the specified file, or standard out. If the database is
580 encrypted, the dump will also have encrypted keys, unless
581 .Fl Fl decrypt
582 is used.  If
583 .Fl Fl format=MIT
584 is used then the dump will be in MIT format.  Otherwise it will be in
585 Heimdal format.
588 .Nm init
589 .Op Fl Fl realm-max-ticket-life= Ns Ar string
590 .Op Fl Fl realm-max-renewable-life= Ns Ar string
591 .Ar realm
592 .Bd -ragged -offset indent
593 Initializes the Kerberos database with entries for a new realm. It's
594 possible to have more than one realm served by one server.
597 .Nm load
598 .Ar file
599 .Bd -ragged -offset indent
600 Reads a previously dumped database, and re-creates that database from
601 scratch.
604 .Nm merge
605 .Ar file
606 .Bd -ragged -offset indent
607 Similar to
608 .Nm load
609 but just modifies the database with the entries in the dump file.
612 .Nm stash
613 .Oo Fl e Ar enctype \*(Ba Xo
614 .Fl Fl enctype= Ns Ar enctype
617 .Oo Fl k Ar keyfile \*(Ba Xo
618 .Fl Fl key-file= Ns Ar keyfile
621 .Op Fl Fl convert-file
622 .Op Fl Fl master-key-fd= Ns Ar fd
623 .Bd -ragged -offset indent
624 Writes the Kerberos master key to a file used by the KDC.
626 This command has the following alias:
627 .Nm kstash .
630 .Nm exit
631 .Bd -ragged -offset indent
632 Exits
633 .Nm kadmin .
635 This command has the following alias:
636 .Nm quit .
638 .\".Sh ENVIRONMENT
639 .\".Sh FILES
640 .\".Sh EXAMPLES
641 .\".Sh DIAGNOSTICS
642 .Sh SEE ALSO
643 .Xr kadmind 8 ,
644 .Xr kdc 8
645 .\".Sh STANDARDS
646 .\".Sh HISTORY
647 .\".Sh AUTHORS
648 .\".Sh BUGS