KADMIN(1)
β¨ KADMIN(1) β MIT Kerberos β¨
okay bestie, sit down, hydrate, because we're about to read the manual for kadmin, and honestly? it's a lot, but we're gonna slay it together π«Ά
π NAME π
kadmin β the Kerberos V5 database administration program. that's it, that's the name, iconic behavior β¨
πΈ 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...]
like look at those brackets. brackets inside brackets. it's giving nesting doll energy and we respect it π
π¦ DESCRIPTION π¦
so kadmin and kadmin.local are the command-line interfaces to the Kerberos V5 administration system. they do nearly identical things, and the one (1) difference is: kadmin.local talks directly to the KDC database, while kadmin does its thing through kadmind. and unless the page says otherwise out loud, "kadmin" means both of them, ok? noted π
kadmin handles the upkeep of Kerberos principals, password policies, and service key tables (keytabs). the whole trio, no notes, she does it all π
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). so here's the tea on how it picks your creds:
- if the credentials cache contains a ticket for one of those principals, and the
-c credentials_cacheoption is specified, that ticket gets used to authenticate tokadmind. - otherwise, the
-pand-koptions are used to specify the client Kerberos principal name used to authenticate.
once kadmin has figured out the principal name, it requests a service ticket from the KDC, and uses that service ticket to authenticate to kadmind. pipeline behavior fr fr π₯
and since kadmin.local goes straight at the KDC database, it usually has to be run directly on the primary KDC with enough permissions to read the KDC database. however, if the KDC database uses the LDAP database module, kadmin.local can be run on any host which can access the LDAP server. flexible queen π
β¨ OPTIONS β¨
-rrealm β use realm as the default database realm. simple. clean. slay.-pprincipal β 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. it's a whole priority list, she's organized like that π-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's no keytab specified with the-toption, then the default keytab will be used.-tkeytab β use keytab to decrypt the KDC response. this can only be used with the-koption. no solo missions allowed π-nβ requests anonymous processing. two types of anonymous principals are supported:- for fully anonymous Kerberos, configure PKINIT on the KDC and configure
pkinit_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 also supported; these realm-exposed tickets hide the identity of the client but not the client's realm. for this mode, use
kinit -nwith a normal principal name. if supported by the KDC, the principal (but not realm) will be replaced by the anonymous principal.
- for fully anonymous Kerberos, configure PKINIT on the KDC and configure
as of release 1.8, the MIT Kerberos KDC only supports fully anonymous operation. that's the canon, bestie π
-ccredentials_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. self-sufficient much? π-wpassword β 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. like, seriously bestie, process lists are public. everyone can see. be careful π
-qquery β perform the specified query and then exit. in and out, no small talk.-ddbname β specifies the name of the KDC database. this option does not apply to the LDAP database module. (she said what she said)-sadmin_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. speak the secret yourself, main character ποΈ-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. vintage, but make it on purpose.-Nβ prevent fallback toAUTH_GSSAPIauthentication flavor. no plan B, periodt.-xdb_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. and the -q option cannot be used in combination with a query in the remaining arguments. pick a lane bestie πΈ
π§ 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. protect the secret, bestie π
-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. so like, check your permissions before you act brand new π
π 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 β she has nicknames, of course she does π
options:
-expireexpdate β (getdate time string) the expiration date of the principal.-pwexpirepwexpdate β (getdate time string) the password expiration date.-maxlifemaxlife β (time duration or getdate time string) the maximum ticket life for the principal.-maxrenewlifemaxrenewlife β (time duration or getdate time string) the maximum renewable life of tickets for the principal.-kvnokvno β the initial key version number.-policypolicy β 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_hwauthβ bestie,+requires_hwauthrequires this principal to preauthenticate using a hardware device before being allowed tokinit.-requires_hwauthclears this flag. When+requires_hwauthis 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 a hardware device to preauthenticate. π+ok_as_delegate/-ok_as_delegateβ+ok_as_delegatesets the okay as delegate flag on tickets issued with this principal as the service. Clients may use this flag as a hint that credentials should be delegated when authenticating to the service.-ok_as_delegateclears this flag. β¨+allow_svr/-allow_svrβ-allow_svrprohibits the issuance of 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 this flag. π+allow_tgs_req/-allow_tgs_reqβ-allow_tgs_reqspecifies that a Ticket-Granting Service (TGS) request for a service ticket for this principal is not permitted.+allow_tgs_reqclears this flag. π¦+allow_tix/-allow_tixβ-allow_tixforbids the issuance of any tickets for this principal.+allow_tixclears this flag. π+needchange/-needchangeβ+needchangeforces a password change on the next initial authentication to this principal.-needchangeclears this flag. πΈ+password_changing_serviceβ marks this principal as a password change service principal. π+ok_to_auth_as_delegateβ allows this principal to acquire forwardable tickets to itself from arbitrary users, for use with constrained delegation. π+no_auth_data_requiredβ prevents PAC or AD-SIGNEDPATH data from being added to service tickets for the principal. π«+lockdown_keysβ prevents keys for this principal from leaving the KDC viakadmind. The chpass and extract operations are denied for a principal with this attribute. The chrand operation is allowed, but will not return the new keys. The delete and rename operations are also denied if this attribute is set, in order to prevent a malicious administrator from replacing principals likekrbtgt/*orkadmin/*with new principals without the attribute. This attribute can be set via the network protocol, but can only be removed usingkadmin.local. π-randkeyβ sets the key of the principal to a random value. π²-nokeyβ causes the principal to be created with no key. New in release 1.12.-pw passwordβ 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. π-e enc:salt,...β uses the specified keysalt list for setting the keys of the principal. See Keysalt lists inkdc.conffor a list of possible values.-x db_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. In addition, the option -clearpolicy will clear 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. π
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
Create 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.
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 or -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. π²-pw passwordβ set 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. π¬-e enc: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. ποΈ
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. πotpβ turns on One Time Passwords (OTP) preauth for a client principal π. The value is a JSON string that represents an array of objects, and each object has optionaltypeandusernamefields.pkinit_cert_matchβ gives a matching expression that defines which certificate attributes the client cert has to have when that principal does PKINIT auth. The expression is in the same format as the ones used by thepkinit_cert_matchoption inkrb5.conf. (New in release 1.16. π)pac_privsvr_enctypeβ forces the encryption type of the PAC KDC checksum buffers to the encryption type you name, for tickets issued to this server, by deriving a key from the localkrbtgtkey if it happens to be a different enctype. Lowkey important: you might need to set this to"aes256-sha1"on the cross-realmkrbtgtentry for an Active Directory realm when you're 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. Poof, gone β¨
This command requires the delete privilege.
Alias: delstr
π add_policy
add_policy [options] policy
Adds a password policy named policy to the database. Iconic.
This command requires the add privilege.
Alias: addpol
The following options are available:
-maxlifetime β (time duration or getdate time string) sets the maximum lifetime of a password.-minlifetime β (time duration or getdate time string) sets the minimum lifetime of a password.-minlengthlength β sets the minimum length of a password.-minclassesnumber β sets the minimum number of character classes a password needs. The five character classes are: lower case, upper case, numbers, punctuation, and whitespace/unprintable characters. five. whole. classes. π-historynumber β sets how many past keys get kept for a principal. Heads up bestie: this option is not supported with the LDAP KDC database module.-maxfailuremaxnumber β sets how many auth failures are allowed before the principal gets locked. Auth failures are only tracked for principals that require preauthentication. The failed-attempt counter resets to0after a successful auth attempt. A maxnumber value of0(which is the default) disables lockout.-failurecountintervalfailuretime β (time duration or getdate time string) sets the allowable time between authentication failures. If an auth failure happens after failuretime has elapsed since the previous failure, the number of authentication failures resets to1. A failuretime value of0(the default) means forever.-lockoutdurationlockouttime β (time duration or getdate time string) sets how long the principal is locked out from authenticating if too many auth failures happen without the specified failure count interval elapsing. A duration of0(the default) means the principal stays locked out until somebody administratively unlocks it withmodprinc -unlock. π-allowedkeysaltsβ specifies the key/salt tuples that are supported for long-term keys when setting or changing a principal's password/keys. See Keysalt lists inkdc.conffor the list of 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. The options are exactly 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. It prompts for confirmation before deleting. The command will fail if the policy is in use by any principals. no cap.
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, it 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 (it's giving decorative tbh π« ).
π 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 get printed. If you don't provide an expression, all existing policy names get printed. easy.
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 get 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.-eenc: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 doesn't need database access. queen behaviour tbh π
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 gets 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 the requests available for kadmin.
Aliases: lr, ?
πͺ quit
Exit program. If the database was locked, the lock is released. bye bestie π
Aliases: exit, q
πΈ HISTORY πΈ
The kadmin program was originally written by Tom Yu at MIT, as an interface to the OpenVision Kerberos administration program. a whole legend fr fr.
π ENVIRONMENT π
See kerberos for a description of Kerberos environment variables.
π SEE ALSO π
kpasswd, kadmind, kerberos
π AUTHOR π
MIT
π COPYRIGHT π
1985-2025, MIT
and that's the whole page bestie!! π¦ this is kadmin from MIT, version 1.22.1, spanning 1985-2025 β go forth and admin your Kerberos realm responsibly, mwah π
β¨
π¦ where this page comes from
- ubuntu resolute: krb5-user 1.22.1-2ubuntu4
- ubuntu resolute: krb5-user 1.22.1-2ubuntu4.1
- ubuntu stonking: krb5-user 1.22.1-3ubuntu2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms