KERBEROS(7)

πŸ’… KERBEROS(7) β€” the MIT Kerberos manual, bestie edition ✨

okay so you opened kerberos(7), the overview page from the MIT Kerberos manual set, and honestly? it's giving "the lore you actually need." sit down, grab a boba πŸ§‹, and let's get you fluent.


🌸 NAME 🌸

kerberos β€” the whole vibe of using Kerberos, explained 🫢


✨ DESCRIPTION ✨

bestie. the Kerberos system authenticates individual users in a network environment. that's the whole job. 😌 and once you've authenticated yourself to Kerberos, you can use Kerberos-enabled programs without having to present passwords or certificates to those programs. no cap, that's the flex. πŸ”₯

okay but real talk β€” if you run kinit and get this back:

kinit: Client not found in Kerberos database while getting initial credentials

…then bestie, you haven't been registered as a Kerberos user. 😭 it's not you, it's the database. go see your system administrator. periodt.

πŸŽ€ the anatomy of a Kerberos name πŸŽ€

a Kerberos name usually contains three parts, and the way it's structured is honestly iconic:

  1. The primary β€” usually a user's or service's name.
  2. The instance β€” for a user this is usually null. some users may have privileged instances though, like root or admin. πŸ‘‘ for a service, the instance is the fully qualified name of the machine on which it runs. i.e. there can be an ssh service running on the machine ABC (ssh/ABC@REALM), which is different from the ssh service running on the machine XYZ (ssh/XYZ@REALM).
  3. The realm β€” corresponds to the Kerberos service providing authentication for the principal. realms are conventionally all-uppercase, and often match the end of hostnames in the realm (for instance, host01.example.com might be in realm EXAMPLE.COM). πŸ’…

πŸ¦‹ how you actually write one πŸ¦‹

when writing a Kerberos name, the principal name is separated from the instance (if not null) by a slash, and the realm (if not the local realm) follows, preceded by an @ sign. here are examples of valid Kerberos names, and yes they ate:

david
jennifer/admin
joeuser@BLEEP.COM
cbrown/root@FUBAR.ORG

🎫 tickets: the main character energy 🎫

when you authenticate yourself with Kerberos you get an initial Kerberos ticket. (a Kerberos ticket is an encrypted protocol message that provides authentication. that's the definition, don't @ me.) Kerberos uses this ticket for network utilities such as ssh. the ticket transactions are done transparently, so you don't have to worry about their management. it's just doing its thing in the background, slaying quietly. ✨

⚠️ but β€” note, however, that tickets expire. this is the part where you pay attention. 🫣

administrators may configure more privileged tickets β€” like those with service or instance of root or admin β€” to expire in a few minutes, while tickets that carry more ordinary privileges may be good for several hours or a day. if your login session extends beyond the time limit, you will have to re-authenticate yourself to Kerberos to get new tickets using the kinit command. annoying? lowkey yes. necessary? also yes. πŸ’€

some tickets are renewable beyond their initial lifetime. this means that kinit -R can extend their lifetime without requiring you to re-authenticate. obsessed. 🫢

if you wish to delete your local tickets, use the kdestroy command. bye felicia πŸ‘‹

🌈 forwarding tickets 🌈

Kerberos tickets can be forwarded. in order to forward tickets, you must request forwardable tickets when you kinit. once you have forwardable tickets, most Kerberos programs have a command line option to forward them to the remote host. this can be useful for, e.g., running kinit on your local machine and then sshing into another to do work. very "i brought my credentials to the function." πŸŽ‰

🚨 however: this should not be done on untrusted machines since they will then have your tickets. literally do not hand your tickets to a sketchy host. that's it, that's the warning. πŸ™ˆ

🧚 ENVIRONMENT VARIABLES 🧚

several environment variables affect the operation of Kerberos-enabled programs. these include:

  • KRB5CCNAME β€” default name for the credentials cache file, in the form TYPE:residual. the type of the default cache may determine the availability of a cache collection. FILE is not a collection type; KEYRING, DIR, and KCM are. πŸ’… if not set, the value of default_ccache_name from configuration files (see KRB5_CONFIG) will be used. if that is also not set, the default type is FILE, and the residual is the path /tmp/krb5cc_*uid*, where uid is the decimal user ID of the user.
  • KRB5_KTNAME β€” specifies the location of the default keytab file, in the form TYPE:residual. if no type is present, the FILE type is assumed and residual is the pathname of the keytab file. if unset, FILE:/etc/krb5.keytab will be used.
  • KRB5_CONFIG β€” specifies the location of the Kerberos configuration file. the default is /usr/etc/krb5.conf. multiple filenames can be specified, separated by a colon; all files which are present will be read. multi-file slay. πŸŽ€
  • KRB5_KDC_PROFILE β€” specifies the location of the KDC configuration file, which contains additional configuration directives for the Key Distribution Center daemon and associated programs. the default is /var/lib/krb5kdc/kdc.conf.
  • KRB5RCACHENAME β€” (New in release 1.18) ✨ specifies the location of the default replay cache, in the form type:residual.
    • the file2 type with a pathname residual specifies a replay cache file in the version-2 format in the specified location.
    • the none type (residual is ignored) disables the replay cache.
    • the dfl type (residual is ignored) indicates the default, which uses a file2 replay cache in a temporary directory. the default is dfl:.
  • KRB5RCACHETYPE β€” specifies the type of the default replay cache, if KRB5RCACHENAME is unspecified. no residual can be specified, so none and dfl are the only useful types.
  • KRB5RCACHEDIR β€” specifies the directory used by the dfl replay cache type. the default is the value of the TMPDIR environment variable, or /var/tmp if TMPDIR is not set.
  • KRB5_TRACE β€” specifies a filename to write trace log output to. trace logs can help illuminate decisions made internally by the Kerberos libraries. for example, env KRB5_TRACE=/dev/stderr kinit would send tracing information for kinit to /dev/stderr. the default is not to write trace log output anywhere. (ngl, turning this on is the move when you're debugging and losing your mind 😭)
  • KRB5_CLIENT_KTNAME β€” default client keytab file name. if unset, FILE:/var/lib/krb5/user/%{euid}/client.keytab will be used).
  • KPROP_PORT β€” kprop port to use. defaults to 754.
  • GSS_MECH_CONFIG β€” specifies a filename containing GSSAPI mechanism module configuration. the default is to read /usr/etc/gss/mech and files with a .conf suffix within the directory /usr/etc/gss/mech.d.
πŸ”’ important: most environment variables are disabled for certain programs, such as login system programs and setuid programs, which are designed to be secure when run within an untrusted process environment. so no, you can't just vibe your way past those. 🫣

πŸ’œ SEE ALSO πŸ’œ

go read these next, they're the whole friend group:

kdestroy, kinit, klist, kswitch, kpasswd, ksu, krb5.conf, kdc.conf, kadmin, kadmind, kdb5_util, krb5kdc


πŸ’€ BUGS πŸ’€

the original page lists this section and… leaves it empty. no bugs to report, bestie. it's giving "nothing to see here" and honestly? we love a clean slate. ✨


πŸ‘‘ AUTHORS πŸ‘‘

icons, all of them:

  • Steve Miller, MIT Project Athena/Digital Equipment Corporation
  • Clifford Neuman, MIT Project Athena
  • Greg Hudson, MIT Kerberos Consortium
  • Robbie Harwood, Red Hat, Inc.

🌈 HISTORY 🌈

the MIT Kerberos 5 implementation was developed at MIT, with contributions from many outside parties. it is currently maintained by the MIT Kerberos Consortium. that's a long-running main character arc fr fr. 🫢


πŸ“ RESTRICTIONS πŸ“

copyright 1985, 1986, 1989-1996, 2002, 2011, 2018 Masachusetts Institute of Technology


⭐ AUTHOR ⭐

MIT


1985-2026, MIT


and that's the page!! πŸ¦‹ you read the whole thing, i'm so proud. this was KERBEROS(7) from the MIT Kerberos manual, version 1.22.2 β€” mwah, go kinit something πŸ’–πŸ’…

πŸ“¦ where this page comes from