NTP

- This document covers the compilation, installation and basic configuration of an NTP client and server for Linux. More advanced configuration is in online documents. A good place to start is the NTP website.
- If you install this software it is highly recommended that you keep up-to-date with any security advisories published in regard to this software.
- If you spot any major errors on this page, please e-mail me using the link above.
- It is assumed that this installation takes place on a computer on which Core Linux has been successfully installed.
- No software other than the packages bundled with Core Linux have been installed.
- As described in the installation guide, it is assumed that any downloaded application source code is stored in a directory called
/appson the CD-R. - It is assumed that the Core Linux computer is attached to a network on which there is at least form of internet access.
Preparation
- Download the NTP source code from www.ntp.org.
- Burn the file
ntp-4.1.1.tar.gzto a CD. This page assumes that the subdirectory/appsis used for the.tar.gzfile. The CD-ROM can be a multi-session disk.
Booting
- Boot your Core Linux PC.
- Login as
root. You will need to enter the password at the prompt.
Extract the source
- Place the CD-R in the CD-ROM drive. Mount the CD-ROM drive under
/mnt/cdrom. - Change to the
/appsdirectory on the CD-R. - Copy the
ntp-4.1.1.tar.gzfile to the directory/usr/src. - Change to the
/usr/srcdirectory and extract the source from the.tar.gzfile.
Configure and compile
- Change to the
/usr/src/ntp-4.1.1directory. - Run the
./configurescript. - Run the
makeprogram. - Run the
makeprogram with the argumentcheck. - Run the
makeprogram with the argumentinstall.
NTPdate Initial Testing
- Edit the file
/etc/servicesand add the linentp 123/udp. You should keep your services file in numerical order as "good housekeeping". - Set the system time using the
ntpdateprogram.
Automating NTPdate
- Append the following line to the
/etc/rc.d/rc.muscript:You can also add comments and echoes for your own information./usr/local/bin/ntpdate -su time.foobar.com - Adjust the
/etc/localtimelink to point to the correct timezone in/usr/share/zoneinfo. - Reboot the system and check that the system time is updated.
NTP Server Setup
- Edit the file
/etc/ntp.confand add the following lines:server time1.foobar.com prefer
server time2.foobar.com
driftfile /etc/ntp.drift
authenticate no - Start the NTP daemon with the command
/usr/local/bin/ntpd. - The daemon will take up to an hour to calculate the "drift" between your system clock and the remote NTP server.
Automating NTP Server
- Append the following line to the
/etc/rc.d/rc.muscript:You can also add comments and echoes for your own information./usr/local/bin/ntpd - Reboot the system and check that the system time is updated.

The text of this page is licensed under a Creative Commons License.
