In this tutorial we will learn to syncronize linux server time with NTP (Network Time Protocol) server.
NTP or Network Time Protocol, is an Internet protocol used to synchronise clocks of computers, linux server for instance.
Following steps shows how to sync time using the terminal. Before we start login to the server via terminal and follow the steps given below.
Use the ntpstat command to view the status of the NTP service on the instance. If you get an error message prompting that NTP is not installed then you have to install it on the server.
# sudo ntpstat
-bash: ntpstat: command not found
Use the following command to install NTP on server.
# sudo yum install ntp
After the installation is complete we need to start NTP by using the following command.
# sudo systemctl start ntpd
To enable NTP to start at boot use the following command.
# sudo systemctl enable ntpd
To stop NTP use the following command.
# sudo systemctl stop ntpd
To restart NTP use the following command.
# sudo systemctl restart ntpd
For this use the following command.
# sudo ntpdate -q 0.rhel.pool.ntp.org
And restart NTP
And the server time will be synced.
Have fun learning :-)
Copyright © 2014 - 2021 DYclassroom. All rights reserved.