KADMIN(1)
π KADMIN(1) β MIT Kerberos, and yes itβs that database admin program
okay so bestie, this is the KADMIN(1) page from MIT Kerberos. Itβs giving βserious admin businessβ but honestly itβs just your girl explaining Kerberos database management so you donβt have to rawdog the manpage alone. π
πΈ NAME πΈ
kadmin β Kerberos V5 database administration program. periodt.
β¨ SYNOPSIS β¨
kadmin [-O|-N] [-r realm] [-p principal] [-q query] [[-c cache_name]|[-k
[-t keytab]]|-n] [-w password] [-s admin_server[:port]] [command
args...]
kadmin.local [-r realm] [-p principal] [-q query] [-d dbname] [-e
enc:salt ...] [-m] [-x db_args] [command args...]
π DESCRIPTION π
kadmin and kadmin.local are command-line interfaces to the Kerberos V5 administration system. They provide nearly identical functionalities; the difference is that kadmin.local directly accesses the KDC database, while kadmin performs operations using kadmind. Except as explicitly noted otherwise, this man page will use βkadminβ to refer to both versions. kadmin provides for the maintenance of Kerberos principals, password policies, and service key tables (keytabs).
The remote kadmin client uses Kerberos to authenticate to kadmind using the service principal kadmin/admin or kadmin/ADMINHOST (where ADMINHOST is the fully-qualified hostname of the admin server). If the credentials cache contains a ticket for one of these principals, and the -c credentials_cache option is specified, that ticket is used to authenticate to kadmind. Otherwise, the -p and -k options are used to specify the client Kerberos principal name used to authenticate. Once kadmin has determined the principal name, it requests a service ticket from the KDC, and uses that service ticket to authenticate to kadmind.
Since kadmin.local directly accesses the KDC database, it usually must be run directly on the primary KDC with sufficient permissions to read the KDC database. If the KDC database uses the LDAP database module, kadmin.local can be run on any host which can access the LDAP server.
π OPTIONS π
-r realmβ Use realm as the default database realm.-p principalβ Use principal to authenticate. Otherwise,kadminwill append/adminto the primary principal name of the default ccache, the value of theUSERenvironment variable, or the username as obtained withgetpwuid, in order of preference.-kβ Use a keytab to decrypt the KDC response instead of prompting for a password. In this case, the default principal will behost/hostname. If there is no keytab specified with the-toption, then the default keytab will be used.-t keytabβ Use keytab to decrypt the KDC response. This can only be used with the-koption.-nβ Requests anonymous processing. Two types of anonymous principals are supported. For fully anonymous Kerberos, configure PKINIT on the KDC and configurepkinit_anchorsin the clientβskrb5.conf. Then use the-noption with a principal of the form@REALM(an empty principal name followed by the at-sign and a realm name). If permitted by the KDC, an anonymous ticket will be returned. A second form of anonymous tickets is supported; these realm-exposed tickets hide the identity of the client but not the clientβs realm. For this mode, usekinit -nwith a normal principal name. If supported by the KDC, the principal (but not realm) will be replaced by the anonymous principal. As of release 1.8, the MIT Kerberos KDC only supports fully anonymous operation.-c credentials_cacheβ Use credentials_cache as the credentials cache. The cache should contain a service ticket for thekadmin/adminorkadmin/ADMINHOST(whereADMINHOSTis the fully-qualified hostname of the admin server) service; it can be acquired with thekinitprogram. If this option is not specified,kadminrequests a new service ticket from the KDC, and stores it in its own temporary ccache.-w passwordβ Use password instead of prompting for one. Use this option with care, as it may expose the password to other users on the system via the process list.-q queryβ Perform the specified query and then exit.-d dbnameβ Specifies the name of the KDC database. This option does not apply to the LDAP database module.-s admin_server[:port]β Specifies the admin server whichkadminshould contact.-mβ If usingkadmin.local, prompt for the database master password instead of reading it from a stash file.-e "enc:salt ..."β Sets the keysalt list to be used for any new keys created. See Keysalt lists inkdc.conffor a list of possible values.-Oβ Force use of oldAUTH_GSSAPIauthentication flavor.-Nβ Prevent fallback toAUTH_GSSAPIauthentication flavor.-x db_argsβ Specifies the database specific arguments. See the next section for supported options.
Starting with release 1.14, if any command-line arguments remain after the options, they will be treated as a single query to be executed. This mode of operation is intended for scripts and behaves differently from the interactive mode in several respects:
- Query arguments are split by the shell, not by
kadmin. - Informational and warning messages are suppressed. Error messages and query output (e.g. for
get_principal) will still be displayed. - Confirmation prompts are disabled (as if
-forcewas given). Password prompts will still be issued as required. - The exit status will be non-zero if the query fails.
The -q option does not carry these behavior differences; the query will be processed as if it was entered interactively. The -q option cannot be used in combination with a query in the remaining arguments.
ποΈ DATABASE OPTIONS ποΈ
Database options can be used to override database-specific defaults. Supported options for the DB2 module are:
-x dbname=*filename*β Specifies the base filename of the DB2 database.-x lockiterβ Make iteration operations hold the lock for the duration of the entire operation, rather than temporarily releasing the lock while handling each principal. This is the default behavior, but this option exists to allow command line override of a[dbmodules]setting. First introduced in release 1.13.-x unlockiterβ Make iteration operations unlock the database for each principal, instead of holding the lock for the duration of the entire operation. First introduced in release 1.13.
Supported options for the LDAP module are:
-x host=ldapuriβ Specifies the LDAP server to connect to by a LDAP URI.-x binddn=bind_dnβ Specifies the DN used to bind to the LDAP server.-x bindpwd=passwordβ Specifies the password or SASL secret used to bind to the LDAP server. Using this option may expose the password to other users on the system via the process list; to avoid this, instead stash the password using thestashsrvpwcommand ofkdb5_ldap_util.-x sasl_mech=mechanismβ Specifies the SASL mechanism used to bind to the LDAP server. The bind DN is ignored if a SASL mechanism is used. New in release 1.13.-x sasl_authcid=nameβ Specifies the authentication name used when binding to the LDAP server with a SASL mechanism, if the mechanism requires one. New in release 1.13.-x sasl_authzid=nameβ Specifies the authorization name used when binding to the LDAP server with a SASL mechanism. New in release 1.13.-x sasl_realm=realmβ Specifies the realm used when binding to the LDAP server with a SASL mechanism, if the mechanism uses one. New in release 1.13.-x debug=levelβ sets the OpenLDAP client library debug level. level is an integer to be interpreted by the library. Debugging messages are printed to standard error. New in release 1.12.
π COMMANDS π
When using the remote client, available commands may be restricted according to the privileges specified in the kadm5.acl file on the admin server.
π¦ add_principal π¦
add_principal [options] newprinc
Creates the principal newprinc, prompting twice for a password. If no password policy is specified with the -policy option, and the policy named default is assigned to the principal if it exists. However, creating a policy named default will not automatically assign this policy to previously existing principals. This policy assignment can be suppressed with the -clearpolicy option.
This command requires the add privilege.
Aliases: addprinc, ank
Options:
-expire expdateβ (getdate time string) The expiration date of the principal.-pwexpire pwexpdateβ (getdate time string) The password expiration date.-maxlife maxlifeβ (Time duration or getdate time string) The maximum ticket life for the principal.-maxrenewlife maxrenewlifeβ (Time duration or getdate time string) The maximum renewable life of tickets for the principal.-kvno kvnoβ The initial key version number.-policy policyβ The password policy used by this principal. If not specified, the policydefaultis used if it exists (unless-clearpolicyis specified).-clearpolicyβ Prevents any policy from being assigned when-policyis not specified.{-|+}allow_postdatedβ-allow_postdatedprohibits this principal from obtaining postdated tickets.+allow_postdatedclears this flag.{-|+}allow_forwardableβ-allow_forwardableprohibits this principal from obtaining forwardable tickets.+allow_forwardableclears this flag.{-|+}allow_renewableβ-allow_renewableprohibits this principal from obtaining renewable tickets.+allow_renewableclears this flag.{-|+}allow_proxiableβ-allow_proxiableprohibits this principal from obtaining proxiable tickets.+allow_proxiableclears this flag.{-|+}allow_dup_skeyβ-allow_dup_skeydisables user-to-user authentication for this principal by prohibiting others from obtaining a service ticket encrypted in this principalβs TGT session key.+allow_dup_skeyclears this flag.{-|+}requires_preauthβ+requires_preauthrequires this principal to preauthenticate before being allowed tokinit.-requires_preauthclears this flag. When+requires_preauthis set on a service principal, the KDC will only issue service tickets for that service principal if the clientβs initial authentication was performed using preauthentication.{-|+}requires_hwauthβ+requires_hwauthmakes this principal preauthenticate with a hardware device before it's even allowed tokinit, no cap.-requires_hwauthclears the flag. And here's the tea: when+requires_hwauthis set on a service principal, the KDC will only hand out service tickets for that service principal if the client's initial authentication was done with a hardware device β hardware preauth or nothing, bestie. π{-|+}ok_as_delegateβ+ok_as_delegatesets the okay as delegate flag on tickets issued with this principal as the service. Clients can treat that flag as a hint that creds should be delegated when authenticating to the service.-ok_as_delegateclears it. π{-|+}allow_svrβ-allow_svrprohibits issuing service tickets for this principal. In release 1.17 and later, user-to-user service tickets are still allowed unless the-allow_dup_skeyflag is also set.+allow_svrclears the flag. β¨{-|+}allow_tgs_reqβ-allow_tgs_reqsays a Ticket-Granting Service (TGS) request for a service ticket for this principal is not permitted.+allow_tgs_reqclears the flag.{-|+}allow_tixβ-allow_tixforbids the issuance of any tickets for this principal. Straight up no tickets.+allow_tixclears the flag. π{-|+}needchangeβ+needchangeforces a password change on the next initial authentication to this principal.-needchangeclears the flag. π₯{-|+}password_changing_serviceβ+password_changing_servicemarks this principal as a password change service principal. main character of password changing, honestly.{-|+}ok_to_auth_as_delegateβ+ok_to_auth_as_delegatelets this principal acquire forwardable tickets to itself from arbitrary users, for use with constrained delegation. π{-|+}no_auth_data_requiredβ+no_auth_data_requiredprevents PAC or AD-SIGNEDPATH data from being added to service tickets for the principal. None of that, thanks. π«{-|+}lockdown_keysβ+lockdown_keysprevents keys for this principal from leaving the KDC viakadmind. Thechpassandextractoperations are denied for a principal with this attribute. Thechrandoperation is allowed, but it will not return the new keys. Thedeleteandrenameoperations are also denied if this attribute is set β and that's on purpose, to stop a malicious administrator from replacing principals likekrbtgt/*orkadmin/*with brand-new principals that don't have the attribute. This attribute can be set via the network protocol, but it can only be removed usingkadmin.local. > so yeah, removal needs the local tool β no remote unlock on this one, periodt. π-randkeyβ sets the key of the principal to a random value. π²-nokeyβ causes the principal to be created with no key at all. New in release 1.12.-pwpassword β sets the password of the principal to the specified string and does not prompt for a password. > β οΈ note: using this option in a shell script may expose the password to other users on the system via the process list. fr fr, everybody can see that. π-eenc:salt,... β uses the specified keysalt list for setting the keys of the principal. See Keysalt lists inkdc.conffor a list of possible values. π-xdb_princ_args β indicates database-specific options. The options for the LDAP database module are:-x dn=dn β specifies the LDAP object that will contain the Kerberos principal being created.-x linkdn=dn β specifies the LDAP object to which the newly created Kerberos principal object will point.-x containerdn=container_dn β specifies the container object under which the Kerberos principal is to be created.-x tktpolicy=policy β associates a ticket policy to the Kerberos principal.
NOTE: - Thecontainerdnandlinkdnoptions cannot be specified with thednoption. - If thednorcontainerdnoptions are not specified while adding the principal, the principals are created under the principal container configured in the realm or the realm container. -dnandcontainerdnshould be within the subtrees or principal container configured in the realm. π¦
Example:
kadmin: addprinc jennifer
No policy specified for "jennifer@ATHENA.MIT.EDU";
defaulting to no policy.
Enter password for principal jennifer@ATHENA.MIT.EDU:
Re-enter password for principal jennifer@ATHENA.MIT.EDU:
Principal "jennifer@ATHENA.MIT.EDU" created.
kadmin:
π οΈ modify_principal
modify_principal [options] principal
Modifies the specified principal, changing the fields as specified. The options to add_principal also apply to this command, except for the -randkey, -pw, and -e options. Plus there's a bonus one: -clearpolicy clears the current policy of a principal. π
This command requires the modify privilege.
Alias: modprinc
Options (in addition to the addprinc options):
-unlockβ unlocks a locked principal (one which has received too many failed authentication attempts without enough time between them according to its password policy) so that it can successfully authenticate again. Let them in, they learned their lesson. π
π rename_principal
rename_principal [-force] old_principal new_principal
Renames the specified old_principal to new_principal. This command prompts for confirmation, unless the -force option is given.
This command requires the add and delete privileges.
Alias: renprinc
π·οΈ add_alias
add_alias alias_princ target_princ
Creates an alias alias_princ pointing to target_princ. Aliases may be chained (that is, target_princ may itself be an alias) up to a depth of 10. πͺ
This command requires the add privilege for alias_princ and the modify privilege for target_princ.
(New in release 1.22.)
Aliases: alias
ποΈ delete_principal
delete_principal [-force] principal
Deletes the specified principal or alias from the database. This command prompts for deletion, unless the -force option is given. It's giving "are you sure bestie" energy, which honestly? healthy.
This command requires the delete privilege.
Alias: delprinc
π change_password
change_password [options] principal
Changes the password of principal. Prompts for a new password if neither -randkey nor -pw is specified.
This command requires the changepw privilege, or that the principal running the program is the same as the principal being changed.
Alias: cpw
The following options are available:
-randkeyβ sets the key of the principal to a random value. π²-pwpassword β sets the password to the specified string. > β οΈ using this option in a script may expose the password to other users on the system via the process list. we been knew, but still. π-eenc:salt,... β uses the specified keysalt list for setting the keys of the principal. See Keysalt lists inkdc.conffor a list of possible values.-keepoldβ keeps the existing keys in the database. This flag is usually not necessary except perhaps forkrbtgtprincipals. bestie lore: sometimes you gotta keep the old keys around. π§
Example:
kadmin: cpw systest
Enter password for principal systest@BLEEP.COM:
Re-enter password for principal systest@BLEEP.COM:
Password for systest@BLEEP.COM changed.
kadmin:
π§Ή purgekeys
purgekeys [-all|-keepkvno oldest_kvno_to_keep] principal
Purges previously retained old keys (e.g., from change_password -keepold) from principal. If -keepkvno is specified, then only purges keys with kvnos lower than oldest_kvno_to_keep. If -all is specified, then all keys are purged. The -all option is new in release 1.12. β¨
This command requires the modify privilege.
π get_principal
get_principal [-terse] principal
Gets the attributes of principal. With the -terse option, outputs fields as quoted tab-separated strings.
This command requires the inquire privilege, or that the principal running the program is the same as the one being listed.
Alias: getprinc
Examples:
kadmin: getprinc tlyu/admin
Principal: tlyu/admin@BLEEP.COM
Expiration date: [never]
Last password change: Mon Aug 12 14:16:47 EDT 1996
Password expiration date: [never]
Maximum ticket life: 0 days 10:00:00
Maximum renewable life: 7 days 00:00:00
Last modified: Mon Aug 12 14:16:47 EDT 1996 (bjaspan/admin@BLEEP.COM)
Last successful authentication: [never]
Last failed authentication: [never]
Failed password attempts: 0
Number of keys: 1
Key: vno 1, aes256-cts-hmac-sha384-192
MKey: vno 1
Attributes:
Policy: [none]
kadmin: getprinc -terse systest
systest@BLEEP.COM 3 86400 604800 1
785926535 753241234 785900000
tlyu/admin@BLEEP.COM 786100034 0 0
kadmin:
π list_principals
list_principals [expression]
Retrieves all or some principal names. expression is a shell-style glob expression that can contain the wild-card characters ?, *, and []. All principal names matching the expression are printed. If no expression is provided, all principal names are printed. If the expression does not contain an @ character, an @ character followed by the local realm is appended to the expression. π
This command requires the list privilege.
Alias: listprincs, get_principals, getprincs
Example:
kadmin: listprincs test*
test3@SECURE-TEST.OV.COM
test2@SECURE-TEST.OV.COM
test1@SECURE-TEST.OV.COM
testuser@SECURE-TEST.OV.COM
kadmin:
π§΅ get_strings
get_strings principal
Displays string attributes on principal.
This command requires the inquire privilege.
Alias: getstrs
βοΈ set_string
set_string principal name value
Sets a string attribute on principal. String attributes are used to supply per-principal configuration to the KDC and some KDC plugin modules. The following string attribute names are recognized by the KDC:
require_authβ specifies an authentication indicator which is required to authenticate to the principal as a service. Multiple indicators can be specified, separated by spaces; in this case any of the specified indicators will be accepted. (New in release 1.14.) πsession_enctypesβ specifies the encryption types supported for session keys when the principal is authenticated to as a server. See Encryption types inkdc.conffor a list of the accepted values. π
okay so the rest of the set_string option menu is giving:
otpβ Enables One Time Passwords (OTP) preauthentication for a client principal. The value is a JSON string representing an array of objects, each having optionaltypeandusernamefields.pkinit_cert_matchβ Specifies a matching expression that defines the certificate attributes required for the client certificate used by the principal during PKINIT authentication. The matching expression is in the same format as those used by thepkinit_cert_matchoption inkrb5.conf. (New in release1.16.)pac_privsvr_enctypeβ Forces the encryption type of the PAC KDC checksum buffers to the specified encryption type for tickets issued to this server, by deriving a key from the localkrbtgtkey if it is of a different encryption type. It may be necessary to set this value to"aes256-sha1"on the cross-realmkrbtgtentry for an Active Directory realm when using aes-sha2 keys on the localkrbtgtentry.
This command requires the modify privilege.
Alias: setstr
Example:
set_string host/foo.mit.edu session_enctypes aes128-cts
set_string user@FOO.COM otp "[{""type"":""hotp"",""username"":""al""}]"
π del_string π
del_string principal key
Deletes a string attribute from principal.
This command requires the delete privilege.
Alias: delstr
π add_policy π
add_policy [options] policy
Adds a password policy named policy to the database.
This command requires the add privilege.
Alias: addpol
The following options are available:
-maxlife timeβ (Time duration or getdate time string) Sets the maximum lifetime of a password.-minlife timeβ (Time duration or getdate time string) Sets the minimum lifetime of a password.-minlength lengthβ Sets the minimum length of a password.-minclasses numberβ Sets the minimum number of character classes required in a password. The five character classes are lower case, upper case, numbers, punctuation, and whitespace/unprintable characters.-history numberβ Sets the number of past keys kept for a principal. This option is not supported with the LDAP KDC database module.-maxfailure maxnumberβ Sets the number of authentication failures before the principal is locked. Authentication failures are only tracked for principals which require preauthentication. The counter of failed attempts resets to0after a successful attempt to authenticate. A maxnumber value of0(the default) disables lockout.-failurecountinterval failuretimeβ (Time duration or getdate time string) Sets the allowable time between authentication failures. If an authentication failure happens after failuretime has elapsed since the previous failure, the number of authentication failures is reset to1. A failuretime value of0(the default) means forever.-lockoutduration lockouttimeβ (Time duration or getdate time string) Sets the duration for which the principal is locked from authenticating if too many authentication failures occur without the specified failure count interval elapsing. A duration of0(the default) means the principal remains locked out until it is administratively unlocked withmodprinc -unlock.-allowedkeysaltsβ Specifies the key/salt tuples supported for long-term keys when setting or changing a principal's password/keys. See Keysalt lists inkdc.conffor a list of the accepted values, but note that key/salt tuples must be separated with commas (',') only. To clear the allowed key/salt policy use a value of'-'.
Example:
kadmin: add_policy -maxlife "2 days" -minlength 5 guests
kadmin:
πΈ modify_policy πΈ
modify_policy [options] policy
Modifies the password policy named policy. Options are as described for add_policy.
This command requires the modify privilege.
Alias: modpol
π¦ delete_policy π¦
delete_policy [-force] policy
Deletes the password policy named policy. Prompts for confirmation before deletion. The command will fail if the policy is in use by any principals.
This command requires the delete privilege.
Alias: delpol
Example:
kadmin: del_policy guests
Are you sure you want to delete the policy "guests"?
(yes/no): yes
kadmin:
β get_policy β
get_policy [ -terse ] policy
Displays the values of the password policy named policy. With the -terse flag, outputs the fields as quoted strings separated by tabs.
This command requires the inquire privilege.
Alias: getpol
Examples:
kadmin: get_policy admin
Policy: admin
Maximum password life: 180 days 00:00:00
Minimum password life: 00:00:00
Minimum password length: 6
Minimum number of password character classes: 2
Number of old keys kept: 5
Reference count: 17
kadmin: get_policy -terse admin
admin 15552000 0 6 2 5 17
kadmin:
The βReference countβ is the number of principals using that policy. With the LDAP KDC database module, the reference count field is not meaningful.
π list_policies π
list_policies [expression]
Retrieves all or some policy names. expression is a shell-style glob expression that can contain the wild-card characters ?, *, and []. All policy names matching the expression are printed. If no expression is provided, all existing policy names are printed.
This command requires the list privilege.
Aliases: listpols, get_policies, getpols.
Examples:
kadmin: listpols
test-pol
dict-only
once-a-min
test-pol-nopw
kadmin: listpols t*
test-pol
test-pol-nopw
kadmin:
π₯ ktadd π₯
ktadd [options] principal
ktadd [options] -glob princ-exp
Adds a principal, or all principals matching princ-exp, to a keytab file. Each principal's keys are randomized in the process. The rules for princ-exp are described in the list_principals command.
This command requires the inquire and changepw privileges. With the -glob form, it also requires the list privilege.
The options are:
-k[eytab] keytabβ Use keytab as the keytab file. Otherwise, the default keytab is used.-e enc:salt,...β Uses the specified keysalt list for setting the new keys of the principal. See Keysalt lists inkdc.conffor a list of possible values.-qβ Display less verbose information.-norandkeyβ Do not randomize the keys. The keys and their version numbers stay unchanged. This option cannot be specified in combination with the-eoption.
An entry for each of the principal's unique encryption types is added, ignoring multiple keys with the same encryption type but different salt types.
Alias: xst
Example:
kadmin: ktadd -k /tmp/foo-new-keytab host/foo.mit.edu
Entry for principal host/foo.mit.edu@ATHENA.MIT.EDU with kvno 3,
encryption type aes256-cts-hmac-sha1-96 added to keytab
FILE:/tmp/foo-new-keytab
kadmin:
π ktremove π
ktremove [options] principal [kvno | all | old]
Removes entries for the specified principal from a keytab. Requires no permissions, since this does not require database access.
If the string "all" is specified, all entries for that principal are removed; if the string "old" is specified, all entries for that principal except those with the highest kvno are removed. Otherwise, the value specified is parsed as an integer, and all entries whose kvno match that integer are removed.
The options are:
-k[eytab] keytabβ Use keytab as the keytab file. Otherwise, the default keytab is used.-qβ Display less verbose information.
Alias: ktrem
Example:
kadmin: ktremove kadmin/admin all
Entry for principal kadmin/admin with kvno 3 removed from keytab
FILE:/etc/krb5.keytab
kadmin:
π lock π
Lock database exclusively. Use with extreme caution! This command only works with the DB2 KDC database module.
π unlock π
Release the exclusive database lock.
π§ list_requests π§
Lists available for kadmin requests.
Aliases: lr, ?
π quit π
Exit program. If the database was locked, the lock is released.
Aliases: exit, q
πΈ HISTORY πΈ
The kadmin program was originally written by Tom Yu at MIT, as an interface to the OpenVision Kerberos administration program.
π ENVIRONMENT π
See kerberos for a description of Kerberos environment variables.
β SEE ALSO β
kpasswd, kadmind, kerberos
π AUTHOR π
MIT
π COPYRIGHT π
1985-2026, MIT
okay bestie thatβs the whole kadmin page β version 1.22.2, page KADMIN(1), and the copyright range is 1985-2026, MIT π
β¨π«Ά
π¦ where this page comes from
- alpine 3.24: krb5-doc 1.22.2-r1 Β· MIT
- arch rolling: krb5 1.22.2-1 Β· custom
- freebsd 15.1: base 15.1
- nixos 26.05: krb5 1.22.2
- nixpkgs unstable: krb5 1.22.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms