How to Setup Network Time Protocol (NTP) on a GNU/Linux Client


Overview: Network Time Protocol (NTP) is used for clock synchronization across multiple devices on a network. If done correctly, all devices tied to an NTP server will be synchronized within one (1) millisecond, which is useful if precision is needed for system operations. 


One can provision a server or a client, though in the case of the former, numerous NTP servers already exist. New York University (NYU), for example maintains: 


DNS Name

IP Address

tick.nyu.edu

128.122.253.8

tock.nyu.edu

128.122.253.90


This document covers configuring an NTP client. You can use either or both of the NTP servers.


Package installation: Depending on the OS, install: 


Apt 

DNF

ntpdate

chrony

ntp

ntpstat


Configuration (Debian based OSs):


  1. Sync system time with NTP server: sudo ntpdate tick.nyu.edu

  2. Disable Ubuntu’s default timesyncd service: sudo timedatectl set-ntp off

  3. Add line to /etc/ntp.conf file: 

sudo bash -c "echo server tick.nyu.edu prefer iburst >> /etc/ntp.conf"

  1. Restart NTP daemon: sudo systemctl restart ntp

  2. List the NTP time synchronization queue (for confirmation): ntpq -p


Configuration (Red Hat-based OSs): 


  1. Edit line 3 of chrony.conf: pool tock.nyu.edu iburst

  2. Enable chrony daemon: systemctl enable --now chronyd

  3. Verify status: chronyc sources

  4. Display time synchronization status: ntpstat