cbf313f55a6638b265e7e1a5a4ad66f8ba6f4a51
[platform/upstream/krb5.git] / doc / admin / admin_commands / kdb5_ldap_util.rst
1 .. _kdb5_ldap_util(8):
2
3 kdb5_ldap_util
4 ===============
5
6 SYNOPSIS
7 --------
8
9 .. _kdb5_ldap_util_synopsis:
10
11 **kdb5_ldap_util**
12 [**-D** *user_dn* [**-w** *passwd*]]
13 [**-H** *ldapuri*]
14 **command**
15 [*command_options*]
16
17 .. _kdb5_ldap_util_synopsis_end:
18
19
20 DESCRIPTION
21 -----------
22
23 kdb5_ldap_util allows an administrator to manage realms, Kerberos
24 services and ticket policies.
25
26
27 COMMAND-LINE OPTIONS
28 --------------------
29
30 .. _kdb5_ldap_util_options:
31
32 **-D** *user_dn*
33     Specifies the Distinguished Name (DN) of the user who has
34     sufficient rights to perform the operation on the LDAP server.
35
36 **-w** *passwd*
37     Specifies the password of *user_dn*.  This option is not
38     recommended.
39
40 **-H** *ldapuri*
41     Specifies the URI of the LDAP server.  It is recommended to use
42     ``ldapi://`` or ``ldaps://`` to connect to the LDAP server.
43
44 .. _kdb5_ldap_util_options_end:
45
46
47 COMMANDS
48 --------
49
50 create
51 ~~~~~~
52
53 .. _kdb5_ldap_util_create:
54
55     **create**
56     [**-subtrees** *subtree_dn_list*]
57     [**-sscope** *search_scope*]
58     [**-containerref** *container_reference_dn*]
59     [**-k** *mkeytype*]
60     [**-kv** *mkeyVNO*]
61     [**-m|-P** *password*\|\ **-sf** *stashfilename*]
62     [**-s**]
63     [**-r** *realm*]
64     [**-maxtktlife** *max_ticket_life*]
65     [**-maxrenewlife** *max_renewable_ticket_life*]
66     [*ticket_flags*]
67
68 Creates realm in directory. Options:
69
70 **-subtrees** *subtree_dn_list*
71     Specifies the list of subtrees containing the principals of a
72     realm.  The list contains the DNs of the subtree objects separated
73     by colon (``:``).
74
75 **-sscope** *search_scope*
76     Specifies the scope for searching the principals under the
77     subtree.  The possible values are 1 or one (one level), 2 or sub
78     (subtrees).
79
80 **-containerref** *container_reference_dn*
81     Specifies the DN of the container object in which the principals
82     of a realm will be created.  If the container reference is not
83     configured for a realm, the principals will be created in the
84     realm container.
85
86 **-k** *mkeytype*
87     Specifies the key type of the master key in the database.  The
88     default is given by the **master_key_type** variable in
89     :ref:`kdc.conf(5)`.
90
91 **-kv** *mkeyVNO*
92     Specifies the version number of the master key in the database;
93     the default is 1.  Note that 0 is not allowed.
94
95 **-m**
96     Specifies that the master database password should be read from
97     the TTY rather than fetched from a file on the disk.
98
99 **-P** *password*
100     Specifies the master database password. This option is not
101     recommended.
102
103 **-r** *realm*
104     Specifies the Kerberos realm of the database.
105
106 **-sf** *stashfilename*
107     Specifies the stash file of the master database password.
108
109 **-s**
110     Specifies that the stash file is to be created.
111
112 **-maxtktlife** *max_ticket_life*
113     (:ref:`getdate` string) Specifies maximum ticket life for
114     principals in this realm.
115
116 **-maxrenewlife** *max_renewable_ticket_life*
117     (:ref:`getdate` string) Specifies maximum renewable life of
118     tickets for principals in this realm.
119
120 *ticket_flags*
121     Specifies global ticket flags for the realm.  Allowable flags are
122     documented in the description of the **add_principal** command in
123     :ref:`kadmin(1)`.
124
125 Example::
126
127     kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
128         create -subtrees o=org -sscope SUB -r ATHENA.MIT.EDU
129     Password for "cn=admin,o=org":
130     Initializing database for realm 'ATHENA.MIT.EDU'
131     You will be prompted for the database Master Password.
132     It is important that you NOT FORGET this password.
133     Enter KDC database master key:
134     Re-enter KDC database master key to verify:
135
136 .. _kdb5_ldap_util_create_end:
137
138 modify
139 ~~~~~~
140
141 .. _kdb5_ldap_util_modify:
142
143     **modify**
144     [**-subtrees** *subtree_dn_list*]
145     [**-sscope** *search_scope*]
146     [**-containerref** *container_reference_dn*]
147     [**-r** *realm*]
148     [**-maxtktlife** *max_ticket_life*]
149     [**-maxrenewlife** *max_renewable_ticket_life*]
150     [*ticket_flags*]
151
152 Modifies the attributes of a realm.  Options:
153
154 **-subtrees** *subtree_dn_list*
155     Specifies the list of subtrees containing the principals of a
156     realm.  The list contains the DNs of the subtree objects separated
157     by colon (``:``).  This list replaces the existing list.
158
159 **-sscope** *search_scope*
160     Specifies the scope for searching the principals under the
161     subtrees.  The possible values are 1 or one (one level), 2 or sub
162     (subtrees).
163
164 **-containerref** *container_reference_dn* Specifies the DN of the
165     container object in which the principals of a realm will be
166     created.
167
168 **-r** *realm*
169     Specifies the Kerberos realm of the database.
170
171 **-maxtktlife** *max_ticket_life*
172     (:ref:`getdate` string) Specifies maximum ticket life for
173     principals in this realm.
174
175 **-maxrenewlife** *max_renewable_ticket_life*
176     (:ref:`getdate` string) Specifies maximum renewable life of
177     tickets for principals in this realm.
178
179 *ticket_flags*
180     Specifies global ticket flags for the realm.  Allowable flags are
181     documented in the description of the **add_principal** command in
182     :ref:`kadmin(1)`.
183
184 Example::
185
186     shell% kdb5_ldap_util -D cn=admin,o=org -H
187         ldaps://ldap-server1.mit.edu modify +requires_preauth -r
188         ATHENA.MIT.EDU
189     Password for "cn=admin,o=org":
190     shell%
191
192 .. _kdb5_ldap_util_modify_end:
193
194 view
195 ~~~~
196
197 .. _kdb5_ldap_util_view:
198
199     **view** [**-r** *realm*]
200
201 Displays the attributes of a realm.  Options:
202
203 **-r** *realm*
204     Specifies the Kerberos realm of the database.
205
206 Example::
207
208     kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
209         view -r ATHENA.MIT.EDU
210     Password for "cn=admin,o=org":
211     Realm Name: ATHENA.MIT.EDU
212     Subtree: ou=users,o=org
213     Subtree: ou=servers,o=org
214     SearchScope: ONE
215     Maximum ticket life: 0 days 01:00:00
216     Maximum renewable life: 0 days 10:00:00
217     Ticket flags: DISALLOW_FORWARDABLE REQUIRES_PWCHANGE
218
219 .. _kdb5_ldap_util_view_end:
220
221 destroy
222 ~~~~~~~
223
224 .. _kdb5_ldap_util_destroy:
225
226     **destroy** [**-f**] [**-r** *realm*]
227
228 Destroys an existing realm. Options:
229
230 **-f**
231     If specified, will not prompt the user for confirmation.
232
233 **-r** *realm*
234     Specifies the Kerberos realm of the database.
235
236 Example::
237
238     shell% kdb5_ldap_util -D cn=admin,o=org -H
239         ldaps://ldap-server1.mit.edu destroy -r ATHENA.MIT.EDU
240     Password for "cn=admin,o=org":
241     Deleting KDC database of 'ATHENA.MIT.EDU', are you sure?
242     (type 'yes' to confirm)? yes
243     OK, deleting database of 'ATHENA.MIT.EDU'...
244     shell%
245
246 .. _kdb5_ldap_util_destroy_end:
247
248 list
249 ~~~~
250
251 .. _kdb5_ldap_util_list:
252
253     **list**
254
255 Lists the name of realms.
256
257 Example::
258
259     shell% kdb5_ldap_util -D cn=admin,o=org -H
260         ldaps://ldap-server1.mit.edu list
261     Password for "cn=admin,o=org":
262     ATHENA.MIT.EDU
263     OPENLDAP.MIT.EDU
264     MEDIA-LAB.MIT.EDU
265     shell%
266
267 .. _kdb5_ldap_util_list_end:
268
269 stashsrvpw
270 ~~~~~~~~~~
271
272 .. _kdb5_ldap_util_stashsrvpw:
273
274     **stashsrvpw**
275     [**-f** *filename*]
276     *name*
277
278 Allows an administrator to store the password for service object in a
279 file so that KDC and Administration server can use it to authenticate
280 to the LDAP server.  Options:
281
282 **-f** *filename*
283     Specifies the complete path of the service password file. By
284     default, ``/usr/local/var/service_passwd`` is used.
285
286 *name*
287     Specifies the name of the object whose password is to be stored.
288     If :ref:`krb5kdc(8)` or :ref:`kadmind(8)` are configured for
289     simple binding, this should be the distinguished name it will
290     use as given by the **ldap_kdc_dn** or **ldap_kadmind_dn**
291     variable in :ref:`kdc.conf(5)`.  If the KDC or kadmind is
292     configured for SASL binding, this should be the authentication
293     name it will use as given by the **ldap_kdc_sasl_authcid** or
294     **ldap_kadmind_sasl_authcid** variable.
295
296 Example::
297
298     kdb5_ldap_util stashsrvpw -f /home/andrew/conf_keyfile
299         cn=service-kdc,o=org
300     Password for "cn=service-kdc,o=org":
301     Re-enter password for "cn=service-kdc,o=org":
302
303 .. _kdb5_ldap_util_stashsrvpw_end:
304
305 create_policy
306 ~~~~~~~~~~~~~
307
308 .. _kdb5_ldap_util_create_policy:
309
310     **create_policy**
311     [**-r** *realm*]
312     [**-maxtktlife** *max_ticket_life*]
313     [**-maxrenewlife** *max_renewable_ticket_life*]
314     [*ticket_flags*]
315     *policy_name*
316
317 Creates a ticket policy in the directory.  Options:
318
319 **-r** *realm*
320     Specifies the Kerberos realm of the database.
321
322 **-maxtktlife** *max_ticket_life*
323     (:ref:`getdate` string) Specifies maximum ticket life for
324     principals.
325
326 **-maxrenewlife** *max_renewable_ticket_life*
327     (:ref:`getdate` string) Specifies maximum renewable life of
328     tickets for principals.
329
330 *ticket_flags*
331     Specifies the ticket flags.  If this option is not specified, by
332     default, no restriction will be set by the policy.  Allowable
333     flags are documented in the description of the **add_principal**
334     command in :ref:`kadmin(1)`.
335
336 *policy_name*
337     Specifies the name of the ticket policy.
338
339 Example::
340
341     kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
342         create_policy -r ATHENA.MIT.EDU -maxtktlife "1 day"
343         -maxrenewlife "1 week" -allow_postdated +needchange
344         -allow_forwardable tktpolicy
345     Password for "cn=admin,o=org":
346
347 .. _kdb5_ldap_util_create_policy_end:
348
349 modify_policy
350 ~~~~~~~~~~~~~
351
352 .. _kdb5_ldap_util_modify_policy:
353
354     **modify_policy**
355     [**-r** *realm*]
356     [**-maxtktlife** *max_ticket_life*]
357     [**-maxrenewlife** *max_renewable_ticket_life*]
358     [*ticket_flags*]
359     *policy_name*
360
361 Modifies the attributes of a ticket policy.  Options are same as for
362 **create_policy**.
363
364 Example::
365
366     kdb5_ldap_util -D cn=admin,o=org -H
367         ldaps://ldap-server1.mit.edu modify_policy -r ATHENA.MIT.EDU
368         -maxtktlife "60 minutes" -maxrenewlife "10 hours"
369         +allow_postdated -requires_preauth tktpolicy
370     Password for "cn=admin,o=org":
371
372 .. _kdb5_ldap_util_modify_policy_end:
373
374 view_policy
375 ~~~~~~~~~~~
376
377 .. _kdb5_ldap_util_view_policy:
378
379     **view_policy**
380     [**-r** *realm*]
381     *policy_name*
382
383 Displays the attributes of a ticket policy.  Options:
384
385 *policy_name*
386     Specifies the name of the ticket policy.
387
388 Example::
389
390     kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
391         view_policy -r ATHENA.MIT.EDU tktpolicy
392     Password for "cn=admin,o=org":
393     Ticket policy: tktpolicy
394     Maximum ticket life: 0 days 01:00:00
395     Maximum renewable life: 0 days 10:00:00
396     Ticket flags: DISALLOW_FORWARDABLE REQUIRES_PWCHANGE
397
398 .. _kdb5_ldap_util_view_policy_end:
399
400 destroy_policy
401 ~~~~~~~~~~~~~~
402
403 .. _kdb5_ldap_util_destroy_policy:
404
405     **destroy_policy**
406     [**-r** *realm*]
407     [**-force**]
408     *policy_name*
409
410 Destroys an existing ticket policy.  Options:
411
412 **-r** *realm*
413     Specifies the Kerberos realm of the database.
414
415 **-force**
416     Forces the deletion of the policy object.  If not specified, the
417     user will be prompted for confirmation before deleting the policy.
418
419 *policy_name*
420     Specifies the name of the ticket policy.
421
422 Example::
423
424     kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
425         destroy_policy -r ATHENA.MIT.EDU tktpolicy
426     Password for "cn=admin,o=org":
427     This will delete the policy object 'tktpolicy', are you sure?
428     (type 'yes' to confirm)? yes
429     ** policy object 'tktpolicy' deleted.
430
431 .. _kdb5_ldap_util_destroy_policy_end:
432
433 list_policy
434 ~~~~~~~~~~~
435
436 .. _kdb5_ldap_util_list_policy:
437
438     **list_policy**
439     [**-r** *realm*]
440
441 Lists the ticket policies in realm if specified or in the default
442 realm.  Options:
443
444 **-r** *realm*
445     Specifies the Kerberos realm of the database.
446
447 Example::
448
449     kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
450         list_policy -r ATHENA.MIT.EDU
451     Password for "cn=admin,o=org":
452     tktpolicy
453     tmppolicy
454     userpolicy
455
456 .. _kdb5_ldap_util_list_policy_end:
457
458
459 SEE ALSO
460 --------
461
462 :ref:`kadmin(1)`