Last update: March 23, 2023 21:05 UTC (6ad51a76f)
from The Wizard of Oz, L. Frank Baum
You need help from the monkeys.
ntpd [ -46aAbdDgLmnNqx ] [ -c conffile ] [ -f driftfile ] [ -i jaildir ] [ -I InterfaceOrAddress ] [ -k keyfile ] [ -l logfile ] [ -p pidfile ] [ -P priority ] [ -r broadcastdelay ] [ -s statsdir ] [ -t key ] [ -u user[:group] ] [ -U interface_update_interval ] [ -v variable ] [ -V variable ]
The ntpd
program is an operating system daemon that synchronizes the system clock to remote NTP time servers or local reference clocks. It is a complete implementation of NTP version 4 defined by RFC 5905, but also retains compatible with version 3 defined by RFC 1305 and versions 1 and 2, defined by RFC 1059 and RFC 1119, respectively. The program can operate in any of several modes, including client/server, symmetric and broadcast modes, and with both symmetric-key and public key-cryptography
The ntpd
program ordinarily requires a configuration file described on this page. It contains configuration commands described on the pages listed above. However a client can discover remote servers and configure them automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment. Further details are on the Automatic Server Discovery page.
The ntpd
program normally operates continuously while adjusting the system time and frequency, but in some cases this might not be practical. With the -q
option ntpd
operates as in continuous mode, but exits just after setting the clock for the first time. Most applications will probably want to specify the iburst
option with the server
command. With this option a volley of messages is exchanged to groom the data and set the clock in about ten seconds. If nothing is heard after a few minutes, the daemon times out and exits without setting the clock.
-4
-6
-a
enable auth
command and is the default.-A
disable auth
command and almost never a good idea.-b
-c conffile
/etc/ntp.conf
.-d
ntpd
stays attached to the starting terminal which will get all the debugging printout. Also, ^C
will kill it. This option may occur more than once, with each occurrence indicating greater detail of display.-D level
level
corresponding to the number of -d
options..-f driftfile
driftfile driftfile
configuration command.-g
ntpd
exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, ntpd
will exit with a message to the system log. This option can be used with the -q
and -x
options. See the tinker
command for other options.-i jaildir
jaildir
. This option also implies that the server attempts to drop root privileges at startup (otherwise, chroot gives very little additional security), and it is only available if the OS supports to run the server without full root privileges. You may need to also specify a -u
option.-I [address | interface name]
-k keyfile
keys keyfile
command.-l logfile
logfile logfile
command.-m
-L
-M
timeBeginPeriod
. (Windows only)-n
-N
ntpd
at the highest priority.-p pidfile
ntpd
process ID. This is the same operation as the pidfile pidfile
command.-P priority
ntpd
at the specified priority.-q
ntpd
just after the first time the clock is set. This behavior mimics that of the ntpdate
program, which is to be retired. The -g
and -x
options can be used with this option.Note: The kernel time discipline is disabled with this option.
-r broadcastdelay
-s statsdir
statsdir statsdir
command.-t key
trustedkey key
command.-u user[:group]
--enable-clockctl
) and Linux (configure with --enable-linuxcaps
).-U interface update interval
-v variable
-V variable
-x
-g
and -q
options. See the tinker
command for other options.Note: The kernel time discipline is disabled with this option.
--pccfreq frequency
--pccfreq
can be used on systems which do not use the PCC to implement QueryPerformanceCounter and have a fixed PCC frequency. The frequency specified must be accurate within 0.5 percent. --usepcc
is equivalent on many systems and should be tried first, as it does not require determining the frequency of the processor cycle counter. For x86-compatible processors, the PCC is also referred to as RDTSC
, which is the assembly-language instruction to retrieve the current value. (Windows only)--usepcc
Ordinarily, ntpd
reads the ntp.conf
configuration file at startup in order to determine the synchronization sources and operating modes. It is also possible to specify a working, although limited, configuration entirely on the command line, obviating the need for a configuration file. This may be particularly useful when the local host is to be configured as a broadcast client, with servers determined by listening to broadcasts at run time.
Usually, the configuration file is installed as/etc/ntp.conf
, but could be installed elsewhere (see the -c conffile
command line option). The file format is similar to other Unix configuration files - comments begin with a #
character and extend to the end of the line; blank lines are ignored.
Configuration commands consist of an initial command keyword followed by a list of option keywords separated by whitespace. Commands may not be continued over multiple lines. Options may be host names, host addresses written in numeric, dotted-quad form, integers, floating point numbers (when specifying times in seconds) and text strings. Optional arguments are delimited by [ ]
in the options pages, while alternatives are separated by |
. The notation [ … ]
means an optional, indefinite repetition of the last item before the [ … ]
.
File | Default | Option | Option |
---|---|---|---|
configuration file | /etc/ntp.conf |
-c |
conffile |
frequency file | none | -f |
driftfile |
leapseconds file | none | leapfile |
|
process ID file | none | -p |
pidfile |
log file | system log | -l |
logfile |
include file | none | none | includefile |
statistics path | /var/NTP |
-s |
statsdir |
keys path | /usr/local/etc |
none | keysdir |