Changing the Kerberos password (krbtgt)

11 November 2019 Off By Rached CHADER

The KRBTGT account is a default local account that acts as a service account for the Key Distribution Center (KDC) service. This account cannot be deleted and the account name cannot be changed. The KRBTGT account cannot be activated in Active Directory.

KRBTGT is also the security principal name used by the KDC for a Windows Server domain, as specified by RFC 4120. The KRBTGT account is the entity for the KRBTGT security principal. It is created automatically when a new domain is created.

Windows Server Kerberos authentication is achieved by using a special Kerberos ticket-granting ticket (TGT) encrypted with a symmetric key. This key is derived from the password of the server or service to which access is requested. The TGT password for the KRBTGT account is known only to the Kerberos service. In order to request a session ticket, the TGT must be presented to the KDC. The TGT is sent to the Kerberos client from the KDC.

A single modification of the Krbtgt account password has no impact on authentication.

On the other hand, if a second modification is desired, it must be ensured that the first modification has indeed been replicated on all the domain controllers, then that all the TGTs and TGS issued with the old password have expired.

It is therefore necessary to count:

(Full replication time + TGTs expiration + TGS expiration)

By default, the expiration time for TGTs is 10 Hours.

kerberos policy

By default, the TGS expiration time is 600 minutes.

kerberos policy

This script will allow you to reset the krbtgt account password and associated keys while minimizing the risk of Kerberos authentication issues caused by the operation.

IMPORTANT NOTE: This script currently only supports running in English.

Script source: https://github.com/zjorz/Public-AD-Scripts/blob/master/Reset-KrbTgt-Password-For-RWDCs-And-RODCs.ps1

  • Copy the script to a .ps1 file
  • Open a PowerShell
  • Type the following command to allow script execution

  • Run the script

  • You will then be asked to read the script information
  • Type YES
  • You will have to choose a mode.
  • Choose – 1 – Information mode (no change)
  • After having checked in the folder where the script is located that everything is correct, you can relaunch the script.
  • Choose the option: – 2 – Simulation Mode | Creation of a temporary object to test the convergence of replication!
  • When you receive a message “Which KrbTgt account do you want to target?” type – 1 –
  • After having checked in the folder where the script is located that everything is correct, you can relaunch the script.
  • Choose the option: – 8 – Create a TEST KrbTgt account
  • The script will create a test account “krbtgt_TEST” which will allow you to perform a simulation in real mode
  • Once the account is created, you can relaunch the script.
  • Choose the option:- 3 – Simulation mode | Use KrbTgt TEST account – No password reset/WhatIf mode!
  • After having checked in the folder where the script is located that everything is correct, you can relaunch the script.
  • Choose the option: – 9 – Clean the TEST KrbTgt account
  • We are going to delete the TEST KrbTgt account
  • After having checked in the folder where the script is located that everything is correct, you can relaunch the script.
  • Choose the option: – 6 – True Reset Mode | Use KrbTgt PROD account – Password will be reset once!
  • We are going to reset the KRBTGT password in production mode

Views: 7572