Most servers are probably automatically configured to network time, but if you want to set it up for yourself, or want to change the servers that you are syncing to, here’s the quick article that shows you how to do it.
Since I had to do this earlier today, I decided it would make a lot of sense to write it down for the next time that I need to do it. Yeah, this article is really just for me.
First, you’ll need to install NTP if it isn’t already installed. For Debian or Ubuntu, that would be this command:
sudo apt-get install ntp
For Redhat or CentOS, you’ll need to use these commands to install ntp and enable it:
yum install ntp
systemctl enable ntpd
Then you’ll want to edit the /etc/ntp.conf file, which is quite possibly already filled out for you.
You’ll find a lot of lines in there, but the important ones are the server lines. You can get a list of server addresses at www.pool.ntp.org, find the preferred ones for your area, and then add them to the file. For my purposes, that meant:
Then you’ll need to restart or start the NTPD service:
If you want to update the time right now, you can stop the NTP service and then run the following command, swapping out your preferred server for pool.ntp.org.