1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
|
'\" te
.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH KDB5_UTIL 1M "April 9, 2016"
.SH NAME
kdb5_util \- Kerberos Database maintenance utility
.SH SYNOPSIS
.LP
.nf
\fB/usr/sbin/kdb5_util\fR [\fB-d\fR \fIdbname\fR] [\fB-f\fR \fIstashfile_name\fR]
[\fB-k\fR \fImkeytype\fR] [\fB-m\fR ] [\fB-M\fR \fImkeyname\fR] [\fB-P\fR \fIpassword\fR] [\fB-r\fR \fIrealm\fR]
[\fB-x\fR \fIdb_args\fR]... \fIcmd\fR
.fi
.SH DESCRIPTION
.LP
The \fBkdb5_util\fR utility enables you to create, dump, load, and destroy the
Kerberos V5 database. You can also use \fBkdb5_util\fR to create a stash file
containing the Kerberos database master key.
.SH OPTIONS
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-d\fR \fIdbname\fR\fR
.ad
.sp .6
.RS 4n
Specify the database name. \fB\&.db\fR is appended to whatever name is
specified. You can specify an absolute path. If you do not specify the \fB-d\fR
option, the default database name is \fB/var/krb5/principal\fR.
.RE
.sp
.ne 2
.na
\fB\fB-f\fR \fIstashfile_name\fR\fR
.ad
.sp .6
.RS 4n
Specify the stash file name. You can specify an absolute path.
.RE
.sp
.ne 2
.na
\fB\fB-k\fR \fImkeytype\fR\fR
.ad
.sp .6
.RS 4n
Specify the master key type. Valid values are \fBdes3-cbc-sha1\fR,
\fBdes-cbc-crc\fR, \fBdes-cbc-md5\fR, \fBdes-cbc-raw\fR,
\fBarcfour-hmac-md5\fR, \fBarcfour-hmac-md5-exp\fR,
\fBaes128-cts-hmac-sha1-96\fR, and \fBaes256-cts-hmac-sha1-96\fR.
.RE
.sp
.ne 2
.na
\fB\fB-m\fR\fR
.ad
.sp .6
.RS 4n
Enter the master key manually.
.RE
.sp
.ne 2
.na
\fB\fB-M\fR \fImkeyname\fR\fR
.ad
.sp .6
.RS 4n
Specify the master key name.
.RE
.sp
.ne 2
.na
\fB\fB-P\fR \fIpassword\fR\fR
.ad
.sp .6
.RS 4n
Use the specified \fIpassword\fR instead of the stash file.
.RE
.sp
.ne 2
.na
\fB\fB-r\fR \fIrealm\fR\fR
.ad
.sp .6
.RS 4n
Use \fIrealm\fR as the default database realm.
.RE
.sp
.ne 2
.na
\fB\fB-x\fR \fIdb_args\fR\fR
.ad
.sp .6
.RS 4n
Pass database-specific arguments to \fBkadmin\fR. Supported arguments are for
LDAP and the \fBBerkeley-db2\fR plug-in. These arguments are:
.sp
.ne 2
.na
\fB\fBbinddn\fR=\fIbinddn\fR\fR
.ad
.sp .6
.RS 4n
LDAP simple bind DN for authorization on the directory server. Overrides the
\fBldap_kadmind_dn\fR parameter setting in \fBkrb5.conf\fR(4).
.RE
.sp
.ne 2
.na
\fB\fBbindpwd\fR=\fIbindpwd\fR\fR
.ad
.sp .6
.RS 4n
Bind password.
.RE
.sp
.ne 2
.na
\fB\fBdbname\fR=\fIname\fR\fR
.ad
.sp .6
.RS 4n
For the \fBBerkeley-db2\fR plug-in, specifies a name for the Kerberos database.
.RE
.sp
.ne 2
.na
\fB\fBnconns\fR=\fInum\fR\fR
.ad
.sp .6
.RS 4n
Maximum number of server connections.
.RE
.sp
.ne 2
.na
\fB\fBport\fR=\fInum\fR\fR
.ad
.sp .6
.RS 4n
Directory server connection port.
.RE
.RE
.SH OPERANDS
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIcmd\fR\fR
.ad
.sp .6
.RS 4n
Specifies whether to create, destroy, dump, or load the database, or to create
a stash file.
.sp
You can specify the following commands:
.sp
.ne 2
.na
\fB\fBcreate\fR \fB-s\fR\fR
.ad
.sp .6
.RS 4n
Creates the database specified by the \fB-d\fR option. You will be prompted for
the database master password. If you specify \fB-s\fR, a stash file is created
as specified by the \fB-f\fR option. If you did not specify \fB-f\fR, the
default stash file name is \fB/var/krb5/.k5.realm\fR. If you use the \fB-f\fR,
\fB-k\fR, or \fB-M\fR options when you create a database, then you must use the
same options when modifying or destroying the database.
.RE
.sp
.ne 2
.na
\fB\fBdestroy\fR\fR
.ad
.sp .6
.RS 4n
Destroys the database specified by the \fB-d\fR option.
.RE
.sp
.ne 2
.na
\fB\fBstash\fR\fR
.ad
.sp .6
.RS 4n
Creates a stash file. If \fB-f\fR was not specified, the default stash file
name is \fB/var/krb5/.k5.realm\fR. You will be prompted for the master database
password. This command is useful when you want to generate the stash file from
the password.
.RE
.sp
.ne 2
.na
\fB\fBdump\fR [\fB-old\fR] [\fB-b6\fR] [\fB-b7\fR] [\fB-ov\fR] [\fB-verbose\fR]
[\fB-mkey_convert\fR] [\fB-new_mkey_file\fR \fImkey_file\fR] [\fB-rev\fR]
[\fB-recurse\fR] [\fIfilename\fR [\fIprincipals\fR...]]\fR
.ad
.sp .6
.RS 4n
Dumps the current Kerberos and KADM5 database into an ASCII file. By default,
the database is dumped in current format, "\fBkdb5_util load_dumpversion 5\fR".
If \fIfilename\fR is not specified or is the string "-", the dump is sent to
standard output. Options are as follows:
.sp
.ne 2
.na
\fB\fB-old\fR\fR
.ad
.sp .6
.RS 4n
Causes the dump to be in the Kerberos 5 Beta 5 and earlier dump format
("\fBkdb5_edit load_dump version 2.0\fR").
.RE
.sp
.ne 2
.na
\fB\fB-b6\fR\fR
.ad
.sp .6
.RS 4n
Causes the dump to be in the Kerberos 5 Beta 6 format ("\fBkdb5_edit load_dump
version 3.0\fR").
.RE
.sp
.ne 2
.na
\fB\fB-b7\fR\fR
.ad
.sp .6
.RS 4n
Causes the dump to be in the Kerberos 5 Beta 7 format ("\fBkdb5_util load_dump
version 4\fR"). This was the dump format produced on releases prior to 1.2.2.
.RE
.sp
.ne 2
.na
\fB\fB-ov\fR\fR
.ad
.sp .6
.RS 4n
Causes the dump to be in \fBovsec_adm_export\fR format.
.RE
.sp
.ne 2
.na
\fB\fB-verbose\fR\fR
.ad
.sp .6
.RS 4n
Causes the name of each principal and policy to be displayed as it is dumped.
.RE
.sp
.ne 2
.na
\fB\fB-mkey_convert\fR\fR
.ad
.sp .6
.RS 4n
Prompts for a new master key. This new master key will be used to re-encrypt
the key data in the dumpfile. The key data in the database will not be changed.
.RE
.sp
.ne 2
.na
\fB\fB-new_mkey_file\fR \fImkey_file\fR\fR
.ad
.sp .6
.RS 4n
The filename of a stash file. The master key in this stash file will be used to
re-encrypt the key data in the dumpfile. The key data in the database will not
be changed.
.RE
.sp
.ne 2
.na
\fB\fB-rev\fR\fR
.ad
.sp .6
.RS 4n
Dumps in reverse order. This might recover principals that do not dump
normally, in cases where database corruption has occurred.
.RE
.sp
.ne 2
.na
\fB\fB-recurse\fR\fR
.ad
.sp .6
.RS 4n
Causes the dump to walk the database recursively (\fBbtree\fR only). This might
recover principals that do not dump normally, in cases where database
corruption has occurred. In cases of such corruption, this option will probably
retrieve more principals than will the \fB-rev\fR option.
.RE
.RE
.sp
.ne 2
.na
\fB\fBload\fR [\fB-old\fR] [\fB-b6\fR] [\fB-b7\fR] [\fB-ov\fR] [\fB-hash\fR]
[\fB-verbose\fR] [\fB-update\fR] \fIfilename\fR \fIdbname\fR
[\fIadmin_dbname\fR]\fR
.ad
.sp .6
.RS 4n
Loads a database dump from \fIfilename\fR into \fIdbname\fR. Unless the
\fB-old\fR or \fB-b6\fR option is specified, the format of the dump file is
detected automatically and handled appropriately. Unless the \fB-update\fR
option is specified, \fBload\fR creates a new database containing only the
principals in the dump file, overwriting the contents of any existing database.
The \fB-old\fR option requires the database to be in the Kerberos 5 Beta 5 or
earlier format ("\fBkdb5_edit load_dump version 2.0\fR").
.sp
.ne 2
.na
\fB\fB-b6\fR\fR
.ad
.sp .6
.RS 4n
Requires the database to be in the Kerberos 5 Beta 6 format ("\fBkdb5_edit
load_dump version 3.0\fR").
.RE
.sp
.ne 2
.na
\fB\fB-b7\fR\fR
.ad
.sp .6
.RS 4n
Requires the database to be in the Kerberos 5 Beta 7 format ("\fBkdb5_util
load_dump version 4\fR").
.RE
.sp
.ne 2
.na
\fB\fB-ov\fR\fR
.ad
.sp .6
.RS 4n
Requires the database to be in \fBovsec_adm_import\fR format. Must be used with
the \fB-update\fR option.
.RE
.sp
.ne 2
.na
\fB\fB-hash\fR\fR
.ad
.sp .6
.RS 4n
Requires the database to be stored as a hash. If this option is not specified,
the database will be stored as a \fBbtree\fR. This option is not recommended,
as databases stored in hash format are known to corrupt data and lose
principals.
.RE
.sp
.ne 2
.na
\fB\fB-verbose\fR\fR
.ad
.sp .6
.RS 4n
Causes the name of each principal and policy to be displayed as it is dumped.
.RE
.sp
.ne 2
.na
\fB\fB-update\fR\fR
.ad
.sp .6
.RS 4n
Records from the dump file are added to or updated in the existing database.
Otherwise, a new database is created containing only what is in the dump file
and the old one is destroyed upon successful completion.
.RE
.sp
.ne 2
.na
\fB\fIfilename\fR\fR
.ad
.sp .6
.RS 4n
Required argument that specifies a path to a file containing database dump.
.RE
.sp
.ne 2
.na
\fB\fIdbname\fR\fR
.ad
.sp .6
.RS 4n
Required argument that overrides the value specified on the command line or
overrides the default.
.RE
.sp
.ne 2
.na
\fB\fIadmin_dbname\fR\fR
.ad
.sp .6
.RS 4n
Optional argument that is derived from \fIdbname\fR if not specified.
.RE
.RE
.RE
.SH EXAMPLES
.LP
\fBExample 1 \fRCreating File that Contains Information about Two Principals
.sp
.LP
The following example creates a file named \fBslavedata\fR that contains the
information about two principals, \fBjdb@ACME.COM\fR and \fBpak@ACME.COM\fR.
.sp
.in +2
.nf
# /usr/krb5/bin/kdb5_util dump -verbose slavedata
jdb@ACME.COM pak@ACME.COM
.fi
.in -2
.sp
.SH FILES
.ne 2
.na
\fB\fB/var/krb5/principal\fR\fR
.ad
.sp .6
.RS 4n
Kerberos principal database.
.RE
.sp
.ne 2
.na
\fB\fB/var/krb5/principal.kadm5\fR\fR
.ad
.sp .6
.RS 4n
Kerberos administrative database. Contains policy information.
.RE
.sp
.ne 2
.na
\fB\fB/var/krb5/principal.kadm5.lock\fR\fR
.ad
.sp .6
.RS 4n
Lock file for the Kerberos administrative database. This file works backwards
from most other lock files (that is, \fBkadmin\fR exits with an error if this
file does not exist).
.RE
.sp
.ne 2
.na
\fB\fB/var/krb5/principal.ulog\fR\fR
.ad
.sp .6
.RS 4n
The update log file for incremental propagation.
.RE
.SH ATTRIBUTES
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Evolving
.TE
.SH SEE ALSO
.LP
\fBkpasswd\fR(1), \fBkadmin\fR(1M), \fBkadmind\fR(1M),
\fBkadmin.local\fR(1M), \fBkdb5_ldap_util\fR(1M), \fBkproplog\fR(1M),
\fBkadm5.acl\fR(4), \fBkdc.conf\fR(4), \fBattributes\fR(5), \fBkerberos\fR(5)
|