KDB5_LDAP_UTIL(8)

πŸ’– KDB5_LDAP_UTIL(8) β€” the kdb5_ldap_util glow-up πŸ’–

okay bestie, so this is kdb5_ldap_util, the Kerberos configuration utility from the MIT Kerberos manual, section 8. she's an admin tool, she's iconic, and she's about to manage your realms, Kerberos services and ticket policies like the queen she is. πŸ‘‘


✨ SYNOPSIS ✨

kdb5_ldap_util [-D user_dn [-w passwd]] [-H ldapuri] command
[command_options]

🌸 DESCRIPTION 🌸

so like, kdb5_ldap_util is the girl who lets an administrator manage realms, Kerberos services and ticket policies. that's the whole job. she does it. slay. πŸ’…


πŸŽ€ COMMAND-LINE OPTIONS πŸŽ€

these are the global girlies, they go before the command:

  • -r realm β€” says which realm we're operating on, like picking your main character. ✨
  • -D user_dn β€” the Distinguished Name (DN) of the user who has sufficient rights to do the operation on the LDAP server. if you don't have the rights bestie, you're not getting in. 🫢
  • -w passwd β€” the password of user_dn. not recommended, fr fr, don't do it. πŸ™ˆ
  • -H ldapuri β€” the URI of the LDAP server. where we're connecting. that's the address. πŸ’Œ

by default, kdb5_ldap_util operates on the default realm (as specified in krb5.conf) and connects + authenticates to the LDAP server the exact same way kadmind(8) would, given the parameters in [dbdefaults] in kdc.conf. no cap.


πŸ‘‘ COMMANDS πŸ‘‘

🌈 create

create [-subtrees subtree_dn_list] [-sscope search_scope]
[-containerref container_reference_dn] [-k mkeytype] [-kv mkeyVNO]
[-M mkeyname] [-m|-P password|-sf stashfilename] [-s] [-maxtktlife
max_ticket_life] [-maxrenewlife max_renewable_ticket_life]
[ticket_flags]

creates the realm in the directory. the options, bestie:

  • -subtrees subtree_dn_list β€” the list of subtrees that contain the principals of a realm. it holds the DNs of the subtree objects, separated by colon (:). ⭐
  • -sscope search_scope β€” the scope for searching the principals under the subtree. possible values are 1 or one (one level), and 2 or sub (subtrees). pick your vibe.
  • -containerref container_reference_dn β€” the DN of the container object where the principals of a realm will be created. if the container reference isn't configured for a realm, the principals get created in the realm container. πŸŽ€
  • -k mkeytype β€” the key type of the master key in the database. the default comes from the master_key_type variable in kdc.conf.
  • -kv mkeyVNO β€” the version number of the master key in the database; default is 1. note that 0 is not allowed, like at all, don't try it. πŸ’€
  • -M mkeyname β€” the principal name for the master key in the database. if you don't specify it, the name is determined by the master_key_name variable in kdc.conf.
  • -m β€” says the master database password should be read from the TTY instead of being fetched from a file on disk. πŸ™Œ
  • -P password β€” the master database password. not recommended. 🚫
  • -sf stashfilename β€” the stash file of the master database password.
  • -s β€” says the stash file is to be created. ✨
  • -maxtktlife max_ticket_life β€” (a getdate time string) the maximum ticket life for principals in this realm. ⏰
  • -maxrenewlife max_renewable_ticket_life β€” (a getdate time string) the maximum renewable life of tickets for principals in this realm. πŸ”
  • ticket_flags β€” the global ticket flags for the realm. allowable flags are documented in the description of the add_principal command in kadmin.

example, because we love a demo:

kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
    -r ATHENA.MIT.EDU create -subtrees o=org -sscope SUB
Password for "cn=admin,o=org":
Initializing database for realm 'ATHENA.MIT.EDU'
You will be prompted for the database Master Password.
It is important that you NOT FORGET this password.
Enter KDC database master key:
Re-enter KDC database master key to verify:

πŸ¦‹ modify

modify [-subtrees subtree_dn_list] [-sscope search_scope]
[-containerref container_reference_dn] [-maxtktlife max_ticket_life]
[-maxrenewlife max_renewable_ticket_life] [ticket_flags]

modifies the attributes of a realm. glow-up time. options:

  • -subtrees subtree_dn_list β€” the list of subtrees containing the principals of a realm. it holds the DNs of the subtree objects separated by colon (:). this list replaces the existing list. ⚠️
  • -sscope search_scope β€” the scope for searching the principals under the subtrees. possible values are 1 or one (one level), 2 or sub (subtrees).
  • -containerref container_reference_dn β€” the DN of the container object in which the principals of a realm will be created.
  • -maxtktlife max_ticket_life β€” (a getdate time string) maximum ticket life for principals in this realm. ⏰
  • -maxrenewlife max_renewable_ticket_life β€” (a getdate time string) maximum renewable life of tickets for principals in this realm. πŸ”
  • ticket_flags β€” global ticket flags for the realm. allowable flags are documented in the description of the add_principal command in kadmin.

example:

shell% kdb5_ldap_util -r ATHENA.MIT.EDU -D cn=admin,o=org -H
    ldaps://ldap-server1.mit.edu modify +requires_preauth
Password for "cn=admin,o=org":
shell%

🌟 view

view

displays the attributes of a realm. no options, just vibes. πŸ‘€

example:

kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
    -r ATHENA.MIT.EDU view
Password for "cn=admin,o=org":
Realm Name: ATHENA.MIT.EDU
Subtree: ou=users,o=org
Subtree: ou=servers,o=org
SearchScope: ONE
Maximum ticket life: 0 days 01:00:00
Maximum renewable life: 0 days 10:00:00
Ticket flags: DISALLOW_FORWARDABLE REQUIRES_PWCHANGE

πŸ’€ destroy

destroy [-f]

destroys an existing realm. yes, destroys. gone. options:

  • -f β€” if specified, will not prompt the user for confirmation. (no take-backs, bestie 😭)

example:

shell% kdb5_ldap_util -r ATHENA.MIT.EDU -D cn=admin,o=org -H
    ldaps://ldap-server1.mit.edu destroy
Password for "cn=admin,o=org":
Deleting KDC database of 'ATHENA.MIT.EDU', are you sure?
(type 'yes' to confirm)? yes
OK, deleting database of 'ATHENA.MIT.EDU'...
shell%

πŸ“ list

list

lists the names of realms under the container. that's it, that's the command. ✨

example:

shell% kdb5_ldap_util -D cn=admin,o=org -H
    ldaps://ldap-server1.mit.edu list
Password for "cn=admin,o=org":
ATHENA.MIT.EDU
OPENLDAP.MIT.EDU
MEDIA-LAB.MIT.EDU
shell%

🧚 stashsrvpw

stashsrvpw [-f filename] name

lets an administrator store the password for a service object in a file, so that the KDC and the Administration server can use it to authenticate to the LDAP server. very useful, very demure. options:

  • -f filename β€” the complete path of the service password file. by default, /usr/local/var/service_passwd is used. πŸ“
  • name β€” the name of the object whose password is to be stored. if krb5kdc or kadmind are configured for simple binding, this should be the distinguished name it will use, as given by the ldap_kdc_dn or ldap_kadmind_dn variable in kdc.conf. if the KDC or kadmind is configured for SASL binding, this should be the authentication name it will use, as given by the ldap_kdc_sasl_authcid or ldap_kadmind_sasl_authcid variable. 🫢

example:

kdb5_ldap_util stashsrvpw -f /home/andrew/conf_keyfile
    cn=service-kdc,o=org
Password for "cn=service-kdc,o=org":
Re-enter password for "cn=service-kdc,o=org":

πŸŽ€ create_policy

create_policy [-maxtktlife max_ticket_life] [-maxrenewlife
max_renewable_ticket_life] [ticket_flags] policy_name

creates a ticket policy in the directory. options:

  • -maxtktlife max_ticket_life β€” (a getdate time string) maximum ticket life for principals. ⏰
  • -maxrenewlife max_renewable_ticket_life β€” (a getdate time string) maximum renewable life of tickets for principals. πŸ”
  • ticket_flags β€” the ticket flags. if this option isn't specified, then by default no restriction will be set by the policy. allowable flags are documented in the description of the add_principal command in kadmin.
  • policy_name β€” the name of the ticket policy. πŸ’–

example:

kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
    -r ATHENA.MIT.EDU create_policy -maxtktlife "1 day"
    -maxrenewlife "1 week" -allow_postdated +needchange
    -allow_forwardable tktpolicy
Password for "cn=admin,o=org":

πŸ’… modify_policy

modify_policy [-maxtktlife max_ticket_life] [-maxrenewlife
max_renewable_ticket_life] [ticket_flags] policy_name

modifies the attributes of a ticket policy. the options are the same as for create_policy. ✨

example:

kdb5_ldap_util -D cn=admin,o=org -H
    ldaps://ldap-server1.mit.edu -r ATHENA.MIT.EDU modify_policy
    -maxtktlife "60 minutes" -maxrenewlife "10 hours"
    +allow_postdated -requires_preauth tktpolicy
Password for "cn=admin,o=org":

🌸 view_policy

view_policy policy_name

displays the attributes of the named ticket policy. the tea. β˜•

example:

kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
    -r ATHENA.MIT.EDU view_policy tktpolicy
Password for "cn=admin,o=org":
Ticket policy: tktpolicy
Maximum ticket life: 0 days 01:00:00
Maximum renewable life: 0 days 10:00:00
Ticket flags: DISALLOW_FORWARDABLE REQUIRES_PWCHANGE

πŸ”₯ destroy_policy

destroy_policy [-force] policy_name

destroys an existing ticket policy. options:

  • -force β€” forces the deletion of the policy object. if it's not specified, the user gets prompted for confirmation before deleting the policy. ⚠️
  • policy_name β€” the name of the ticket policy.

example:

kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
    -r ATHENA.MIT.EDU destroy_policy tktpolicy
Password for "cn=admin,o=org":
This will delete the policy object 'tktpolicy', are you sure?
(type 'yes' to confirm)? yes
** policy object 'tktpolicy' deleted.

⭐ list_policy

list_policy

lists ticket policies. short, sweet, iconic. πŸ‘‘

example:

kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu
    -r ATHENA.MIT.EDU list_policy
Password for "cn=admin,o=org":
tktpolicy
tmppolicy
userpolicy

🌈 ENVIRONMENT 🌈

see kerberos for a description of the Kerberos environment variables. that's the whole section, bestie, go read it. πŸ¦‹


πŸ’œ SEE ALSO πŸ’œ

kadmin, kerberos


✍️ AUTHOR ✍️

MIT. that's the author. MIT did that. πŸ’…


1985-2026, MIT


okay so that's the whole page!! you now know every single flag, every example, every default, every DN, and every warning. i'm so proud of you, fr fr. go configure a realm. 🫢✨

this whole thing is from MIT Kerberos, version 1.22.2, and yeah, she lives in the KDB5_LDAP_UTIL(8) section of the manual. mwah. πŸ˜˜πŸŽ€

πŸ“¦ where this page comes from