Repository

Looks good to me!

User Tools

Site Tools


kb:internet:connectivity:ntp:start

NTP

Changelog

  • 2024-07-30: Init

The typical NTP service is timesyncd (typically run as system-timesyncd under systemd). This does not actually run a full NTP daemon, but an SNTP (simple NTP). From the systemd mailing list:

...focusing only on querying time from one remote server and synchronizing the local clock to it... The daemon saves the current clock to disk every time a new NTP sync has been acquired (and every 60 seconds), and uses this to possibly correct the system clock early at bootup (e.g. when no RTC clock is available)...

For more accurate timekeeping as well as serving NTP, a recommended solution is to use chrony, which comes as a "chronyd" daemon and "chronyc" CLI. Configuration is under /etc/chrony/chrony.conf, with pool and server settings. Restart the chrony service to load configuration.

server 0.sg.pool.ntp.org
server 1.sg.pool.ntp.org
server 2.sg.pool.ntp.org
server 3.sg.pool.ntp.org

Note this is critical if one wants to use TOTP for 2FA.

# timedatectl
      Local time: Wed 2023-09-20 18:05:04 +08
  Universal time: Wed 2023-09-20 10:05:04 UTC
        RTC time: Wed 2023-09-20 10:05:03
       Time zone: Asia/Singapore (+08, +0800)
 Network time on: yes  <-- system clock is being controlled by NTP service
NTP synchronized: yes  <-- NTP service is available and in sync
 RTC in local TZ: no
kb/internet/connectivity/ntp/start.txt · Last modified: 4 weeks ago (23 October 2024) by justin