Troubleshooting Kerberos Errors
Troubleshooting Kerberos Errors
Troubleshooting Kerberos Errors
Microsoft Corporation
Published: March 2004
Abstract
This white paper can help you troubleshoot Kerberos authentication problems that might occur in
a Microsoft Windows Server 2003 operating system environment. It outlines some simple
troubleshooting basics and explains the causes of common Kerberos errors. It also summarizes
common tools used to troubleshoot problems with Kerberos authentication.
To troubleshoot Kerberos authentication, you need to understand how Kerberos authentication
interacts with its supporting technologies (such as Active Directory directory service and time
servers) as well as how the Kerberos authentication process works. With that understanding, you
can use specific diagnostic tools to find answers to specific questions, and to identify and resolve
problems.
This white paper does not provide detailed information about Kerberos authentication or its
supporting technologies, but does provide references to that information.
The information contained in this document represents the current
view of Microsoft Corporation on the issues discussed as of the
date of publication. Because Microsoft must respond to changing
market conditions, it should not be interpreted to be a commitment
on the part of Microsoft, and Microsoft cannot guarantee the
accuracy of any information presented after the date of publication.
This document is for informational purposes only. MICROSOFT
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE
INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of
the user. Without limiting the rights under copyright, no part of this
document might be reproduced, stored in or introduced into a
retrieval system, or transmitted in any form or by any means
(electronic, mechanical, photocopying, recording, or otherwise), or
for any purpose, without the express written permission of Microsoft
Corporation.
Microsoft might have patents, patent applications, trademarks,
copyrights, or other intellectual property rights covering subject
matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this
document does not give you any license to these patents,
trademarks, copyrights, or other intellectual property.
2004 Microsoft Corporation. All rights reserved.
Microsoft, Active Directory, Windows NT, and Windows Server are
either registered trademarks or trademarks of Microsoft Corporation
in the United States and/or other countries.
The names of actual companies and products mentioned herein
might be the trademarks of their respective owners.
Contents
Abstract ........................................................................................................................ 1
Contents ....................................................................................................................... 3
Introduction .................................................................................................................. 7
Infrastructure Requirements ....................................................................................... 7
Active Directory Domain.................................................................................. 7
TCP/IP Network Connectivity .......................................................................... 7
Domain Name System .................................................................................... 8
Time Service .................................................................................................... 8
Operating System ............................................................................................ 8
Troubleshooting Strategies ......................................................................................... 9
Kerberos Authentication Basics ..................................................................... 9
Isolating the Problem ................................................................................... 11
Common Issues ........................................................................................................ 12
Time Synchronization (Clock Skew) ............................................................ 12
UDP Fragmentation ...................................................................................... 13
Group Membership Overloads PAC ............................................................. 14
Need an SPN Set .......................................................................................... 15
Kerberos Logons Failing in a Mixed Windows and UNIX Environment with
Windows NT 4.0 Computers ........................................................................ 16
NTLM Fallback .............................................................................................. 16
Diagnostic Tools ........................................................................................................ 18
Event Viewer ................................................................................................. 18
Network Monitor ........................................................................................... 21
Klist.exe: Kerberos List ................................................................................ 24
Kerbtray.exe: Kerberos Tray ........................................................................ 26
Tokensz.exe: Kerberos Token Size .............................................................. 27
Setspn.exe: Manipulate Service Principal Names for Accounts ................ 33
Debug Output ............................................................................................... 34
Kerberos Errors: Codes, Possible Causes, Resolutions .......................................... 36
RFC Hex Error Value - Error Code: Description .................................................. 37
Possible Causes and Resolutions ............................................................... 37
0x6 - KDC_ERR_C_PRINCIPAL_UNKNOWN: Client not found in Kerberos database
............................................................................................................................. 37
Possible Causes and Resolutions ............................................................... 38
0x7 - KDC_ERR_S_PRINCIPAL_UNKNOWN: Server not found in Kerberos database
............................................................................................................................. 38
Possible Causes and Resolutions ............................................................... 39
0x8 - KDC_ERR_PRINCIPAL_NOT_UNIQUE: Multiple principal entries in database
............................................................................................................................. 39
0xA - KDC_ERR_CANNOT_POSTDATE: Ticket not eligible for postdating ........ 41
Possible Causes and Resolutions ............................................................... 42
0xB - KDC_ERR_NEVER_VALID: Requested start time is later than end time 42
Possible Cause and Resolution ................................................................... 42
0xC - KDC_ERR_POLICY: KDC policy rejects request ....................................... 42
Possible Causes and Resolutions ............................................................... 43
0xD - KDC_ERR_BADOPTION: KDC cannot accommodate requested option . 43
Possible Causes and Resolutions: .............................................................. 44
0xE - KDC_ERR_ETYPE_NOTSUPP: KDC has no support for encryption type . 45
Possible Causes and Resolutions ............................................................... 45
0xF - KDC_ERR_SUMTYPE_NOSUPP: KDC has no support for checksum type46
Possible Cause and Resolution ................................................................... 46
0x10 - KDC_ERR_PADATA_TYPE_NOSUPP: KDC has no support for padata type
............................................................................................................................. 46
Possible Cause and Resolution ................................................................... 46
0x12 - KDC_ERR_CLIENT_REVOKED: Clients credentials have been revoked47
Possible Causes and Resolution ................................................................. 47
0x17 - KDC_ERR_KEY_EXPIRED: Password has expired change password to reset
............................................................................................................................. 47
Possible Cause and Resolution ................................................................... 48
0x18 - KDC_ERR_PREAUTH_FAILED: Pre-authentication information was invalid
............................................................................................................................. 48
Possible Cause and Resolution ................................................................... 48
0x19 - KDC_ERR_PREAUTH_REQUIRED: Additional pre-authentication required
............................................................................................................................. 48
Possible Causes and Resolution ................................................................. 48
0x1B - KDC_ERR_MUST_USE_USER2USER: Server principal valid for user2user only
............................................................................................................................. 49
Possible Causes and Resolution ................................................................. 49
0x1C - KDC_ERR_PATH_NOT_ACCEPTED: KDC Policy rejects transited path. 49
Possible Causes and Resolutions ............................................................... 49
0x1D - KDC_ERR_SVC_UNAVAILABLE: A service is not available .................... 50
Possible Cause and Resolution ................................................................... 50
0x1F - KRB_AP_ERR_BAD_INTEGRITY: Integrity check on decrypted field failed50
Possible Causes and Resolutions ............................................................... 51
0x20 - KRB_AP_ERR_TKT_EXPIRED: Ticket expired ........................................ 51
Possible Cause and Resolution ................................................................... 51
0x21 - KRB_AP_ERR_TKT_NYV: Ticket not yet valid ........................................ 51
Possible Causes and Resolution ................................................................. 52
0x22 - KRB_AP_ERR_REPEAT: Request is a replay.......................................... 52
Possible Causes and Resolutions ............................................................... 52
0x23 - KRB_AP_ERR_NOT_US: The ticket isnt for us ...................................... 52
Possible Cause and Resolution ................................................................... 52
0x24 - KRB_AP_ERR_BADMATCH: Ticket and authenticator dont match ..... 53
Possible Causes and Resolutions ............................................................... 53
0x25 - KRB_AP_ERR_SKEW: Clock skew too great .......................................... 53
Possible Causes and Resolution ................................................................. 53
0x28 - KRB_AP_ERR_MSG_TYPE: Invalid msg type ......................................... 54
Possible Causes and Resolutions ............................................................... 54
0x29 - KRB_AP_ERR_MODIFIED: Message stream modified .......................... 54
Possible Causes and Resolutions ............................................................... 55
0x34 - KRB_ERR_RESPONSE_TOO_BIG: Response too big for UDP, retry with TCP
............................................................................................................................. 55
Possible Cause and Resolution ................................................................... 56
0x3C - KRB_ERR_GENERIC: Generic error ........................................................ 56
Possible Causes and Resolutions ............................................................... 57
0x44 - KDC_ERR_WRONG_REALM: (user-to-user) ........................................... 57
Possible Causes and Resolution ................................................................. 57
Appendix A: Network Monitor Sample Traces ......................................................... 58
Kerberos Authentication During Normal Logon.......................................... 58
Clock Skew ................................................................................................... 60
UDP to TCP Failover ..................................................................................... 61
UDP Fragmentation ...................................................................................... 63
Related Information .................................................................................................. 65
Troubleshooting Kerberos Errors 7
Introduction
The Kerberos V5 protocol assumes that transactions between clients and servers take place on an
open network, in which packets transmitted along the network can be monitored and modified at
will. The assumed environment, in other words, is very much like todays Internet, where an
attacker can easily pose as either a client or a server, and can readily eavesdrop on or tamper with
communications between legitimate clients and servers.
Microsofts implementation of the Kerberos V5 protocol is the default authentication package for
Windows Server 2003. The Kerberos V5 protocol became the default authentication package
with Windows 2000. Windows Server 2003 still supports NTLM for non-Kerberos clients such
as the Windows NT Server 4.0 operating system.
Infrastructure Requirements
Problems with Kerberos authentication often involve technologies on which the Kerberos SSP
depends, or stem from easy-to-correct oversights in the configuration of Kerberos settings. This
section reviews these dependencies and summarizes how they relate to troubleshooting Kerberos
authentication.
TCP and UDP Ports Required for Correct Operation of the Kerberos Protocol
Port Service Description
53/TCP DNS service The internal DNS server needs to be accessible to all
clients for the location of KDC computers. The Active
53/UDP
Directory domain controllers need to be able to
access external DNS servers for resolving external
domain name requests.
Troubleshooting Kerberos Errors 8
88/TCP Kerberos ticket-granting All clients need to be able to connect to this port on
service the KDC servers.
88/UDP
123/TCP Time service All clients need to be able to connect to this port for
time synchronization, either to an internal time server
123/UDP
or to an external time source. The internal time server
will need to connect to an external time source to
synchronize.
464/TCP Microsoft Windows 2000 This port is also used by the kpasswd protocol. This
Kerberos change port should only be open if clients use the kpasswd
password protocol protocol.
For more information about ports domain controllers use, see A List of the Windows Server
Domain Controller Default Ports in the Microsoft Knowledge Base at
http://go.microsoft.com/fwlink/?LinkId=22894. For more information about TCP/IP, see
TCP/IP Technical Reference on Microsoft TechNet at
http://go.microsoft.com/fwlink/?LinkId=25392.
Cached credentials. A user who can log on with cached credentials might not be aware of a
connectivity issue.
Time Service
For Kerberos authentication to function properly, it is vital that the time on all of the computers
on a network be synchronized that is, that all of the domains and forests in a network are
using the same time source. An Active Directory domain controller will act as an authoritative
source of time for its domain, which guarantees that an entire domain will have the same time.
For more information, see Windows Time Service Technical Reference on Microsoft TechNet
at http://go.microsoft.com/fwlink/?LinkId=25393.
Operating System
Kerberos authentication relies on client functionality that is built in to Windows 2000, Windows
Server 2003, and the Microsoft Windows XP operating system. If a client, domain controller, or
target server is running an earlier operating system, it cannot use Kerberos authentication
natively.
Troubleshooting Kerberos Errors 9
Troubleshooting Strategies
As with most technologies, the better you understand how Kerberos authentication should work
and how to confirm whether it is being used, the better you can isolate a problem and determine a
solution.
Keys
Kerberos authentication relies on different types of keys:
User, service, and system keys. Long-term symmetric keys generated from passwords.
Public keys. Long-term asymmetric keys used with smart cards.
Session keys. Short-term symmetric keys created by domain controllers.
Tickets
The main component in Kerberos authentication is the ticket. Essentially, the goal of Kerberos
messages is to request and deliver tickets. There are two types of tickets used in Kerberos
authentication, ticket-granting tickets (TGTs) and session tickets:
TGT. The KDC responds to a clients authentication service request by returning a session
ticket for itself. This special session ticket is called a ticket-granting ticket (TGT). A TGT
enables the authentication service to safely transport the requestors credentials to the ticket-
granting service.
Session ticket. A session ticket allows the ticket-granting service (TGS) to safely transport
the requestors credentials to the target server or service.
Authentication service (AS). The AS issues TGTs good for admission to the ticket-granting
service in its domain. Before network clients can get tickets for services, each client must get
an initial TGT from the AS in the users account domain.
Ticket-granting service (TGS). The TGS issues tickets good for admission to other services
in the TGSs domain or to the ticket-granting service of a trusted domain. When a client
wants access to a service, it must contact the ticket-granting service in the services account
domain, present a TGT, and ask for a ticket. If the client does not have a TGT valid for
admission to that TGS, it must get one through a referral process that begins at the TGS in
the user accounts domain and ends at the TGS in the service accounts domain.
Windows Server 2003 implements the KDC as a domain service. It uses the domains Active
Directory as its account database and gets some information about users from the global catalog.
The TGT has a limited lifetime, which is 10 hours by default. At the point that the client has
received the TGT, the client has not been granted access to any resources, even to resources on
the local computer.
Important
The TGS cannot determine if the user will be able to get access to the target
server. It simply returns a valid ticket. Authentication does not imply
authorization.
Client/server exchange
Kerberos application server request (KRB_AP_REQ) After the client has the session ticket, the
client sends the ticket and a new authenticator to the target server, requesting access. The server
will decrypt the ticket, validate the authenticator, and for Windows services, create an access
token for the user based on the SIDs in the ticket.
Kerberos application server response (KRB_AP_REP) Optionally, the client might request mutual
authentication that is, that the target server verify its own identity. If mutual authentication is
requested, the target server will take the client computers timestamp from the authenticator,
encrypt it with the session key the TGS provided for client-target server messages, and send it to
the client.
For more detailed information about how Kerberos authentication works, see:
Windows 2000 Kerberos Authentication White Paper on the Microsoft website at
http://go.microsoft.com/fwlink/?LinkId=23128.
Windows Server 2003 Technical Reference on Microsoft TechNet at
http://go.microsoft.com/fwlink/?LinkId=21711.
How do you determine that a problem is occurring with Kerberos authentication? If the system
event log shows errors from any services that provide authentication such as Kerberos, KDC,
LsaSrv, or Netlogon, there might be Kerberos errors associated, as well. Also failure audits in the
security event log might show that the Kerberos protocol was being used when a logon failure
occurred.
Where to start
1. Use Kerberos Tray or Kerberos List to confirm that you have a session ticket for the server
you are attempting to connect to. If you have a session ticket for the server and you are still
getting an error message, consider these two possibilities:
You might have an issue with SPNs. For more information about SPN issues, see Need
an SPN Set and 0x8 KDC_ERR_PRINCIPAL_NOT_UNIQUE later in this white paper.
You might have an authorization issue instead of an authentication issue. If this is the
case, most likely Kerberos authentication is not the problem.
2. If you do not have a session ticket, then use Kerberos Tray or Kerberos List to confirm that
you have a TGT.
If you have a TGT but no session ticket, examine the system event log. Errors logged in
the system log will help you determine why you cannot get a ticket to the server.
3. If you are auditing successful logons, then you can check the security event log on the client
to see if the system is using NTLM instead of Kerberos authentication. Use of NTLM can
occur because:
The application uses NTLM. See NTLM Fallback later in this white paper for an
example of this condition.
Kerberos authentication is failing and Negotiate is using NTLM.
4. If Kerberos authentication is failing, the system event log or captured data in a network trace
should contain the Kerberos error code that was returned by the KDC or the Kerberos SSP.
You can also debug to get more information.
Common Issues
The following sections detail the most common problems encountered by users in Kerberos
authentication environments, explain the possible causes of those problems, and suggest how to
resolve those problems.
The Kerberos client on the local computer encrypts a timestamp inside the authenticator and
then sends it to the KDC. If the KDC verifies that the time it decrypts from the authenticator
is within a specified amount of the local time on the KDC (the default is 5 minutes), the
system can assume that the credentials presented are genuine.
All tickets issued by the KDC have an expiration time. Thus, if a ticket is compromised, it
cannot be used outside of a specified time range usually short enough to make the risk of
a replay attack minimal.
Because of these mechanisms, Kerberos authentication relies on the date and time that are set on
the KDC and the client. If there is too great a time difference between the KDC and a client
requesting tickets, the KDC cannot determine whether the request is legitimate or a replay.
Moreover, if the time difference is so great that the client is far into the future, the client might
attempt to compensate for the clock skew, but will receive tickets that have already expired and
are useless. If the client requests new tickets, that will not solve the problem because the KDC
uses its own clock as a reference instead of the time on the client computer.
Therefore, it is vital that the time on all of the computers on a network be synchronized in order
for Kerberos authentication to function properly. This means that all of the domains and forest in
a network must use the same time source. An Active Directory domain controller will act as an
authoritative time server for its domain, which guarantees that an entire domain will have the
same time. However, multiple domains might not have their times synchronized. It is
recommended that you use either an external time source or a single time source within the
network to synchronize all computers.
Problem
The difference between client timestamp in the authenticator or KRB_AS_REQ and the server is
greater than the Maximum tolerance for computer clock synchronization setting in the
domain policy.
Confirmation
Clock skew can be easily diagnosed by reviewing data in Event Viewer. For more information,
see:
0x25: KRB_AP_ERR_SKEW: Clock Skew too great later in this white paper.
Clock Skew network trace in Appendix A.
Resolution
For information about how to use an external time source to synchronize all the computers in a
domain, see How to Configure an Authoritative Time Server in Windows 2000 in the
Microsoft Knowledge Base at http://go.microsoft.com/fwlink/?LinkId=23042.
UDP Fragmentation
By default, Kerberos authentication uses User Datagram Protocol (UDP) to transmit its data.
Troubleshooting Kerberos Errors 14
Problem
UDP provides no guarantee that a packet sent along the network will reach its destination intact.
Thus, in environments with a high amount of network congestion it is common for packets to get
lost or fragmented on the way to their destination.
Confirmation
You can diagnose UDP fragmentation by reviewing Network Monitor captured data. For more
information, see the UDP Fragmentation network trace in Appendix A.
Resolution
Because the only way to decrease the likelihood of UDP fragmentation occurring is to reduce
network traffic a usually impractical solution it is almost always better to configure the
Kerberos authentication service to use TCP instead of UDP. TCP provides a guarantee that a
packet that is sent will reach its destination intact and can therefore be used in any network
environment. In order to force Kerberos authentication to use TCP, see How to Force Kerberos
to Use TCP Instead of UDP in the Microsoft Knowledge Base at
http://go.microsoft.com/fwlink/?LinkId=23043.
Problem
In order to optimize performance, the buffer size for the PAC is pre-allocated. The pre-allocated
buffer size is usually adequate to hold all the required authorization data. However, if a user has a
very high group membership from over 70 to over 120, depending on what groups the size
of the PAC might exceed the pre-allocated buffer size. In such a case, the system will generate a
memory allocation error, PAC creation will fail, and the Kerberos ticket-granting service will
either fail to generate a valid ticket or will generate a ticket with an empty PAC. This sort of error
usually manifests itself in the form of a memory allocation error, which gets reported as 0x3C -
KRB_ERR_GENERIC: Generic error. This also can result in the failure of clients to apply Group
Policy settings.
Confirmation
The Kerberos Token Size tool, described in the Diagnostic Tools section of this white paper, is
specifically designed to check for this problem.
Resolution
You can solve this problem in two ways:
Reduce the number of groups that the user is a member of. Because nested groups are
expanded out within the PAC, the actual number of groups that the user is a member of
might be greater than you suspect.
Troubleshooting Kerberos Errors 15
Alternatively, install a hotfix that will enable you to set the maximum size of a Kerberos
token via the registry. See New Resolution for Problems That Occur When Users Belong to
Many Groups in the Microsoft Knowledge Base at
http://go.microsoft.com/fwlink/?LinkId=23044.
Problem
If an SPN is not set for a service, then clients will have no way of locating that service. Thus,
common results of not setting an SPN are KDC_ERR_C_PRINCIPAL_UNKNOWN or
KDC_ERR_S_PRINCIPAL_UNKNOWN errors. These two errors usually indicate that an SPN
has not been set correctly. Furthermore, there are many other errors for which the cause might be
a missing or incorrectly set SPN. Kerberos authentication is not possible without properly set
SPNs.
Resolution
Because multiple services can run simultaneously under the same account, setting an SPN
requires four pieces of information that will make the SPN unique:
The service class. This allows you to differentiate between multiple services running under
the same account.
The account under which the service is running.
The computer on which the service is running, including any aliases that point to that
computer.
The port on which the service is running.
These four pieces of information uniquely identify any service running on a network and can be
used to mutually authenticate to any service.
Troubleshooting Kerberos Errors 16
Kerberos Logons Failing in a Mixed Windows and UNIX Environment with Windows NT
4.0 Computers
In an environment where there exists a trust between a Kerberos realm and an Active Directory
domain, authentication data can come from one of two sources, either a UNIX KDC or the
Active Directory domain controller. If the authentication data is coming from a UNIX KDC, then
Windows users have account mappings set up for them to map their UNIX user account to a
Windows user account. Normally, the password on the Windows account does not matter,
because all authentications are done by the UNIX KDC.
Problem
The Windows NT 4.0 operating system does not support Kerberos authentication. Therefore, if
there are Windows NT computers on the network running services, any authentications involving
these computers will occur using NTLM and these authentications will be conducted by the
domain controller. In this scenario, the password on the domain controller must match the
password stored on the UNIX KDC. The passwords must match because the fallback to NTLM
occurs transparently. If the passwords do not match, the domain controller will return an Access
denied error because the user has provided a password that does not match the one stored on their
Active Directory account.
Resolution
Reset the password on the account that the users UNIX principal is mapped to in order to match
the password stored on the UNIX KDC.
NTLM Fallback
You might find that the security log recorded an event in which logon occurred using NTLM
when it should have occurred using Kerberos authentication.
Problem
There are two situations in which this might happen:
The first situation is where the system attempts authentication using the Kerberos protocol
but it fails. As a result, the system attempts to authenticate using NTLM. Windows
Server 2003, Windows XP, and Windows 2000 use an algorithm called Negotiate
(SPNEGO) to negotiate which authentication protocol is used. Although the Kerberos
protocol is the default, if the default fails, Negotiate will try NTLM.
Troubleshooting Kerberos Errors 17
The second situation is one in which a call to Negotiate returns NTLM as the only protocol
available.
Confirmation
The first situation will result in a failed Kerberos authentication that you can investigate by
examining errors in the event log or data packets captured by Network Monitor. Both
investigation methods are discussed later in this document.
The second situation is much more difficult to diagnose. There are two common causes of the
second situation when Internet Explorer is being used and the Kerberos protocol is not being
attempted:
Enable Integrated Windows Authentication (requires restart) setting is not selected in
Internet Explorer 6
Internet Explorer is accessing a site in the Internet zone instead of the intranet zone.
Resolution
Internet Explorer 6 will, by default, not attempt to use the Kerberos protocol to authenticate to
any site. To change this, you must select the Enable Integrated Windows Authentication
(requires restart) setting. For more information, see Unable to Negotiate Kerberos
Authentication After Upgrading to Internet Explorer 6 in the Microsoft Knowledge Base at
http://go.microsoft.com/fwlink/?LinkId=23045.
The second common cause is that Internet Explorer 6 is attempting to access a site located in the
Internet zone. Internet zone sites are prevented from using Integrated Windows authentication
because these protocols will not typically work through Web proxies, among other reasons. If a
site is located in the Internet zone, Internet Explorer 6 will not attempt to use Kerberos
authentication, and will automatically try NTLM. In all versions of Internet Explorer, when
accessing a website to which you want to use Kerberos authentication, you must verify that the
website appears as being in the local intranet zone. An icon in the lower right-hand corner of the
Internet Explorer window will indicate what zone a website is in. It will display Internet for the
Internet zone and Local Intranet for the intranet zone. If the website appears as being in the
Internet zone, you must manually add the site to the local intranet sites list.
Diagnostic Tools
Some tools for example, Event Viewer and Network Monitor that you use to diagnose
Kerberos errors are the same you would use for other network-related or authentication issues.
More specific tools such as Kerberos List, Kerberos Tray, and Kerberos Token Size can be
used for detailed Kerberos-specific information. To get more even more detailed information,
you can enable debug output. Information about troubleshooting tools is provided in this section.
Event Viewer
Event Viewer is included in Windows Server 2003, Windows XP, and Windows 2000. The
system and security logs will contain Kerberos error codes and other events related to
authentication. For more information about using Event Viewer, see HOW TO: Diagnose
System Problems with Event Viewer in Windows Server 2003 in the Microsoft Knowledge
Base at http://go.microsoft.com/fwlink/?LinkId=23046.
System event log The first place to look if you are experiencing a problem with Kerberos
authentication is the system event log.
Any critical errors that Kerberos authentication encounters will show a Source value of Kerberos,
KDC, or LsaSrv. The event itself will contain a Kerberos error code and might contain
information about how to fix the problem.
If there are no errors listed in the system log or if the errors that appear are not detailed enough to
pinpoint the problem, you can configure more detailed Kerberos event logging.
Windows Server 2003 and Windows 2000 can log detailed Kerberos events in the event logs.
You can use the resulting information when you troubleshoot Kerberos authentication errors.
Caution
Incorrectly editing the registry might severely damage your system. Before
making changes to the registry, you should back up any valued data on the
computer.
Note
Remove this registry value when it is no longer needed so that performance
is not degraded on the computer. Also, you can remove this registry value to
disable Kerberos event logging on a specific computer.
(Windows User ID
Server 200
3) Service Name
Service ID
Ticket Options
Result Code: Kerberos error code
Ticket Encryption Type
Pre-Authentication Type
Client Address
Certificate Issuer Name
Certificate Serial Number
Certificate Thumbprint
673 Success Service Ticket Request:
audit
User Name
(Windows
2000 and User Domain
Windows
Server 200 Service Name
3) Service ID
Failure Ticket Options
audit
(Windows Ticket Encryption Type
Server 200 Client Address
3)
Failure Code: Kerberos Error Code
Logon GUID
Transited Services
675 Failure Pre-authentication Failed:
audit
User Name
User ID
Service Name
Pre-authentication Type
Failure Code: Kerberos error code
Client Address
676 Failure Authentication Ticket Request Failed:
audit
User Name
(Obsolete
in Windows Supplied Realm Name
Troubleshooting Kerberos Errors 21
Network Monitor
If the errors in the event logs do not help you solve the problem, or if you need more detailed
information, use Network Monitor to capture a network trace for inspection of the actual
Kerberos packets being sent across the network.
Note
For more information about Network Monitor, see Network Monitor on
Microsoft TechNet at http://go.microsoft.com/fwlink/?LinkId=23049. For
best practices and procedures associated with Network Monitor, see
Checklist: Monitoring network traffic on your local computer on Microsoft
TechNet at http://go.microsoft.com/fwlink/?linkid=23047.
The full version of Network Monitor is included with Microsoft Systems Management Server
(SMS). A limited version of the tool is included with Windows 2000, Windows XP, and the
Windows Server 2003 family. It is also available from Microsoft Product Support Services.
Note
To perform this procedure, you must be a member of the
Administrators group on the local computer, or you must have
been delegated the appropriate authority. If the computer is joined
to a domain, members of the Domain Admins group might be able
to perform this procedure.
To open the Windows Components Wizard, click Start, click Control
Panel, click Add or Remove Programs, and then click Add/Remove
Windows Components.
Certain Windows components require configuration before they
can be used. If you installed one or more of these components but
did not configure them, when you click Add/Remove Windows
Components, a list of components that need to be configured is
displayed. To start the Windows Components Wizard, click
Components.
This procedure automatically installs the Network Monitor driver.
Important
Network monitoring on Windows XP is done with the Netcap.exe tool. This
tool only allows the capture of network traffic. The capture cannot be viewed
with the same tool. You must use the full version of Network Monitor on
Windows 2000 or the Windows Server 2003 family to view the captured
data.
How to capture network traffic with Windows 2000 and the Windows Server 2003 family
1. Click Start, click Control Panel, click Performance and Maintenance, click
Administrative Tools, and then double-click Network Monitor.
2. Click the Start button to begin capturing network traffic.
3. Reproduce the error.
4. Click the Stop button to stop capturing network traffic.
5. In the capture statistics information on the right-hand side, verify that no packets were lost
because of the buffer overflowing. If any packets were lost, increase the buffer size in the
Buffer Settings dialog box on the Capture menu and perform the capture again.
For more information, see To capture network frames on Microsoft TechNet at
http://go.microsoft.com/fwlink/?LinkId=23052.
Option Description
End Time Time when the ticket becomes invalid. After a ticket is past this time, it
cannot be used to authenticate to a service.
KerbTicket Encryption Type Encryption type used to encrypt the Kerberos ticket.
Renew Time Maximum lifetime of a renewable ticket (see TicketFlags in the following
table). To continue using this ticket, you must renew it before reaching
the established End Time and before the expiration date established in
RenewUntil.
Server Server and domain for the ticket.
tgt Lists the initial Kerberos ticket-granting ticket (TGT). Tgt displays the following attributes
of the currently cached ticket:
Option Description
AltTargetDomainName Name supplied to InitializeSecurityContext that generated this ticket,
typically an SPN.
Troubleshooting Kerberos Errors 26
purge Deletes all Kerberos tickets held by the user. Purge destroys all tickets that you have
cached, so use this with caution. It might stop you from being able to authenticate to resources. If
this happens you must log off, and then log on again.
-? Displays command-line help
In this example:
Troubleshooting Kerberos Errors 28
Name shows the name of package chosen, in this case Negotiate, which is the Microsoft
Package Negotiator.
Current PackageInfo shows the current MaxTokenSize value in registry when package was
initialized.
MaxTokenSize is the maximum token size required to authenticate to ServerName.
Incomplete context. The tool will return (incomplete context) when it does not have the
key for all the tickets.
Note
Incomplete context versus complete context. Two situations might cause the
tool to return (complete context):
Using the /system switch. The tool will run the test in the system
context and thus have the key needed to open the service ticket.
Using the /serveruser switch and specifying the password. The
service ticket can be opened.
Note
If you provide a target_server parameter, you must specify the
[/serveruser:UserName] [/serverdomain:ServerDomain]
[/serverpassword:ServerPassword] parameters corresponding to the
account on which the SPN is registered. Alternatively, you can run the tool
under the service or computer account on which the SPN is registered. If you
choose to run the tool under the account corresponding to the SPN and you
want to get the MaxTokenSize value for a user, you must specify the users
credentials using the [/user:UserName] [/domain:UserDomain] [/password:
ClientPassword] parameters.
In nearly all cases, the maximum token size is determined by the first call to
InitializeSecurityContext(). Thus, if you have connectivity issues to a target server you are
troubleshooting, you can select another server in the same domain as a target server for this
tool and be reasonably assured that accurate results will be reported. That is, if the target
server is in the same domain as the user, the credentials will contain global group, domain
local groups, and universal group membership. On the other hand, if you were to choose a
target server in a different domain, the credentials will include the domain local groups for
that domain.
/user:UserName
/domain:UserDomain
/password:ClientPassword
These switches enable you to specify client credentials. For example, if you have a user
experiencing maximum token size issues, you can run this tool with that users credentials to
get an accurate idea of the MaxTokenSize values. Alternatively, the user can run the tool.
/serveruser:UserName
/serverdomain:ServerDomain
/serverpassword:ServerPassword
These switches enable you to specify server credentials. They must match the credentials of
the account specified in the [/target_server:TargetName] parameter, or you will only get
information for the incomplete context. In many cases for example, computer accounts
it is not possible to know the service password, so these switches are useful when the target
is a service account.
/dump_groups
This switch extracts and displays all of the users token groups, relative to the server. The
output of this switch is dependent on which server is being used. For example, domain local
group membership is relative to which domain the service resides in. The choice of target
domain will affect the number of groups reported and the maximum token size.
/system
Troubleshooting Kerberos Errors 30
You must have administrator rights to use this switch, which runs the test under the Local
System context of the computer that the test is being run on. In these cases, you must use the
[/user:UserName] [/domain:UserDomain] [/password:ClientPassword] switches, because
the tool will be running under the Local System context. This switch is useful to see what
groups are present in the Local System logon context.
/nopac
This switch uses the SEC_WINNT_AUTH_IDENTITY_ONLY flag for
AcquireCredentialsHandle(), which informs the KDC not to include a PAC in the TGT or
the service ticket. Because a service tickets size is primarily influenced by the PAC, you can
use this option to determine the size of the Kerberos ticket without including the PAC.
/use_delegation
This switch passes the ISC_REQ_DELEGATE flag into InitializeSecurityContext(). If you
are testing delegation scenarios, use this flag in conjunction with a server in the
/target_server parameter that has the Trusted for Delegation option selected. When
delegation is used, the system passes both a service ticket and a TGT to the remote server.
This approximately doubles the required maximum token size, and is responsible for several
Group Policy issues that might be encountered.
/purge_tickets:[SPN | NULL]
You can use this switch to purge all of the tickets for the user before starting the token size
calculation. This is important if you want to judge the effects of adding groups to a users
maximum token size. This parameter provides the same functionality as using Kerberos List
to purge a users ticket.
Calc_groups syntax is:
tokensz /calc_groups ClientName [/user:UserName] [/domain:UserDomain]
[/password:ClientPassword] [/system]
/calc_groups
This option is only available if you are using Windows Server 2003 KDCs and running the
tool on a computer running Windows Server 2003. The parameter passed to this option is a
user and (optionally) a domain that this user is a member of. Kerberos Token Size will list
all the groups that this user is a member of. If the user is a member of a large number of
groups generally more than 70-120 this user might exhibit maximum token size issues.
/user:UserName
/domain:UserDomain
/password:ClientPassword
These switches enable you to specify client credentials.
/system
You must have administrator rights to use this switch, which runs the test under the Local
System context of the computer that the test is being run on. In these cases, you must use the
Troubleshooting Kerberos Errors 31
In this example:
MaxTokenSize (incomplete context) indicates that the protocol could not perform all legs of
authentication. In this case, (incomplete context) was returned because the server was specified
as server 1, but the test was run under the user account. However, this is still a reasonable
estimation of the maximum token size required for this user to authenticate to server 1.
Example 2: Administrator account to server host with delegation requested
To determine the maximum Kerberos token size for administrator to the host server 1:
Type the following at the command line:
tokensz /compute_tokensize /package:negotiate /target_server:host/server1
/user:administrator /password:ClientPassword /domain:UserDomain /use_delegation
When you press ENTER, the following output is displayed:
Name: Negotiate Comment: Microsoft Package Negotiator
QueryKeyInfo:
Signature algorithm =
KeySize = 128
Flags = 2081e
Encrypt Algorithm = 23
Start:4/2/2003 5:54:19
Expiry:4/2/2003 6:54:19
In this example:
Asked for delegate, but didnt get it indicates that delegation was not used. This happens if
the target server is not trusted for delegation, or if the user account has the Account is
sensitive and cannot be delegated option selected.
MaxToken (complete context) indicates that all authentication legs have been completed,
and that this is a reliable value for maximum token size for server 1.
Example 3: Using /calc_groups
To calculate group membership for user 1:
Type the following at the command line:
tokensz /calc_groups user1
When you press ENTER, the tool returns a list of Kerberos token contents. In this example, the
following output is displayed:
Username = user1
TS Session ID: 0
User
S-1-5-21-148402017-3776891892-3157626230-1945
Groups:
00 S-1-5-21-148402017-3776891892-3157626230-513 Attributes -
Mandatory Default Enabled
Primary Group:
S-1-5-21-148402017-3776891892-3157626230-513
Privs
Auth ID 0:10494b4
TokenType Impersonation
ServiceClass. There are many different types of SPNs, and each service that is running on a
computer should have the appropriate SPN service class assigned to it. If an application is
written to take advantage of Kerberos authentication and delegation, it has the specific type
of SPN that it needs to access predetermined. For example, when Internet Explorer 5.5 and
later uses the Kerberos protocol to authenticate to a Web server, it looks for the http/ SPN,
whereas a SQL Server client looks for the MSSQLSvc/ SPN. If the wrong service class is
used on an SPN, then the SPN will not be located when a service searches for it.
Host. The computer to which the SPN belongs is all the names by which a computer on
which the service is running can be referenced. This usually includes a NetBIOS name, the
FQDN, and any aliases that might have been assigned to this computer A separate SPN will
need to be set for each name by which the computer can be referenced, with the Host
parameter changing respectively.
Port. The port that the service is running on. If this is a default port for that service (such as
80 for HTTP), then it can be omitted. However, it is recommended the port be included
regardless of what service is running.
AccountName. The name of the domain account under which the service runs. If the service
runs as Local System or Network Service, you usually do not need to set an SPN explicitly
for the service because most common SPN service classes will automatically be mapped to
the host/ SPN which is in turn automatically generated for each computer account.
Debug Output
You can use debug output associated with Kerberos authentication to obtain information if other
troubleshooting tools fail to produce useful information. Debug output is not meant to be used in
day-to-day troubleshooting. It should only be used if there is absolutely no other means available
to get information about the error. Debug output sometimes has extremely detailed error
messages that might help you find the source of the problem. However, debug output also can
contain messages that appear to indicate an error, but are actually normal messages that result
from routine operations of the Kerberos protocol.
The directions in the following sections apply only to Windows Server 2003. In order to view the
debug output on Windows 2000 Server, you must obtain instructions and a checked build of the
Kerberos dynamic-link libraries (DLLs) from Microsoft Product Support Services.
Caution
Incorrectly editing the registry might severely damage your system. Before
making changes to the registry, you should back up any valued data on the
computer.
Troubleshooting Kerberos Errors 35
Note
After you have obtained the necessary output, delete the two registry keys
that you added in order to return the system to its full performance.
You might want to view and print the debug output in real time, as the errors actually happen. To
do this, you can use a debugging tool called Ntsd. Ntsd is included in both Windows 2000 and
Windows Server 2003.
.
How to use Ntsd to view real-time debug output from Kerberos authentication
Note
Ntsd is included as a courtesy to software developers. Only system
developers should use this command. For more information, see the Help
file included with Ntsd.
Caution
Incorrectly editing the registry might severely damage your system. Before
making changes to the registry, you should back up any valued data on the
computer.
Troubleshooting Kerberos Errors 36
Important
After you have viewed the debug output, exit Ntsd correctly. If you do not exit
Ntsd correctly, you can terminate the lsass process, which will force a
system restart. To exit Ntsd, press CTRL+C. At the prompt, type qd to quit the
debugger. To return the system to its full performance level, remove the
KerbDebugLevel registry entry.
Note
If you do not have the Windows Server 2003 Support Tools installed, install
them from the Windows Server 2003 CD-ROM before proceeding. (The
Setup executable file for Support Tools is located on the CD-ROM in the
Support\Tools folder. The installation does not require you to restart the
computer, but you might have to restart the computer so that the
environment variables are updated.
Note
If the accounts that seem to have the duplicate SPNs are located in a certain
OU (for example, Florida), you can refine the base distinguished name. For
example: -d ou=sales,dc=tailspintoys,dc=com .
2. Open the text file in Notepad, and then search for the SPN that is reported in the security
event log.
3. Note the accounts under which the SPN is located.
Use Setspn to rename or delete the duplicates. For more information about setting SPNs, see
Need an SPN Set earlier in this white paper.
For information about setting up service accounts for delegation, see HOW TO: Configure
Computer Accounts and User Accounts So That They Are Trusted for Delegation in
Windows Server 2003 Enterprise Edition in the Microsoft Knowledge Base at
http://go.microsoft.com/fwlink/?LinkId=23067.
The server does not support constrained delegation or protocol transition. (Windows 2000
does not support constrained delegation or protocol transition.)
Alternatively, consider upgrading to the most recent MIT reference distribution of Kerberos
authentication.
Resolution Verify that there is a two-way transitive trust set up between the users domain and
the domain on which the user is trying to access resources.
If the domain to which the user is trying to authenticate is in another forest, see Cannot Use
Kerberos Trust Relationships Between Two Forests in Windows 2000 in the Microsoft
Knowledge Base at http://go.microsoft.com/fwlink/?LinkId=23069. This article describes
why you cannot use internal Kerberos trust relationships between two forests in Windows
2000.
Constrained delegation is being attempted across multiple domains.
Resolution No resolution. Windows 2000 does not support constrained delegation across
multiple domains.
If constrained delegation is being attempted across multiple domains in Windows
Server 2003, this error message will read: Constrained delegation is not currently supported
across multiple domains.
Resolution Beware that the higher you set the value of the Maximum tolerance for computer
clock synchronization setting, the more susceptible the network becomes to replay attacks.
To set Maximum tolerance for computer clock synchronization Kerberos policy:
1. Open the domain security policy by clicking Start, Programs, Administrative Tools,
Local Security Policy.
2. Click Account Policies, and then click Kerberos Policy.
3. Increase the value for Maximum tolerance for computer clock synchronization.
4. You can either wait for the policy change to propagate or you can run gpupdate /force
on the client computers to force propagation immediately.
For more information, see Time Synchronization (Clock Skew) earlier in this white paper.
TGT is different than the realm of the KDC that the TGT is being presented to. Then
investigate why the TGT is routed to something other than the realm it was meant for.
Note
The traces below have been altered to remove irrelevant or unnecessary
information.
A successful logon will include an initial KRB_AS_REQ and KRB_AS_REP to obtain a TGT.
(This only occurs on the first authentication. After the client has a TGT, the protocol will not ask
for one again until the TGT expires.) After the AS message exchange, there will be a
Troubleshooting Kerberos Errors 60
KRB_TGS_REQ and KRB_TGS_REP for a service ticket to whatever service the client is trying
to access. Note that the realm names, the requesting user name, the time, and the SPN can all be
viewed in this exchange. This information is often vital in diagnosing problems with Kerberos
authentication. The sample packets above have been trimmed to only show the vital data. In a
real network capture, there will be much more data displayed, including ticket options and
encryption types.
Clock Skew
+ FRAME: Base frame properties
+ ETHERNET: EType = Internet IP (IPv4)
+ IP: Protocol = UDP - User Datagram; Packet ID = 6674; Total IP Length = 333;
Options = No Options
+ UDP: Src Port: Unknown (1550); Dst Port: Kerberos (88); Length = 313 (0x139)
+ KERBEROS: KRB_AS_REQ
*******************************************************************************
This is a common example of the error that occurs when the Kerberos protocol attempts to switch
to TCP. The RFC states that the Kerberos protocol should use UDP for transmitting data.
However, UDP has a practical limit on how large a packet might be sent across the network.
Because Microsoft extensions to the Kerberos protocol place group memberships within a ticket,
it is common for a ticket issued to a user that belongs to many groups to be larger than the
maximum value that UDP can reliably transmit. If this is what happens, a
KRB_ERR_RESPONSE_TOO_BIG is almost always present.
In the system event log (with Kerberos event logging turned on), a Kerberos error will appear,
the details of which will state that a KRB_ERR_RESPONSE_TOO_BIG was received. In the
example above, there is a KRB_ERROR packet after the initial KRB_AS_REQ with the same
failure code in it. Also, note that the initial KRB_AS_REQ and KRB_ERROR occur over UDP,
but the rest of the traffic occurs over TCP, indicating that the switchover was successful and the
authentication continued normally.
Furthermore, note that the subsequent KRB_AS_REP takes multiple packets. This is because
there are many groups to be transmitted and they do not all fit into one packet. Thus, multiple
packets are required to transmit the information, something that could not have been
accomplished reliably with UDP.
UDP Fragmentation
+ FRAME: Base frame properties
+ ETHERNET: EType = Internet IP (IPv4)
+ IP: Protocol = UDP - User Datagram; Packet ID = 39863; Total IP Length = 1500;
Options = No Options
UDP: Src Port: Unknown (3010); Dst Port: Kerberos (88); Length = 1798 (0x706)
UDP: Source Port = 0x0BC2
UDP: Destination Port = Kerberos
UDP: Total length = 1798 (0x706)
UDP: UDP Checksum = Frame was truncated, unable to verify Checksum.
KERBEROS: KRB_TGS_REQ
Troubleshooting Kerberos Errors 64
Related Information
Answers to Frequently Asked Kerberos Questions in the Microsoft Knowledge Base at
http://go.microsoft.com/fwlink/?LinkId=25039
Authentication for Administrative Authority on Microsoft TechNet at
http://go.microsoft.com/fwlink/?LinkId=25038
Building Security and Directory Solutions for UNIX Using the Windows Server 2003
Active Directory Kerberos and LDAP Services in the Solution Guide for Windows Security
and Directory Services for UNIX on the Microsoft Download Center at
http://go.microsoft.com/fwlink/?LinkId=25395
Windows Server 2003 Technical Reference on Microsoft TechNet at
http://go.microsoft.com/fwlink/?LinkId=21711
Acknowledgements
Vincent Abella, Technical Editor, Microsoft Corporation
Leon Arber, University of Illinois at Urbana-Champaign
David Christiansen, Software Design Engineer, Microsoft Corporation
Mike Danseglio, Technical Writer, Microsoft Corporation
Xin Fan, Software Test Engineer, Microsoft Corporation
JK Jaganathan, Program Manager, Microsoft Corporation
Steve Light, Escalation Engineer, Microsoft Corporation
David Longmuir, Technical Editor, Volt
Soumitra Sengupta, Architect, Microsoft Corporation
Michiko Short, Technical Writer, Microsoft Corporation
Tim Springston, Support Professional, Microsoft Corporation
Todd Stecher, Development Lead, Microsoft Corporation
Jonathan Stephens, Escalation Engineer, Microsoft Corporation
Darol Timberlake, Consultant, Microsoft Corporation
Joseph Vasil, Consultant, Microsoft Corporation
Liqiang (Larry) Zhu, Software Design Engineer, Microsoft Corporation