Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 38 ยท Authentication: Kerberos

Kerberos Concepts: Realms, KDC, TGT and Service Tickets

Learn the core ideas of Kerberos in Active Directory: the KDC on every domain controller, the krbtgt account, TGTs and service tickets, lifetimes, renewal and the clock-skew rule.

When you sign in to a domain computer and then open a file share, print to a server and read mail, you type your password once. That single sign-on is Kerberos, the default authentication protocol of Active Directory since Windows 2000. It never sends your password over the network. Instead, a trusted third party hands out time-limited tickets that prove who you are to each service.

This lesson introduces the vocabulary. The next one, the exchanges walkthrough, follows the messages step by step. Windows tools such as klist are described in text; the runnable examples are small Python models of the rules (lifetimes, clock skew, ticket caching).

The cast of characters

  • Principal: anything that can be authenticated, written name@REALM, for example [email protected]. Users, computers and services are all principals.
  • Realm: the Kerberos administrative domain. In Active Directory the realm is the DNS name of the domain in upper case, EXAMPLE.COM.
  • KDC (Key Distribution Center): the service that issues tickets. In Active Directory the KDC runs on every domain controller and is built into the directory service. It has two logical parts: the Authentication Service (AS) and the Ticket Granting Service (TGS).
  • Long-term keys: every principal shares a secret key with the KDC, derived from its password. The KDC knows all of them (they live in the directory database).
  • krbtgt: a special account in every domain whose key is used to encrypt and sign all TGTs. Whoever steals its key can forge tickets for anyone, so it is the crown jewel of the domain. Its password is rotated with care (twice, with a pause between rotations).
flowchart LR
  C["Client (alice)"] -- "1. prove identity" --> AS["KDC: Authentication Service"]
  AS -- "2. TGT" --> C
  C -- "3. TGT + service name" --> TGS["KDC: Ticket Granting Service"]
  TGS -- "4. service ticket" --> C
  C -- "5. service ticket" --> S["Server (file share)"]

The KDC is one component with two roles. Steps 1 and 2 happen once per logon; steps 3 to 5 happen for each service.

Ticket-Granting Ticket (TGT)

When you log on, the client asks the AS for a TGT. The TGT says "this is alice, verified by the KDC" and is encrypted with the krbtgt key, so only a KDC can read it. The client keeps it in memory and cannot read the inside. The TGT is the reason you do not need your password again.

Defaults in Active Directory (changeable in the Default Domain Policy):

Setting Default
Maximum lifetime for user ticket (TGT) 10 hours
Maximum lifetime for user ticket renewal 7 days
Maximum lifetime for service ticket 600 minutes
Maximum tolerance for computer clock synchronization 5 minutes

A TGT can be renewed (without a password) until the renewal limit of 7 days, which is why you rarely need to re-type credentials during a working week on a laptop that stays on.

Service tickets

For each service you use, the client presents its TGT to the TGS and names the service by its Service Principal Name (SPN), such as cifs/fileserver.example.com. The TGS returns a service ticket encrypted with the service account's key. The client forwards it to the service, which decrypts it with its own key and thereby learns who the client is. The client never learns the service key, and the KDC does not talk to the service at all, which makes Kerberos scale well. SPNs are covered in SPNs and delegation.

Tickets are cached. Seeing them is a one-liner on Windows (output not shown, because it contains your own ticket details):

TEXT
klist
klist tgt
klist purge

klist lists the cached tickets with server name, encryption type, start and end times; klist purge throws them away so a fresh request is made, which is the standard first step when testing a group-membership change (group SIDs are copied into the ticket at issue time, so a new group only appears after a new logon or a purge plus a new TGT).

Time matters: the clock-skew rule

Authenticators in Kerberos contain a timestamp. To stop replayed messages, the receiver rejects any message whose time differs from its own by more than the allowed skew, 5 minutes by default. A client whose clock is off by more than that fails with errors such as KRB_AP_ERR_SKEW. Domain-joined machines synchronise to their domain controllers (the PDC emulator is the authoritative time source for the domain, see FSMO roles). Virtual machines restored from snapshots are the classic offender.

Python Clock skew and ticket lifetime checker (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A ticket cache model

Clients reuse service tickets until they expire, so the KDC sees one request per service per ten hours rather than one per file opened. The tiny model below shows hits and misses:

Python Ticket cache model

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

What Kerberos gives you

  • Mutual authentication: the client can also verify the service is genuine.
  • No password on the wire, and passwords are not stored on each server.
  • Delegation (a service acting for the user) and single sign-on across services.
  • Group membership in the ticket: the Privilege Attribute Certificate (PAC) inside tickets carries the user's SID and group SIDs, so servers do not query the directory on each access. That is also why large group memberships can enlarge tickets beyond the default token size.

It also has requirements: reliable DNS (names, not IP addresses, produce Kerberos tickets), synchronised time and correct SPNs. When any of those fail, Windows silently falls back to NTLM, which is weaker (compare in errors and NTLM).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Where does the KDC run in an Active Directory domain?

    The KDC is integrated with the directory service and runs on all domain controllers.
  2. 2. Which account's key encrypts all Ticket-Granting Tickets?

    krbtgt's key protects TGTs, so its compromise allows forged tickets for any user.
  3. 3. The default maximum clock skew for Kerberos is:

    Messages with a timestamp more than 5 minutes off are rejected to limit replay attacks.
  4. 4. Why does a newly added group membership not show up in the user's current session?

    The PAC holds the group SIDs at ticket issue time; a new logon or fresh tickets are needed.

Summary

  • Kerberos issues tickets instead of sending passwords; the realm is the upper-case domain name.
  • Every domain controller is a KDC; krbtgt's key protects TGTs.
  • TGT defaults: 10 hours, renewable for 7 days; service tickets name an SPN.
  • Clock skew over 5 minutes breaks authentication, and tickets carry group SIDs in the PAC.

Next: Kerberos Exchanges Step by Step