third_party/heimdal: Import lorikeet-heimdal-202306091507 (commit 7d8afc9d7e3d309ddcc...
[Samba.git] / third_party / heimdal / admin / ktutil.1
blobfb8bc382b39c7f8a58a89d7a48c6246853def02e
1 .\" Copyright (c) 1997-2004 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 April 14, 2005
35 .Dt KTUTIL 1
36 .Os HEIMDAL
37 .Sh NAME
38 .Nm ktutil
39 .Nd manage Kerberos keytabs
40 .Sh SYNOPSIS
41 .Nm
42 .Oo Fl k Ar keytab \*(Ba Xo
43 .Fl Fl keytab= Ns Ar keytab
44 .Xc
45 .Oc
46 .Op Fl v | Fl Fl verbose
47 .Op Fl Fl version
48 .Op Fl h | Fl Fl help
49 .Ar command
50 .Op Ar args
51 .Sh DESCRIPTION
52 .Nm
53 is a program for managing keytabs.
54 Supported options:
55 .Bl -tag -width Ds
56 .It Fl v , Fl Fl verbose
57 Verbose output.
58 .El
59 .Pp
60 .Ar command
61 can be one of the following:
62 .Bl -tag -width srvconvert
63 .It Nm add Oo Fl p Ar principal Oc Oo Fl Fl principal= Ns Ar principal Oc \
64 Oo Fl V Ar kvno Oc Oo Fl Fl kvno= Ns Ar kvno Oc Oo Fl e Ar enctype Oc \
65 Oo Fl Fl keepold | Fl Fl keepallold | Fl Fl pruneall Oc \
66 Oo Fl Fl enctype= Ns Ar enctype Oc Oo Fl w Ar password Oc \
67 Oo Fl Fl password= Ns Ar password Oc Oo Fl r Oc Oo Fl Fl random Oc \
68 Oo Fl s Oc Oo Fl Fl no-salt Oc Oo Fl H Oc Op Fl Fl hex
69 Adds a key to the keytab. Options that are not specified will be
70 prompted for. This requires that you know the password or the hex key of the
71 principal to add; if what you really want is to add a new principal to
72 the keytab, you should consider the
73 .Ar get
74 command, which talks to the kadmin server.
75 .It Nm change Oo Fl r Ar realm Oc Oo Fl Fl realm= Ns Ar realm Oc \
76 Oo Fl Fl keepold | Fl Fl keepallold | Fl Fl pruneall Oc \
77 Oo Fl Fl enctype= Ns Ar enctype Oc \
78 Oo Fl Fl a Ar host Oc Oo Fl Fl admin-server= Ns Ar host Oc \
79 Oo Fl Fl s Ar port Oc Op Fl Fl server-port= Ns Ar port
80 Update one or several keys to new versions.  By default, use the admin
81 server for the realm of a keytab entry.  Otherwise it will use the
82 values specified by the options.
83 .Pp
84 If no principals are given, all the ones in the keytab are updated.
85 .It Nm copy Oo Fl Fl copy-duplicates Oc Ar keytab-src Ar keytab-dest
86 Copies all the entries from
87 .Ar keytab-src
89 .Ar keytab-dest .
90 Because entries already in
91 .Ar keytab-dest
92 are kept, this command functions to merge keytabs.
93 Entries for the same principal, key version number, and
94 encryption type in the
95 .Ar keytab-src
96 that are also in the
97 .Ar keytab-dest
98 will not be copied to the
99 .Ar keytab-dest
100 unless the
101 .Fl Fl copy-duplicates
102 option is given.
103 .It Nm get Oo Fl p Ar admin principal Oc \
104 Oo Fl Fl principal= Ns Ar admin principal Oc Oo Fl e Ar enctype Oc \
105 Oo Fl Fl no-create Oc \
106 Oo Fl Fl no-change-keys Oc \
107 Oo Fl Fl keepold | Fl Fl keepallold | Fl Fl pruneall Oc \
108 Oo Fl Fl enctypes= Ns Ar enctype Oc Oo Fl r Ar realm Oc \
109 Oo Fl Fl realm= Ns Ar realm Oc Oo Fl a Ar admin server Oc \
110 Oo Fl Fl admin-server= Ns Ar admin server Oc Oo Fl s Ar server port Oc \
111 Oo Fl Fl server-port= Ns Ar server port Oc Ar principal ...
113 For each
114 .Ar principal ,
115 get a the principal's keys from the KDC via the kadmin protocol,
116 creating the principal if it doesn't exist (unless
117 .Fl Fl no-create
118 is given), and changing its keys to new random keys (unless
119 .Fl Fl no-change-keys
120 is given).
122 If no
123 .Ar realm
124 is specified, the realm to operate on is taken from the first
125 principal.
126 .It Nm import Oo JSON-FILE Oc
127 Read an array of keytab entries in a JSON file and copy them to
128 the keytab.
129 Use the
130 .Nm list
131 command with its
132 .Fl Fl json
133 option
135 .Fl Fl keys
136 option to export a keytab.
137 .It Nm list Oo Fl Fl keys Oc Op Fl Fl timestamp Oo Op Fl Fl json Oc
138 List the keys stored in the keytab.
139 Use the
140 .Fl Fl json
142 .Fl Fl keys
143 options to export a keytab as JSON for importing with the
144 .Nm import
145 command.
146 .It Nm remove Oo Fl p Ar principal Oc Oo Fl Fl principal= Ns Ar principal Oc \
147 Oo Fl V kvno Oc Oo Fl Fl kvno= Ns Ar kvno Oc Oo Fl e enctype Oc \
148 Oo Fl Fl enctype= Ns Ar enctype Oc
149 Removes the specified key or keys. Not specifying a
150 .Ar kvno
151 removes keys with any version number. Not specifying an
152 .Ar enctype
153 removes keys of any type.
154 .It Nm merge Oo Fl Fl copy-duplicates Oc Ar keytab-src Ar keytab-dest
155 An alias for the
156 .Nm copy
157 command.
158 .It Nm rename Ar from-principal Ar to-principal
159 Renames all entries for the
160 .Ar from-principal
161 in the keytab
162 .Ar from-principal
164 .Ar to-principal .
165 .It Nm purge Op Fl Fl age= Ns Ar age
166 Removes all old versions of a key for which there is a newer version
167 that is at least
168 .Ar age
169 (default one week) old.
170 Note that this does not update the KDC database.
172 .Xr kadmin 1
173 command has a
174 .Nm prune
175 command that can do this on the KDC side.
177 .Sh ENVIRONMENT
178 .Bl -tag -width Ds
179 .It Ev KRB5_KTNAME
180 Specifies the default keytab.
181 .It Ev KRB5_CONFIG
182 The file name of
183 .Pa krb5.conf ,
184 the default being
185 .Pa /etc/krb5.conf .
187 .Sh KEYTAB NAMING
188 The syntax for the value of the
189 .Ql KRB5_KTNAME
190 environment variable and
191 .Oo Fl k Ar keytab \*(Ba Xo
192 .Fl Fl keytab= Ns Ar keytab
195 options is
196 .Ql TYPE:name
197 where the TYPE is one of
198 .Ql FILE ,
199 .Ql HDBGET ,
200 .Ql HDB ,
202 .Ql ANY ,
203 and the name syntax is specific to the keytab type.
205 For the FILE keytab type the name is the path to a file whose
206 format is the well-known keytab file format used by MIT Kerberos,
207 Heimdal, Java, and others.
209 For the HDB and HDBGET keytab types the name syntax is
210 .Ql [<path>][:mkey=<path>]
211 where the first path is the path to the HDB and the second path
212 is the path to the master key file.
213 Note that to use the HDB and HDBGET keytab types in a program
214 linked with Heimdal libraries one first load the
215 .Ql libhdb
216 library and then register their keytab methods using
217 .Xr krb5_kt_register 3 .
218 Note also that
219 .Nm ktutil
220 does not load and register the HDB and HDBGET keytab types at
221 this time.
223 The ANY keytab type name syntax is a sequence of other keytab
224 names (including their TYPE: prefix) separated by commas.
225 Note that there is no escape sequence for commas in keytab names.
226 .Sh SEE ALSO
227 .Xr kadmin 1
228 .Xr kinit 1
229 .Xr krb5_kt_register 3