In this tutorial, I will show you how to configure the client-side, but the server-side configurations are not entirely different. NTP (Network Time Protocol) is a protocol for synchronizing the clock/time on a server with a central time server.
Install and configure NTP Daemon
In RHEL 8, the NTP protocol is implemented only by the chronyd daemon, provided by the chrony package.
# dnf install chrony
Enable Chrony and start.
# systemctl enable chronyd
# systemctl start chronyd
Open Chrony configuration file.
# nano /etc/chrony.conf
Change to your own NTP server or others in your timezone.
The full list of official NTP Public Pool Time Servers
Verify status.
# chronyc sources
Install NTPStat, it’s possible to display time synchronization status.
# dnf -y install ntpstat
# ntpstat
synchronised to NTP server (2a04:92c7:e:bd2::e6b9) at stratum 3
time correct to within 13 ms
polling server every 64 s
Configure time zone
To make sure that the appropriate time zone is configured on the server please execute the command below.
# timedatectl
Local time: Thu 2020-03-26 13:32:07 CET
Universal time: Thu 2020-03-26 12:32:07 UTC
RTC time: Thu 2020-03-26 12:32:07
Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Get the list of all the available time zones.
# timedatectl list-timezones
Set your time zone.
# timedatectl set-timezone Europe/London
# date
Thu Mar 26 12:59:44 GMT 2020