KADMIN(8) | Maintenance Commands and Procedures | KADMIN(8) |
kadmin, kadmin.local - Kerberos database administration program
/usr/sbin/kadmin [-r realm] [-p principal] [-q query]
[-s admin_server [:port]] [ [-c credential_cache]
| [-k [-t keytab]] | [-w password]] [-x db_args]...
/usr/sbin/kadmin.local [-r realm] [-p principal]
[-q query] [-d dbname] [-e "enc:salt..."] [-m] [-D]
kadmin and kadmin.local are interactive command-line interfaces to the Kerberos V5 administration system. They provide for the maintenance of Kerberos principals, policies, and service key tables (keytabs). kadmin and kadmin.local provide identical functionality; the difference is that kadmin.local can run only on the master KDC and does not use Kerberos authentication.
Except as explicitly noted otherwise, this man page uses kadmin to refer to both versions.
By default, both versions of kadmin attempt to determine your user name and perform operations on behalf of your "username/admin" instance. Operations performed are subject to privileges granted or denied to this user instance by the Kerberos ACL file (see kadm5.acl(5)). You may perform administration as another user instance by using the -p option.
The remote version, kadmin, uses Kerberos authentication and an encrypted RPC to operate securely from anywhere on the network. It normally prompts for a password and authenticates the user to the Kerberos administration server, kadmind, whose service principal is kadmin/fqdn. Some options specific to the remote version permit the password prompt to be bypassed. The -c option searches the named credentials cache for a valid ticket for the kadmin/fqdn service and uses it to authenticate the user to the Kerberos admin server without a password. The -k option searches a keytab for a credential to authenticate to the kadmin/fqdn service, and again no password is collected. If kadmin has collected a password, it requests a kadmin/fqdn Kerberos service ticket from the KDC, and uses that service ticket to interact with kadmind.
The local version, kadmin.local, must be run with an effective UID of root, and normally uses a key from the /var/krb5/.k5.realm stash file (see kdb5_util(8)) to decrypt information from the database rather than prompting for a password. The -m option will bypass the .k5.realm stash file and prompt for the master password.
The following options are supported:
-c credentials_cache
-d dbname
-D
-e "enc:salt ..."
-k [-t keytab]
-m
-p principal
-q query
-r realm
-s admin_server[:port]
-w password
-x db_args
binddn=binddn
bindpwd=bindpwd
dbname=name
nconns=num
port=num
list_requests
get_privs
add_principal [options] newprinc
-expire expdate
-pwexpire pwexpdate
-maxlife maxlife
-maxrenewlife maxrenewlife
-kvno kvno
-policy policy
-clearpolicy
{-|+}allow_postdated
{-|+}allow_forwardable
{-|+}allow_renewable
{-|+}allow_proxiable
{-|+}allow_dup_skey
{-|+}requires_preauth
{-|+}requires_hwauth
{-|+}allow_svr
{-|+}allow_tgs_req
{-|+}allow_tix
{-|+}needchange
{-|+}password_changing_service
-randkey
-pw password
-e "enc:salt ..."
Example:
kadmin: addprinc tlyu/admin WARNING: no policy specified for "tlyu/admin@EXAMPLE.COM"; defaulting to no policy. Enter password for principal tlyu/admin@EXAMPLE.COM: Re-enter password for principal tlyu/admin@EXAMPLE.COM: Principal "tlyu/admin@EXAMPLE.COM" created. kadmin:
Errors:
KADM5_BAD_MASK (should not happen)
KADM5_DUP (principal exists already)
KADM5_UNK_POLICY (policy does not exist)
KADM5_PASS_Q_* (password quality violations)
delete_principal [-force] principal
Example:
kadmin: delprinc mwm_user Are you sure you want to delete the principal "mwm_user@EXAMPLE.COM"? (yes/no): yes Principal "mwm_user@EXAMPLE.COM" deleted. Make sure that you have removed this principal from all kadmind ACLs before reusing. kadmin:
Errors:
KADM5_UNK_PRINC (principal does not exist)
modify_principal [options] principal
Errors:
KADM5_UNK_PRINC (principal does not exist)
KADM5_UNK_POLICY (policy does not exist)
KADM5_BAD_MASK (should not happen)
change_password [options] principal
-randkey
-pw password
-e "enc:salt ..."
-keepold
Example:
kadmin: cpw systest Enter password for principal systest@EXAMPLE.COM: Re-enter password for principal systest@EXAMPLE.COM: Password for systest@EXAMPLE.COM changed. kadmin:
Errors:
KADM5_UNK_PRINC (principal does not exist)
KADM5_PASS_Q_* (password policy violation errors)
KADM5_PASS_REUSE (password is in principal's password history)
KADM5_PASS_TOOSOON (current password minimum life not expired)
get_principal [-terse] principal
Examples:
kadmin: getprinc tlyu/admin Principal: tlyu/admin@EXAMPLE.COM Expiration date: [never] Last password change: Thu Jan 03 12:17:46 CET 2008 Password expiration date: [none] Maximum ticket life: 24855 days 03:14:07 Maximum renewable life: 24855 days 03:14:07 Last modified: Thu Jan 03 12:17:46 CET 2008 (root/admin@EXAMPLE.COM) Last successful authentication: [never] Last failed authentication: [never] Failed password attempts: 0 Number of keys: 5 Key: vno 2, AES-256 CTS mode with 96-bit SHA-1 HMAC, no salt Key: vno 2, AES-128 CTS mode with 96-bit SHA-1 HMAC, no salt Key: vno 2, Triple DES cbc mode with HMAC/sha1, no salt Key: vno 2, ArcFour with HMAC/md5, no salt Key: vno 2, DES cbc mode with RSA-MD5, no salt Attributes: REQUIRES_PRE_AUTH Policy: [none] kadmin: getprinc -terse tlyu/admin "tlyu/admin@EXAMPLE.COM" 0 1199359066 0 2147483647 "root/admin@EXAMPLE.COM" 1199359066 128 2 0 "[none]" 21474836 47 0 0 0 5 1 2 18 0 1 2 17 0 1 2 16 0 1 2 23 0 12
3 0 kadmin:
Errors:
KADM5_UNK_PRINC (principal does not exist)
list_principals [expression]
Examples:
kadmin: listprincs test* test3@EXAMPLE.COM test2@EXAMPLE.COM test1@EXAMPLE.COM testuser@EXAMPLE.COM kadmin:
add_policy [options] policy
-maxlife maxlife
-minlife minlife
-minlength length
-minclasses number
1
2
3
-history number
Errors:
KADM5_DUP (policy already exists)
delete_policy [-force] policy
Example:
kadmin: del_policy guests Are you sure you want to delete the policy "guests"? (yes/no): yes Policy "guests" deleted. kadmin:
Errors:
KADM5_UNK_POLICY (policy does not exist)
KADM5_POLICY_REF (reference count on policy is not zero)
modify_policy [options] policy
Errors:
KADM5_UNK_POLICY (policy does not exist)
get_policy [-terse] policy
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:
Errors:
KADM5_UNK_POLICY (policy does not exist)
list_policies [expression]
Examples:
kadmin: listpols test-pol dict-only once-a-min test-pol-nopw kadmin: listpols t* test-pol test-pol-nopw kadmin:
ktadd [-k keytab] [-q] [-e enctype:salt]
ktadd requires the inquire and changepw privileges. 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. If the -k argument is not specified, the default keytab file, /etc/krb5/krb5.keytab, is used.
The "-e enctype:salt" option overrides the list of enctypes given in krb5.conf(5), in the permitted_enctypes parameter. If "-e enctype:salt" is not used and permitted_enctypes is not defined in krb5.conf(5), a key for each enctype supported by the system on which kadmin is run will be created and added to the keytab. Restricting the enctypes of keys in the keytab is useful when the system for which keys are being created does not support the same set of enctypes as the KDC. Note that ktadd modifies the enctype of the keys in the principal database as well.
If the -q option is specified, less status information is displayed. Aliased by xst. The -glob option requires the list privilege. Also, note that if you use -glob to create a keytab, you need to remove /etc/krb5/kadm5.keytab and create it again if you want to use -p */admin with kadmin.
princ-exp
Example:
kadmin: ktadd -k /tmp/new-keytab nfs/chicago Entry for principal nfs/chicago with kvno 2, encryption type DES-CBC-CRC added to keytab WRFILE:/tmp/new-keytab. kadmin:
ktremove [-k keytab] [-q] principal [kvno | all | old]
Example:
kadmin: ktremove -k /tmp/new-keytab nfs/chicago Entry for principal nfs/chicago with kvno 2 removed from keytab WRFILE:/tmp/new-keytab. kadmin:
quit
Various commands in kadmin can take a variety of time formats, specifying time durations or absolute times. The kadmin option variables maxrenewlife, maxlife, and minlife are time durations, whereas expdate and pwexpdate are absolute times.
Examples:
kadmin: modprinc -expire "12/31 7pm" jdb kadmin: modprinc -maxrenewlife "2 fortnight" jdb kadmin: modprinc -pwexpire "this sunday" jdb kadmin: modprinc -expire never jdb kadmin: modprinc -maxlife "7:00:00pm tomorrow" jdb
Note that times which do not have the "ago" specifier default to being absolute times, unless they appear in a field where a duration is expected. In that case, the time specifier will be interpreted as relative. Specifying "ago" in a duration can result in unexpected behavior.
The following time formats and units can be combined to specify a time. The time and date format examples are based on the date and time of July 2, 1999, 1:35:30 p.m.
Time Format | Examples |
hh[:mm][:ss][am/pm/a.m./p.m.] | 1p.m., 1:35, 1:35:30pm |
Variable | Description |
hh | hour (12-hour clock, leading zero permitted but not required) |
mm | minutes |
ss | seconds |
Date Format | Examples |
mm/dd[/yy] | 07/02, 07/02/99 |
yyyy-mm-dd | 1999-07-02 |
dd-month-yyyy | 02-July-1999 |
month [,yyyy] | Jul 02, July 02,1999 |
dd month[ yyyy] | 02 JULY, 02 july 1999 |
Variable | Description |
dd | day |
mm | month |
yy | year within century (00-38 is 2000 to 2038; 70-99 is 1970 to 1999) |
yyyy | year including century |
month | locale's full or abbreviated month name |
Time Units | Examples |
[+|- #] year | "-2 year" |
[+|- #] month | "2 months" |
[+|- #] fortnight | |
[+|- #] week | |
[+|- #] day | |
[+|- #] hour | |
[+|- #] minute | |
[+|- #] min | |
[+|- #] second | |
[+|- #] sec | |
tomorrow | |
yesterday | |
today | |
now | |
this | "this year" |
last | "last saturday" |
next | "next month" |
sunday | |
monday | |
tuesday | |
wednesday | |
thursday | |
friday | |
saturday | |
never |
You can also use the following time modifiers: first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, and ago.
See environ(7) for descriptions of the following environment variables that affect the execution of kadmin:
PAGER
/var/krb5/principal
/var/krb5/principal.ulog
/var/krb5/principal.kadm5
/var/krb5/principal.kadm5.lock
/var/krb5/kadm5.dict
/etc/krb5/kadm5.acl
/etc/krb5/kadm5.keytab
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Committed |
kpasswd(1), more(1), kadm5.acl(5), kdc.conf(5), krb5.conf(5), attributes(7), environ(7), kerberos(7), krb5envvar(7), kadmind(8), kdb5_ldap_util(8), kdb5_util(8), kproplog(8)
The kadmin program was originally written by Tom Yu at MIT, as an interface to the OpenVision Kerberos administration program.
The kadmin command is currently incompatible with the MIT kadmind daemon interface, so you cannot use this command to administer an MIT-based Kerberos database. However, clients running the Solaris implementation of Kerberos can still use an MIT-based KDC.
November 22, 2021 | OmniOS |