NTP — Time Synchronization
Linux
Systemd
Why is time synchronization required?
- TLS/SSL certificates depend on accurate time
- Authentication systems like Kerberos & LDAP require synchronized clocks
- System logs, application logs, and audit logs rely on timestamps
- File Systems & Build Systems generate timestamps
- Distributed Systems (HPC, Kubernetes) & Databases require consistent time
Most modern Linux systems use one of the following components to sync time:
systemd-timesyncdchrony(chronyd) – recommended for serversntpd(older systems)
Check current time status:
>>> timedatectl status
Local time: Thu 2026-02-12 09:23:41 CET
Universal time: Thu 2026-02-12 08:23:41 UTC
RTC time: Thu 2026-02-12 08:23:41
Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
NTP service: active
RTC in local TZ: noTypes of clocks:
- RTC (Real-Time Clock) aka hardware clock runs on battery when the machine is powered off (unplugged)
- Uses local time (in current time zone)
- Or UTC (Coordinated Universal Time) with an time zone dependent offset
- SC (Software Clock) aka system clock
- Maintained by the OS kernel during run-time driven by a timer interrupt
- Initialized on boot using RTC as reference.
Chrony
| Command | Description |
|---|---|
chronyd |
The daemon (runs in background) |
chronyc |
Command-line client to control/query it |
Show synchronization status (stratum, drift, current offset
>>> chronyc tracking
Reference ID : 8CB55A16 (ntp.example.org)
Stratum : 3
Ref time (UTC) : Thu Feb 12 08:28:06 2026
System time : 0.000000040 seconds slow of NTP time
Last offset : +0.000039854 seconds
RMS offset : 0.000029645 seconds
Frequency : 60.475 ppm slow
Residual freq : +0.033 ppm
Skew : 0.109 ppm
Root delay : 0.016435383 seconds
Root dispersion : 0.023702158 seconds
Update interval : 130.6 seconds
Leap status : Normal- Leap status —
Normalmeans system is synced - Stratum — Level in the NTP hierarchy
0highly accurate reference clocks (atomic & GPS clocks)1NTP servers directly connected to stratum 0 devices2NTP servers sync their time from stratum 1 servers3+NTP servers sync their time from stratum 2 servers, and so on
- Offset — Time difference between client and reference NTP server
Configuration
Main configuration file for Chrony:
/etc/chrony.conf
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsyncRestart chronyd so the changes in the config file take effect:
server— Specify a remote NTP server (hostname or IP address)iburstFirst initial synchronization faster- Multiple servers to increase redundancy and improve accuracy
driftfile— Information about how much your system’s clock is driftingmakestep— How to to make adjustments to the system clockrtcsync— System time is written to the hardware clock periodically
Verify NTP sources:
chronyc sources -vsystemd-timesyncd
timedatectl # show time and time zone configuration
timedatectl set-time YYYY-MM-DD # change the current date
timedatectl set-time HH:MM:SS # change the current time
timedatectl list-timezones # list available time zones
timedatectl set-timezone <zone> # set a given time zone, e.g. Europe/Berlin
grep ^Servers /etc/systemd/timesyncd.conf # list time servers
timedatectl set-ntp true # enable NTP
timedatectl set-local-rtc 0 # RTC in UTC mode
timedatectl set-local-rtc 1 # RTC in locel time mode
systemctl start systemd-timesyncd # start the time sync daemon
systemctl enable systemd-timesyncd # make the time sync daemon boot persistant