ntp

NTP stands for Network Time Protocol. It is a protocol or service used to synchronize the clock of your client computers with the clock of a server. The server’s clock is also synchronized with the Internet.

Update Debian package repository

Open up the terminal with root privileges and run the following command to update the package repository.

apt-get update

Install NTP server on Debian

To install an NTP server, run the following command on the terminal.

apt-get install ntp

Restart the NTP server

Run the following command to restart the NTP server.

systemctl restart ntp

To verify whether the NTP service is actually running, execute the following command.

systemctl status ntp

Installing an NTP client

Let us configure the NTP client to be time synced with the NTP server. For this, you have to install the ntpd daemon on the client machine.

apt-get install ntpdate

Installing an NTP on the client

Open up the terminal with root privileges and run the following command.

apt-get install ntp

Configuring the NTP client

Run the following command to open a configuration file in the nano editor.

nano /etc/ntp.conf

Add the following lines,

server 10.0.0.1 prefer iburst

Restart NTP Service

systemctl restart ntp

To check the status, run the following command on the terminal.

ntpq -p