Instructions For Using The NIST Authenticated NTP Server
Instructions For Using The NIST Authenticated NTP Server
(NTP) server
These instructions explain how to add symmetric-key authentication to the most common version of
the NTP software. Users with special requirements or who are using a non-standard version of NTP
should contact NIST for assistance. We will try to provide as much assistance as possible. Users who
wish to add authentication to the NTP process of a network appliance (such as a gateway, firewall or
router) should contact the supplier to verify that the embedded NTP algorithm supports the symmetric key
encryption algorithm.
The authenticated version of NTP will be supported by the NIST time servers listed as authenticated NTP
servers here: http://tf.nist.gov/tf-cgi/servers.cgi
The same key can be used in a request to any NIST authenticated server.
Requesting a key
To request a key, the user should send a letter to NIST using the US mail or a FAX machine (e-mail is
not acceptable). The request should contain the following information:
The letter M specifies that the key is in MD5 format. For example:
12345 M BlahBlahBlah
If the user requests a key in SHA-1 format, the "M" should be replaced by "SHA1".
[Note that this identifier may be different on some systems.]
The key value must be entered in upper and lower case exactly as received from NIST. The key file should be
owned by root and should not be readable by normal users. (See exception below) Each user can request a key
in MD5 format or SHA-1 format, but not both.
After the key has been entered into the key file, it can be tested using the utility program ntpdate.
For example, suppose that the key received from NIST was number 12345 and that the key number
and the corresponding value have been added to the key file as described above. The following
command will use this key to contact the NIST server and report the results of the conversation. The
switches have the following meanings:
-d Run in debug mode: print intermediate results and do not adjust the clock -a The following integer
specifies the key number -k The following string specifies the name of the key file
The IP address specifies the address of the server to be queried. The example uses 1.2.3.4 for the IP
address of the NIST time server. This should be replaced with the IP address of one of the NIST
servers that supports authentication, as listed here: http://tf.nist.gov/tf-cgi/servers.cgi
The command:
The reply:
Note: When ntpdate is run in debug mode (as in the example above), it is normally not a privileged
program and can be run by any user. The user must have read access to the key file in this case.
In order to use authentication, the following commands must be added to the ntp configuration
file (usually named ntp.conf). These changes should be made after the key has been added to the key
file as described above. The symbol “#” introduces a comment, which continues for the remainder of
the line. The NTP daemon process must be restarted after the file has been edited.
#
# authentication is normally enabled by default
#
enable auth
#
# define the name of the key file
#
keys /local/bin/ntp.keys
#
# specify the key(s) that can be trusted
# replace <key number> with the key number
# received from NIST
#
# For example: trustedkey 12345
#
trustedkey <key number>
#
# specify the address of the server and the
# key number to be used when processing a query
# the server can be specified using its name or
# its IP address.
# the value 12345 should be replaced with the
# actual key number received from NIST
# and the address 1.2.3.4 should be replaced
# with the address of a NIST authenticated time
# server.
It is helpful to monitor the performance of the NTP daemon to confirm that the authentication
algorithm is working as expected. The NTP daemon provides a number of monitoring tools that can
be used for this purpose. For example, the peerstats command will provide information on the status
of the connections to the servers that are being used to synchronize the system time. To enable this
report, the following commands would be added to the NTP configuration file:
#
# enable monitoring and reporting of statistics
#
enable monitor
enable stats
#
# turn on reporting of the peer statistics
#
statistics peerstats
#
# the file for the report will be named peerstats with
# the date appended. The full name of the file
# will be peerstats.yyyymmdd.
# a new file will be created every day at 0 hours UTC.
#
filegen peerstats file peerstats type day
#
# the following command specifies the full name of
# the directory where the files will be located
#
statsdir /local/bin/
The daemon process will add an entry into the peerstats file each time the client queries a server. The
entry will be in the following form:
The first two parameters give the time of the query as the MJD (Modified Julian Day number) and the
UTC second of the day. The third parameter gives the IP address of the remote system. The fourth
parameter describes the state of the query using the hexadecimal representation of a series of bits. The
significance of each bit is described in Appendix B of RFC1305. Using the convention that the most
significant bit of the state is bit 0, the first hexadecimal digit of the state should be “f” to indicate that:
If authentication is not used, then bits 1 and 2 will be 0, and the first digit will be 9 instead of f. The
“6” in the second digit signals that this server is being used to synchronize the local clock. If the client
is querying more than one server, then the one that is selected to synchronize the clock will have a 6
as the second digit and the other status words will normally have a 4 in that position.
The remaining parameters describe the offset, delay, dispersion, and jitter of the query.
These parameters are in units of seconds and are described in RFC1305.
The NTP documentation describes other reports that can be generated by the daemon process. We
recommend that some monitoring and reporting process be used to verify the proper operation of the
daemon.