Time & NTP
Keeping Time in Sync
It's easy to assume a server's clock "just works," but hardware clocks drift over time - and accurate, synchronized time turns out to matter far more than it seems: log timestamps become useless for correlating events across servers if their clocks disagree, TLS certificates are validated partly by comparing the current time against their validity window, and authentication protocols like Kerberos reject requests if the clock skew between client and server is too large.
| Command | Purpose |
|---|---|
timedatectl | Show/set time, zone, NTP status |
timedatectl set-timezone Asia/Kolkata | Set timezone |
timedatectl set-ntp true | Enable network time sync |
chronyc sources | chrony NTP sources (RHEL) |
date / hwclock | System / hardware clock |
$ timedatectl
Local time: Mon 2025-01-06 10:00:00 IST
System clock synchronized: yes
NTP service: active
That System clock synchronized: yes line is the actual health check to look for - it confirms the machine isn't just running some clock, but is actively keeping that clock aligned with a trusted external time source over the network (NTP, Network Time Protocol).
Tip: The daemon actually performing that synchronization has changed over the years - modern RHEL-family systems usechronyd, Ubuntu commonly uses the simpler built-insystemd-timesyncd, and the older, once-universalntpdis now considered legacy on most distros. All three achieve the same underlying goal (a clock that tracks a trusted network time source), so don't be thrown off if a server you're troubleshooting uses a different one than you expected.