Consistent system time keeps log entries aligned, TLS certificates valid, cron jobs predictable, and clustered services in agreement; even a few minutes of drift can make debugging or authentication feel like chasing a ghost.
On modern Linux systems built around systemd, the kernel maintains the system clock while systemd-timesyncd queries remote NTP servers and adjusts time gradually, with timedatectl providing a front end for inspecting and controlling synchronization. The hardware real-time clock (RTC) is updated periodically so reboots still start from a sane baseline.
Configuration in this workflow assumes a systemd-based distribution where systemd-timesyncd is present, uses root privileges via sudo, and expects that no alternative NTP daemon like chronyd or ntpd is running at the same time to avoid competing adjustments and sudden clock jumps that can confuse databases or distributed systems.
Steps to synchronize time with NTP in Linux:
- Open a terminal with access to sudo privileges.
$ whoami user
- Display current time configuration and NTP status using timedatectl.
$ timedatectl status Local time: Mon 2025-06-23 14:03:18 UTC Universal time: Mon 2025-06-23 14:03:18 UTC RTC time: Mon 2025-06-23 14:03:17 Time zone: Etc/UTC (UTC, +0000) System clock synchronized: no NTP service: inactive RTC in local TZ: no ##### snipped #####The fields System clock synchronized and NTP service indicate whether time is already being tracked by an NTP client.
- Enable NTP-based synchronization through systemd-timesyncd.
$ sudo timedatectl set-ntp true
This command instructs systemd to manage time using its built-in NTP client rather than leaving the clock unmanaged.
- Confirm that NTP synchronization is now active.
$ timedatectl status Local time: Mon 2025-06-23 14:05:42 UTC Universal time: Mon 2025-06-23 14:05:42 UTC RTC time: Mon 2025-06-23 14:05:41 Time zone: Etc/UTC (UTC, +0000) System clock synchronized: yes NTP service: active RTC in local TZ: no ##### snipped ##### - Check for any other NTP daemons such as chronyd or ntpd that might still be enabled.
$ systemctl status chronyd ntp Unit chronyd.service could not be found. ○ ntp.service - Network Time Service Loaded: loaded (/lib/systemd/system/ntp.service; disabled; vendor preset: enabled) Active: inactive (dead) ##### snipped #####Only one NTP client should manage the clock; running systemd-timesyncd alongside chronyd or ntpd can cause oscillating or unstable system time.
- Disable and stop any legacy NTP services that should no longer control time.
$ sudo systemctl disable --now ntp Removed /etc/systemd/system/multi-user.target.wants/ntp.service.
- Edit the /etc/systemd/timesyncd.conf file to define explicit NTP servers when custom sources are required.
$ sudo nano /etc/systemd/timesyncd.conf
[Time] NTP=0.pool.ntp.org 1.pool.ntp.org FallbackNTP=2.pool.ntp.org 3.pool.ntp.org
NTP entries specify preferred servers, while FallbackNTP provides alternatives if the primary pool is unreachable.
- Restart the systemd-timesyncd service so configuration changes take effect.
$ sudo systemctl restart systemd-timesyncd
Incorrect server names or blocked outbound UDP port 123 can prevent synchronization; always verify connectivity to the chosen NTP endpoints after modifying /etc/systemd/timesyncd.conf.
- Inspect detailed synchronization status using the timesync view from timedatectl.
$ timedatectl timesync-status Server: 0.pool.ntp.org (162.159.200.123) Poll interval: 32min Leap: normal Version: 4 Stratum: 2 Precision: 1us (-20) Root distance: 1.234s (max: 5s) Offset: -2.3ms Jitter: 0.4ms ##### snipped #####Small Offset and reasonable Root distance indicate healthy synchronization to a nearby, reliable NTP source.
- Verify that the reported local time matches an external reference such as a trusted NTP site or another already-correct system.
$ date Mon Jun 23 14:06:10 UTC 2025
- Review recent logs for systemd-timesyncd if synchronization still appears inactive or offset values remain large.
$ journalctl --unit=systemd-timesyncd --since "15 minutes ago" Jun 23 14:03:20 host systemd-timesyncd[531]: Network configuration changed, trying to establish connection. Jun 23 14:03:45 host systemd-timesyncd[531]: Synchronized to time server 0.pool.ntp.org (162.159.200.123). ##### snipped #####
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.
