Step 2: Specify IP and hostname of the NTP server in the
hosts file
For your NTP server to be resolved by a hostname in your client machine, you
need to configure your /etc/hosts file.
Open the hosts file as sudo in the nano editor by
entering the following
command:
$ sudo nano /etc/hosts
Step 3: Check if the client machine’s time is synchronized
with NTP server
The following ntpdate command will let you manually
check if time is
synchronized between the client and server systems:
$ sudo ntpdate NTP-server-host
The output should ideally show a time offset between the two systems.
Step 4: Disable the systemd timesyncd service on the client
Because we want our client to sync
time with the NTP server, let
us disable the
timesyncd service on the client machine.
Enter the following command to do so:
$ sudo timedatectl set-ntp off
Step 5: Install NTP on your client
Run the following command as sudo in order to install NTP on your client
machine:
$ sudo apt-get install ntp