OneStopList

Gods and goddesses

How Kerberos Works: Diagram and Step-by-Step

Updated November 24, 2026

Kerberos is a network authentication protocol that uses secret-key cryptography and a trusted third party, called the Key Distribution Center (KDC), to let clients and servers prove their identities without sending passwords over the network. In short, it works through a series of ticket exchanges: the client first gets a Ticket-Granting Ticket (TGT) from the Authentication Service, then uses that TGT to obtain service tickets from the Ticket-Granting Service, and finally presents a service ticket to the target server. The diagram below shows the classic five-step flow, and the sections that follow explain each message in detail.

Background: Why Kerberos Was Created

Kerberos was developed in the 1980s at the Massachusetts Institute of Technology (MIT) as part of Project Athena. Before Kerberos, networked services often relied on the client sending a password in plaintext, which could be intercepted on the wire. Kerberos solves this by never transmitting passwords or password hashes. Instead, it uses symmetric encryption (typically AES) and timestamps to create short-lived tickets that prove identity. The protocol is named after the three-headed dog Cerberus from Greek mythology, because it guards the “gate” of a network with three parts: the client, the server, and the KDC.

Kerberos is the default authentication method in Microsoft Active Directory and is also used by many Unix and Linux systems via MIT Kerberos or Heimdal. It is designed for a single realm (a logical network domain) but can be extended with cross-realm trust to work between realms.

The Core Components: KDC, TGT, and Service Tickets

To understand the diagram, you need to know the three main actors and two ticket types:

  • Client – the user or service that wants to access a network resource.
  • Key Distribution Center (KDC) – the trusted third party, which is split into two logical services: the Authentication Service (AS) and the Ticket-Granting Service (TGS). The KDC holds a master key for every principal (user or service) in the realm.
  • Target Server – the service (e.g., a file server, web server, or database) that the client wants to use.
  • Ticket-Granting Ticket (TGT) – a long-lived (typically 8-10 hours) ticket that proves the client has authenticated to the KDC. It is encrypted with the KDC’s secret key.
  • Service Ticket – a short-lived (typically a few hours or less) ticket that grants access to a specific service. It is encrypted with the target server’s secret key.

Each ticket contains a session key, the client’s identity, the service’s identity, an expiration time, and other metadata. The session key is used to encrypt subsequent communication between the client and the service.

How Kerberos Works: Step-by-Step Diagram

Here is the standard five-step flow, often drawn as a diagram with arrows between the client, KDC, and target server:

  1. AS Request (Authentication Service Request): The client sends its username (or principal name) and a timestamp encrypted with the user’s password-derived key to the AS. The AS looks up the user’s key in its database.
  2. AS Response (TGT Issuance): The AS replies with two messages: one is a TGT encrypted with the KDC’s secret key (the client cannot read this), and the other is a session key (the client-KDC session key) encrypted with the user’s key. The client decrypts the second part using its password-derived key, thus authenticating itself and obtaining the TGT.
  3. TGS Request (Ticket-Granting Service Request): When the client wants to access a service, it sends the TGT, the service’s principal name, and an authenticator (a timestamp encrypted with the client-KDC session key) to the TGS.
  4. TGS Response (Service Ticket Issuance): The TGS decrypts the TGT with its own key, verifies the authenticator, and then issues a service ticket (encrypted with the target server’s key) and a client-server session key (encrypted with the client-KDC session key).
  5. AP Request (Application Request): The client sends the service ticket and a new authenticator (encrypted with the client-server session key) to the target server. The server decrypts the ticket with its own key, verifies the authenticator, and optionally sends back a timestamp to confirm mutual authentication.

After step 5, the client and server share a session key and can communicate securely. The service ticket is reusable until it expires, so the client does not need to contact the KDC again for the same service within the ticket’s lifetime.

Real-World Example: Logging into a Domain

Suppose a user named Alice logs into a Windows workstation joined to an Active Directory domain. The login process sends an AS request to the domain controller (which acts as the KDC). The domain controller validates Alice’s password and returns a TGT. Later, when Alice opens a shared folder on a file server, the workstation automatically sends a TGS request to get a service ticket for the file server. The file server receives the service ticket and grants access without ever asking Alice for her password again. This is why users only enter their password once per logon session, even if they access many different servers.

In a cross-realm scenario, if Alice needs a resource in another domain, her KDC will issue a referral ticket that points to the other domain’s KDC, and the process repeats with that KDC.

Common Problems and Misconceptions

One common misconception is that Kerberos uses a public-key infrastructure (PKI) with certificates. In fact, the core Kerberos protocol uses symmetric keys only; certificates are used in some extensions (such as PKINIT) for initial authentication, but they are not required. Another misconception is that Kerberos encrypts all network traffic. It only encrypts the authentication messages and provides a session key; the actual data between client and server is not encrypted by Kerberos itself (though it can be encrypted by the application protocol, e.g., Kerberized NFS or SMB encryption).

Common problems include:

  • Clock skew: Kerberos relies on timestamps to prevent replay attacks. If the client and server clocks differ by more than a few minutes (default is 5 minutes), authentication fails. Solutions include using Network Time Protocol (NTP).
  • Expired tickets: TGTs and service tickets have lifetimes. If a user leaves a machine on overnight, tickets may expire, and the user may be prompted to re-authenticate.
  • SPN mismatches: Service Principal Names (SPNs) must be correctly registered in Active Directory. If an SPN is missing or duplicated, the service ticket request fails.
  • Keytab issues: Services that run as a machine account or service account need a keytab file containing the service’s secret key. If the keytab is outdated or has wrong permissions, authentication fails.

Kerberos vs. Alternatives: NTLM, OAuth, and SAML

Kerberos is often compared to older Windows authentication protocols like NTLM. NTLM is challenge-response based and does not use a trusted third party; it is weaker because it is vulnerable to pass-the-hash attacks and does not support mutual authentication by default. Kerberos is more secure because it uses tickets and mutual authentication, and it avoids sending password hashes over the network.

For web-based authentication, OAuth 2.0 and SAML are common. OAuth is an authorization framework, not an authentication protocol, and it often runs over HTTPS. SAML is an XML-based authentication standard for single sign-on (SSO) across web domains. Kerberos is designed for enterprise networks, not for internet-scale SSO, but it can be used in web applications via SPNEGO (Simple and Protected GSSAPI Negotiation Mechanism) to provide transparent SSO in browsers.

Security and Best Practices

Kerberos is generally secure, but it has some known weaknesses and operational requirements:

  • KDC compromise: If an attacker gains access to the KDC’s master key database, they can forge any ticket. Therefore, the KDC must be heavily protected and monitored.
  • Password-derived keys: The security of the initial AS exchange depends on the strength of the user’s password. Weak passwords can be brute-forced offline if an attacker captures an AS response.
  • Replay protection: Kerberos uses timestamps and optional replay caches. In distributed systems, ensure clocks are synchronized.
  • Use of encryption types: Modern Kerberos implementations support AES-256 and should disable older DES and RC4 where possible.
  • Renewal and delegation: Kerberos supports ticket renewal and constrained delegation, but these features should be used carefully to avoid privilege escalation.

For administrators, best practices include: keeping the KDC patched, using strong password policies, enabling Kerberos armoring (FAST) where supported, and regularly auditing Kerberos logs for anomalous requests.

Frequently Asked Questions

What does the diagram of Kerberos look like?

The diagram typically shows a client on the left, a KDC in the middle (split into AS and TGS), and a target server on the right. Arrows go from client to AS (step 1), back to client (step 2), then to TGS (step 3), back to client (step 4), and finally to server (step 5). The TGT is shown as a small ticket inside the client after step 2, and the service ticket appears after step 4.

Is Kerberos still used today?

Yes. Kerberos is the default authentication protocol in Microsoft Active Directory and is also used in many Unix/Linux environments, including for SSH (with GSSAPI), NFS, and various network services. It remains a core technology for enterprise single sign-on.

What is the difference between a TGT and a service ticket?

A TGT is obtained once after the user enters their password and is used to request service tickets. A service ticket is specific to one service and is obtained using the TGT. The TGT is encrypted with the KDC’s key, while a service ticket is encrypted with the target server’s key.

Why does Kerberos require time synchronization?

Kerberos uses timestamps in authenticators to prevent replay attacks. If the client’s clock is too far off from the KDC’s clock, the authenticator is considered invalid. The default maximum skew is 5 minutes, so NTP is essential.

Can Kerberos be used over the internet?

Yes, but it is not recommended without additional security measures like IPsec or TLS tunnels. Kerberos traffic itself is not encrypted end-to-end; it only encrypts the tickets and authenticators. Over the internet, you should use a VPN or a secure tunnel to protect the session.

What happens if a user’s password changes?

When a password changes, the user’s key in the KDC is updated. Any existing TGTs and service tickets that were issued under the old key will become invalid because the client’s session keys are derived from the old password. The user must log in again to obtain a new TGT.

Related

How pages are sourced and corrected: Sources and editorial policy.