Time – NTP – Linux

Reading Time: < 1 minute

Last Update: 10/13/2024

In this segment we are going to talk about a number of NTP tools. We will review Microsoft’s NTP; Linux NTP and discuss hardware solutions. Integrating time/NTP into your organization is important in event analysis. Also applications and services can become cranky if servers have drifted too far apart. For example if you have multiple Exchange servers deployed in the same environment and they drift too far apart they might not talk to each other the way you would expect.

For UBUNTU

apt install systemd-timesyncd

For SUSE … you probably didn’t escape the system installing chronyd

If you are experiencing problems you might consider running:

systemctl stop chronyd.service
systemctl restart chronyd.service


Then you can use chronyc tracking to display time info.

Set to true

timedatectl set-ntp true

Show the time

sudo hwclock --show

Display timedatectl (Good for Ubuntu and SUSE)

timedatectl

Some examples:


timedatectl list-timezones

timedatectl set-timezone America/New_York
timedatectl set-timezone EST

timedatectl set-timezone America/Chicago

timedatectl set-timezone EST5EDT

more /etc/timezone

ntpq -p

date --set "23 Sep 2018 11:04:00"


Stratum: Aside: A “stratum” is hierarchy used to “rank” and delineate the quality of the time keeping.

A Stratum 0: device is a high-precision time keeping device. Typically something that is deriving it’s time either through an Atomic Clock; GPS; or a Radio Clock. Typically a Stratum 0 device would not advertise it’s service.

A Stratum 1 device – typically get’s it’s time from a Stratum 1 device. A Stratum 1 device may “peer” with with other Stratum 1 devices as a check.

References:
https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-16-04
https://en.wikipedia.org/wiki/Network_Time_Protocol

This entry was posted in Linux, Networking, ntp. Bookmark the permalink.