xref: /freebsd/crypto/krb5/doc/user/user_commands/kinit.rst (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert.. _kinit(1):
2*7f2fe78bSCy Schubert
3*7f2fe78bSCy Schubertkinit
4*7f2fe78bSCy Schubert=====
5*7f2fe78bSCy Schubert
6*7f2fe78bSCy SchubertSYNOPSIS
7*7f2fe78bSCy Schubert--------
8*7f2fe78bSCy Schubert
9*7f2fe78bSCy Schubert**kinit**
10*7f2fe78bSCy Schubert[**-V**]
11*7f2fe78bSCy Schubert[**-l** *lifetime*]
12*7f2fe78bSCy Schubert[**-s** *start_time*]
13*7f2fe78bSCy Schubert[**-r** *renewable_life*]
14*7f2fe78bSCy Schubert[**-p** | -**P**]
15*7f2fe78bSCy Schubert[**-f** | -**F**]
16*7f2fe78bSCy Schubert[**-a**]
17*7f2fe78bSCy Schubert[**-A**]
18*7f2fe78bSCy Schubert[**-C**]
19*7f2fe78bSCy Schubert[**-E**]
20*7f2fe78bSCy Schubert[**-v**]
21*7f2fe78bSCy Schubert[**-R**]
22*7f2fe78bSCy Schubert[**-k** [**-i** | -**t** *keytab_file*]]
23*7f2fe78bSCy Schubert[**-c** *cache_name*]
24*7f2fe78bSCy Schubert[**-n**]
25*7f2fe78bSCy Schubert[**-S** *service_name*]
26*7f2fe78bSCy Schubert[**-I** *input_ccache*]
27*7f2fe78bSCy Schubert[**-T** *armor_ccache*]
28*7f2fe78bSCy Schubert[**-X** *attribute*\ [=\ *value*]]
29*7f2fe78bSCy Schubert[**--request-pac** | **--no-request-pac**]
30*7f2fe78bSCy Schubert[*principal*]
31*7f2fe78bSCy Schubert
32*7f2fe78bSCy Schubert
33*7f2fe78bSCy SchubertDESCRIPTION
34*7f2fe78bSCy Schubert-----------
35*7f2fe78bSCy Schubert
36*7f2fe78bSCy Schubertkinit obtains and caches an initial ticket-granting ticket for
37*7f2fe78bSCy Schubert*principal*.  If *principal* is absent, kinit chooses an appropriate
38*7f2fe78bSCy Schubertprincipal name based on existing credential cache contents or the
39*7f2fe78bSCy Schubertlocal username of the user invoking kinit.  Some options modify the
40*7f2fe78bSCy Schubertchoice of principal name.
41*7f2fe78bSCy Schubert
42*7f2fe78bSCy Schubert
43*7f2fe78bSCy SchubertOPTIONS
44*7f2fe78bSCy Schubert-------
45*7f2fe78bSCy Schubert
46*7f2fe78bSCy Schubert**-V**
47*7f2fe78bSCy Schubert    display verbose output.
48*7f2fe78bSCy Schubert
49*7f2fe78bSCy Schubert**-l** *lifetime*
50*7f2fe78bSCy Schubert    (:ref:`duration` string.)  Requests a ticket with the lifetime
51*7f2fe78bSCy Schubert    *lifetime*.
52*7f2fe78bSCy Schubert
53*7f2fe78bSCy Schubert    For example, ``kinit -l 5:30`` or ``kinit -l 5h30m``.
54*7f2fe78bSCy Schubert
55*7f2fe78bSCy Schubert    If the **-l** option is not specified, the default ticket lifetime
56*7f2fe78bSCy Schubert    (configured by each site) is used.  Specifying a ticket lifetime
57*7f2fe78bSCy Schubert    longer than the maximum ticket lifetime (configured by each site)
58*7f2fe78bSCy Schubert    will not override the configured maximum ticket lifetime.
59*7f2fe78bSCy Schubert
60*7f2fe78bSCy Schubert**-s** *start_time*
61*7f2fe78bSCy Schubert    (:ref:`duration` string.)  Requests a postdated ticket.  Postdated
62*7f2fe78bSCy Schubert    tickets are issued with the **invalid** flag set, and need to be
63*7f2fe78bSCy Schubert    resubmitted to the KDC for validation before use.
64*7f2fe78bSCy Schubert
65*7f2fe78bSCy Schubert    *start_time* specifies the duration of the delay before the ticket
66*7f2fe78bSCy Schubert    can become valid.
67*7f2fe78bSCy Schubert
68*7f2fe78bSCy Schubert**-r** *renewable_life*
69*7f2fe78bSCy Schubert    (:ref:`duration` string.)  Requests renewable tickets, with a total
70*7f2fe78bSCy Schubert    lifetime of *renewable_life*.
71*7f2fe78bSCy Schubert
72*7f2fe78bSCy Schubert**-f**
73*7f2fe78bSCy Schubert    requests forwardable tickets.
74*7f2fe78bSCy Schubert
75*7f2fe78bSCy Schubert**-F**
76*7f2fe78bSCy Schubert    requests non-forwardable tickets.
77*7f2fe78bSCy Schubert
78*7f2fe78bSCy Schubert**-p**
79*7f2fe78bSCy Schubert    requests proxiable tickets.
80*7f2fe78bSCy Schubert
81*7f2fe78bSCy Schubert**-P**
82*7f2fe78bSCy Schubert    requests non-proxiable tickets.
83*7f2fe78bSCy Schubert
84*7f2fe78bSCy Schubert**-a**
85*7f2fe78bSCy Schubert    requests tickets restricted to the host's local address[es].
86*7f2fe78bSCy Schubert
87*7f2fe78bSCy Schubert**-A**
88*7f2fe78bSCy Schubert    requests tickets not restricted by address.
89*7f2fe78bSCy Schubert
90*7f2fe78bSCy Schubert**-C**
91*7f2fe78bSCy Schubert    requests canonicalization of the principal name, and allows the
92*7f2fe78bSCy Schubert    KDC to reply with a different client principal from the one
93*7f2fe78bSCy Schubert    requested.
94*7f2fe78bSCy Schubert
95*7f2fe78bSCy Schubert**-E**
96*7f2fe78bSCy Schubert    treats the principal name as an enterprise name.
97*7f2fe78bSCy Schubert
98*7f2fe78bSCy Schubert**-v**
99*7f2fe78bSCy Schubert    requests that the ticket-granting ticket in the cache (with the
100*7f2fe78bSCy Schubert    **invalid** flag set) be passed to the KDC for validation.  If the
101*7f2fe78bSCy Schubert    ticket is within its requested time range, the cache is replaced
102*7f2fe78bSCy Schubert    with the validated ticket.
103*7f2fe78bSCy Schubert
104*7f2fe78bSCy Schubert**-R**
105*7f2fe78bSCy Schubert    requests renewal of the ticket-granting ticket.  Note that an
106*7f2fe78bSCy Schubert    expired ticket cannot be renewed, even if the ticket is still
107*7f2fe78bSCy Schubert    within its renewable life.
108*7f2fe78bSCy Schubert
109*7f2fe78bSCy Schubert    Note that renewable tickets that have expired as reported by
110*7f2fe78bSCy Schubert    :ref:`klist(1)` may sometimes be renewed using this option,
111*7f2fe78bSCy Schubert    because the KDC applies a grace period to account for client-KDC
112*7f2fe78bSCy Schubert    clock skew.  See :ref:`krb5.conf(5)` **clockskew** setting.
113*7f2fe78bSCy Schubert
114*7f2fe78bSCy Schubert**-k** [**-i** | **-t** *keytab_file*]
115*7f2fe78bSCy Schubert    requests a ticket, obtained from a key in the local host's keytab.
116*7f2fe78bSCy Schubert    The location of the keytab may be specified with the **-t**
117*7f2fe78bSCy Schubert    *keytab_file* option, or with the **-i** option to specify the use
118*7f2fe78bSCy Schubert    of the default client keytab; otherwise the default keytab will be
119*7f2fe78bSCy Schubert    used.  By default, a host ticket for the local host is requested,
120*7f2fe78bSCy Schubert    but any principal may be specified.  On a KDC, the special keytab
121*7f2fe78bSCy Schubert    location ``KDB:`` can be used to indicate that kinit should open
122*7f2fe78bSCy Schubert    the KDC database and look up the key directly.  This permits an
123*7f2fe78bSCy Schubert    administrator to obtain tickets as any principal that supports
124*7f2fe78bSCy Schubert    authentication based on the key.
125*7f2fe78bSCy Schubert
126*7f2fe78bSCy Schubert**-n**
127*7f2fe78bSCy Schubert    Requests anonymous processing.  Two types of anonymous principals
128*7f2fe78bSCy Schubert    are supported.
129*7f2fe78bSCy Schubert
130*7f2fe78bSCy Schubert    For fully anonymous Kerberos, configure pkinit on the KDC and
131*7f2fe78bSCy Schubert    configure **pkinit_anchors** in the client's :ref:`krb5.conf(5)`.
132*7f2fe78bSCy Schubert    Then use the **-n** option with a principal of the form ``@REALM``
133*7f2fe78bSCy Schubert    (an empty principal name followed by the at-sign and a realm
134*7f2fe78bSCy Schubert    name).  If permitted by the KDC, an anonymous ticket will be
135*7f2fe78bSCy Schubert    returned.
136*7f2fe78bSCy Schubert
137*7f2fe78bSCy Schubert    A second form of anonymous tickets is supported; these
138*7f2fe78bSCy Schubert    realm-exposed tickets hide the identity of the client but not the
139*7f2fe78bSCy Schubert    client's realm.  For this mode, use ``kinit -n`` with a normal
140*7f2fe78bSCy Schubert    principal name.  If supported by the KDC, the principal (but not
141*7f2fe78bSCy Schubert    realm) will be replaced by the anonymous principal.
142*7f2fe78bSCy Schubert
143*7f2fe78bSCy Schubert    As of release 1.8, the MIT Kerberos KDC only supports fully
144*7f2fe78bSCy Schubert    anonymous operation.
145*7f2fe78bSCy Schubert
146*7f2fe78bSCy Schubert**-I** *input_ccache*
147*7f2fe78bSCy Schubert
148*7f2fe78bSCy Schubert    Specifies the name of a credentials cache that already contains a
149*7f2fe78bSCy Schubert    ticket.  When obtaining that ticket, if information about how that
150*7f2fe78bSCy Schubert    ticket was obtained was also stored to the cache, that information
151*7f2fe78bSCy Schubert    will be used to affect how new credentials are obtained, including
152*7f2fe78bSCy Schubert    preselecting the same methods of authenticating to the KDC.
153*7f2fe78bSCy Schubert
154*7f2fe78bSCy Schubert**-T** *armor_ccache*
155*7f2fe78bSCy Schubert    Specifies the name of a credentials cache that already contains a
156*7f2fe78bSCy Schubert    ticket.  If supported by the KDC, this cache will be used to armor
157*7f2fe78bSCy Schubert    the request, preventing offline dictionary attacks and allowing
158*7f2fe78bSCy Schubert    the use of additional preauthentication mechanisms.  Armoring also
159*7f2fe78bSCy Schubert    makes sure that the response from the KDC is not modified in
160*7f2fe78bSCy Schubert    transit.
161*7f2fe78bSCy Schubert
162*7f2fe78bSCy Schubert**-c** *cache_name*
163*7f2fe78bSCy Schubert    use *cache_name* as the Kerberos 5 credentials (ticket) cache
164*7f2fe78bSCy Schubert    location.  If this option is not used, the default cache location
165*7f2fe78bSCy Schubert    is used.
166*7f2fe78bSCy Schubert
167*7f2fe78bSCy Schubert    The default cache location may vary between systems.  If the
168*7f2fe78bSCy Schubert    **KRB5CCNAME** environment variable is set, its value is used to
169*7f2fe78bSCy Schubert    locate the default cache.  If a principal name is specified and
170*7f2fe78bSCy Schubert    the type of the default cache supports a collection (such as the
171*7f2fe78bSCy Schubert    DIR type), an existing cache containing credentials for the
172*7f2fe78bSCy Schubert    principal is selected or a new one is created and becomes the new
173*7f2fe78bSCy Schubert    primary cache.  Otherwise, any existing contents of the default
174*7f2fe78bSCy Schubert    cache are destroyed by kinit.
175*7f2fe78bSCy Schubert
176*7f2fe78bSCy Schubert**-S** *service_name*
177*7f2fe78bSCy Schubert    specify an alternate service name to use when getting initial
178*7f2fe78bSCy Schubert    tickets.
179*7f2fe78bSCy Schubert
180*7f2fe78bSCy Schubert**-X** *attribute*\ [=\ *value*]
181*7f2fe78bSCy Schubert    specify a pre-authentication *attribute* and *value* to be
182*7f2fe78bSCy Schubert    interpreted by pre-authentication modules.  The acceptable
183*7f2fe78bSCy Schubert    attribute and value values vary from module to module.  This
184*7f2fe78bSCy Schubert    option may be specified multiple times to specify multiple
185*7f2fe78bSCy Schubert    attributes.  If no value is specified, it is assumed to be "yes".
186*7f2fe78bSCy Schubert
187*7f2fe78bSCy Schubert    The following attributes are recognized by the PKINIT
188*7f2fe78bSCy Schubert    pre-authentication mechanism:
189*7f2fe78bSCy Schubert
190*7f2fe78bSCy Schubert    **X509_user_identity**\ =\ *value*
191*7f2fe78bSCy Schubert        specify where to find user's X509 identity information
192*7f2fe78bSCy Schubert
193*7f2fe78bSCy Schubert    **X509_anchors**\ =\ *value*
194*7f2fe78bSCy Schubert        specify where to find trusted X509 anchor information
195*7f2fe78bSCy Schubert
196*7f2fe78bSCy Schubert    **flag_RSA_PROTOCOL**\ [**=yes**]
197*7f2fe78bSCy Schubert        specify use of RSA, rather than the default Diffie-Hellman
198*7f2fe78bSCy Schubert        protocol
199*7f2fe78bSCy Schubert
200*7f2fe78bSCy Schubert    **disable_freshness**\ [**=yes**]
201*7f2fe78bSCy Schubert        disable sending freshness tokens (for testing purposes only)
202*7f2fe78bSCy Schubert
203*7f2fe78bSCy Schubert**--request-pac** | **--no-request-pac**
204*7f2fe78bSCy Schubert    mutually exclusive.  If **--request-pac** is set, ask the KDC to
205*7f2fe78bSCy Schubert    include a PAC in authdata; if **--no-request-pac** is set, ask the
206*7f2fe78bSCy Schubert    KDC not to include a PAC; if neither are set,  the KDC will follow
207*7f2fe78bSCy Schubert    its default, which is typically is to include a PAC if doing so is
208*7f2fe78bSCy Schubert    supported.
209*7f2fe78bSCy Schubert
210*7f2fe78bSCy SchubertENVIRONMENT
211*7f2fe78bSCy Schubert-----------
212*7f2fe78bSCy Schubert
213*7f2fe78bSCy SchubertSee :ref:`kerberos(7)` for a description of Kerberos environment
214*7f2fe78bSCy Schubertvariables.
215*7f2fe78bSCy Schubert
216*7f2fe78bSCy Schubert
217*7f2fe78bSCy SchubertFILES
218*7f2fe78bSCy Schubert-----
219*7f2fe78bSCy Schubert
220*7f2fe78bSCy Schubert|ccache|
221*7f2fe78bSCy Schubert    default location of Kerberos 5 credentials cache
222*7f2fe78bSCy Schubert
223*7f2fe78bSCy Schubert|keytab|
224*7f2fe78bSCy Schubert    default location for the local host's keytab.
225*7f2fe78bSCy Schubert
226*7f2fe78bSCy Schubert
227*7f2fe78bSCy SchubertSEE ALSO
228*7f2fe78bSCy Schubert--------
229*7f2fe78bSCy Schubert
230*7f2fe78bSCy Schubert:ref:`klist(1)`, :ref:`kdestroy(1)`, :ref:`kerberos(7)`
231