]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/sntp/sntp.1sntpman
Fix ntp multiple vulnerabilities.
[FreeBSD/releng/10.2.git] / contrib / ntp / sntp / sntp.1sntpman
1 .de1 NOP
2 .  it 1 an-trap
3 .  if \\n[.$] \,\\$*\/
4 ..
5 .ie t \
6 .ds B-Font [CB]
7 .ds I-Font [CI]
8 .ds R-Font [CR]
9 .el \
10 .ds B-Font B
11 .ds I-Font I
12 .ds R-Font R
13 .TH sntp 1sntpman "26 Apr 2016" "4.2.8p7" "User Commands"
14 .\"
15 .\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-EjaOrb/ag-RjaGqb)
16 .\"
17 .\" It has been AutoGen-ed April 26, 2016 at 08:21:08 PM by AutoGen 5.18.5
18 .\" From the definitions sntp-opts.def
19 .\" and the template file agman-cmd.tpl
20 .SH NAME
21 \f\*[B-Font]sntp\fP
22 \- standard Simple Network Time Protocol client program
23 .SH SYNOPSIS
24 \f\*[B-Font]sntp\fP
25 .\" Mixture of short (flag) options and long options
26 [\f\*[B-Font]\-flags\f[]]
27 [\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
28 [\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
29 [ hostname-or-IP ...]
30 .sp \n(Ppu
31 .ne 2
32
33 .SH DESCRIPTION
34 \f\*[B-Font]sntp\fP
35 can be used as an SNTP client to query a NTP or SNTP server and either display
36 the time or set the local system's time (given suitable privilege).  It can be
37 run as an interactive command or from a
38 \f\*[B-Font]cron\f[]
39 job.
40 NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
41 are defined and described by RFC 5905.
42 .sp \n(Ppu
43 .ne 2
44
45 The default is to write the estimated correct local date and time (i.e. not
46 UTC) to the standard output in a format like:
47 \f\*[B-Font]'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'\f[]
48 where the
49 \f\*[B-Font]'(+0800)'\f[]
50 means that to get to UTC from the reported local time one must
51 add 8 hours and 0 minutes,
52 the
53 \f\*[B-Font]'+4.567'\f[]
54 indicates the local clock is 4.567 seconds behind the correct time
55 (so 4.567 seconds must be added to the local clock to get it to be correct).
56 Note that the number of decimals printed for this value will change
57 based on the reported precision of the server.
58 \f\*[B-Font]'+/- 0.089'\f[]
59 is the reported
60 \fIsynchronization\f[] \fIdistance\f[]
61 (in seconds), which represents the maximum error due to all causes.
62 If the server does not report valid data needed to calculate the
63 synchronization distance, this will be reported as
64 \f\*[B-Font]'+/- ?'\f[].
65 If the
66 \fIhost\f[]
67 is different from the
68 \fIIP\f[],
69 both will be displayed.
70 Otherwise, only the 
71 \fIIP\f[]
72 is displayed.
73 Finally, the
74 \fIstratum\f[]
75 of the host is reported
76 and the leap indicator is decoded and displayed.
77 .SH "OPTIONS"
78 .TP
79 .NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
80 Force IPv4 DNS name resolution.
81 This option must not appear in combination with any of the following options:
82 ipv6.
83 .sp
84 Force DNS resolution of the following host names on the command line
85 to the IPv4 namespace.
86 .TP
87 .NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
88 Force IPv6 DNS name resolution.
89 This option must not appear in combination with any of the following options:
90 ipv4.
91 .sp
92 Force DNS resolution of the following host names on the command line
93 to the IPv6 namespace.
94 .TP
95 .NOP \f\*[B-Font]\-a\f[] \f\*[I-Font]auth\-keynumber\f[], \f\*[B-Font]\-\-authentication\f[]=\f\*[I-Font]auth\-keynumber\f[]
96 Enable authentication with the key \fBauth-keynumber\fP.
97 This option takes an integer number as its argument.
98 .sp
99 Enable authentication using the key specified in this option's
100 argument.  The argument of this option is the \fBkeyid\fP, a
101 number specified in the \fBkeyfile\fP as this key's identifier.
102 See the \fBkeyfile\fP option (\fB-k\fP) for more details.
103 .TP
104 .NOP \f\*[B-Font]\-b\f[] \f\*[I-Font]broadcast\-address\f[], \f\*[B-Font]\-\-broadcast\f[]=\f\*[I-Font]broadcast\-address\f[]
105 Listen to the address specified for broadcast time sync.
106 This option may appear an unlimited number of times.
107 .sp
108 If specified \fBsntp\fP will listen to the specified address
109 for NTP broadcasts.  The default maximum wait time
110 can (and probably should) be modified with \fB-t\fP.
111 .TP
112 .NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]host\-name\f[], \f\*[B-Font]\-\-concurrent\f[]=\f\*[I-Font]host\-name\f[]
113 Concurrently query all IPs returned for host-name.
114 This option may appear an unlimited number of times.
115 .sp
116 Requests from an NTP "client" to a "server" should never be sent
117 more rapidly than one every 2 seconds.  By default, any IPs returned
118 as part of a DNS lookup are assumed to be for a single instance of
119 \fBntpd\fP, and therefore \fBsntp\fP will send queries to these IPs
120 one after another, with a 2-second gap in between each query.
121 .sp
122 The \fB-c\fP or \fB--concurrent\fP flag says that any IPs
123 returned for the DNS lookup of the supplied host-name are on
124 different machines, so we can send concurrent queries.
125 .TP
126 .NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
127 Increase debug verbosity level.
128 This option may appear an unlimited number of times.
129 .sp
130 .TP
131 .NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
132 Set the debug verbosity level.
133 This option may appear an unlimited number of times.
134 This option takes an integer number as its argument.
135 .sp
136 .TP
137 .NOP \f\*[B-Font]\-g\f[] \f\*[I-Font]milliseconds\f[], \f\*[B-Font]\-\-gap\f[]=\f\*[I-Font]milliseconds\f[]
138 The gap (in milliseconds) between time requests.
139 This option takes an integer number as its argument.
140 The default
141 \f\*[I-Font]milliseconds\f[]
142 for this option is:
143 .ti +4
144  50
145 .sp
146 Since we're only going to use the first valid response we get and
147 there is benefit to specifying a good number of servers to query,
148 separate the queries we send out by the specified number of
149 milliseconds.
150 .TP
151 .NOP \f\*[B-Font]\-K\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-kod\f[]=\f\*[I-Font]file\-name\f[]
152 KoD history filename.
153 The default
154 \f\*[I-Font]file\-name\f[]
155 for this option is:
156 .ti +4
157  /var/db/ntp-kod
158 .sp
159 Specifies the filename to be used for the persistent history of KoD
160 responses received from servers.  If the file does not exist, a
161 warning message will be displayed.  The file will not be created.
162 .TP
163 .NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]file\-name\f[]
164 Look in this file for the key specified with \fB-a\fP.
165 .sp
166 This option specifies the keyfile.
167 \fBsntp\fP will search for the key specified with \fB-a\fP
168 \fIkeyno\fP in this file.  See \fBntp.keys(5)\fP for more
169 information.
170 .TP
171 .NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-logfile\f[]=\f\*[I-Font]file\-name\f[]
172 Log to specified logfile.
173 .sp
174 This option causes the client to write log messages to the specified
175 \fIlogfile\fP.
176 .TP
177 .NOP \f\*[B-Font]\-M\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-steplimit\f[]=\f\*[I-Font]number\f[]
178 Adjustments less than \fBsteplimit\fP msec will be slewed.
179 This option takes an integer number as its argument.
180 The value of
181 \f\*[I-Font]number\f[]
182 is constrained to being:
183 .in +4
184 .nf
185 .na
186 greater than or equal to 0
187 .fi
188 .in -4
189 .sp
190 If the time adjustment is less than \fIsteplimit\fP milliseconds,
191 slew the amount using \fBadjtime(2)\fP.  Otherwise, step the
192 correction using \fBsettimeofday(2)\fP.  The default value is 0,
193 which means all adjustments will be stepped.  This is a feature, as
194 different situations demand different values.
195 .TP
196 .NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-ntpversion\f[]=\f\*[I-Font]number\f[]
197 Send \fBint\fP as our NTP protocol version.
198 This option takes an integer number as its argument.
199 The value of
200 \f\*[I-Font]number\f[]
201 is constrained to being:
202 .in +4
203 .nf
204 .na
205 in the range  0 through 7
206 .fi
207 .in -4
208 The default
209 \f\*[I-Font]number\f[]
210 for this option is:
211 .ti +4
212  4
213 .sp
214 When sending requests to a remote server, tell them we are running
215 NTP protocol version \fIntpversion\fP .
216 .TP
217 .NOP \f\*[B-Font]\-r\f[], \f\*[B-Font]\-\-usereservedport\f[]
218 Use the NTP Reserved Port (port 123).
219 .sp
220 Use port 123, which is reserved for NTP, for our network
221 communications.
222 .TP
223 .NOP \f\*[B-Font]\-S\f[], \f\*[B-Font]\-\-step\f[]
224 OK to 'step' the time with \fBsettimeofday(2)\fP.
225 .sp
226 .TP
227 .NOP \f\*[B-Font]\-s\f[], \f\*[B-Font]\-\-slew\f[]
228 OK to 'slew' the time with \fBadjtime(2)\fP.
229 .sp
230 .TP
231 .NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]seconds\f[], \f\*[B-Font]\-\-timeout\f[]=\f\*[I-Font]seconds\f[]
232 The number of seconds to wait for responses.
233 This option takes an integer number as its argument.
234 The default
235 \f\*[I-Font]seconds\f[]
236 for this option is:
237 .ti +4
238  5
239 .sp
240 When waiting for a reply, \fBsntp\fP will wait the number
241 of seconds specified before giving up.  The default should be
242 more than enough for a unicast response.  If \fBsntp\fP is
243 only waiting for a broadcast response a longer timeout is
244 likely needed.
245 .TP
246 .NOP \f\*[B-Font]\-\-wait\f[], \f\*[B-Font]\- Fl \-no\-wait\f[]
247 Wait for pending replies (if not setting the time).
248 The \fIno\-wait\fP form will disable the option.
249 This option is enabled by default.
250 .sp
251 If we are not setting the time, wait for all pending responses.
252 .TP
253 .NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
254 Display usage information and exit.
255 .TP
256 .NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
257 Pass the extended usage information through a pager.
258 .TP
259 .NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
260 Save the option state to \fIcfgfile\fP.  The default is the \fIlast\fP
261 configuration file listed in the \fBOPTION PRESETS\fP section, below.
262 The command will exit after updating the config file.
263 .TP
264 .NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
265 Load options from \fIcfgfile\fP.
266 The \fIno-load-opts\fP form will disable the loading
267 of earlier config/rc/ini files.  \fI\-\-no-load-opts\fP is handled early,
268 out of order.
269 .TP
270 .NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
271 Output version of program and exit.  The default mode is `v', a simple
272 version.  The `c' mode will print copyright information and `n' will
273 print the full copyright notice.
274 .PP
275 .SH "OPTION PRESETS"
276 Any option that is not marked as \fInot presettable\fP may be preset
277 by loading values from configuration ("RC" or ".INI") file(s) and values from
278 environment variables named:
279 .nf
280   \fBSNTP_<option-name>\fP or \fBSNTP\fP
281 .fi
282 .ad
283 The environmental presets take precedence (are processed later than)
284 the configuration files.
285 The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
286 If any of these are directories, then the file \fI.ntprc\fP
287 is searched for within those directories.
288 .SH USAGE
289 .TP 7
290 .NOP \f[C]sntp ntpserver.somewhere\f[]
291 is the simplest use of this program
292 and can be run as an unprivileged command
293 to check the current time and error in the local clock.
294 .TP 7
295 .NOP \f[C]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
296 With suitable privilege,
297 run as a command
298 or from a
299 \fCcron\f[]\fR(8)\f[]
300 job,
301 \f\*[B-Font]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
302 will request the time from the server,
303 and if that server reports that it is synchronized
304 then if the offset adjustment is less than 128 milliseconds
305 the correction will be slewed,
306 and if the correction is more than 128 milliseconds
307 the correction  will be stepped.
308 .TP 7
309 .NOP \f[C]sntp \-S ntpserver.somewhere\f[]
310 With suitable privilege,
311 run as a command
312 or from a
313 \fCcron\f[]\fR(8)\f[]
314 job,
315 \f\*[B-Font]sntp \-S ntpserver.somewhere\f[]
316 will set (step) the local clock from a synchronized specified server,
317 like the (deprecated)
318 \fCntpdate\f[]\fR(1ntpdatemdoc)\f[],
319 or
320 \fCrdate\f[]\fR(8)\f[]
321 commands.
322 .PP
323 .SH "ENVIRONMENT"
324 See \fBOPTION PRESETS\fP for configuration environment variables.
325 .SH "FILES"
326 See \fBOPTION PRESETS\fP for configuration files.
327 .SH "EXIT STATUS"
328 One of the following exit values will be returned:
329 .TP
330 .NOP 0 " (EXIT_SUCCESS)"
331 Successful program execution.
332 .TP
333 .NOP 1 " (EXIT_FAILURE)"
334 The operation failed or the command syntax was not valid.
335 .TP
336 .NOP 66 " (EX_NOINPUT)"
337 A specified configuration file could not be loaded.
338 .TP
339 .NOP 70 " (EX_SOFTWARE)"
340 libopts had an internal operational error.  Please report
341 it to autogen-users@lists.sourceforge.net.  Thank you.
342 .PP
343 .SH AUTHORS
344 .NOP  "Johannes Maximilian Kuehn" 
345 .br
346 .NOP  "Harlan Stenn" 
347 .br
348 .NOP  "Dave Hart" 
349 .br
350 .SH "COPYRIGHT"
351 Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation all rights reserved.
352 This program is released under the terms of the NTP license, <http://ntp.org/license>.
353 .SH "BUGS"
354 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
355 .SH "NOTES"
356 This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP
357 option definitions.