Configure NTP client

To configure your Linux system as an NTP client, you will need to install the ntp daemon (ntpd). You can do this with the sudo apt-get install ntp command:

install ntp

The ntpd configuration file is located at /etc/ntp.conf. Open this file in a text editor:

etc ntp.conf

This file contains the list of NTP servers that will be used for time synchronization. By default, Ubuntu servers will be used (e.g. 0.ubuntu.pool.ntp.org). You can add your preferred servers or leave the defaults.

Next, restart the NTP deamon with the sudo service ntp reload command:

service ntp reload

And that’s it! You system should synchronize time with NTP servers listed in the ntp.conf file. You can use the ntpq -p command to show a list of all the NTP servers and when they where last checked:

ntpq p command example

Subscribe to our Newsletter

Like us on Facebook

top
Geek University 2019