Broken time sync: why clock drift ruins logs and authentication
Investigations depend on timestamps lining up across systems, and Kerberos and TOTP depend on clocks agreeing. How to check NTP health with timedatectl, chronyc, and w32tm, and keep logs in UTC.
Diagram
Checking time on three systems
Step 1 of 4
Linux
Is the clock synchronized?
$ timedatectl
System clock synchronized: no
NTP service: active
$ chronyc tracking | grep -E "Reference|System time"
Reference ID : 00000000 ()
System time : 312.448 seconds slow of NTP timeThe example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Kerberos skew
- What fails
- Kerberos rejects tickets when clocks differ by more than five minutes by default.
- Who is affected
- Users who cannot sign in.
- What you would notice
- KRB_AP_ERR_SKEW errors.
- What you change
- Sync domain controllers and members to one hierarchy.
Timeline errors
- What fails
- Events from drifting hosts appear in the wrong order.
- Who is affected
- Investigators.
- What you would notice
- Log events that seem to happen before their cause.
- What you change
- Record time offset per host and normalize to UTC.
Local clock sources
- What fails
- A server using its own hardware clock drifts.
- Who is affected
- Everything that syncs to it.
- What you would notice
- w32tm source Local CMOS Clock on a domain controller.
- What you change
- Configure the PDC emulator with external peers.
Logs in UTC
Store and display logs in UTC with ISO 8601 timestamps. Local time zones and daylight saving changes create hour-long gaps and duplicates in timelines.
Check yourself
Recognition and the fix. Nothing here is a procedure.
A domain controller reports Source: Local CMOS Clock. What is wrong?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.
This page stands on its own. The lab and the glossary card are the next reading.