Configure a host as an NTP client using chronyd to
keep logs and timestamps consistent across systems. Verify sync
health with timedatectl and chronyc,
then apply a one-time step correction when drift is large.
A server’s clock is drifting and logs are no longer ordered
correctly. You need to install chrony, enable
chronyd, verify the system is synchronized, and
confirm the active NTP sources and tracking statistics.
Time drift creates subtle failures: TLS issues, confusing incident timelines, broken log correlation, and unpredictable authentication behavior. The goal is enable time sync, prove it’s working, then document what it’s using.
chrony and enable chronyd.systemctl.timedatectl.chronyc sources -v.chronyc makestep.systemctl.
timedatectl.
chronyc sources -v.
chronyc tracking.
chronyc makestep.
sudo dnf install chrony -y
Install the client tooling and the daemon. On managed systems, this is usually standard build baseline work, not an emergency fix.
# Expected signal:
# Installed: chrony
sudo systemctl enable --now chronyd
This starts synchronization immediately and ensures it comes back after reboot.
systemctl status chronyd --no-pager
Confirm the unit is active and scan for obvious failures before you trust anything downstream.
# Expected patterns:
# Active: active (running)
timedatectl status
You’re looking for a synchronized clock and an active NTP service. If the OS doesn’t agree, treat chrony output as incomplete evidence.
# Expected patterns:
# System clock synchronized: yes
# NTP service: active
chronyc sources -v
Validate that the host can reach sources and that at least
one is healthy. The selected source is typically marked
with *.
# Expected patterns:
# ^* time.example.net ...
chronyc tracking
Tracking output shows the current offset, correction behavior, stratum, and reference source being used. This is what you document when troubleshooting drift.
Stepping time can be disruptive for time-sensitive applications. Use this when drift is large and you need a fast correction, then confirm sync and sources again.
sudo chronyc makestep
# Re-verify:
timedatectl status
chronyc sources -v
ls -l /etc/chrony.conf
This is where you document or adjust servers/pools and local policy. If the environment uses internal NTP, this file is where you confirm what the host is configured to trust.
If the service is not running, start with
systemctl status
and then review logs. Fix the service state before trying to
validate sources or tracking output.
Confirm network reachability to NTP sources and verify at
least one source is selectable in
chronyc sources -v
. If sources are unreachable, investigate DNS, routing, and
firewall policy.
If nothing is marked with *, the host has not
selected a usable source. Confirm configuration and verify
you are not blocked upstream by egress controls.
Stepping time can confuse systems that assume monotonic timestamps. If this is a risk, prefer gradual correction and coordinate the change window for sensitive workloads.
This lab is non-destructive. Cleanup is confirming the service is enabled, the system reports synchronized time, and at least one usable source is selected.
systemctl is-enabled chronyd
systemctl is-active chronyd
timedatectl status
chronyc sources -v
chronyc tracking
timedatectl
reports the clock is synchronized and
chronyc sources
shows a selected source with stable tracking output.
dnf install chrony -y
: Installs the chrony package.
-y
: Automatically answers yes to prompts.
systemctl enable --now chronyd
: Enables chronyd at boot and starts it immediately.
--now
: Starts the service immediately after enabling.
systemctl status chronyd --no-pager
: Shows chronyd service status.
--no-pager
: Prints output without paging.
timedatectl status
: Shows system time settings and synchronization status.
chronyc sources -v
: Shows configured and active NTP sources.
-v
: Enables verbose output.
chronyc tracking
: Shows chrony tracking statistics (offset, stratum, reference source).
chronyc makestep
: Steps the clock to correct large drift.
ls -l /etc/chrony.conf
: Confirms the primary chrony configuration file path.
/etc/chrony.conf
: File containing chrony server/pool configuration and policy.