JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 1M: System Administration Commands     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

System Administration Commands - Part 1

6to4relay(1M)

acct(1M)

acctadm(1M)

acctcms(1M)

acctcon1(1M)

acctcon(1M)

acctcon2(1M)

acctdisk(1M)

acctdusg(1M)

acctmerg(1M)

accton(1M)

acctprc1(1M)

acctprc(1M)

acctprc2(1M)

acctsh(1M)

acctwtmp(1M)

acpihpd(1M)

adbgen(1M)

add_allocatable(1M)

addbadsec(1M)

add_drv(1M)

aimanifest(1M)

arp(1M)

asradm(1M)

asr-notify(1M)

atohexlabel(1M)

audit(1M)

auditconfig(1M)

auditd(1M)

auditrecord(1M)

auditreduce(1M)

auditstat(1M)

audit_warn(1M)

automount(1M)

automountd(1M)

autopush(1M)

bart(1M)

beadm(1M)

boot(1M)

bootadm(1M)

bootconfchk(1M)

bootparamd(1M)

busstat(1M)

captoinfo(1M)

catman(1M)

cfgadm(1M)

cfgadm_ac(1M)

cfgadm_cardbus(1M)

cfgadm_fp(1M)

cfgadm_ib(1M)

cfgadm_pci(1M)

cfgadm_sata(1M)

cfgadm_sbd(1M)

cfgadm_scsi(1M)

cfgadm_sdcard(1M)

cfgadm_shp(1M)

cfgadm_sysctrl(1M)

cfgadm_usb(1M)

chargefee(1M)

chat(1M)

check-hostname(1M)

check-permissions(1M)

chk_encodings(1M)

chroot(1M)

cimworkshop(1M)

ckpacct(1M)

clear_locks(1M)

clinfo(1M)

closewtmp(1M)

clri(1M)

comsat(1M)

configCCR(1M)

consadm(1m)

console-reset(1M)

coreadm(1M)

cpustat(1M)

croinfo(1M)

cron(1M)

cryptoadm(1M)

datadm(1M)

dcopy(1M)

dcs(1M)

dd(1M)

ddu(1M)

ddu-text(1M)

devchassisd(1M)

devfsadm(1M)

devfsadmd(1M)

device_allocate(1M)

device_remap(1M)

devinfo(1M)

devlinks(1M)

devnm(1M)

devprop(1M)

df(1M)

dfmounts(1M)

dfmounts_nfs(1M)

dfshares(1M)

dfshares_nfs(1M)

df_ufs(1M)

dhcpagent(1M)

dhcpconfig(1M)

dhcpmgr(1M)

dhtadm(1M)

dig(1M)

directoryserver(1M)

diskinfo(1M)

disks(1M)

diskscan(1M)

dispadmin(1M)

distro_const(1M)

dladm(1M)

dlmgmtd(1M)

dlstat(1M)

dmesg(1M)

dminfo(1M)

dns-sd(1M)

dnssec-dsfromkey(1M)

dnssec-keyfromlabel(1M)

dnssec-keygen(1M)

dnssec-makekeyset(1M)

dnssec-signkey(1M)

dnssec-signzone(1M)

dodisk(1M)

domainname(1M)

drd(1M)

drvconfig(1M)

dsbitmap(1M)

dscfg(1M)

dscfgadm(1M)

dscfglockd(1M)

dsstat(1M)

dsvclockd(1M)

dtrace(1M)

dumpadm(1M)

editmap(1M)

edquota(1M)

eeprom(1M)

efdaemon(1M)

embedded_su(1M)

emCCR(1M)

emocmrsp(1M)

etrn(1M)

fbconfig(1M)

fbconf_xorg(1M)

fcadm(1M)

fcinfo(1M)

fdetach(1M)

fdisk(1M)

ff(1M)

ff_ufs(1M)

fingerd(1M)

fiocompress(1M)

flowadm(1M)

flowstat(1M)

fmadm(1M)

fmd(1M)

fmdump(1M)

fmstat(1M)

fmthard(1M)

format(1M)

fruadm(1M)

fsck(1M)

fsck_pcfs(1M)

fsck_udfs(1M)

fsck_ufs(1M)

fsdb(1M)

fsdb_udfs(1M)

fsdb_ufs(1M)

fsflush(1M)

fsirand(1M)

fssnap(1M)

fssnap_ufs(1M)

fsstat(1M)

fstyp(1M)

fuser(1M)

fwflash(1M)

fwtmp(1M)

getdevpolicy(1M)

getent(1M)

gettable(1M)

getty(1M)

gkadmin(1M)

groupadd(1M)

groupdel(1M)

groupmod(1M)

growfs(1M)

grpck(1M)

gsscred(1M)

gssd(1M)

hald(1M)

hal-device(1M)

hal-fdi-validate(1M)

hal-find(1M)

hal-find-by-capability(1M)

hal-find-by-property(1M)

hal-get-property(1M)

hal-set-property(1M)

halt(1M)

hextoalabel(1M)

host(1M)

hostconfig(1M)

hotplug(1M)

hotplugd(1M)

htable(1M)

ickey(1M)

id(1M)

idmap(1M)

idmapd(1M)

idsconfig(1M)

ifconfig(1M)

if_mpadm(1M)

ifparse(1M)

iiadm(1M)

iicpbmp(1M)

iicpshd(1M)

ikeadm(1M)

ikecert(1M)

ilbadm(1M)

ilbd(1M)

ilomconfig(1M)

imqadmin(1M)

imqbrokerd(1M)

imqcmd(1M)

imqdbmgr(1M)

imqkeytool(1M)

imqobjmgr(1M)

imqusermgr(1M)

in.chargend(1M)

in.comsat(1M)

in.daytimed(1M)

in.dhcpd(1M)

in.discardd(1M)

in.echod(1M)

inetadm(1M)

inetconv(1M)

inetd(1M)

in.fingerd(1M)

infocmp(1M)

in.iked(1M)

init(1M)

init.sma(1M)

init.wbem(1M)

inityp2l(1M)

in.lpd(1M)

in.mpathd(1M)

in.named(1M)

in.ndpd(1M)

in.rarpd(1M)

in.rdisc(1M)

in.rexecd(1M)

in.ripngd(1M)

in.rlogind(1M)

in.routed(1M)

in.rshd(1M)

in.rwhod(1M)

install(1M)

installadm(1M)

installboot(1M)

installf(1M)

installgrub(1M)

in.stdiscover(1M)

in.stlisten(1M)

in.talkd(1M)

in.telnetd(1M)

in.tftpd(1M)

in.timed(1M)

intrd(1M)

intrstat(1M)

in.uucpd(1M)

iostat(1M)

ipaddrsel(1M)

ipadm(1M)

ipf(1M)

ipfs(1M)

ipfstat(1M)

ipmgmtd(1M)

ipmon(1M)

ipmpstat(1M)

ipnat(1M)

ippool(1M)

ipqosconf(1M)

ipsecalgs(1M)

ipsecconf(1M)

ipseckey(1M)

iscsiadm(1M)

isns(1M)

isnsadm(1M)

itadm(1M)

itu(1M)

js2ai(1M)

k5srvutil(1M)

kadb(1M)

kadmin(1M)

kadmind(1M)

kadmin.local(1M)

kcfd(1M)

kclient(1M)

kdb5_ldap_util(1M)

kdb5_util(1M)

kdcmgr(1M)

kernel(1M)

keyserv(1M)

killall(1M)

kmem_task(1M)

kmscfg(1M)

kprop(1M)

kpropd(1M)

kproplog(1M)

krb5kdc(1M)

ksslcfg(1M)

kstat(1M)

ktkt_warnd(1M)

labeld(1M)

labelit(1M)

labelit_hsfs(1M)

labelit_udfs(1M)

labelit_ufs(1M)

lastlogin(1M)

latencytop(1M)

ldapaddent(1M)

ldap_cachemgr(1M)

ldapclient(1M)

ldmad(1M)

link(1M)

llc2_loop(1M)

lldpadm(1M)

lldpd(1M)

lms(1M)

locator(1M)

lockd(1M)

lockfs(1M)

lockstat(1M)

lofiadm(1M)

logadm(1M)

logins(1M)

lshal(1M)

System Administration Commands - Part 2

System Administration Commands - Part 3

kadmin

, kadmin.local

- Kerberos database administration program

Synopsis

/usr/sbin/kadmin [-r realm] [-p principal] [-q query]
 [-s admin_server [:port]] [ [-c credential_cache]
 | [-k [-t keytab] | [-n]] | [-w password]] [-x db_args]...
/usr/sbin/kadmin.local [-r realm] [-p principal]
 [-q query] [-d dbname] [-e "enc:salt..."] [-m] [-D]

Description

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(4)). 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(1M)) 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.

Options

The following options are supported:

-c credentials_cache

Search credentials_cache for a service ticket for the kadmin/fqdn service; it can be acquired with the kinit(1) program. If this option is not specified, kadmin requests a new service ticket from the KDC, and stores it in its own temporary credentials cache.

-d dbname

Specify a non-standard database name. [Local only]

-D

Turn on debug mode. [Local only]

-e “enc:salt ...”

Specify a different encryption type and/or key salt. [Local only]

-k [-t keytab]

Use the default keytab (-k) or a specific keytab (-t keytab) to decrypt the KDC response instead of prompting for a password. In this case, the default principal will be host/hostname. This is primarily used for keytab maintenance.

-m

Accept the database master password from the keyboard rather than using the /var/krb5/.k5.realm stash file. [Local only]

-n

Requests anonymous processing. Two types of anonymous principals are supported. For fully anonymous Kerberos, configure pkinit on the KDC and configure pkinit_anchors in the client's krb5.conf. Then use the -n option 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, use kinit -n with 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 supports only fully anonymous operation.

-p principal

Authenticate principal to the kadmin/fqdn service. Otherwise, kadmin will append /admin to the primary principal name of the default credentials cache, the value of the USER environment variable, or the username as obtained with getpwuid, in that order of preference.

-q query

Pass query directly to kadmin, which will perform query and then exit. This can be useful for writing scripts.

-r realm

Use realm as the default database realm.

-s admin_server[:port]

Administer the specified admin server at the specified port number (port). This can be useful in administering a realm not known to your client.

-w password

Use password instead of prompting for one. Note that placing the password for a Kerberos principal with administration access into a shell script can be dangerous if unauthorized users gain read access to the script or can read arguments of this command through ps(1).

-x db_args

Pass database-specific arguments to kadmin. Supported arguments are for LDAP and the Berkeley-db2 plug-in. These arguments are:

binddn=binddn

LDAP simple bind DN for authorization on the directory server. Overrides the ldap_kadmind_dn parameter setting in krb5.conf(4).

bindpwd=bindpwd

Bind password.

dbname=name

For the Berkeley-db2 plug-in, specifies a name for the Kerberos database.

nconns=num

Maximum number of server connections.

port=num

Directory server connection port.

COMMANDS

list_requests

Lists all the commands available for kadmin. Aliased by lr and ?.

get_privs

Lists the current Kerberos administration privileges (ACLs) for the principal that is currently running kadmin. The privileges are based on the /etc/krb5/kadm5.acl file on the master KDC. Aliased by getprivs.

add_principal [options] newprinc

Creates a new principal, newprinc, prompting twice for a password. If the -policy option is not specified and a policy named default exists, then the default policy is assigned to the principal; note that the assignment of the default policy occurs automatically only when a principal is first created, so the default policy must already exist for the assignment to occur. The automatic assignment of the default policy can be suppressed with the -clearpolicy option. This command requires the add privilege. Aliased by addprinc and ank. The options are:

-expire expdate

Expiration date of the principal. See the Time Formats section for the valid absolute time formats that you can specify for expdate.

-pwexpire pwexpdate

Password expiration date. See the Time Formats section for the valid absolute time formats that you can specify for pwexpdate.

-maxlife maxlife

Maximum ticket life for the principal. See the Time Formats section for the valid time duration formats that you can specify for maxlife.

-maxrenewlife maxrenewlife

Maximum renewable life of tickets for the principal. See the Time Formats section for the valid time duration formats that you can specify for maxrenewlife.

-kvno kvno

Explicitly set the key version number.

-policy policy

Policy used by the principal. If both the -policy and -clearpolicy options are not specified, the default policy is used if it exists; otherwise, the principal will have no policy. Also note that the password and principal name must be different when you add a new principal with a specific policy or the default policy.

-clearpolicy

-clearpolicy prevents the default policy from being assigned when -policy is not specified. This option has no effect if the default policy does not exist.

{|+}allow_postdated

-allow_postdated prohibits the principal from obtaining postdated tickets. (Sets the KRB5_KDB_DISALLOW_POSTDATED flag.) +allow_postdated clears this flag.

{|+}allow_forwardable

-allow_forwardable prohibits the principal from obtaining forwardable tickets. (Sets the KRB5_KDB_DISALLOW_FORWARDABLE flag.) +allow_forwardable clears this flag.

{|+}allow_renewable

-allow_renewable prohibits the principal from obtaining renewable tickets. (Sets the KRB5_KDB_DISALLOW_RENEWABLE flag.) +allow_renewable clears this flag.

{|+}allow_proxiable

-allow_proxiable prohibits the principal from obtaining proxiable tickets. (Sets the KRB5_KDB_DISALLOW_PROXIABLE flag.) +allow_proxiable clears this flag.

{|+}allow_dup_skey

-allow_dup_skey disables user-to-user authentication for the principal by prohibiting this principal from obtaining a session key for another user. (Sets the KRB5_KDB_DISALLOW_DUP_SKEY flag.) +allow_dup_skey clears this flag.

{|+}requires_preauth

+requires_preauth requires the principal to preauthenticate before being allowed to kinit. (Sets the KRB5_KDB_REQUIRES_PRE_AUTH flag.) -requires_preauth clears this flag.

{|+}requires_hwauth

+requires_hwauth requires the principal to preauthenticate using a hardware device before being allowed to kinit. (Sets the KRB5_KDB_REQUIRES_HW_AUTH flag.) -requires_hwauth clears this flag.

{|+}allow_svr

-allow_svr prohibits the issuance of service tickets for the principal. (Sets the KRB5_KDB_DISALLOW_SVR flag.) +allow_svr clears this flag.

{|+}allow_tgs_req

–allow_tgs_req specifies that a Ticket-Granting Service (TGS) request for a service ticket for the principal is not permitted. This option is useless for most things. +allow_tgs_req clears this flag. The default is +allow_tgs_req. In effect, –allow_tgs_req sets the KRB5_KDB_DISALLOW_TGT_BASED flag on the principal in the database.

{|+}allow_tix

–allow_tix forbids the issuance of any tickets for the principal. +allow_tix clears this flag. The default is +allow_tix. In effect, –allow_tix sets the KRB5_KDB_DISALLOW_ALL_TIX flag on the principal in the database.

{|+}needchange

+needchange sets a flag in attributes field to force a password change; –needchange clears it. The default is –needchange. In effect, +needchange sets the KRB5_KDB_REQUIRES_PWCHANGE flag on the principal in the database.

{|+}password_changing_service

+password_changing_service sets a flag in the attributes field marking this as a password change service principal (useless for most things). –password_changing_service clears the flag. This flag intentionally has a long name. The default is –password_changing_service. In effect, +password_changing_service sets the KRB5_KDB_PWCHANGE_SERVICE flag on the principal in the database.

{-|+}ok_as_delegate

+ok_as_delegate sets the OK-AS-DELEGATE flag on tickets issued for use with this principal as the service, which clients may use as a hint that credentials can and should be delegated when authenticating to the service. (Sets the KRB5_KDB_OK_AS_DELEGATE flag.) -ok_as_delegate clears this flag.

{-|+}ok_to_auth_as_delegate

+ok_to_auth_as_delegate sets the service to allow the use of S4U2Self. -ok_to_auth_as_delegate clears this flag.

-randkey

Sets the key of the principal to a random value.

-pw password

Sets the key of the principal to the specified string and does not prompt for a password. Note that using this option in a shell script can be dangerous if unauthorized users gain read access to the script.

-e “enc:salt ...”

Override the list of enctype:salttype pairs given in kdc.conf(4) for setting the key of the principal. The quotes are necessary if there are multiple enctype:salttype pairs. One key for each similar enctype and same salttype will be created and the first one listed will be used. For example, in a list of two similar enctypes with the same salt, “des-cbc-crc:normal des-cbc-md5:normal”, one key will be created and it will be of type des-cbc-crc:normal.

Example:
kadmin: addprinc tlyu/admin
WARNING: no policy specified for "tlyu/admin@ACME.COM"; 
defaulting to no policy.
Enter password for principal tlyu/admin@ACME.COM:
Re-enter password for principal tlyu/admin@ACME.COM:
Principal "tlyu/admin@ACME.COM" created. 
kadmin:
Errors:

KADM5_AUTH_ADD (requires add privilege)

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

Deletes the specified principal from the database. This command prompts for deletion, unless the -force option is given. This command requires the delete privilege. Aliased by delprinc.

Example:
kadmin: delprinc mwm_user
Are you sure you want to delete the principal
"mwm_user@ACME.COM"? (yes/no): yes 
Principal "mwm_user@ACME.COM" deleted.
Make sure that you have removed this principal from
all kadmind ACLs before reusing.
kadmin:
Errors:

KADM5_AUTH_DELETE (requires delete privilege)

KADM5_UNK_PRINC (principal does not exist)

modify_principal [options] principal

Modifies the specified principal, changing the fields as specified. The options are as above for add_principal, except that password changing is forbidden by this command. In addition, the option -clearpolicy will clear the current policy of a principal. This command requires the modify privilege. Aliased by modprinc.

-unlock

Unlocks the principal so that it can successfully authenticate. If the principal had previously been locked due to reaching maxfailure in failurecountinterval time then the principal will be locked for lockoutduration time.

Errors:

KADM5_AUTH_MODIFY (requires modify privilege)

KADM5_UNK_PRINC (principal does not exist)

KADM5_UNK_POLICY (policy does not exist)

KADM5_BAD_MASK (should not happen)

change_password [options] principal

Changes the password of principal. Prompts for a new password if neither -randkey or -pw is specified. Requires the changepw privilege, or that the principal that is running the program to be the same as the one changed. Aliased by cpw. The following options are available:

-randkey

Sets the key of the principal to a random value.

-pw password

Sets the password to the specified string. Not recommended.

-e “enc:salt ...”

Override the list of enctype:salttype pairs given in kdc.conf(4) for setting the key of the principal. The quotes are necessary if there are multiple enctype:salttype pairs. For each key, the first matching similar enctype and same salttype in the list will be used to set the new key(s).

-keepold

Keeps the previous kvno's keys around. There is no easy way to delete the old keys, and this flag is usually not necessary except perhaps for TGS keys as it will allow existing valid TGTs to continue to work.

Example:
kadmin: cpw systest
Enter password for principal systest@ACME.COM:
Re-enter password for principal systest@ACME.COM:
Password for systest@ACME.COM changed.
kadmin:
Errors:

KADM5_AUTH_MODIFY (requires the modify privilege)

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

Gets the attributes of principal. Requires the inquire privilege, or that the principal that is running the program to be the same as the one being listed. With the -terse option, outputs fields as quoted tab-separated strings. Aliased by getprinc.

Examples:
kadmin: getprinc tlyu/admin
Principal: tlyu/admin@ACME.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@ACME.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@ACME.COM"   0       1199359066      0       2147483647      
"root/admin@ACME.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_AUTH_GET (requires the get [inquire] privilege)

KADM5_UNK_PRINC (principal does not exist)

list_principals [expression]

Retrieves all or some principal names. expression is a shell-style glob expression that can contain the wild-card characters ?, *, and []'s. 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. Requires the list privilege. Aliased by listprincs, get_principals, and getprincs.

Examples:
kadmin: listprincs test*
test3@ACME.COM
test2@ACME.COM
test1@ACME.COM
testuser@ACME.COM
kadmin:
add_policy [options] policy

Adds the named policy to the policy database. Requires the add privilege. Aliased by addpol. The following options are available:

-maxfailure maxnumber

sets the maximum number of failures before the principal is locked after authentication failures in failurecountinterval time.

-failurecountinterval failuretime

sets the time after which the authentication failure count is reset 0. See the “Time Formats” section, below, for the valid time duration formats that you can specify for failuretime.

-lockoutduration lockouttime

sets the time in which the principal is locked from authenticating if maxfailure authentication failures occur within failurecountinterval time. See the “Time Formats” section, below, for the valid time duration formats that you can specify for lockouttime.

-maxlife maxlife

sets the maximum lifetime of a password. See the Time Formats section for the valid time duration formats that you can specify for maxlife.

-minlife minlife

sets the minimum lifetime of a password. See the Time Formats section for the valid time duration formats that you can specify for minlife.

-minlength length

sets the minimum length of a password.

-minclasses number

sets the minimum number of character classes allowed in a password. The valid values are:

1

only letters (himom)

2

both letters and numbers (hi2mom)

3

letters, numbers, and punctuation (hi2mom!)

-history number

sets the number of past keys kept for a principal.

Errors:

KADM5_AUTH_ADD (requires the add privilege)

KADM5_DUP (policy already exists)

delete_policy [-force] policy

Deletes the named policy. Unless the -force option is specified, prompts for confirmation before deletion. The command will fail if the policy is in use by any principals. Requires the delete privilege. Aliased by delpol.

Example:
kadmin: del_policy guests 
Are you sure you want to delete the 
policy "guests"? (yes/no): yes
Policy "guests" deleted.
kadmin:
Errors:

KADM5_AUTH_DELETE (requires the delete privilege)

KADM5_UNK_POLICY (policy does not exist)

KADM5_POLICY_REF (reference count on policy is not zero)

modify_policy [options] policy

Modifies the named policy. Options are as above for add_policy. Requires the modify privilege. Aliased by modpol.

Errors:

KADM5_AUTH_MODIFY (requires the modify privilege)

KADM5_UNK_POLICY (policy does not exist)

get_policy [-terse] policy

Displays the values of the named policy. Requires the inquire privilege. With the -terse flag, outputs the fields as quoted strings separated by tabs. Aliased by 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
Maximum password failures before lockout: 3
Password failure count reset interval: 180
Password lockout duration: 60
kadmin: get_policy -terse admin
admin admin    15552000    0    6    2    5    17 3 180 60
kadmin:
Errors:

KADM5_AUTH_GET (requires the get privilege)

KADM5_UNK_POLICY (policy does not exist)

list_policies [expression]

Retrieves all or some policy names. expression is a shell-style glob expression that can contain the wild-card characters ?, *, and []'s. All policy names matching the expression are printed. If no expression is provided, all existing policy names are printed. Requires the list privilege. Aliased by listpols, get_policies, and getpols.

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 keysaltlist] [-norandkey] [[principal | -glob princ-exp]] [...]

Adds a principal or all principals matching princ-exp to a keytab. It randomizes each principal's key in the process, to prevent a compromised admin account from reading out all of the keys from the database. However, kadmin.local has the -norandkey option, which leaves the keys and their version numbers unchanged, similar to the Kerberos V4 ext_srvtab command. That allows users to continue to use the passwords they know to login normally, while simultaneously allowing scripts to login to the same account using a keytab. There is no significant security risk added since kadmin.local must be run by root on the KDC anyway.

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(4), in the permitted_enctypes parameter. If “-e enctype:salt” is not used and permitted_enctypes is not defined in krb5.conf(4), 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

princ-exp follows the same rules described for the list_principals command.

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]

Removes entries for the specified principal from a keytab. Requires no privileges, since this does not require database access. If all is specified, all entries for that principal are removed; if 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. If the -k argument is not specified, the default keytab file, /etc/krb5/krb5.keytab, is used. If the -q option is specified, less status information is displayed. Aliased by ktrem.

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

Quits kadmin. Aliased by exit and q.

Time Formats

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.

Environment Variables

See environ(5) for descriptions of the following environment variables that affect the execution of kadmin:

PAGER

The command to use as a filter for paging output. This can also be used to specify options. The default is more(1).

Files

/var/krb5/principal

Kerberos principal database.

/var/krb5/principal.ulog

The update log file for incremental propagation.

/var/krb5/principal.kadm5

Kerberos administrative database. Contains policy information.

/var/krb5/principal.kadm5.lock

Lock file for the Kerberos administrative database. This file works backwards from most other lock files (that is, kadmin will exit with an error if this file does not exist).

/var/krb5/kadm5.dict

Dictionary of strings explicitly disallowed as passwords.

/etc/krb5/kadm5.acl

List of principals and their kadmin administrative privileges.

/etc/krb5/kadm5.keytab

Keytab for kadmind principals: kadmin/fqdn, changepw/fqdn, and kadmin/changepw.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/security/kerberos-5
Interface Stability
Committed

See Also

kpasswd(1), more(1), gkadmin(1M), kadmind(1M), kdb5_util(1M), kdb5_ldap_util(1M), kproplog(1M), kadm5.acl(4), kdc.conf(4), krb5.conf(4), attributes(5), environ(5), kerberos(5), krb5envvar(5)

HISTORY

The kadmin program was originally written by Tom Yu at MIT, as an interface to the OpenVision Kerberos administration program.

Diagnostics

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.