How To Set Up Time Synchronization With NTP On Ubuntu 18.04
How To Set Up Time Synchronization With NTP On Ubuntu 18.04
Ubuntu 18.04
February 20, 2020 by Hitesh Jethva(253 posts) under VPS Hosting
0 Comments
Accurate time synchronization over the Internet is a crucial point for any system administrator. If your server
time is not synchronized with the correct time zone, you can face data corruption or other issues. NTP, which
stands for Network Time Protocol, is a TCP/IP protocol used for synchronizing time over a network. By
default, Ubuntu 18.04 uses systemd’s timesyncd service for time synchronization.
In this tutorial, we will show you how you can check whether time synchronization is working on your
Ubuntu 18.04 server.
Prerequisites
A fresh Ubuntu 18.04 VPS on the Atlantic.Net Cloud Platform.
A root password configured on your server.
apt-get update -y
date
Next, you can check whether the time on your servers is activated and whether your server is synchronized
with correct time zone using the timedatectl command:
timedatectl
In the above output, you should see that the time synchronization is activated and your configured time zone
is Etc/UTC.
You can also check the status of the time synchronization service with the following command:
CGroup: /system.slice/systemd-timesyncd.service
timedatectl list-timezones
You should see the long list of available time zones in the following screen:
Next, you can set the time zone using the timedatectl set-timezone command.
For example, set your server’s time zone to America/Antigua as shown below:
timedatectl
timedatectl
systemd-timesyncd.service active: no
You can enable time synchronization at any time with the following command:
timedatectl set-ntp on
You can run the timedatectl command again to confirm the network time status.
Conclusion
In this guide, we reviewed how to see the system time amd date, change the time zone, and enable/disable
time synchronization on Ubuntu 18.04. For more information, you can visit the official documentation
at NTP Doc.