KINIT(1)

NAME
kinit - acquire initial tickets

SYNOPSIS
kinit [- -no-change-default] [- -default-for-principal] [- -afslog] [-c cachename - -cache=cachename] [-f | - -forwardable] [-F | - -no-forwardable] [-t keytabname - -keytab=keytabname] [-l time - -lifetime=time] [-p | - -proxiable] [-R | - -renew] [- -renewable] [-r time - -renewable-life=time] [-S principal - -server=principal] [-s time - -start-time=time] [-k | - -use-keytab] [-v | - -validate] [-e enctypes - -enctypes=enctypes] [-a addresses - -extra-addresses=addresses] [- -password-file=filename] [- -fcache-version=version-number] [-A | - -no-addresses] [-n | - -anonymous] [- -enterprise] [- -version] [- -help] [principal [command]]

DESCRIPTION
kinit is used to authenticate to the Kerberos server as principal, or if none is given, a system generated default (typically your login name at the default realm), and acquire a ticket granting ticket that can later be used to obtain tickets for other services.

Supported options:

-c cachename | - -cache=cachename
    The credentials cache to put the acquired ticket in, if other than default.

- -no-change-default
    By default the principal's credentials will be stored in the default credential cache. This option will cause them to instead be stored only in a cache whose name is derived from the principal's name. Note that klist(1) with the -l option will list all the credential caches the user has, along with the name of the principal whose credentials are stored therein. This option is ignored if the -c cachename | - -cache=cachename option is given. See also kswitch(1).

- -default-for-principal
    If this option is given and -c cachename | - -cache=cachename is not given, then the cache that will be used will be one that is appropriate for the client principal. For example, if the default cache type is FILE then the default cache may be either FILE:/tmp/krb5cc_%{uid}+%{principal_name} or FILE:/tmp/krb5cc_%{uid} if the principal is the default principal for the user, meaning that it is of the form ${USER}@${user_realm} or ${USER}@${default_realm}. This option implies - -no-change-default unless - -change-default is given. Caches for the user can be listed with the -l option to klist(1).

-f - -forwardable
    Obtain a ticket than can be forwarded to another host.

-F - -no-forwardable
    Do not obtain a forwardable ticket.

-t keytabname, - -keytab=keytabname
    Don't ask for a password, but instead get the key from the specified keytab.

-l time, - -lifetime=time
    Specifies the lifetime of the ticket. The argument can either be in seconds, or a more human readable string like ‘1h’.

-p, - -proxiable
    Request tickets with the proxiable flag set.

-R, - -renew
    Try to renew a ticket. The ticket must have the ‘renewable’ flag set, and must not be expired. If the [-S principal] option is specified, the ticket for the indicated service is renewed. If no service is explicitly specified, an attempt is made to renew the TGT for the client realm. If no TGT for the client realm is found in the credential cache, an attempt is made to renew the TGT for the defaualt realm (if that is found in the credential cache), or else the first TGT found. This makes it easier for users to renew forwarded tickets that are not issued by the origin realm.

- -renewable
    The same as - -renewable-life, with an infinite time.

-r time, - -renewable-life=time
    The max renewable ticket life.

-S principal, - -server=principal
    Get a ticket for a service other than krbtgt/LOCAL.REALM.

-s time, - -start-time=time
    Obtain a ticket that starts to be valid time (which can really be a generic time specification, like ‘1h’) seconds into the future.

-k, - -use-keytab
    The same as - -keytab, but with the default keytab name (normally FILE:/etc/krb5.keytab).

-v, - -validate
    Try to validate an invalid ticket.

-e, - -enctypes=enctypes
    Request tickets with this particular enctype.

- -password-file=filename
    read the password from the first line of filename. If the filename is STDIN, the password will be read from the standard input.

- -fcache-version=version-number
    Create a credentials cache of version version-number.

-a, - -extra-addresses=enctypes
    Adds a set of addresses that will, in addition to the systems local addresses, be put in the ticket. This can be useful if all addresses a client can use can't be automatically figured out. One such example is if the client is behind a firewall. Also settable via libdefaults/extra_addresses in krb5.conf(5).

-A, - -no-addresses
    Request a ticket with no addresses.

-n, - -anonymous
    Request an anonymous ticket. With the default (false) setting of the historical_anon_pkinit configuration parameter, if the principal is specified as @REALM, then anonymous PKINIT will be used to acquire an unauthenticated anonymous ticket and both the client name and (with fully RFC-comformant KDCs) realm in the returned ticket will be anonymized. Otherwise, authentication proceeds as normal and the anonymous ticket will have only the client name anonymized. With historical_anon_pkinit set to true, the principal is interpreted as a realm even without an at-sign prefix, and it is not possible to obtain authenticated anonymized tickets.

- -enterprise
    Parse principal as a enterprise (KRB5-NT-ENTERPRISE) name. Enterprise names are email like principals that are stored in the name part of the principal, and since there are two @ characters the parser needs to know that the first is not a realm. An example of an enterprise name is “lha@e.kth.se@KTH.SE”, and this option is usually used with canonicalize so that the principal returned from the KDC will typically be the real principal name.

- -gss-mech
    Enable GSS-API pre-authentication using the specified mechanism OID. Unless gss-name is also set, then the specified principal name will be used as the GSS-API initiator name. If the principal is specified as @REALM or left unspecified, then the default GSS-API credential will be used.

- -gss-name
    Attempt GSS-API pre-authentication using an initiator name distinct from the Kerberos client principal,

- -afslog
    Gets AFS tickets, converts them to version 4 format, and stores them in the kernel. Only useful if you have AFS.

The forwardable, proxiable, ticket_life, and renewable_life options can be set to a default value from the appdefaults section in krb5.conf, see krb5_appdefault(3).

If a command is given, kinit will set up new credentials caches, and AFS PAG, and then run the given command. When it finishes the credentials will be removed.

CREDENTIALS CACHE TYPES
Heimdal supports a number of credentials cache types:

FILE
    Uses a file per-cache with a binary format common to other Kerberos implementations.

DIR Uses a directory with multiple files, one per-cache in a collection.

SCC Uses a SQLite3 database with multiple caches in the database.

KEYRING
    Uses a Linux keyring.

KCM Uses a inter-process communications (IPC) to talk to a daemon typically named kcm.

API Uses KCM or else a shared object that implements the "CCAPI".

MEMORY
    Uses in-process memory (which disappears on process exit, so this if of little use in this program, kinit ).

CREDENTIALS CACHE COLLECTIONS
Every credentials cache's name consists of its cache type (e.g., FILE), a possibly-optional collection name, and a possibly optional "subsidiary" name naming a single cache in the collection.

The convention in Heimdal is that a cache's subsidiary cache name is the name of the client principal whose credentials are expected to be stored and found in that cache, with the following characters replaced with a hyphen: slash, backslash, colon, and plus.

The caches in a credentials cache collection can be listed by the klist(1) command. The ‘FILE’ credentials cache type supports listing of caches in the collection only when the ‘enable_file_cache_iteration’ is set to ‘yes’ in the ‘[libdefaults]’ section of krb5.conf(5).

CREDENTIALS CACHE NAMES
The general syntax for credentials cache names is
    TYPE:[collection-name][:subsidiary]
except that for the FILE type it is
    FILE:collection-name[+subsidiary]
and for the KEYRING type it is:
    KEYRING:[anchor:][collection[:subsidiary]]
where the collection name is free-form and the anchor is one of ‘process’, ‘thread’, or ‘legacy’.

The collection name is always absent for the ‘MEMORY’ credentials cache type.

When the collection name is absent then the default collection for the given credentials cache type is used, which are:
‘/tmp/krb5cc_{UID}’
    for FILE caches, where {UID} is a numeric user ID
‘/tmp/krb5cc_{UID}_dir’
    for DIR caches, where {UID} is a numeric user ID
‘/tmp/krb5scc_{UID}’
    for SCC caches, where {UID} is a numeric user ID, and where the named file is a SQLite3 database file
‘{UID}’
    for KCM caches, where {UID} is the user's numeric user ID
<implementation-specific>
    for API (CCAPI) credentials caches

The collection name is only optional for: ‘DIR’, ‘SCC’, ‘KCM’, ‘KEYRING’ and ‘API’ credentials cache types.

EXAMPLE CREDENTIALS CACHE NAMES

‘FILE:/tmp/cc’
    this is a FILE cache in a file named ‘/tmp/cc’ (the default would be ‘/tmp/krb5cc_{UID}’)

‘FILE:/tmp/cc+jane@TEST.H5L.SE’

‘DIR:/tmp/ccdir’
    this is a FILE cache named by ‘/tmp/krb5cc_{UID}_dir/primary’ which will be of the form ‘/tmp/ccdir/tkt.XXXXXX’

‘DIR:/tmp/ccdir:jane@TEST.H5L.SE’
    this is a FILE ccache named ‘/tmp/ccdir/tkt.jane@TEST.H5L.SE’

‘DIR::jane@TEST.H5L.SE’
    this is a FILE ccache named ‘/tmp/krb5cc_{UID}_dir/tkt.jane@TEST.H5L.SE’ where {UID} is the user's numeric identifier

‘SCC:’
    this is the current primary cache in the SQLite3 database named ‘/tmp/krb5scc_{UID}’

‘SCC:/tmp/ccdb’
    this is the current primary cache in the SQLite3 database named ‘/tmp/ccdb’

‘SCC:/tmp/ccdb:jane@TEST.H5L.SE’
    this is the cache “named jane@TEST.H5L.SE” in the SQLite3 database named ‘/tmp/ccdb’

‘SCC::jane@TEST.H5L.SE’
    this is the cache named “jane@TEST.H5L.SE” in the SQLite3 database named ‘/tmp/krb5scc_{UID}’

‘KEYRING:’
    this is the primary cache in the default KEYRING collection for the running user

‘KEYRING:foo’
    this is the primary cache in the KEYRING collection named “foo”

‘KEYRING:foo:jane@TEST.H5L.SE’
    this is the cache named “jane@TEST.H5L.SE” in the KEYRING collection named “foo”

‘KCM:’
    this is the primary cache in the default KCM collection for the running user

‘KCM:12345’
    this is the primary cache in the default KCM collection for the user whose numeric identifier is 12345

‘KCM:jane@TEST.H5L.SE’
    this is the cache named “jane@TEST.H5L.SE” in the default KCM collection for the running user

‘KCM:12345:jane@TEST.H5L.SE’
    this is the cache named “jane@TEST.H5L.SE” in the default KCM collection for the given user

‘API:’
    this is the primary cache in the default API collection for the running user

‘API:foo’
    this is the primary cache in the API collection named “foo”

‘API:foo:jane@TEST.H5L.SE’
    this is the cache named “jane@TEST.H5L.SE” in the KEYRING collection named “foo”

ENVIRONMENT

KRB5CCNAME
    Specifies the default credentials cache.

KRB5_CONFIG
    The file name of krb5.conf, the default being /etc/krb5.conf.

SEE ALSO
kdestroy(1), klist(1), kswitch(1), kcm(8), krb5_appdefault(3), krb5.conf(5)