lib/krb5: krb5_init_creds_set_service fail if set_realm fails
[heimdal.git] / kadmin / kadmin.1
blobb0e852931c6b33f4c50a93bd2282fa4279bbd104
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 When a client requests a service ticket for a service principal
154 name that is an alias of a principal in a different realm, the
155 TGS will return a referral to that realm.
156 This compares favorably to using
157 .Ar [domain_realm]
158 entries in the KDC's
159 .Ar krb5.conf ,
160 but may be managed via the
161 .Nm kadmin
162 command and its
163 .Nm add_alias
165 .Nm del_alias
166 sub-commands rather than having to edit the KDC's configuration
167 file and having to restart the KDC.
169 There are two methods for issuing referrals for entire namespaces
170 of hostnames.
171 An alias of the form
172 .Ar  WELLKNOWN/HOSTBASED-NAMESPACE/service/namespace-fqdn@REALM
173 (see
174 .Nm add_namespace
175 below) will cause all requests for host-based principals in the
176 given namespace to be referred to the given realm.
177 Alternatively, the KDC will issue referrals for all host-based
178 service principals whose hostname component matches a
179 .Ar [domain_realm]
180 entry in the KDC's
181 .Ar krb5.conf
182 file referring to a different realm.
185 .Nm add_namespace
186 .Ar Fl Fl key-rotation-epoch= Ns Ar time
187 .Ar Fl Fl key-rotation-period= Ns Ar time
188 .Op Fl Fl enctypes= Ns Ar string
189 .Op Fl Fl max-ticket-life= Ns Ar lifetime
190 .Op Fl Fl max-renewable-life= Ns Ar lifetime
191 .Op Fl Fl attributes= Ns Ar attributes
192 .Ar host-based-principal...
193 .Bd -ragged -offset indent
194 Adds a new namespace of virtual host-based or domain-based
195 principals to the database, whose keys will be automatically
196 derived from base keys stored in the namespace record, and which
197 keys will be rotated automatically.
198 The namespace names are of the same form as host-based principal
199 names:
200 .Ar service/hostname@REALM
201 and these will match all host-based or domain-based service names
202 where hostname component of such a principal ends in the labels
203 of the hostname in the namespace name.
205 The service name component may be a wild-card (underscore,
206 .Ar _ ),
207 in which case it will match any service.
209 For example,
210 .Ar bar.baz.example@BAZ.EXAMPLE
211 will match
212 .Ar host/foo.bar.baz.example@BAZ.EXAMPLE
213 but not
214 .Ar host/foobar.baz.example@BAZ.EXAMPLE .
216 Note well that services are expected to
217 .Ar ext_keytab
218 or otherwise re-fetch their keytabs at least as often as one
219 quarter of the key rotation period, otherwise they risk not
220 having keys they need to decrypt tickets with.
222 The epoch must be given as either an absolute time,
223 .Ar "now",
224 or as
225 .Ar "+<N>[<unit>]"
226 where
227 .Ar N
228 is a natural and
229 .Ar unit
230 is one "s", "m", "h", "day", "week", "month", defaulting to
231 "month".
232 The default key rotation period is
233 .Ar 7d .
234 The default enctypes is as for the
235 .Nm add
236 command.
238 Note that namespaces are stored as principals whose names are of the form
239 .Ar WELLKNOWN/HOSTBASED-NAMESPACE/service/namespace.fqdn@REALM ,
240 with the
241 .Ar service
243 This command has the following alias:
244 .Nm add_ns .
247 .Nm add_enctype
248 .Op Fl r | Fl Fl random-key
249 .Ar principal enctypes...
251 .Bd -ragged -offset indent
252 Adds a new encryption type to the principal, only random key are
253 supported.
256 .Nm delete
257 .Ar principal...
258 .Bd -ragged -offset indent
259 Removes a principal.
260 It is an error to delete an alias.
261 To remove a principal's alias or aliases, use the
262 .Nm del_alias
263 command.
264 To remove a principal given an alias, first
265 .Nm get
266 the principal to get its canonical name and then delete that.
269 .Nm del_alias
270 .Ar alias...
271 .Bd -ragged -offset indent
272 Deletes the given aliases, but not their canonical principals.
274 This command has the following aliases:
275 .Nm del ,
276 .Nm del_entry .
279 .Nm del_enctype
280 .Ar principal enctypes...
281 .Bd -ragged -offset indent
282 Removes some enctypes from a principal; this can be useful if the
283 service belonging to the principal is known to not handle certain
284 enctypes.
287 .Nm prune
288 .Ar principal [kvno]
289 .Bd -ragged -offset indent
290 Deletes the named principal's keys of the given kvno.  If a kvno is
291 not given then this deletes all the named principals keys that are
292 too old to be needed for decrypting tickets issued using those keys
293 (i.e., any such tickets are necessarily expired).  The determination
294 of "too old" is made using the max-ticket-life attribute of the
295 principal; though in practice that max ticket life is also constrained
296 by the max-ticket-life of the client principals and the krbtgt
297 principals, those are not consulted here.
300 .Nm ext_keytab
301 .Oo Fl k Ar keytab \*(Ba Xo
302 .Op Fl Fl keepold | Fl Fl keepallold | Fl Fl pruneall
303 .Op Fl Fl enctypes= Ns Ar string
304 .Fl Fl keytab= Ns Ar string
307 .Ar principal...
308 .Bd -ragged -offset indent
309 Creates a keytab with the keys of the specified principals.  Requires
310 get-keys rights, otherwise the principal's keys are changed and saved in
311 the keytab.
312 If enctypes to use are not given, then the
313 .Ar [libdefaults] supported_enctypes
314 configuration parameter will be used on the client side to select
315 enctypes, defaulting to
316 .Ar aes128-cts-hmac-sha1-96.
317 For compatibility with MIT, the enctypes string is a space- or
318 comma-separated list of enctype:salttype.
320 .Fl Fl keepold
321 is given, then old keys needed to decrypt extant tickets are
322 kept, and all other old keys are deleted.
324 .Fl Fl keepallold
325 is given then all old keys are kept.  If
326 .Fl Fl pruneall is given then all old keys are removed.
328 .Fl Fl keepold
329 behavior is the default if none of these are given.
332 .Nm get
333 .Op Fl l | Fl Fl long
334 .Op Fl s | Fl Fl short
335 .Op Fl t | Fl Fl terse
336 .Op Fl o Ar string | Fl Fl column-info= Ns Ar string
337 .Op Fl C Ar path | Fl Fl krb5-config-file= Ns Ar path
338 .Ar principal...
339 .Bd -ragged -offset indent
340 Lists the matching principals, short prints the result as a table,
341 while long format produces a more verbose output. Which columns to
342 print can be selected with the
343 .Fl o
344 option. The argument is a comma separated list of column names
345 optionally appended with an equal sign
346 .Pq Sq =
347 and a column header. Which columns are printed by default differ
348 slightly between short and long output.
350 The default terse output format is similar to
351 .Fl s o Ar principal= ,
352 just printing the names of matched principals.
355 .Fl C
357 .Fl Fl krb5-config-file
358 is given and the principal has krb5 config file contents saved
359 in its HDB entry, then that will be saved in the given file.
360 Note that if multiple principals are requested, then the second,
361 third, and so on will have -1, -2, and so on appended to the
362 given filename unless the given filename is a device name.
364 Possible column names include:
365 .Li principal ,
366 .Li princ_expire_time ,
367 .Li pw_expiration ,
368 .Li last_pwd_change ,
369 .Li max_life ,
370 .Li max_rlife ,
371 .Li mod_time ,
372 .Li mod_name ,
373 .Li attributes ,
374 .Li kvno ,
375 .Li mkvno ,
376 .Li last_success ,
377 .Li last_failed ,
378 .Li fail_auth_count ,
379 .Li policy ,
381 .Li keytypes .
384 .Nm modify
385 .Oo Fl a Ar attributes \*(Ba Xo
386 .Fl Fl attributes= Ns Ar attributes
389 .Op Fl Fl max-ticket-life= Ns Ar lifetime
390 .Op Fl Fl max-renewable-life= Ns Ar lifetime
391 .Op Fl Fl expiration-time= Ns Ar time
392 .Op Fl Fl pw-expiration-time= Ns Ar time
393 .Op Fl Fl kvno= Ns Ar number
394 .Op Fl Fl policy= Ns Ar policy-name
395 .Op Fl Fl alias= Ns Ar alias-name
396 .Op Fl C Ar path | Fl Fl krb5-config-file= Ns Ar path
397 .Ar principal...
398 .Bd -ragged -offset indent
399 Modifies certain attributes of a principal. If run without command
400 line options, you will be prompted. With command line options, it will
401 only change the ones specified.
404 .Fl Fl alias= Ns Ar alias-name
405 option may be given multiple times, which will set the complete
406 list of aliases for the principal.
407 Use the
408 .Nm add_alias
409 command instead to add an alias without having to list all
410 existing aliases to keep.
413 .Fl Fl alias=
414 option without a value allows the user to set an empty list of
415 aliases.
416 Use the
417 .Nm del_alias
418 command to delete one or more aliases.
420 The only policy supported by Heimdal is
421 .Ql default .
423 If a krb5 config file is given, it will be saved in the entry.
425 Possible attributes are:
426 .Li new-princ ,
427 .Li support-desmd5 ,
428 .Li pwchange-service ,
429 .Li disallow-client ,
430 .Li disallow-svr ,
431 .Li requires-pw-change ,
432 .Li requires-hw-auth ,
433 .Li requires-pre-auth ,
434 .Li allow-digest ,
435 .Li trusted-for-delegation ,
436 .Li ok-as-delegate ,
437 .Li disallow-all-tix ,
438 .Li disallow-dup-skey ,
439 .Li disallow-proxiable ,
440 .Li disallow-renewable ,
441 .Li disallow-tgt-based ,
442 .Li disallow-forwardable ,
443 .Li disallow-postdated ,
444 .Li no-auth-data-reqd
446 Attributes may be negated with a "-", e.g.,
448 kadmin -l modify -a -disallow-proxiable user
450 This command has the following alias:
451 .Nm mod .
454 .Nm passwd
455 .Op Fl Fl keepold | Fl Fl keepallold | Fl Fl pruneall
456 .Op Fl Fl enctypes= Ns Ar string
457 .Op Fl r | Fl Fl random-key
458 .Op Fl Fl random-password
459 .Oo Fl p Ar string \*(Ba Xo
460 .Fl Fl password= Ns Ar string
463 .Op Fl Fl key= Ns Ar string
464 .Ar principal...
465 .Bd -ragged -offset indent
466 Changes the password of an existing principal.
467 If enctypes to use are not given, then the
468 .Ar [libdefaults] supported_enctypes
469 configuration parameter will be used on the client side to select
470 enctypes, defaulting to
471 .Ar aes128-cts-hmac-sha1-96.
472 For compatibility with MIT, the enctypes string is a space- or
473 comma-separated list of enctype:salttype.
475 .Fl Fl keepold
476 is given, then old keys needed to decrypt extant tickets are
477 kept, and all other old keys are deleted.
479 .Fl Fl keepallold
480 is given then all old keys are kept.  If
481 .Fl Fl pruneall is given then all old keys are removed.
483 .Fl Fl keepold
484 behavior is the default if none of these are given.
486 This command has the following aliases:
487 .Nm cpw ,
488 .Nm change_password .
491 .Nm verify-password-quality
492 .Ar principal
493 .Ar password
494 .Bd -ragged -offset indent
495 Run the password quality check function locally.
496 You can run this on the host that is configured to run the kadmind
497 process to verify that your configuration file is correct.
498 The verification is done locally, if kadmin is run in remote mode,
499 no rpc call is done to the server. NOTE: if the environment has
500 verify-password-quality configured to use a back-end that stores
501 password history (such as heimdal-history), running
502 verify-quality-password will cause an update to the password
503 database meaning that merely verifying the quality of the password
504 using verify-quality-password invalidates the use of that
505 principal/password in the future.
507 This command has the following alias:
508 .Nm pwq .
511 .Nm privileges
512 .Bd -ragged -offset indent
513 Lists the operations you are allowed to perform. These include
514 .Li add ,
515 .Li add_enctype ,
516 .Li change-password ,
517 .Li delete ,
518 .Li del_enctype ,
519 .Li get ,
520 .Li get-keys ,
521 .Li list ,
523 .Li modify .
525 This command has the following alias:
526 .Nm privs .
529 .Nm rename
530 .Ar from to
531 .Bd -ragged -offset indent
532 Renames a principal. This is normally transparent, but since keys are
533 salted with the principal name, they will have a non-standard salt,
534 and clients which are unable to cope with this will fail. Kerberos 4
535 suffers from this.
538 .Nm check
539 .Op Ar realm
541 .Bd -ragged -offset indent
542 Check database for strange configurations on important principals. If
543 no realm is given, the default realm is used.
546 When running in local mode, the following commands can also be used:
548 .Nm dump
549 .Op Fl d | Fl Fl decrypt
550 .Op Fl f Ns Ar format | Fl Fl format= Ns Ar format
551 .Op Ar dump-file
552 .Bd -ragged -offset indent
553 Writes the database in
554 .Dq machine readable text
555 form to the specified file, or standard out. If the database is
556 encrypted, the dump will also have encrypted keys, unless
557 .Fl Fl decrypt
558 is used.  If
559 .Fl Fl format=MIT
560 is used then the dump will be in MIT format.  Otherwise it will be in
561 Heimdal format.
564 .Nm init
565 .Op Fl Fl realm-max-ticket-life= Ns Ar string
566 .Op Fl Fl realm-max-renewable-life= Ns Ar string
567 .Ar realm
568 .Bd -ragged -offset indent
569 Initializes the Kerberos database with entries for a new realm. It's
570 possible to have more than one realm served by one server.
573 .Nm load
574 .Ar file
575 .Bd -ragged -offset indent
576 Reads a previously dumped database, and re-creates that database from
577 scratch.
580 .Nm merge
581 .Ar file
582 .Bd -ragged -offset indent
583 Similar to
584 .Nm load
585 but just modifies the database with the entries in the dump file.
588 .Nm stash
589 .Oo Fl e Ar enctype \*(Ba Xo
590 .Fl Fl enctype= Ns Ar enctype
593 .Oo Fl k Ar keyfile \*(Ba Xo
594 .Fl Fl key-file= Ns Ar keyfile
597 .Op Fl Fl convert-file
598 .Op Fl Fl master-key-fd= Ns Ar fd
599 .Bd -ragged -offset indent
600 Writes the Kerberos master key to a file used by the KDC.
602 This command has the following alias:
603 .Nm kstash .
606 .Nm exit
607 .Bd -ragged -offset indent
608 Exits
609 .Nm kadmin .
611 This command has the following alias:
612 .Nm quit .
614 .\".Sh ENVIRONMENT
615 .\".Sh FILES
616 .\".Sh EXAMPLES
617 .\".Sh DIAGNOSTICS
618 .Sh SEE ALSO
619 .Xr kadmind 8 ,
620 .Xr kdc 8
621 .\".Sh STANDARDS
622 .\".Sh HISTORY
623 .\".Sh AUTHORS
624 .\".Sh BUGS