skip to content

Kerberos

Ticket-based network authentication: a KDC issues a ticket-granting ticket, then service tickets that prove identity without resending a password. Asked to test how single sign-on actually works.

on this pageshow

explore

questions

page 1 of 2

In Kerberos, what does one sign-in at the KDC give a user, and why does a file archive server never see the password?

level: juniorimportance: must knowfreq 55%

answer

  1. sign in once, reach many servers
  2. two things come back, sealed differently
  3. the client cannot read its own ticket
  4. each service opens tickets with its own key
  5. realm bounds which names the KDC knows

basics

~20 s

One sign-in returns a ticket-granting ticket plus a session key. The user spends that ticket at the ticket-granting service for a short-lived service ticket, and the archive server validates that ticket with its own long-term key — the password itself never reaches it.

solid answer

~40 s

Signing in runs the AS exchange against the key distribution centre's authentication service, which listens on port 88 over UDP and TCP. The `AS-REP` carries two differently sealed things: a **ticket-granting ticket** sealed under the long-term key of the realm's `krbtgt/REALM@REALM` principal, which the client cannot open, and a **session key** in the reply's `enc-part` sealed under the user's own long-term key, which only the password-holder can recover. For each archive server the client then runs a `TGS-REQ`/`TGS-REP` against the ticket-granting service and gets a **service ticket** sealed under that server's long-term key. The archive server opens it with its own key. It holds no verifier for the user, so it could not check a password even if one were offered.

code

pseudocode · 21 lines
pseudocode
at sign-in (AS exchange):
  client -> KDC authentication service : AS-REQ
      cname  = mkeita
      crealm = MET.EXAMPLE
  KDC -> client : AS-REP
      ticket   = ticket-granting ticket for krbtgt/[email protected],
                 sealed under that principal's long-term key
      enc-part = session key, sealed under the client's long-term key

later, once per service (TGS exchange):
  client -> KDC ticket-granting service : TGS-REQ
      presents the ticket-granting ticket
      sname = archive/store1.met.example
  KDC -> client : TGS-REP
      ticket = service ticket, sealed under the archive service's long-term key

at the archive server (AP exchange):
  open the service ticket with the archive service's own long-term key
  read cname and crealm from inside it
  check the caller holds the matching session key
  note: no password appears anywhere in this sequence

go deeper

for a junior

Recall the two steps and the two tickets: sign in once for a ticket-granting ticket, then get one service ticket per server. The key point to be able to say out loud is that the server checks a ticket, not a password.

for a middle

Explain which key seals which thing — the ticket-granting ticket under the krbtgt principal's key, the session key under the user's own — and why that pairing is what proves the holder is the right party.

for a senior

Be ready for the operational edges: an expired ticket-granting ticket versus an expired service ticket, what still works when the KDC is unreachable, and the fact that an authenticated name is not an authorization decision.

for a principal

The angle worth arguing is what this architecture concentrates: one realm-wide key distribution centre removes per-server password stores, and in exchange makes one component's availability and one key's secrecy an estate-level concern.

## The problem the ticket-granting service replaces A meteorological office publishes model output across several archive servers. Without a network authentication protocol, each of those servers has to satisfy itself that a caller is who they claim to be, and each ends up doing it the same bad way: holding a password verifier of its own, prompting for the password again, or trusting a network address. The password then exists in as many places as there are servers, and every one of them is somewhere it can leak. Kerberos V5 replaces that arrangement with a **key distribution centre (KDC)**: one trusted third party that already shares a long-term key with every **principal** in the **realm** — every user and every service. The KDC listens on **port 88**, over both UDP and TCP. ## What one sign-in actually returns Signing in is the **AS exchange**: the client sends an `AS-REQ` to the KDC's **authentication service** and receives an `AS-REP`. The reply carries two things, and the whole design lives in the fact that they are sealed under *different* keys: - a **ticket-granting ticket (TGT)** — an opaque structure sealed under the long-term key of `krbtgt/REALM@REALM`, the realm's ticket-granting service principal. The user's machine holds it and cannot read it. - a **session key**, returned in the reply's `enc-part`, sealed under the **user's own long-term key**. That key is derived from the password by **string-to-key**, so only someone who knows the password can recover it. The client therefore ends up holding a ticket it cannot open and a key it can. Possession of the session key is what later proves the ticket is being used by the party it was issued to. ## What happens at each archive server 1. The client sends a `TGS-REQ` to the KDC's **ticket-granting service**, presenting the ticket-granting ticket and naming the service it wants — `archive/[email protected]`. 2. The `TGS-REP` returns a **service ticket** sealed under **that service's** long-term key, together with a fresh session key shared between the client and that service. 3. The client presents the service ticket to the archive server in an `AP-REQ`. The server opens it with its own long-term key — provisioned to it in advance as a principal of the realm — and reads the client name inside. | | ticket-granting ticket | service ticket | |---|---|---| | sealed under | the `krbtgt/REALM@REALM` long-term key | the target service's long-term key | | obtained from | the authentication service, in `AS-REP` | the ticket-granting service, in `TGS-REP` | | spent at | the ticket-granting service | the application service, in an `AP-REQ` | | readable by the client | no | no | Validating the presented ticket needs no call to the KDC: the archive server already has the only key that opens it. It also has no verifier for the user, so it cannot check a password — its question is narrower and better: *does this ticket open under my key, and does the name sealed inside it match the caller in front of me?* ## What the realm bounds A **realm** is the namespace the KDC can name and the set of long-term keys it holds. Written by convention in upper case, it appears as the part after `@` in the string forms `user@REALM` and `service/host@REALM`. Two consequences follow immediately: - A principal in a different realm is not a bad password to this KDC; it is a name this KDC cannot resolve at all. - Reaching a service in another realm is therefore a naming problem before it is a credential problem, and it is solved by a key shared between the two realms rather than by copying accounts. ## What this does not do - It does not say what the user may **read**. Authorization stays with the archive service; a valid ticket is an authenticated name, not a permission. - It does not encrypt the model-output bytes by itself. The session key is available to the application for integrity or confidentiality, but only if the application asks for it. - It does not last forever. A ticket-granting ticket has an end time and, if it is renewable, a `renew-till`; when it is spent after expiry the ticket-granting service answers `KRB_AP_ERR_TKT_EXPIRED` and the AS exchange runs again. - It does not survive an unreachable KDC. Tickets already held keep working at their services until they expire, but no new service ticket can be obtained.

  • Why is the session key sealed under the user's long-term key rather than sent in the clear?
    Because that is what binds the ticket to the person. The ticket-granting ticket is public in effect — anyone who intercepts it holds the bytes — but it is unusable without the session key beside it, and only a party that can derive the user's long-term key from the password recovers that session key.
  • What has to be provisioned on the archive server in advance?
    One thing: the long-term key of its own service principal, shared with the realm's KDC when the principal is registered. It holds no per-user state, no password verifiers and no list of who may sign in — those live in the KDC's database, and the server learns a user's name only from the ticket it opens.
  • What happens when a user's ticket-granting ticket expires in the middle of a working session?
    Service tickets already issued keep working until their own end times. A new `TGS-REQ` presenting the expired ticket-granting ticket is refused with `KRB_AP_ERR_TKT_EXPIRED`. If the ticket was issued renewable and its `renew-till` has not passed, it can be renewed; otherwise the AS exchange runs again and the user re-authenticates.

It is the difference between every door telephoning the personnel office and the gate handing you a dated slip that each door checks against its own seal. The door learns the slip is genuine without ever learning how you identified yourself at the gate.

saying these in an interview costs you the question

  • Says the archive server checks the user's password with the KDC on each request.
  • Believes the client can open and read its own ticket-granting ticket.
  • Thinks one ticket-granting ticket is presented directly to every application service.
  • Claims Kerberos encrypts the files an application returns by itself.
  • Assumes the KDC stores plaintext passwords so it can compare them.
open as a page

In HTTP Negotiate authentication, what is inside the base64 value of the Authorization header a client sends?

level: juniorimportance: must knowfreq 42%

basics

~10 s

A GSS-API context-establishment token, normally a SPNEGO NegTokenInit wrapping a Kerberos AP-REQ built from a service ticket. It is one leg of a handshake for one service, not the user's password.

open as a page

In a Kerberos AS-REP, which key seals the ticket-granting ticket and which key seals the enc-part beside it?

level: middleimportance: must knowfreq 58%

basics

~20 s

The ticket-granting ticket is sealed under the krbtgt principal's long-term key, so the requesting client cannot open it. The AS-REP's enc-part beside it is sealed under the client's own long-term key and carries the session key, the ticket flags and the expiry times.

open as a page

What does a KDC's KDC_ERR_PREAUTH_REQUIRED reply to a Kerberos AS-REQ tell the client to do?

level: middleimportance: must knowfreq 50%

basics

~20 s

KDC_ERR_PREAUTH_REQUIRED (25) means the KDC will not issue a ticket until the client proves it holds its long-term key. The error's e-data carries METHOD-DATA listing the pre-authentication types accepted, and the client resends the AS-REQ with PA-ENC-TIMESTAMP.

open as a page

In Kerberos, which exchange does Pass-the-Ticket use, and what does the service check before accepting the stolen service ticket?

level: middleimportance: must knowfreq 58%

basics

~20 s

Pass-the-Ticket runs the AP exchange only: an AP-REQ carrying the stolen service ticket plus a fresh Authenticator sealed under that ticket's session key. The service checks decryption, names and timestamp, never who copied the ticket.

open as a page

In Kerberos, what does an encryption type number such as 18 or 23 actually select?

level: middleimportance: must knowfreq 52%

basics

~20 s

A Kerberos etype number names a whole cryptosystem profile from the registry: the encryption function, the key size, the string-to-key that turns a password plus salt into a long-term key, the per-message key derivation and the required checksum.

open as a page

In Kerberos, what does the forwardable(1) ticket flag permit that proxiable(3) does not?

level: middleimportance: must knowfreq 48%

basics

~20 s

forwardable(1) lets the ticket-granting service mint a new ticket-granting ticket for the holder; proxiable(3) only lets it mint single service tickets. A forwarded ticket-granting ticket buys tickets to anything in the realm; a proxy ticket buys nothing more.

open as a page

Why is a Kerberos realm's ticket-granting service itself a principal named krbtgt/REALM@REALM, and what does that make a ticket-granting ticket?

level: middleimportance: must knowfreq 48%

basics

~20 s

The ticket-granting service is registered as an ordinary principal with its own long-term key, so a ticket-granting ticket is simply a service ticket whose sname is krbtgt. That one key validates every ticket-granting ticket in the realm, which makes it the realm's root of trust.

open as a page

Why does a Kerberos service send an AP-REP at all, and what does that reply prove?

level: middleimportance: must knowfreq 46%

basics

~20 s

A service returns an AP-REP only when the client set MUTUAL-REQUIRED in ap-options. The reply echoes the client's own ctime and cusec sealed under the ticket's session key, which only a party holding the service principal's long-term key could produce.

open as a page

Besides the Kerberos service ticket, what does an AP-REQ carry, and why is the ticket alone not proof?

level: middleimportance: must knowfreq 58%

basics

~20 s

An AP-REQ carries ap-options, the service ticket and an Authenticator encrypted under the ticket's session key. Anyone can copy a ticket; only the holder of its session key can mint a fresh Authenticator carrying cname, ctime and cusec.

open as a page

What does GSS-API give a client application, and why is SPNEGO called a pseudo-mechanism inside it?

level: middleimportance: must knowfreq 46%

basics

~10 s

GSS-API gives one mechanism-independent loop: GSS_Init_sec_context and GSS_Accept_sec_context exchange opaque tokens until a context exists. SPNEGO is a mechanism whose only work is choosing which real mechanism, named by OID, both ends will run.

open as a page

What does the PA-TGS-REQ padata in a Kerberos TGS-REQ contain, and what does its Authenticator prove?

level: middleimportance: must knowfreq 48%

basics

~20 s

PA-TGS-REQ (padata-type 1) carries a DER-encoded AP-REQ: the ticket-granting ticket plus an Authenticator sealed under that ticket's session key, whose cksum covers the KDC-REQ-BODY. It proves the sender holds the session key and sent this exact request body.

open as a page

A Kerberos TGS-REP carries a service ticket and an enc-part: which key seals each, and which can the client read?

level: middleimportance: must knowfreq 58%

basics

~20 s

The ticket is sealed under the target service's long-term key and is opaque to the client; the enc-part beside it is sealed under the ticket-granting session key, so the client reads it to recover the new service session key.

open as a page

In Kerberos, which exchange does AS-REP roasting draw on, which does Kerberoasting use, and what does each reply seal?

level: seniorimportance: must knowfreq 52%

basics

~20 s

AS-REP roasting takes the AS-REP enc-part of a principal that does not require Kerberos pre-authentication, sealed under that client's long-term key. Kerberoasting takes the TGS-REP ticket's enc-part, sealed under the named service principal's long-term key.

open as a page

Why does a Kerberos service ticket sealed with etype 23 rc4-hmac fall to offline guessing faster than one sealed with etype 18?

level: seniorimportance: must knowfreq 58%

basics

~20 s

Etype 23 derives the service principal's long-term key from an unsalted single-pass digest of its password, so one guess costs one digest and work is reusable. Etype 18 uses a salted, iterated string-to-key, making each guess far dearer and reuse impossible.

open as a page

In Kerberos, how does a principal name for a user differ from one for a service, and what does the realm part fix?

level: middleimportance: should knowfreq 40%

basics

~20 s

A user principal is usually one name component, written user@REALM; a host-based service is two, written service/host@REALM. The realm is a separate field, not a component, and it fixes which KDC's database holds the principal and therefore which long-term key exists for it.

open as a page

In SPNEGO, what does a NegTokenInit offer an acceptor, and what does the reply's negState say?

level: middleimportance: should knowfreq 34%

basics

~10 s

NegTokenInit offers an ordered mechTypes list and often an optimistic mechToken for the first entry. The acceptor's NegTokenResp answers with negState — accept-completed(0), accept-incomplete(1), reject(2) or request-mic(3) — plus supportedMech and responseToken.

open as a page

A Kerberos client on an unattended overnight pipeline scheduler holds its long-term key on disk — what does that mean for its AS exchange?

level: seniorimportance: should knowfreq 40%

basics

~20 s

The AS exchange tests possession of that long-term key and nothing else, so anyone who can read the file completes it identically and receives a ticket bearing the same flags. The exchange's other unattended dependency is the clock: drift outside the allowed skew fails pre-authentication at 03:00 with nobody watching.

open as a page

A forged Kerberos ticket is minted with a stolen long-term key — which exchange validates a golden ticket, and which validates a silver one?

level: seniorimportance: should knowfreq 44%

basics

~20 s

A golden ticket is a ticket-granting ticket minted under the krbtgt key and spent in a TGS-REQ; a silver ticket is a service ticket minted under one service's key and spent in an AP-REQ, so no KDC exchange occurs.

open as a page

In Kerberos PKINIT, what replaces the client's password-derived long-term key when a certificate authenticates the AS exchange?

level: seniorimportance: should knowfreq 40%

basics

~20 s

A signature replaces the proof and a freshly established reply key replaces the password-derived key: the client signs its pre-authentication data, and the KDC returns a reply key by key transport or key agreement, which then protects the AS-REP's enc-part.

open as a page

When a client sets GSS_C_DELEG_FLAG on a Kerberos context, what does the accepting service end up holding?

level: seniorimportance: should knowfreq 37%

basics

~20 s

A forwarded ticket-granting ticket for the client, plus its session key. GSS_C_DELEG_FLAG makes the initiator pack that credential into the AP-REQ Authenticator's checksum, so the acceptor can afterwards obtain service tickets in the client's name.

open as a page

In Kerberos, how does a service that authenticated a user without Kerberos obtain a service ticket in that user's name?

level: seniorimportance: should knowfreq 42%

basics

~20 s

Through the S4U2Self extension: the service presents its own ticket-granting ticket and asks the ticket-granting service for a service ticket to itself in the named user's name, with no proof from the user. S4U2Proxy then chains onward.

open as a page

In Kerberos, how does a researcher whose principal exists only in a partner realm get a service ticket in the archive's realm?

level: seniorimportance: should knowfreq 45%

basics

~20 s

The two realms share an inter-realm key, registered as the principal krbtgt/MET.[email protected]. The home KDC issues a cross-realm ticket-granting ticket sealed under it; the archive's ticket-granting service opens that and issues a service ticket sealed under the archive service's own key.

open as a page

Why would a Kerberos service reject an AP-REQ whose service ticket is valid, unexpired and for that service?

level: seniorimportance: should knowfreq 44%

basics

~20 s

Two freshness checks sit outside the ticket. If the Authenticator's ctime falls outside the service's allowable clock skew, the answer is KRB_AP_ERR_SKEW; if that client name and timestamp pair is already in the service's Kerberos replay cache, it is KRB_AP_ERR_REPEAT.

open as a page

Browser Negotiate sign-on works for an archive's registered host name but prompts on an alternative name — why?

level: seniorimportance: should knowfreq 44%

basics

~20 s

The client builds the service principal name from the host in the URL, as HTTP/<host>. An alternative name is a different principal; with none registered the KDC answers KDC_ERR_S_PRINCIPAL_UNKNOWN (7) and the negotiation drops to a weaker mechanism or a prompt.

open as a page

Why is a renewable Kerberos service ticket with a distant renew-till not an immortal ticket?

level: seniorimportance: should knowfreq 34%

basics

~20 s

Because renewal is a fresh TGS exchange the KDC must agree to. Each renewal moves endtime forward but copies renew-till unchanged, so renew-till is a hard ceiling, and every renewal is a checkpoint the KDC can refuse.

open as a page

Why can a Kerberos TGS-REQ ask for a renewable, forwardable service ticket and get one with neither flag set?

level: seniorimportance: should knowfreq 40%

basics

~20 s

Requesting a flag is not getting it. The client's kdc-options in KDC-REQ-BODY are a request; the TicketFlags inside EncTicketPart are the grant, bounded by realm policy and by the flags on the ticket-granting ticket presented. A reduced grant returns as success, not an error.

open as a page

A Kerberos TGS-REQ returns KDC_ERR_S_PRINCIPAL_UNKNOWN for a render queue host: what does that tell you?

level: seniorimportance: should knowfreq 38%

basics

~20 s

Only that the sname and srealm in the request did not resolve to a principal the KDC holds a long-term key for. It says nothing about the service being reachable, running, or permitted to the caller, and a typo produces it identically to a missing registration.

open as a page

How would you sequence a Kerberos migration off etype 23 across depot services whose owners you cannot compel to change?

level: principalimportance: should knowfreq 32%

basics

~20 s

Add capability first, then keys, then withdraw etype 23 last. A principal only gains an AES key when its long-term key is set again, so removing the old profile before that is what causes authentication failures rather than the removal itself.

open as a page

Which Kerberos delegation model would you standardise on across many middle-tier services, and why does who holds the configuration decide it?

level: principalimportance: should knowfreq 29%

basics

~20 s

Resource-based delegation, in most estates: the target service declares who may impersonate to it, so the party bearing the loss holds the setting and a new service starts reachable by nobody. Constrained delegation puts that list on the middle tier instead.

open as a page

showing 1–30 of 35