Setup Debian NTP Server

From banana_wiki
Jump to: navigation, search

This tutorial will show you how to setup a synchronized time server so that hosts on your LAN can all be synchronized to the correct time. What is NTP? The Network Time Protocol (NTP) is a protocol designed for accurately synchronizing local time clocks with networked time servers. The NTP network of time servers is set up as a hierarchical manner, such that any user can enter the system as a server at some level (see the Wikipedia page for more details). The NTP hierarchy is separated into different levels, called clock strata. The most accurate level, Stratum 0, is reserved for atomic clocks, etc. The next level, Stratum 1, is generally used by networked machines locally connected to the Straum 0 clocks. Stratum 2…15 are NTP machines that are connected, in turn, to lower level clocks and each other. This guide describes how to synchronize accurately with Stratum 1 and 2 machines, and maintain as accurate of system clock as possible thorughout the day. Sections are also included on how to allow your machine to operate as a Stratum 2/3 server for other machines on your local network.

First you are going to have to get access to the server, so either SSH into it or sit down at it. Next we need to install the NTP service.

apt-get install ntp

Next you can configure the NTP service to meet your needs.

nano /etc/ntp.conf

At line 19 you can change the NTP servers, that your server looks to or you can leave them as the ubuntu/debian defaults. At line 48 you will need to add this line so that your new NTP server respond to requestes on your network.

restrict mask nomodify notrap

Then go ahead and save the configuration. Before NTP will work we need to restart the service

/etc/init.d/ntp restart

Now you have an NTP server! To check on the daemon :

ntpq -p