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
The 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.
If you wish to change the timezone, go to the following path to see available time zones:
ls -la /usr/share/zoneinfo/
As it appears some of the time zones are available in the folder but the others are in the sub-directories. For example, we are going to change the time zone to Los Angeles.
mv /etc/localtime /etc/localtime.back
ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
You have to start the NTP service with the command below:
service ntpd start
To make NTP run at startup:
chkconfig ntpd on
To check if the NTP is working properly:
To confirm if the date has been successfully synchronized and time zone is correct.
We are done! If you have any comment or question please let us know.