xref: /freebsd/crypto/krb5/doc/admin/admin_commands/kdb5_util.rst (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert.. _kdb5_util(8):
2*7f2fe78bSCy Schubert
3*7f2fe78bSCy Schubertkdb5_util
4*7f2fe78bSCy Schubert=========
5*7f2fe78bSCy Schubert
6*7f2fe78bSCy SchubertSYNOPSIS
7*7f2fe78bSCy Schubert--------
8*7f2fe78bSCy Schubert
9*7f2fe78bSCy Schubert.. _kdb5_util_synopsis:
10*7f2fe78bSCy Schubert
11*7f2fe78bSCy Schubert**kdb5_util**
12*7f2fe78bSCy Schubert[**-r** *realm*]
13*7f2fe78bSCy Schubert[**-d** *dbname*]
14*7f2fe78bSCy Schubert[**-k** *mkeytype*]
15*7f2fe78bSCy Schubert[**-kv** *mkeyVNO*]
16*7f2fe78bSCy Schubert[**-M** *mkeyname*]
17*7f2fe78bSCy Schubert[**-m**]
18*7f2fe78bSCy Schubert[**-sf** *stashfilename*]
19*7f2fe78bSCy Schubert[**-P** *password*]
20*7f2fe78bSCy Schubert[**-x** *db_args*]
21*7f2fe78bSCy Schubert*command* [*command_options*]
22*7f2fe78bSCy Schubert
23*7f2fe78bSCy Schubert.. _kdb5_util_synopsis_end:
24*7f2fe78bSCy Schubert
25*7f2fe78bSCy SchubertDESCRIPTION
26*7f2fe78bSCy Schubert-----------
27*7f2fe78bSCy Schubert
28*7f2fe78bSCy Schubertkdb5_util allows an administrator to perform maintenance procedures on
29*7f2fe78bSCy Schubertthe KDC database.  Databases can be created, destroyed, and dumped to
30*7f2fe78bSCy Schubertor loaded from ASCII files.  kdb5_util can create a Kerberos master
31*7f2fe78bSCy Schubertkey stash file or perform live rollover of the master key.
32*7f2fe78bSCy Schubert
33*7f2fe78bSCy SchubertWhen kdb5_util is run, it attempts to acquire the master key and open
34*7f2fe78bSCy Schubertthe database.  However, execution continues regardless of whether or
35*7f2fe78bSCy Schubertnot kdb5_util successfully opens the database, because the database
36*7f2fe78bSCy Schubertmay not exist yet or the stash file may be corrupt.
37*7f2fe78bSCy Schubert
38*7f2fe78bSCy SchubertNote that some KDC database modules may not support all kdb5_util
39*7f2fe78bSCy Schubertcommands.
40*7f2fe78bSCy Schubert
41*7f2fe78bSCy Schubert
42*7f2fe78bSCy SchubertCOMMAND-LINE OPTIONS
43*7f2fe78bSCy Schubert--------------------
44*7f2fe78bSCy Schubert
45*7f2fe78bSCy Schubert.. _kdb5_util_options:
46*7f2fe78bSCy Schubert
47*7f2fe78bSCy Schubert**-r** *realm*
48*7f2fe78bSCy Schubert    specifies the Kerberos realm of the database.
49*7f2fe78bSCy Schubert
50*7f2fe78bSCy Schubert**-d** *dbname*
51*7f2fe78bSCy Schubert    specifies the name under which the principal database is stored;
52*7f2fe78bSCy Schubert    by default the database is that listed in :ref:`kdc.conf(5)`.  The
53*7f2fe78bSCy Schubert    password policy database and lock files are also derived from this
54*7f2fe78bSCy Schubert    value.
55*7f2fe78bSCy Schubert
56*7f2fe78bSCy Schubert**-k** *mkeytype*
57*7f2fe78bSCy Schubert    specifies the key type of the master key in the database.  The
58*7f2fe78bSCy Schubert    default is given by the **master_key_type** variable in
59*7f2fe78bSCy Schubert    :ref:`kdc.conf(5)`.
60*7f2fe78bSCy Schubert
61*7f2fe78bSCy Schubert**-kv** *mkeyVNO*
62*7f2fe78bSCy Schubert    Specifies the version number of the master key in the database;
63*7f2fe78bSCy Schubert    the default is 1.  Note that 0 is not allowed.
64*7f2fe78bSCy Schubert
65*7f2fe78bSCy Schubert**-M** *mkeyname*
66*7f2fe78bSCy Schubert    principal name for the master key in the database.  If not
67*7f2fe78bSCy Schubert    specified, the name is determined by the **master_key_name**
68*7f2fe78bSCy Schubert    variable in :ref:`kdc.conf(5)`.
69*7f2fe78bSCy Schubert
70*7f2fe78bSCy Schubert**-m**
71*7f2fe78bSCy Schubert    specifies that the master database password should be read from
72*7f2fe78bSCy Schubert    the keyboard rather than fetched from a file on disk.
73*7f2fe78bSCy Schubert
74*7f2fe78bSCy Schubert**-sf** *stash_file*
75*7f2fe78bSCy Schubert    specifies the stash filename of the master database password.  If
76*7f2fe78bSCy Schubert    not specified, the filename is determined by the
77*7f2fe78bSCy Schubert    **key_stash_file** variable in :ref:`kdc.conf(5)`.
78*7f2fe78bSCy Schubert
79*7f2fe78bSCy Schubert**-P** *password*
80*7f2fe78bSCy Schubert    specifies the master database password.  Using this option may
81*7f2fe78bSCy Schubert    expose the password to other users on the system via the process
82*7f2fe78bSCy Schubert    list.
83*7f2fe78bSCy Schubert
84*7f2fe78bSCy Schubert**-x** *db_args*
85*7f2fe78bSCy Schubert    specifies database-specific options.  See :ref:`kadmin(1)` for
86*7f2fe78bSCy Schubert    supported options.
87*7f2fe78bSCy Schubert
88*7f2fe78bSCy Schubert.. _kdb5_util_options_end:
89*7f2fe78bSCy Schubert
90*7f2fe78bSCy Schubert
91*7f2fe78bSCy SchubertCOMMANDS
92*7f2fe78bSCy Schubert--------
93*7f2fe78bSCy Schubert
94*7f2fe78bSCy Schubertcreate
95*7f2fe78bSCy Schubert~~~~~~
96*7f2fe78bSCy Schubert
97*7f2fe78bSCy Schubert.. _kdb5_util_create:
98*7f2fe78bSCy Schubert
99*7f2fe78bSCy Schubert    **create** [**-s**]
100*7f2fe78bSCy Schubert
101*7f2fe78bSCy SchubertCreates a new database.  If the **-s** option is specified, the stash
102*7f2fe78bSCy Schubertfile is also created.  This command fails if the database already
103*7f2fe78bSCy Schubertexists.  If the command is successful, the database is opened just as
104*7f2fe78bSCy Schubertif it had already existed when the program was first run.
105*7f2fe78bSCy Schubert
106*7f2fe78bSCy Schubert.. _kdb5_util_create_end:
107*7f2fe78bSCy Schubert
108*7f2fe78bSCy Schubertdestroy
109*7f2fe78bSCy Schubert~~~~~~~
110*7f2fe78bSCy Schubert
111*7f2fe78bSCy Schubert.. _kdb5_util_destroy:
112*7f2fe78bSCy Schubert
113*7f2fe78bSCy Schubert    **destroy** [**-f**]
114*7f2fe78bSCy Schubert
115*7f2fe78bSCy SchubertDestroys the database, first overwriting the disk sectors and then
116*7f2fe78bSCy Schubertunlinking the files, after prompting the user for confirmation.  With
117*7f2fe78bSCy Schubertthe **-f** argument, does not prompt the user.
118*7f2fe78bSCy Schubert
119*7f2fe78bSCy Schubert.. _kdb5_util_destroy_end:
120*7f2fe78bSCy Schubert
121*7f2fe78bSCy Schubertstash
122*7f2fe78bSCy Schubert~~~~~
123*7f2fe78bSCy Schubert
124*7f2fe78bSCy Schubert.. _kdb5_util_stash:
125*7f2fe78bSCy Schubert
126*7f2fe78bSCy Schubert    **stash** [**-f** *keyfile*]
127*7f2fe78bSCy Schubert
128*7f2fe78bSCy SchubertStores the master principal's keys in a stash file.  The **-f**
129*7f2fe78bSCy Schubertargument can be used to override the *keyfile* specified in
130*7f2fe78bSCy Schubert:ref:`kdc.conf(5)`.
131*7f2fe78bSCy Schubert
132*7f2fe78bSCy Schubert.. _kdb5_util_stash_end:
133*7f2fe78bSCy Schubert
134*7f2fe78bSCy Schubertdump
135*7f2fe78bSCy Schubert~~~~
136*7f2fe78bSCy Schubert
137*7f2fe78bSCy Schubert.. _kdb5_util_dump:
138*7f2fe78bSCy Schubert
139*7f2fe78bSCy Schubert    **dump** [**-b7**\|\ **-r13**\|\ **-r18**]
140*7f2fe78bSCy Schubert    [**-verbose**] [**-mkey_convert**] [**-new_mkey_file**
141*7f2fe78bSCy Schubert    *mkey_file*] [**-rev**] [**-recurse**] [*filename*
142*7f2fe78bSCy Schubert    [*principals*...]]
143*7f2fe78bSCy Schubert
144*7f2fe78bSCy SchubertDumps the current Kerberos and KADM5 database into an ASCII file.  By
145*7f2fe78bSCy Schubertdefault, the database is dumped in current format, "kdb5_util
146*7f2fe78bSCy Schubertload_dump version 7".  If filename is not specified, or is the string
147*7f2fe78bSCy Schubert"-", the dump is sent to standard output.  Options:
148*7f2fe78bSCy Schubert
149*7f2fe78bSCy Schubert**-b7**
150*7f2fe78bSCy Schubert    causes the dump to be in the Kerberos 5 Beta 7 format ("kdb5_util
151*7f2fe78bSCy Schubert    load_dump version 4").  This was the dump format produced on
152*7f2fe78bSCy Schubert    releases prior to 1.2.2.
153*7f2fe78bSCy Schubert
154*7f2fe78bSCy Schubert**-r13**
155*7f2fe78bSCy Schubert    causes the dump to be in the Kerberos 5 1.3 format ("kdb5_util
156*7f2fe78bSCy Schubert    load_dump version 5").  This was the dump format produced on
157*7f2fe78bSCy Schubert    releases prior to 1.8.
158*7f2fe78bSCy Schubert
159*7f2fe78bSCy Schubert**-r18**
160*7f2fe78bSCy Schubert    causes the dump to be in the Kerberos 5 1.8 format ("kdb5_util
161*7f2fe78bSCy Schubert    load_dump version 6").  This was the dump format produced on
162*7f2fe78bSCy Schubert    releases prior to 1.11.
163*7f2fe78bSCy Schubert
164*7f2fe78bSCy Schubert**-verbose**
165*7f2fe78bSCy Schubert    causes the name of each principal and policy to be printed as it
166*7f2fe78bSCy Schubert    is dumped.
167*7f2fe78bSCy Schubert
168*7f2fe78bSCy Schubert**-mkey_convert**
169*7f2fe78bSCy Schubert    prompts for a new master key.  This new master key will be used to
170*7f2fe78bSCy Schubert    re-encrypt principal key data in the dumpfile.  The principal keys
171*7f2fe78bSCy Schubert    themselves will not be changed.
172*7f2fe78bSCy Schubert
173*7f2fe78bSCy Schubert**-new_mkey_file** *mkey_file*
174*7f2fe78bSCy Schubert    the filename of a stash file.  The master key in this stash file
175*7f2fe78bSCy Schubert    will be used to re-encrypt the key data in the dumpfile.  The key
176*7f2fe78bSCy Schubert    data in the database will not be changed.
177*7f2fe78bSCy Schubert
178*7f2fe78bSCy Schubert**-rev**
179*7f2fe78bSCy Schubert    dumps in reverse order.  This may recover principals that do not
180*7f2fe78bSCy Schubert    dump normally, in cases where database corruption has occurred.
181*7f2fe78bSCy Schubert
182*7f2fe78bSCy Schubert**-recurse**
183*7f2fe78bSCy Schubert    causes the dump to walk the database recursively (btree only).
184*7f2fe78bSCy Schubert    This may recover principals that do not dump normally, in cases
185*7f2fe78bSCy Schubert    where database corruption has occurred.  In cases of such
186*7f2fe78bSCy Schubert    corruption, this option will probably retrieve more principals
187*7f2fe78bSCy Schubert    than the **-rev** option will.
188*7f2fe78bSCy Schubert
189*7f2fe78bSCy Schubert    .. versionchanged:: 1.15
190*7f2fe78bSCy Schubert        Release 1.15 restored the functionality of the **-recurse**
191*7f2fe78bSCy Schubert        option.
192*7f2fe78bSCy Schubert
193*7f2fe78bSCy Schubert    .. versionchanged:: 1.5
194*7f2fe78bSCy Schubert        The **-recurse** option ceased working until release 1.15,
195*7f2fe78bSCy Schubert        doing a normal dump instead of a recursive traversal.
196*7f2fe78bSCy Schubert
197*7f2fe78bSCy Schubert.. _kdb5_util_dump_end:
198*7f2fe78bSCy Schubert
199*7f2fe78bSCy Schubertload
200*7f2fe78bSCy Schubert~~~~
201*7f2fe78bSCy Schubert
202*7f2fe78bSCy Schubert.. _kdb5_util_load:
203*7f2fe78bSCy Schubert
204*7f2fe78bSCy Schubert    **load** [**-b7**\|\ **-r13**\|\ **-r18**] [**-hash**]
205*7f2fe78bSCy Schubert    [**-verbose**] [**-update**] *filename*
206*7f2fe78bSCy Schubert
207*7f2fe78bSCy SchubertLoads a database dump from the named file into the named database.  If
208*7f2fe78bSCy Schubertno option is given to determine the format of the dump file, the
209*7f2fe78bSCy Schubertformat is detected automatically and handled as appropriate.  Unless
210*7f2fe78bSCy Schubertthe **-update** option is given, **load** creates a new database
211*7f2fe78bSCy Schubertcontaining only the data in the dump file, overwriting the contents of
212*7f2fe78bSCy Schubertany previously existing database.  Note that when using the LDAP KDC
213*7f2fe78bSCy Schubertdatabase module, the **-update** flag is required.
214*7f2fe78bSCy Schubert
215*7f2fe78bSCy SchubertOptions:
216*7f2fe78bSCy Schubert
217*7f2fe78bSCy Schubert**-b7**
218*7f2fe78bSCy Schubert    requires the database to be in the Kerberos 5 Beta 7 format
219*7f2fe78bSCy Schubert    ("kdb5_util load_dump version 4").  This was the dump format
220*7f2fe78bSCy Schubert    produced on releases prior to 1.2.2.
221*7f2fe78bSCy Schubert
222*7f2fe78bSCy Schubert**-r13**
223*7f2fe78bSCy Schubert    requires the database to be in Kerberos 5 1.3 format ("kdb5_util
224*7f2fe78bSCy Schubert    load_dump version 5").  This was the dump format produced on
225*7f2fe78bSCy Schubert    releases prior to 1.8.
226*7f2fe78bSCy Schubert
227*7f2fe78bSCy Schubert**-r18**
228*7f2fe78bSCy Schubert    requires the database to be in Kerberos 5 1.8 format ("kdb5_util
229*7f2fe78bSCy Schubert    load_dump version 6").  This was the dump format produced on
230*7f2fe78bSCy Schubert    releases prior to 1.11.
231*7f2fe78bSCy Schubert
232*7f2fe78bSCy Schubert**-hash**
233*7f2fe78bSCy Schubert    stores the database in hash format, if using the DB2 database
234*7f2fe78bSCy Schubert    type.  If this option is not specified, the database will be
235*7f2fe78bSCy Schubert    stored in btree format.  This option is not recommended, as
236*7f2fe78bSCy Schubert    databases stored in hash format are known to corrupt data and lose
237*7f2fe78bSCy Schubert    principals.
238*7f2fe78bSCy Schubert
239*7f2fe78bSCy Schubert**-verbose**
240*7f2fe78bSCy Schubert    causes the name of each principal and policy to be printed as it
241*7f2fe78bSCy Schubert    is dumped.
242*7f2fe78bSCy Schubert
243*7f2fe78bSCy Schubert**-update**
244*7f2fe78bSCy Schubert    records from the dump file are added to or updated in the existing
245*7f2fe78bSCy Schubert    database.  Otherwise, a new database is created containing only
246*7f2fe78bSCy Schubert    what is in the dump file and the old one destroyed upon successful
247*7f2fe78bSCy Schubert    completion.
248*7f2fe78bSCy Schubert
249*7f2fe78bSCy Schubert.. _kdb5_util_load_end:
250*7f2fe78bSCy Schubert
251*7f2fe78bSCy Schubertark
252*7f2fe78bSCy Schubert~~~
253*7f2fe78bSCy Schubert
254*7f2fe78bSCy Schubert    **ark** [**-e** *enc*:*salt*,...] *principal*
255*7f2fe78bSCy Schubert
256*7f2fe78bSCy SchubertAdds new random keys to *principal* at the next available key version
257*7f2fe78bSCy Schubertnumber.  Keys for the current highest key version number will be
258*7f2fe78bSCy Schubertpreserved.  The **-e** option specifies the list of encryption and
259*7f2fe78bSCy Schubertsalt types to be used for the new keys.
260*7f2fe78bSCy Schubert
261*7f2fe78bSCy Schubertadd_mkey
262*7f2fe78bSCy Schubert~~~~~~~~
263*7f2fe78bSCy Schubert
264*7f2fe78bSCy Schubert    **add_mkey** [**-e** *etype*] [**-s**]
265*7f2fe78bSCy Schubert
266*7f2fe78bSCy SchubertAdds a new master key to the master key principal, but does not mark
267*7f2fe78bSCy Schubertit as active.  Existing master keys will remain.  The **-e** option
268*7f2fe78bSCy Schubertspecifies the encryption type of the new master key; see
269*7f2fe78bSCy Schubert:ref:`Encryption_types` in :ref:`kdc.conf(5)` for a list of possible
270*7f2fe78bSCy Schubertvalues.  The **-s** option stashes the new master key in the stash
271*7f2fe78bSCy Schubertfile, which will be created if it doesn't already exist.
272*7f2fe78bSCy Schubert
273*7f2fe78bSCy SchubertAfter a new master key is added, it should be propagated to replica
274*7f2fe78bSCy Schubertservers via a manual or periodic invocation of :ref:`kprop(8)`.  Then,
275*7f2fe78bSCy Schubertthe stash files on the replica servers should be updated with the
276*7f2fe78bSCy Schubertkdb5_util **stash** command.  Once those steps are complete, the key
277*7f2fe78bSCy Schubertis ready to be marked active with the kdb5_util **use_mkey** command.
278*7f2fe78bSCy Schubert
279*7f2fe78bSCy Schubertuse_mkey
280*7f2fe78bSCy Schubert~~~~~~~~
281*7f2fe78bSCy Schubert
282*7f2fe78bSCy Schubert    **use_mkey** *mkeyVNO* [*time*]
283*7f2fe78bSCy Schubert
284*7f2fe78bSCy SchubertSets the activation time of the master key specified by *mkeyVNO*.
285*7f2fe78bSCy SchubertOnce a master key becomes active, it will be used to encrypt newly
286*7f2fe78bSCy Schubertcreated principal keys.  If no *time* argument is given, the current
287*7f2fe78bSCy Schuberttime is used, causing the specified master key version to become
288*7f2fe78bSCy Schubertactive immediately.  The format for *time* is :ref:`getdate` string.
289*7f2fe78bSCy Schubert
290*7f2fe78bSCy SchubertAfter a new master key becomes active, the kdb5_util
291*7f2fe78bSCy Schubert**update_princ_encryption** command can be used to update all
292*7f2fe78bSCy Schubertprincipal keys to be encrypted in the new master key.
293*7f2fe78bSCy Schubert
294*7f2fe78bSCy Schubertlist_mkeys
295*7f2fe78bSCy Schubert~~~~~~~~~~
296*7f2fe78bSCy Schubert
297*7f2fe78bSCy Schubert    **list_mkeys**
298*7f2fe78bSCy Schubert
299*7f2fe78bSCy SchubertList all master keys, from most recent to earliest, in the master key
300*7f2fe78bSCy Schubertprincipal.  The output will show the kvno, enctype, and salt type for
301*7f2fe78bSCy Schuberteach mkey, similar to the output of :ref:`kadmin(1)` **getprinc**.  A
302*7f2fe78bSCy Schubert``*`` following an mkey denotes the currently active master key.
303*7f2fe78bSCy Schubert
304*7f2fe78bSCy Schubertpurge_mkeys
305*7f2fe78bSCy Schubert~~~~~~~~~~~
306*7f2fe78bSCy Schubert
307*7f2fe78bSCy Schubert    **purge_mkeys** [**-f**] [**-n**] [**-v**]
308*7f2fe78bSCy Schubert
309*7f2fe78bSCy SchubertDelete master keys from the master key principal that are not used to
310*7f2fe78bSCy Schubertprotect any principals.  This command can be used to remove old master
311*7f2fe78bSCy Schubertkeys all principal keys are protected by a newer master key.
312*7f2fe78bSCy Schubert
313*7f2fe78bSCy Schubert**-f**
314*7f2fe78bSCy Schubert    does not prompt for confirmation.
315*7f2fe78bSCy Schubert
316*7f2fe78bSCy Schubert**-n**
317*7f2fe78bSCy Schubert    performs a dry run, showing master keys that would be purged, but
318*7f2fe78bSCy Schubert    not actually purging any keys.
319*7f2fe78bSCy Schubert
320*7f2fe78bSCy Schubert**-v**
321*7f2fe78bSCy Schubert    gives more verbose output.
322*7f2fe78bSCy Schubert
323*7f2fe78bSCy Schubertupdate_princ_encryption
324*7f2fe78bSCy Schubert~~~~~~~~~~~~~~~~~~~~~~~
325*7f2fe78bSCy Schubert
326*7f2fe78bSCy Schubert    **update_princ_encryption** [**-f**] [**-n**] [**-v**]
327*7f2fe78bSCy Schubert    [*princ-pattern*]
328*7f2fe78bSCy Schubert
329*7f2fe78bSCy SchubertUpdate all principal records (or only those matching the
330*7f2fe78bSCy Schubert*princ-pattern* glob pattern) to re-encrypt the key data using the
331*7f2fe78bSCy Schubertactive database master key, if they are encrypted using a different
332*7f2fe78bSCy Schubertversion, and give a count at the end of the number of principals
333*7f2fe78bSCy Schubertupdated.  If the **-f** option is not given, ask for confirmation
334*7f2fe78bSCy Schubertbefore starting to make changes.  The **-v** option causes each
335*7f2fe78bSCy Schubertprincipal processed to be listed, with an indication as to whether it
336*7f2fe78bSCy Schubertneeded updating or not.  The **-n** option performs a dry run, only
337*7f2fe78bSCy Schubertshowing the actions which would have been taken.
338*7f2fe78bSCy Schubert
339*7f2fe78bSCy Schuberttabdump
340*7f2fe78bSCy Schubert~~~~~~~
341*7f2fe78bSCy Schubert
342*7f2fe78bSCy Schubert    **tabdump** [**-H**] [**-c**] [**-e**] [**-n**] [**-o** *outfile*]
343*7f2fe78bSCy Schubert    *dumptype*
344*7f2fe78bSCy Schubert
345*7f2fe78bSCy SchubertDump selected fields of the database in a tabular format suitable for
346*7f2fe78bSCy Schubertreporting (e.g., using traditional Unix text processing tools) or
347*7f2fe78bSCy Schubertimporting into relational databases.  The data format is tab-separated
348*7f2fe78bSCy Schubert(default), or optionally comma-separated (CSV), with a fixed number of
349*7f2fe78bSCy Schubertcolumns.  The output begins with a header line containing field names,
350*7f2fe78bSCy Schubertunless suppression is requested using the **-H** option.
351*7f2fe78bSCy Schubert
352*7f2fe78bSCy SchubertThe *dumptype* parameter specifies the name of an output table (see
353*7f2fe78bSCy Schubertbelow).
354*7f2fe78bSCy Schubert
355*7f2fe78bSCy SchubertOptions:
356*7f2fe78bSCy Schubert
357*7f2fe78bSCy Schubert**-H**
358*7f2fe78bSCy Schubert    suppress writing the field names in a header line
359*7f2fe78bSCy Schubert
360*7f2fe78bSCy Schubert**-c**
361*7f2fe78bSCy Schubert    use comma separated values (CSV) format, with minimal quoting,
362*7f2fe78bSCy Schubert    instead of the default tab-separated (unquoted, unescaped) format
363*7f2fe78bSCy Schubert
364*7f2fe78bSCy Schubert**-e**
365*7f2fe78bSCy Schubert    write empty hexadecimal string fields as empty fields instead of
366*7f2fe78bSCy Schubert    as "-1".
367*7f2fe78bSCy Schubert
368*7f2fe78bSCy Schubert**-n**
369*7f2fe78bSCy Schubert    produce numeric output for fields that normally have symbolic
370*7f2fe78bSCy Schubert    output, such as enctypes and flag names.  Also requests output of
371*7f2fe78bSCy Schubert    time stamps as decimal POSIX time_t values.
372*7f2fe78bSCy Schubert
373*7f2fe78bSCy Schubert**-o** *outfile*
374*7f2fe78bSCy Schubert    write the dump to the specified output file instead of to standard
375*7f2fe78bSCy Schubert    output
376*7f2fe78bSCy Schubert
377*7f2fe78bSCy SchubertDump types:
378*7f2fe78bSCy Schubert
379*7f2fe78bSCy Schubert**keydata**
380*7f2fe78bSCy Schubert    principal encryption key information, including actual key data
381*7f2fe78bSCy Schubert    (which is still encrypted in the master key)
382*7f2fe78bSCy Schubert
383*7f2fe78bSCy Schubert    **name**
384*7f2fe78bSCy Schubert        principal name
385*7f2fe78bSCy Schubert    **keyindex**
386*7f2fe78bSCy Schubert        index of this key in the principal's key list
387*7f2fe78bSCy Schubert    **kvno**
388*7f2fe78bSCy Schubert        key version number
389*7f2fe78bSCy Schubert    **enctype**
390*7f2fe78bSCy Schubert        encryption type
391*7f2fe78bSCy Schubert    **key**
392*7f2fe78bSCy Schubert        key data as a hexadecimal string
393*7f2fe78bSCy Schubert    **salttype**
394*7f2fe78bSCy Schubert        salt type
395*7f2fe78bSCy Schubert    **salt**
396*7f2fe78bSCy Schubert        salt data as a hexadecimal string
397*7f2fe78bSCy Schubert
398*7f2fe78bSCy Schubert**keyinfo**
399*7f2fe78bSCy Schubert    principal encryption key information (as in **keydata** above),
400*7f2fe78bSCy Schubert    excluding actual key data
401*7f2fe78bSCy Schubert
402*7f2fe78bSCy Schubert**princ_flags**
403*7f2fe78bSCy Schubert    principal boolean attributes.  Flag names print as hexadecimal
404*7f2fe78bSCy Schubert    numbers if the **-n** option is specified, and all flag positions
405*7f2fe78bSCy Schubert    are printed regardless of whether or not they are set.  If **-n**
406*7f2fe78bSCy Schubert    is not specified, print all known flag names for each principal,
407*7f2fe78bSCy Schubert    but only print hexadecimal flag names if the corresponding flag is
408*7f2fe78bSCy Schubert    set.
409*7f2fe78bSCy Schubert
410*7f2fe78bSCy Schubert    **name**
411*7f2fe78bSCy Schubert        principal name
412*7f2fe78bSCy Schubert    **flag**
413*7f2fe78bSCy Schubert        flag name
414*7f2fe78bSCy Schubert    **value**
415*7f2fe78bSCy Schubert        boolean value (0 for clear, or 1 for set)
416*7f2fe78bSCy Schubert
417*7f2fe78bSCy Schubert**princ_lockout**
418*7f2fe78bSCy Schubert    state information used for tracking repeated password failures
419*7f2fe78bSCy Schubert
420*7f2fe78bSCy Schubert    **name**
421*7f2fe78bSCy Schubert        principal name
422*7f2fe78bSCy Schubert    **last_success**
423*7f2fe78bSCy Schubert        time stamp of most recent successful authentication
424*7f2fe78bSCy Schubert    **last_failed**
425*7f2fe78bSCy Schubert        time stamp of most recent failed authentication
426*7f2fe78bSCy Schubert    **fail_count**
427*7f2fe78bSCy Schubert        count of failed attempts
428*7f2fe78bSCy Schubert
429*7f2fe78bSCy Schubert**princ_meta**
430*7f2fe78bSCy Schubert    principal metadata
431*7f2fe78bSCy Schubert
432*7f2fe78bSCy Schubert    **name**
433*7f2fe78bSCy Schubert        principal name
434*7f2fe78bSCy Schubert    **modby**
435*7f2fe78bSCy Schubert        name of last principal to modify this principal
436*7f2fe78bSCy Schubert    **modtime**
437*7f2fe78bSCy Schubert        timestamp of last modification
438*7f2fe78bSCy Schubert    **lastpwd**
439*7f2fe78bSCy Schubert        timestamp of last password change
440*7f2fe78bSCy Schubert    **policy**
441*7f2fe78bSCy Schubert        policy object name
442*7f2fe78bSCy Schubert    **mkvno**
443*7f2fe78bSCy Schubert        key version number of the master key that encrypts this
444*7f2fe78bSCy Schubert        principal's key data
445*7f2fe78bSCy Schubert    **hist_kvno**
446*7f2fe78bSCy Schubert        key version number of the history key that encrypts the key
447*7f2fe78bSCy Schubert        history data for this principal
448*7f2fe78bSCy Schubert
449*7f2fe78bSCy Schubert**princ_stringattrs**
450*7f2fe78bSCy Schubert    string attributes (key/value pairs)
451*7f2fe78bSCy Schubert
452*7f2fe78bSCy Schubert    **name**
453*7f2fe78bSCy Schubert        principal name
454*7f2fe78bSCy Schubert    **key**
455*7f2fe78bSCy Schubert        attribute name
456*7f2fe78bSCy Schubert    **value**
457*7f2fe78bSCy Schubert        attribute value
458*7f2fe78bSCy Schubert
459*7f2fe78bSCy Schubert**princ_tktpolicy**
460*7f2fe78bSCy Schubert    per-principal ticket policy data, including maximum ticket
461*7f2fe78bSCy Schubert    lifetimes
462*7f2fe78bSCy Schubert
463*7f2fe78bSCy Schubert    **name**
464*7f2fe78bSCy Schubert        principal name
465*7f2fe78bSCy Schubert    **expiration**
466*7f2fe78bSCy Schubert        principal expiration date
467*7f2fe78bSCy Schubert    **pw_expiration**
468*7f2fe78bSCy Schubert        password expiration date
469*7f2fe78bSCy Schubert    **max_life**
470*7f2fe78bSCy Schubert        maximum ticket lifetime
471*7f2fe78bSCy Schubert    **max_renew_life**
472*7f2fe78bSCy Schubert        maximum renewable ticket lifetime
473*7f2fe78bSCy Schubert
474*7f2fe78bSCy SchubertExamples::
475*7f2fe78bSCy Schubert
476*7f2fe78bSCy Schubert    $ kdb5_util tabdump -o keyinfo.txt keyinfo
477*7f2fe78bSCy Schubert    $ cat keyinfo.txt
478*7f2fe78bSCy Schubert    name	keyindex	kvno	enctype	salttype	salt
479*7f2fe78bSCy Schubert    K/M@EXAMPLE.COM	0	1	aes256-cts-hmac-sha384-192	normal	-1
480*7f2fe78bSCy Schubert    foo@EXAMPLE.COM	0	1	aes128-cts-hmac-sha1-96	normal	-1
481*7f2fe78bSCy Schubert    bar@EXAMPLE.COM	0	1	aes128-cts-hmac-sha1-96	normal	-1
482*7f2fe78bSCy Schubert    $ sqlite3
483*7f2fe78bSCy Schubert    sqlite> .mode tabs
484*7f2fe78bSCy Schubert    sqlite> .import keyinfo.txt keyinfo
485*7f2fe78bSCy Schubert    sqlite> select * from keyinfo where enctype like 'aes256-%';
486*7f2fe78bSCy Schubert    K/M@EXAMPLE.COM	1	1	aes256-cts-hmac-sha384-192	normal	-1
487*7f2fe78bSCy Schubert    sqlite> .quit
488*7f2fe78bSCy Schubert    $ awk -F'\t' '$4 ~ /aes256-/ { print }' keyinfo.txt
489*7f2fe78bSCy Schubert    K/M@EXAMPLE.COM	1	1	aes256-cts-hmac-sha384-192	normal	-1
490*7f2fe78bSCy Schubert
491*7f2fe78bSCy Schubert
492*7f2fe78bSCy SchubertENVIRONMENT
493*7f2fe78bSCy Schubert-----------
494*7f2fe78bSCy Schubert
495*7f2fe78bSCy SchubertSee :ref:`kerberos(7)` for a description of Kerberos environment
496*7f2fe78bSCy Schubertvariables.
497*7f2fe78bSCy Schubert
498*7f2fe78bSCy Schubert
499*7f2fe78bSCy SchubertSEE ALSO
500*7f2fe78bSCy Schubert--------
501*7f2fe78bSCy Schubert
502*7f2fe78bSCy Schubert:ref:`kadmin(1)`, :ref:`kerberos(7)`
503