Remember Me
forgot your password?

How to Configure a Linux Ntp Server

Network Time Protocol (NTP) provides algorithms and defines messages for the synchronisation of time clients to an accurate time reference. This article discusses how to configure a Linux NTP Time Server to synchronise time with an Internet based public NTP Server.

NTP server systems fall into two categories: primary reference servers and secondary reference servers. Primary reference servers use an external timing reference to provide time, such as GPS or radio clocks. Secondary reference servers synchronise with primary reference NTP servers and offer slightly reduced accuracy. Primary reference servers are designated stratum 1 servers, while secondary servers have a stratum greater than 1.

The NTP Distribution

The NTP source code is freely available from the Network Time Protocol web site. The current version available for download is 4.2.4. NTP is available for the Linux operating systems with ports available for Windows NT. Once the source code is downloaded, it should be configured, compiled and installed on the host machine. Many Linux operating systems, such as RedHat, offer NTP RPM packages.

Configuring NTP

The ‘ntp.conf’ file is main source of configuration information for a NTP server installation. Amongst other things, it contains a list of reference clocks that the installation is to synchronise. A list of NTP server references is specified with the ‘server’ configuration command thus:

server time-a.nist.gov # NIST, Gaithersburg, Maryland NTP server

server time-c.timefreq.bldrdoc.gov # NIST, Boulder, Colorado NTP server

Controlling the NTP Server Daemon

Once configured, the NTP daemon can be started, stopped and restarted using the commands: ‘ntpd start’; ‘ntpd stop’ and ‘ntpd restart’. The NTP server daemon can be queried using the ‘ntpq –p’ command. The ntpq command queries the NTP server for synchronisation status and provides a list of servers with synchronisation information for each server.

NTP Access Control

Access to the NTP server can be restricted using the ‘restrict’ directive in the ntp.conf file. You can restrict all access to the NTP server with:

restrict default ignore

To only allow machines on your own network to synchronize with the server use:

restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

Multiple restrict directives can be specified in the ntp.conf file to restrict access to a specified range of computers.

Authentication Options

Authentication allows a matching passwords to be specified by the NTP server and associated clients. NTP keys are stored in the ntp.keys file in the following format: Key-number M Key (The M stands for MD5 encryption), e.g.:

1 M secret

5 M RaBBit

7 M TiMeLy

10 M MYKEY



In the NTP configuration file ntp.conf, specify which of the keys specified above are trusted, i.e. are secure and you want to use. Any keys specified in the keys file but not trusted will not be used for authentication, e.g.:

trustedkey 1 7 10

The NTP server is now configured for authentication.

Client Configuration for Authentication

The client needs to be configured with similar information as the server, however, you may use a subset of the keys specified on the server. A different subset of keys can be used on different clients, e.g.:

Client A)

1 M secret

7 M TiMeLy

trustedkey 1 7

Client B)

1 M secret

5 M RaBBit

7 M TiMeLy

10 M MYKEY

trustedkey 7 10

Essentially authentication is used by the client to authenticate that the time server is who he says he is, and that no rogue server intervenes. The key is encrypted and sent to the client by the server where it is unencrypted and checked against the client keys to ensure a match.

David Evans

Dave Evans develops Linux NTP Server synchronisation systems to ensure accurate time on PC’s and computer networks. Click here to find out more about Linux NTP Time Server systems.

Rate this Article: 0 / 5 stars - 0 vote(s)
Print Email Re-Publish

Add new Comment



Captcha

  • Latest Operating Systems Articles
  • More from David Evans

Platform Requirements for Windows Mobile Development

By: Inessa Bokhan | 28/12/2009
As companies embark on mobile application development in order to satisfy business needs (whether it be Android, iPhone, Blackberry, Windows Mobile development, or whatever), a number of requirements to a mobile platform emerge. Most critical of them are as follows

Fix Windows Update Problem-Windows Update Problem

By: Franck Lin | 28/12/2009
Are you affected by the Windows Update Problem? If you receive windows update error message while checking for updates, the cause might be a high number of update requests on the windows update servers.Close Windows Update and wait 5 to 10 minutes, and then run Windows Update again.If you continue to receive windows update error message,It is most probable that the problem lies in the Windows registry.

Fix Winlogon.exe Application Error With Registry Cleaner

By: Franck Lin | 28/12/2009
Are you getting the dreaded winlogon exe application error? Winlogon.exe is a very critical problem caused by errors in your computer's registry.It is an essential and required component for Windows 2003, XP and Vista.When you start your system, the Winlogon application performs like a host in that it checks the registry and creates a list of services that are to be loaded.

Fix Cannot Open Exe Files Error With Registry Cleaner

By: Franck Lin | 28/12/2009
There are some cases when Windows system tries to find some file (basically at bootup) that does not exist. Among various sorts of computer-related problems Windows cannot open exe files is evidently the one of the most bothering ones.

Do You Know the Difference Between Your Hardware and Software on Your Computer?

By: Colon Bolden | 27/12/2009
You better believe understanding the difference and how your hardware and software operates is the key to success because they work together to allow you to perform the wide variety of functions possible on your personal computer.

Stop C0000221 Unknown Hard Error Fix

By: Franck Lin | 27/12/2009
A registry cleaner software might be a good solution for you to solve the stop c0000221 unknown hard error, since this type of software will check all the registry entries from your system, will remove the unnecessary or damaged entries and you will have good chances to get rid of the annoying stop c0000221 unknown hard error.This type of software is also able to detect all the embedded keys generated by the numerous malware programs.

Fix Msvcrt.dll Not Found Error With Registry Cleaner

By: Franck Lin | 27/12/2009
If your personal computer is encountering a msvcrt.dll not found error,you do not need to worry too much because it is just a simple and effortless problem in your computer.You may receive a msvcrt.dll not found error message with the following format:

Fix Tcpip.Sys Blue Screen-Tcpip.Sys Blue Screen

By: Franck Lin | 27/12/2009
Fixing tcpip.sys blue screen error is easy to do with registry cleaner. If you scan your computer it will detect the errors in your registry and safely remove them.

How To Sync A Network Using NTP

By: David Evans | 29/09/2009 | Computers
This article describes how easy it is to synchronise servers, workstations and network infrastructure to a precise time reference.

Using GPS For NTP Server Time Synchronisation

By: David Evans | 16/04/2009 | Computers
This article attempts to describe simply, how network time servers can obtain accurate timing information to provide a precise reference for computer time synchronisation. It also discusses how NTP servers can utilise the atomic time generated by GPS to provide a timing reference for computer networks

How To Synchronise a Network

By: David Evans | 03/04/2009 | Computers
Computers are notorious for providing inaccurate time and can drift by several minutes each day. This has serious consequences for networked computer systems and applications. Each computer can have wildly differing system times, which can be totally unacceptable for transaction processing applications.

Configuring a Simple Ntp Time Server

By: David Evans | 03/01/2009 | Computers
This article attempts to simplify the installation and configuration of the Linux NTP server application. It describes a simple NTP installation and goes through step-by-step the configuration procedure required to provide a NTP server on a Linux machine.

Lf Radio Ntp Servers: How to Decode the Dcf-77 Time Broadcast

By: David Evans | 23/11/2008 | Computers
This article describes how the DCF-77 signal can be decoded to provide an accurate time reference for NTP servers and other computer timing applications.

Ntp Server Reference Clocks: What's Best Radio or GPS ?

By: David Evans | 24/09/2008 | Computers
This article describes the external time references that are available to synchronise NTP servers and discusses the merits of each.

Use a Ntp Server to Keep Precise Network Time

By: David Evans | 18/07/2008 | Computers
It is quite simple to synchronise every device on your network to an accurate time reference - a NTP time server.

Keeping Accurate Time on Your Computer Using Ntp Servers

By: David Evans | 21/05/2008 | Computers
This article discusses ways in which you can maintain continuously accurate system time on your computer system. It looks at how Internet time references and NTP servers can be utilised for computer time synchronisation.

Submit Your Articles Free: Signup
Article Categories




Use of this web site constitutes acceptance of the Terms Of Use and Privacy Policy | User published content is licensed under a Creative Commons License.
Copyright © 2005-2008 Free Articles by ArticlesBase.com, All rights reserved. (0.10, 6, w3)