NTP (Network Time Protocol) is a protocol which runs over port 123 UDP. NTP synchronize clients time and date with a master server.
This tutorial is about the client side configuration, but the server side configurations are not entirely different.
We are assuming that you have root permission, otherwise, you may start commands with “sudo”.
Install and configure NTP Daemon
NTP package is provided by default from RHEL repositories, and can be installed by the following command:
yum install ntp
To make sure that the appropriate time zone is configured on the server please execute below command.
timedatectl
If you wish to change the timezone please follow following steps.
to get the list of all the available time zones:
timedatectl list-timezones
To set your time zone you can use command below: (e.g. Los Angeles)
timedatectl set-timezone America/Los_Angeles
Now you need to active the NTPD service at boot:
systemctl enable ntpd
systemctl start ntpd
To get a basic report you can use
ntpstat
Or
date
And to get some information about the time synchronization process
ntpq -p
All of your NTP configurations are here:
/etc/ntp.conf