acquire initial tickets

kinit [--afslog] [-c cachename | --cache=cachename] [--canonicalize]
      [-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] [--anonymous] [--enterprise] [--version] [--help]
                                                                                          [principal [command]]

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.

-c cachename
credentials cache to put the acquired ticket in
--canonicalize ask the KDC canonicalize the client name and server name. Useful with enterprise names,
PK-INIT, and LKDC realms when the user doesn't know its real kerberos user name.
Request tickets with the proxiable flag set.
Get ticket that can be forwarded to another host.
Get ticket that can be forwarded to another host, or if the negative flags use, don't get a forwardable flag.
Request tickets with this particular enctype.
Request a ticket with no addresses.
-r seconds
--renewable-life= seconds
The max renewable ticket life.
--renewable As --renewable-life, with an infinite time. (Not wise ed)
renew ticket which must have the `renewable' flag set, and not be expired.
-t keytabname
Don't ask for a password, get the key from the keytab.
as --keytab, but with the default keytab name (normally /etc/krb5.keytab).
-l time
lifetime of the ticket. in seconds, or a string like 1h.
-s seconds
Obtain a ticket that starts to be valid seconds in the future (which can really be a generic time specification, like `1h')
-S principal
Get a ticket for a service other than krbtgt/LOCAL.REALM.
Try to validate an invalid ticket.
--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.
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).
--anonymous Request an anonymous ticket (which means that the ticket will be issued to an anonymous principal, typically anonymous@REALM).
slightly more verbose output
--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, and this option is usually used with canonicalize so that the principal returned from the KDC will typically be the real principal name.
--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. ENVIRONMENT KRB5CCNAME default credentials cache.

KRB5_CONFIG default /etc/krb5.conf.

KRBTKFILE ticket file .

see also

krb5.conf -- configuration file for Kerberos 5 #include

The krb5.conf file specifies several configuration parameters for the Kerberos 5 library, as well as for some programs. The file consists of one or more sections, containing a number of bindings. The value of each binding can be either a string or a list of other bindings. The grammar looks like:

                   /* empty */

                   section sections

                   '[' section_name ']' bindings


                   binding bindings

                   name '=' STRING
                   name '=' '{' bindings '}'


     STRINGs consists of one or more non-whitespace characters.

     STRINGs that are specified later in this man-page uses the following notation.

           boolean yes/true or no/false.

           time     list of year, month, day, hour, min, second.  
                  Example: 1 month 2 days 30 min.  
                        If no unit is given, seconds is assumed.

           etypes   des3-cbc-sha1, arcfour-hmac-md5, aes128-cts-hmac-sha1-96, and aes256-cts-hmac-sha1-96 .

           address   an address can be either a IPv4 or a IPv6 address.

     Currently recognised sections and bindings are:

                Specifies the default values per application, realm, or a combination of these.  
            The preference order is:
                1.   application realm option
                2.   application option
                3.   realm option
                4.   option

                options :

                      forwardable = boolean When obtaining initial credentials, make the credentials forwardable.

                      proxiable    = boolean    When obtaining initial credentials, make the credentials proxiable.

                      no-addresses = boolean When obtaining initial credentials, request them for an empty set of addresses, 
                                    making the tickets valid from any address.

                      ticket_lifetime = time Default ticket lifetime.

                      renew_lifetime = time Default renewable ticket lifetime.

                      encrypt = boolean Use encryption, when available.

                      forward = boolean Forward credentials to remote host (for rsh(1), telnet(1), etc).


                      default_realm = REALM Default realm to use, this is also known as your local realm.  
                                        The default is the result of krb5_get_host_realm(local hostname).

                      allow_weak_crypto = boolean

                      clockskew = time   Maximum time differential (in seconds) allowed when comparing times.  
                                        Default 300 seconds 

                      kdc_timeout = time Maximum time to wait for a reply from the kdc, default is 3 seconds.


                      v4_instance_resolve described in krb5_425_conv_principal(3) 

                      capath = { destination-realm = next-hop-realm ...  } deprecated, see the capaths section below.

                      default_cc_type = cctype sets the default credentials type.

                      default_cc_name = ccname the default credentials cache name.      
                                        to change the type only use default_cc_type.  
                                        The string can contain %{uid} expanded on runtime.  

                      default_etypes = etypes ...  Default: all enctypes

                      default_as_etypes = etypes ... Default: the value of default_etypes.

                      default_tgs_etypes = etypes ...Default: the value of default_etypes.

                      default_keytab_name = keytab , default /etc/krb5.keytab

                      dns_lookup_kdc   = boolean Use DNS SRV records to lookup KDC services location.

                      dns_lookup_realm = boolean Use DNS TXT records to lookup domain to realm mappings.

                      kdc_timesync = boolean   keep track of the time differential between the local machine and the KDC, and 
                                            then compensate for that when issuing requests.

                      max_retries = number to try to contact each KDC.

                      large_msg_size = number The threshold where protocols with tiny maximum message sizes are not considered usable 
                                                to send messages to the KDC.

                      max_msg_size   = number The threshold where Kerberos protocol packets are consider too large and are dropped.

                      ticket_lifetime = time

                      renew_lifetime = time

                      forwardable = boolean initial credentials are forwardable.  also valid in the [realms] section.

                      proxiable = boolean initial credentials nare proxiable.  also valid in the [realms] section.

                      verify_ap_req_nofail = boolean
                           If enabled, failure to verify credentials against a local key is a fatal error.  
                                        The application has to be able to read the corresponding service key for this to work.  
                                        Some applications, like su(1), enable this option unconditionally.

                      warn_pwexpire = time How soon to warn for expiring password.  Default is seven days.

                      http_proxy = proxy-spec A HTTP-proxy to use when talking to the KDC via HTTP.

                      dns_proxy = proxy-spec   Enable using DNS via HTTP.

                      extra_addresses = address ...  list of addresses to get tickets for along with all local addresses.

                      time_format = string  in logs passed to strftime(3).

                      date_format = string   in logs passed to strftime(3).

                      log_utc = boolean 

                      scan_interfaces = boolean for addresses, 
                                                    as opposed to simply using the address associated with the system's host name.

                      fcache_version = int Use file credential cache format version specified.

                      krb4_get_tickets = boolean Also get Kerberos 4 tickets in kinit, login, and other programs.  also valid in [realms] .

                      fcc-mit-ticketflags = boolean Use MIT compatible format for file credential cache.  
                                                    It's the field ticketflags that is stored in reverse bit order for older than Heimdal 0.7.  
                                                   If TRUE store the MIT way, this is default for Heimdal 0.7.

                      check-rd-req-server If "ignore", the framework will ignore any the server input to krb5_rd_req(3,) 
                                            this is very useful when the GSS-API server 
                                        input the wrong server name into the gss_accept_sec_context call.

                list of mappings from DNS domain to Kerberos realm.  

                      domain = realm

                domain a full name of a host or a trailing component with the domain-string starting with a period.  
                                The trailing component only matches hosts that are in the same domain, ie
                           matches, but not

                realm may be dns_locate, in which case 
                            the actual realm will be determined using DNS 
                            (independently of the setting of the `dns_lookup_realm' option).  

                      REALM = { 
                                 kdc = [service/]host[:port]
                                      Ordered list of code>kdcs for this realm.
                                        port default value for the kerberos/udp kerberos/tcp, and http/tcp port (depending on service) will be used.  

                                    service specifies how the kdc should be contacted.  
                                       services are udp, tcp, and http aka  http://.
                                           Default: udp and tcp.

                                 admin_server = host[:port] where all the modifications to the database are performed.

                                 kpasswd_server = host[:port] where all the password changes are performed.  
                                        Default: kpasswd port on the admin_server host 

                                 krb524_server = host[:port] does 524 conversions.  
                                        Default: the krb524 port on the kdcs 



                                 default_domain See krb5_425_conv_principal(3).

                                 tgs_require_subkey boolan defaults false.  Old DCE secd (pre 1.1) might need this to be true.  


                      client-realm = { 
                                 server-realm = hop-realm ...
                                    first listed hop-realm tells a client which realm it
                                      should contact in order to ultimately obtain credentials for a service in the
                                   tells the KDC (and other servers) which realms are allowed in a multi-hop traversal 
                                    from client-realm to server-realm.  
                                    Except for the client case,the order of the realms are not important.  


                      entity = destination
                           entity should use the specified destination for logging.  See man 3  krb5_openlog


                      database = { 
                                 dbname = databasename .  See info documetation how to configure different database backends.

                                 realm = realm If realm isn't set, it will
                                      used as the default database, there can only be one entry that doesn't have a realm stanza.

                                 mkey_file = filename keytab file for the master key. Default: DATABASENAME.mkey 

                                 acl_file = pa filename 

                                 log_file = FILENAME changes performed to the database.  
                                                used by ipropd-master for propagating changes to slaves.  

                      max-request = size 

                      require-preauth = BOOL If set pre-authentication is required.  
                                        Since krb4 requests are not pre-authenticated they will be rejected.

                      ports = list of ports kdc listens to.

                      addresses = list of interfaces kdc should bind to.

                      enable-kerberos4 = BOOL Turn on Kerberos 4 support.

                      v4-realm = REALM what realm v4 requests should be mapped.

                      enable-524 = BOOL Kerberos 524 converting facility .  Default is the same as enable-kerberos4.

                      enable-http = BOOL kdc answer kdc-requests over http.

                      enable-kaserver = BOOL emulate the AFS kaserver.

                      as-use-strongest-session-key = BOOL
                           If TRUE the KDC will prefer the strongest key from the client's AS-REQ enctype list,
                           that is also supported by the KDC and the target principal, for the ticket session key. 
                            Else prefers the first key from the client's AS-REQ enctype list that is also supported by the KDC
                           and the target principal. Default TRUE.

                      preauth-use-strongest-session-key = BOOL
                           Like as-use-strongest-session-key, applies to the session key enctype selection for PA-ETYPE-
                           INFO2 (i.e., for password-based pre-authentication). Default TRUE.

                      tgs-use-strongest-session-key = BOOL
                           Like as-use-strongest-session-key, 
                                but applies to the session key enctype of tickets issued by the TGS. Default TRUE.

                      use-strongest-server-key = BOOL
                           TRUE: KDC uses, for the ticket encrypted part's key, 
                                    the first supported enctype from
                                    the target service principal's hdb entry's current keyset. 
                           FALSE: KDC uses the first supported enctype from 
                                    the target service principal's hdb entry's current keyset. Default TRUE.

                      check-ticket-addresses = BOOL Verify the addresses in the tickets used in tgs requests.

                      allow-null-ticket-addresses = BOOL Allow address-less tickets.

                      allow-anonymous = BOOL kdc is allowed to hand out anonymous tickets.

                      encode_as_rep_as_tgs_rep = BOOL Encode as-rep as tgs-rep to be compatible with mistakes older DCE secd did.

                      kdc_warn_pwexpire = time before expiration the user is be warned that password is about to expire.

                      logging = Logging type of logging the kdc should use, see also [logging]/kdc.

                      use_2b = { principal = BOOL should the 524 daemon should return AFS 2b tokens for principal.  

                      hdb-ldap-structural-object structural object
                           If the LDAP backend is used for storing principals, this is the structural object that will be used
                           when creating and when reading objects.  The default value is account .

                      hdb-ldap-create-base creation dn
                           that will be appended to the principal when creating entries.  
                            Default value is the search dn.

                      enable-digest = BOOL answer digest requests. default FALSE.

                      digests_allowed = list of digests kdc will reply to. The default is ntlm-v2.

                      require-preauth = BOOL required to talk to the kadmin server.

                      password_lifetime = time
                           If a principal already have its password set for expiration, this is the time it will be valid for
                           after a change.

                      default_keys = keytypes...
                           For each entry in default_keys try to parse it as a sequence of etype:salttype:salt syntax of this
                           if something like:


                           If etype is omitted it means everything, and if string is omitted it means the default salt string
                           (for that principal and encryption type).  Additional special values of keytypes are:

                                 v5   The Kerberos 5 salt pw-salt

                                      Check the Password quality assurance in the info documentation for more information.

                                            check_library = library-name Library name that contains the password check_function

                                            check_function = function-name Function name for checking passwords in check_library

                                            policy_libraries = library1 ... libraryN List of libraries that can do password policy checks

                                            policies = policy1 ... policyN List of policy names to apply to the password. Builtin policies are among
                                                 other minimum-length, character-class, external-check.
ENVIRONMENT KRB5CCNAME the Kerberos credential cache to use. KRB5CCPRINCIPAL the Kerberos credential cache use, specified by princi- pal, if the strings starts with an @, only the realm is used for matching. Example @REALM will only match the (exact match) of cache that have the realm REALM. The first cache found is picked. KRB5_CONFIG points to the configuration file to read. FILES /etc/krb5.conf configuration file for Kerberos 5. EXAMPLES
                   default_realm = FOO.SE
          = FOO.SE
          = FOO.SE
                   FOO.SE = {
                           kdc =
                           v4_name_convert = {
                                   rcmd = host
                           v4_instance_convert = {
                                   xyz =
                           default_domain =
                   kdc = FILE:/var/heimdal/kdc.log
                   kdc = SYSLOG:INFO
                   default = SYSLOG:INFO:USER

DIAGNOSTICS Since krb5.conf is read and parsed by the krb5 library, there is not a lot of opportunities for programs to report pars- ing errors in any useful format. To help overcome this problem, there is a program verify_krb5_conf that reads krb5.conf and tries to emit useful diagnostics from parsing errors. Note that this program does not have any way of knowing what options are actually used and thus cannot warn about unknown or misspelled ones. SEE ALSO kinit(1), krb5_425_conv_principal(3), krb5_openlog(3), strftime(3), verify_krb5_conf(8)