diff options
author | schwarze <> | 2018-08-17 14:03:10 +0000 |
---|---|---|
committer | schwarze <> | 2018-08-17 14:03:10 +0000 |
commit | ff0a5d520ad32e0f9a6191ef9a200e5cb93be13d (patch) | |
tree | 6c9633f0162d212cce77b023692f5c6ba38a2f69 /src | |
parent | 9c8ed9fc37dd34af232404d0945d2667da72cef3 (diff) | |
download | openbsd-ff0a5d520ad32e0f9a6191ef9a200e5cb93be13d.tar.gz openbsd-ff0a5d520ad32e0f9a6191ef9a200e5cb93be13d.tar.bz2 openbsd-ff0a5d520ad32e0f9a6191ef9a200e5cb93be13d.zip |
Make the wording more concise, use the imperative throughout, state
more precisely which options require which other options, add many
missing incompatibilities, mention the default for -e, and some
macro cleanup.
OK jmc@ tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/usr.bin/nc/nc.1 | 234 |
1 files changed, 126 insertions, 108 deletions
diff --git a/src/usr.bin/nc/nc.1 b/src/usr.bin/nc/nc.1 index e10d385a14..8072bc220e 100644 --- a/src/usr.bin/nc/nc.1 +++ b/src/usr.bin/nc/nc.1 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: nc.1,v 1.88 2017/11/28 16:59:10 jsing Exp $ | 1 | .\" $OpenBSD: nc.1,v 1.89 2018/08/17 14:03:10 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1996 David Sacerdote | 3 | .\" Copyright (c) 1996 David Sacerdote |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. |
@@ -25,7 +25,7 @@ | |||
25 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | .\" | 27 | .\" |
28 | .Dd $Mdocdate: November 28 2017 $ | 28 | .Dd $Mdocdate: August 17 2018 $ |
29 | .Dt NC 1 | 29 | .Dt NC 1 |
30 | .Os | 30 | .Os |
31 | .Sh NAME | 31 | .Sh NAME |
@@ -96,27 +96,31 @@ and much, much more | |||
96 | The options are as follows: | 96 | The options are as follows: |
97 | .Bl -tag -width Ds | 97 | .Bl -tag -width Ds |
98 | .It Fl 4 | 98 | .It Fl 4 |
99 | Forces | 99 | Use IPv4 addresses only. |
100 | .Nm | ||
101 | to use IPv4 addresses only. | ||
102 | .It Fl 6 | 100 | .It Fl 6 |
103 | Forces | 101 | Use IPv6 addresses only. |
104 | .Nm | ||
105 | to use IPv6 addresses only. | ||
106 | .It Fl C Ar certfile | 102 | .It Fl C Ar certfile |
107 | Specifies the filename from which the public key part of the TLS | 103 | Load the public key part of the TLS peer certificate from |
108 | certificate is loaded, in PEM format. | 104 | .Ar certfile , |
109 | May only be used with TLS. | 105 | in PEM format. |
106 | Requires | ||
107 | .Fl c . | ||
110 | .It Fl c | 108 | .It Fl c |
111 | If using a TCP socket to connect or listen, use TLS. | 109 | Use TLS to connect or listen. |
112 | Illegal if not using TCP sockets. | 110 | Cannot be used together with any of the options |
111 | .Fl FuU . | ||
113 | .It Fl D | 112 | .It Fl D |
114 | Enable debugging on the socket. | 113 | Enable debugging on the socket. |
115 | .It Fl d | 114 | .It Fl d |
116 | Do not attempt to read from stdin. | 115 | Do not attempt to read from stdin. |
117 | .It Fl e Ar name | 116 | .It Fl e Ar name |
118 | Specify the name that must be present in the peer certificate when using TLS. | 117 | Only accept the TLS peer certificate if it contains the |
119 | Illegal if not using TLS. | 118 | .Ar name . |
119 | Requires | ||
120 | .Fl c . | ||
121 | If not specified, | ||
122 | .Ar destination | ||
123 | is used. | ||
120 | .It Fl F | 124 | .It Fl F |
121 | Pass the first connected socket using | 125 | Pass the first connected socket using |
122 | .Xr sendmsg 2 | 126 | .Xr sendmsg 2 |
@@ -132,47 +136,49 @@ using the | |||
132 | .Xr ssh_config 5 | 136 | .Xr ssh_config 5 |
133 | .Cm ProxyUseFdpass | 137 | .Cm ProxyUseFdpass |
134 | option). | 138 | option). |
139 | Cannot be used with | ||
140 | .Fl c | ||
141 | or | ||
142 | .Fl U . | ||
135 | .It Fl H Ar hash | 143 | .It Fl H Ar hash |
136 | Specifies the required hash string of the peer certificate when using TLS. | 144 | Only accept the TLS peer certificate if its hash returned from |
137 | The string format required is that used by | 145 | .Xr tls_peer_cert_hash 3 |
138 | .Xr tls_peer_cert_hash 3 . | 146 | matches |
139 | Illegal if not using TLS, and may not be used with -T noverify. | 147 | .Ar hash . |
148 | Requires | ||
149 | .Fl c | ||
150 | and cannot be used with | ||
151 | .Fl T Cm noverify . | ||
140 | .It Fl h | 152 | .It Fl h |
141 | Prints out | 153 | Print out the |
142 | .Nm | 154 | .Nm |
143 | help. | 155 | help text and exit. |
144 | .It Fl I Ar length | 156 | .It Fl I Ar length |
145 | Specifies the size of the TCP receive buffer. | 157 | Specify the size of the TCP receive buffer. |
146 | .It Fl i Ar interval | 158 | .It Fl i Ar interval |
147 | Specifies a delay time interval between lines of text sent and received. | 159 | Sleep for |
160 | .Ar interval | ||
161 | seconds between lines of text sent and received. | ||
148 | Also causes a delay time between connections to multiple ports. | 162 | Also causes a delay time between connections to multiple ports. |
149 | .It Fl K Ar keyfile | 163 | .It Fl K Ar keyfile |
150 | Specifies the filename from which the private key | 164 | Load the TLS private key from |
151 | is loaded in PEM format. | 165 | .Ar keyfile , |
152 | May only be used with TLS. | 166 | in PEM format. |
167 | Requires | ||
168 | .Fl c . | ||
153 | .It Fl k | 169 | .It Fl k |
154 | Forces | 170 | When a connection is completed, listen for another one. |
155 | .Nm | 171 | Requires |
156 | to stay listening for another connection after its current connection | 172 | .Fl l . |
157 | is completed. | ||
158 | It is an error to use this option without the | ||
159 | .Fl l | ||
160 | option. | ||
161 | When used together with the | 173 | When used together with the |
162 | .Fl u | 174 | .Fl u |
163 | option, the server socket is not connected and it can receive UDP datagrams from | 175 | option, the server socket is not connected and it can receive UDP datagrams from |
164 | multiple hosts. | 176 | multiple hosts. |
165 | .It Fl l | 177 | .It Fl l |
166 | Used to specify that | 178 | Listen for an incoming connection rather than initiating a |
167 | .Nm | ||
168 | should listen for an incoming connection rather than initiate a | ||
169 | connection to a remote host. | 179 | connection to a remote host. |
170 | It is an error to use this option in conjunction with the | 180 | Cannot be used together with any of the options |
171 | .Fl p , | 181 | .Fl psxz . |
172 | .Fl s , | ||
173 | or | ||
174 | .Fl z | ||
175 | options. | ||
176 | Additionally, any timeouts specified with the | 182 | Additionally, any timeouts specified with the |
177 | .Fl w | 183 | .Fl w |
178 | option are ignored. | 184 | option are ignored. |
@@ -189,97 +195,111 @@ Some servers require this to finish their work. | |||
189 | Do not do any DNS or service lookups on any specified addresses, | 195 | Do not do any DNS or service lookups on any specified addresses, |
190 | hostnames or ports. | 196 | hostnames or ports. |
191 | .It Fl O Ar length | 197 | .It Fl O Ar length |
192 | Specifies the size of the TCP send buffer. | 198 | Specify the size of the TCP send buffer. |
193 | .It Fl o Ar staplefile | 199 | .It Fl o Ar staplefile |
194 | Specifies the filename from which to load data to be stapled | 200 | During the TLS handshake, load data to be stapled from |
195 | during the TLS handshake. | 201 | .Ar staplefile , |
196 | The file is expected to contain an OCSP response from an OCSP server in | 202 | which is expected to contain an OCSP response from an OCSP server in |
197 | DER format. | 203 | DER format. |
198 | May only be used with TLS and when a certificate is being used. | 204 | Requires |
205 | .Fl c | ||
206 | and | ||
207 | .Fl C . | ||
199 | .It Fl P Ar proxy_username | 208 | .It Fl P Ar proxy_username |
200 | Specifies a username to present to a proxy server that requires authentication. | 209 | Specifies a username to present to a proxy server that requires authentication. |
201 | If no username is specified then authentication will not be attempted. | 210 | If no username is specified then authentication will not be attempted. |
202 | Proxy authentication is only supported for HTTP CONNECT proxies at present. | 211 | Proxy authentication is only supported for HTTP CONNECT proxies at present. |
203 | .It Fl p Ar source_port | 212 | .It Fl p Ar source_port |
204 | Specifies the source port | 213 | Specify the source port |
205 | .Nm | 214 | .Nm |
206 | should use, subject to privilege restrictions and availability. | 215 | should use, subject to privilege restrictions and availability. |
207 | It is an error to use this option in conjunction with the | 216 | Cannot be used together with |
208 | .Fl l | 217 | .Fl l . |
209 | option. | ||
210 | .It Fl R Ar CAfile | 218 | .It Fl R Ar CAfile |
211 | Specifies the filename from which the root CA bundle for certificate | 219 | Load the root CA bundle for TLS certificate verification from |
212 | verification is loaded, in PEM format. | 220 | .Ar CAfile , |
213 | Illegal if not using TLS. | 221 | in PEM format, instead of |
214 | The default is | ||
215 | .Pa /etc/ssl/cert.pem . | 222 | .Pa /etc/ssl/cert.pem . |
223 | Requires | ||
224 | .Fl c . | ||
216 | .It Fl r | 225 | .It Fl r |
217 | Specifies that source and/or destination ports should be chosen randomly | 226 | Choose source and/or destination ports randomly |
218 | instead of sequentially within a range or in the order that the system | 227 | instead of sequentially within a range or in the order that the system |
219 | assigns them. | 228 | assigns them. |
220 | .It Fl S | 229 | .It Fl S |
221 | Enables the RFC 2385 TCP MD5 signature option. | 230 | Enable the RFC 2385 TCP MD5 signature option. |
222 | .It Fl s Ar source | 231 | .It Fl s Ar source |
223 | Specifies the IP of the interface which is used to send the packets. | 232 | Send packets from the interface with the |
233 | .Ar source | ||
234 | IP address. | ||
224 | For | 235 | For |
225 | .Ux Ns -domain | 236 | .Ux Ns -domain |
226 | datagram sockets, specifies the local temporary socket file | 237 | datagram sockets, specifies the local temporary socket file |
227 | to create and use so that datagrams can be received. | 238 | to create and use so that datagrams can be received. |
228 | It is an error to use this option in conjunction with the | 239 | Cannot be used together with |
229 | .Fl l | 240 | .Fl l |
230 | option. | 241 | or |
242 | .Fl x . | ||
231 | .It Fl T Ar keyword | 243 | .It Fl T Ar keyword |
232 | Change IPv4 TOS value or TLS options. | 244 | Change the IPv4 TOS value or the TLS options. |
233 | For TLS options | 245 | .Pp |
246 | For TLS options, | ||
234 | .Ar keyword | 247 | .Ar keyword |
235 | may be one of: | 248 | may be one of: |
236 | .Ar noverify , | 249 | .Cm noverify , |
237 | which disables certificate verification; | 250 | which disables certificate verification; |
238 | .Ar noname , | 251 | .Cm noname , |
239 | which disables certificate name checking; | 252 | which disables certificate name checking; |
240 | .Ar clientcert , | 253 | .Cm clientcert , |
241 | which requires a client certificate on incoming connections; or | 254 | which requires a client certificate on incoming connections; or |
242 | .Ar muststaple , | 255 | .Cm muststaple , |
243 | which requires the peer to provide a valid stapled OCSP response | 256 | which requires the peer to provide a valid stapled OCSP response |
244 | with the handshake. | 257 | with the handshake. |
245 | The following TLS options specify a value in the form of a key=value pair: | 258 | The following TLS options specify a value in the form of a |
246 | .Ar ciphers , | 259 | .Ar key Ns = Ns Ar value |
260 | pair: | ||
261 | .Cm ciphers , | ||
247 | which allows the supported TLS ciphers to be specified (see | 262 | which allows the supported TLS ciphers to be specified (see |
248 | .Xr tls_config_set_ciphers 3 | 263 | .Xr tls_config_set_ciphers 3 |
249 | for further details); | 264 | for further details); |
250 | .Ar protocols , | 265 | .Cm protocols , |
251 | which allows the supported TLS protocols to be specified (see | 266 | which allows the supported TLS protocols to be specified (see |
252 | .Xr tls_config_parse_protocols 3 | 267 | .Xr tls_config_parse_protocols 3 |
253 | for further details). | 268 | for further details). |
254 | It is illegal to specify TLS options if not using TLS. | 269 | Specifiying TLS options requires |
270 | .Fl c . | ||
255 | .Pp | 271 | .Pp |
256 | For IPv4 TOS value | 272 | For the IPv4 TOS value, |
257 | .Ar keyword | 273 | .Ar keyword |
258 | may be one of | 274 | may be one of |
259 | .Ar critical , | 275 | .Cm critical , |
260 | .Ar inetcontrol , | 276 | .Cm inetcontrol , |
261 | .Ar lowdelay , | 277 | .Cm lowdelay , |
262 | .Ar netcontrol , | 278 | .Cm netcontrol , |
263 | .Ar throughput , | 279 | .Cm throughput , |
264 | .Ar reliability , | 280 | .Cm reliability , |
265 | or one of the DiffServ Code Points: | 281 | or one of the DiffServ Code Points: |
266 | .Ar ef , | 282 | .Cm ef , |
267 | .Ar af11 ... af43 , | 283 | .Cm af11 No ... Cm af43 , |
268 | .Ar cs0 ... cs7 ; | 284 | .Cm cs0 No ... Cm cs7 ; |
269 | or a number in either hex or decimal. | 285 | or a number in either hex or decimal. |
270 | .It Fl t | 286 | .It Fl t |
271 | Causes | 287 | Send RFC 854 DON'T and WON'T responses to RFC 854 DO and WILL requests. |
272 | .Nm | ||
273 | to send RFC 854 DON'T and WON'T responses to RFC 854 DO and WILL requests. | ||
274 | This makes it possible to use | 288 | This makes it possible to use |
275 | .Nm | 289 | .Nm |
276 | to script telnet sessions. | 290 | to script telnet sessions. |
277 | .It Fl U | 291 | .It Fl U |
278 | Specifies to use | 292 | Use |
279 | .Ux Ns -domain | 293 | .Ux Ns -domain |
280 | sockets. | 294 | sockets. |
295 | Cannot be used together with any of the options | ||
296 | .Fl cFx . | ||
281 | .It Fl u | 297 | .It Fl u |
282 | Use UDP instead of the default option of TCP. | 298 | Use UDP instead of TCP. |
299 | Cannot be used together with | ||
300 | .Fl c | ||
301 | or | ||
302 | .Fl x . | ||
283 | For | 303 | For |
284 | .Ux Ns -domain | 304 | .Ux Ns -domain |
285 | sockets, use a datagram socket instead of a stream socket. | 305 | sockets, use a datagram socket instead of a stream socket. |
@@ -293,9 +313,7 @@ flag is given. | |||
293 | .It Fl V Ar rtable | 313 | .It Fl V Ar rtable |
294 | Set the routing table to be used. | 314 | Set the routing table to be used. |
295 | .It Fl v | 315 | .It Fl v |
296 | Have | 316 | Produce more verbose output. |
297 | .Nm | ||
298 | give more verbose output. | ||
299 | .It Fl W Ar recvlimit | 317 | .It Fl W Ar recvlimit |
300 | Terminate after receiving | 318 | Terminate after receiving |
301 | .Ar recvlimit | 319 | .Ar recvlimit |
@@ -315,22 +333,20 @@ will listen forever for a connection, with or without the | |||
315 | flag. | 333 | flag. |
316 | The default is no timeout. | 334 | The default is no timeout. |
317 | .It Fl X Ar proxy_protocol | 335 | .It Fl X Ar proxy_protocol |
318 | Requests that | 336 | Use |
319 | .Nm | 337 | .Ar proxy_protocol |
320 | should use the specified protocol when talking to the proxy server. | 338 | when talking to the proxy server. |
321 | Supported protocols are | 339 | Supported protocols are |
322 | .Dq 4 | 340 | .Cm 4 |
323 | (SOCKS v.4), | 341 | (SOCKS v.4), |
324 | .Dq 5 | 342 | .Cm 5 |
325 | (SOCKS v.5) | 343 | (SOCKS v.5) |
326 | and | 344 | and |
327 | .Dq connect | 345 | .Cm connect |
328 | (HTTPS proxy). | 346 | (HTTPS proxy). |
329 | If the protocol is not specified, SOCKS version 5 is used. | 347 | If the protocol is not specified, SOCKS version 5 is used. |
330 | .It Fl x Ar proxy_address Ns Op : Ns Ar port | 348 | .It Fl x Ar proxy_address Ns Op : Ns Ar port |
331 | Requests that | 349 | Connect to |
332 | .Nm | ||
333 | should connect to | ||
334 | .Ar destination | 350 | .Ar destination |
335 | using a proxy at | 351 | using a proxy at |
336 | .Ar proxy_address | 352 | .Ar proxy_address |
@@ -343,17 +359,18 @@ for SOCKS, 3128 for HTTPS). | |||
343 | An IPv6 address can be specified unambiguously by enclosing | 359 | An IPv6 address can be specified unambiguously by enclosing |
344 | .Ar proxy_address | 360 | .Ar proxy_address |
345 | in square brackets. | 361 | in square brackets. |
362 | A proxy cannot be used with any of the options | ||
363 | .Fl lsuU . | ||
346 | .It Fl Z Ar peercertfile | 364 | .It Fl Z Ar peercertfile |
347 | Specifies the filename in which the peer supplied certificates will be saved | 365 | Save the peer certificates to |
366 | .Ar peercertfile , | ||
348 | in PEM format. | 367 | in PEM format. |
349 | May only be used with TLS. | 368 | Requires |
369 | .Fl c . | ||
350 | .It Fl z | 370 | .It Fl z |
351 | Specifies that | 371 | Only scan for listening daemons, without sending any data to them. |
352 | .Nm | 372 | Cannot be used together with |
353 | should just scan for listening daemons, without sending any data to them. | 373 | .Fl l . |
354 | It is an error to use this option in conjunction with the | ||
355 | .Fl l | ||
356 | option. | ||
357 | .El | 374 | .El |
358 | .Pp | 375 | .Pp |
359 | .Ar destination | 376 | .Ar destination |
@@ -375,7 +392,8 @@ option is given). | |||
375 | .Pp | 392 | .Pp |
376 | .Ar port | 393 | .Ar port |
377 | can be a specified as a numeric port number, or as a service name. | 394 | can be a specified as a numeric port number, or as a service name. |
378 | Ports may be specified in a range of the form nn-mm. | 395 | Ports may be specified in a range of the form |
396 | .Ar nn Ns - Ns Ar mm . | ||
379 | In general, | 397 | In general, |
380 | a destination port must be specified, | 398 | a destination port must be specified, |
381 | unless the | 399 | unless the |
@@ -548,8 +566,8 @@ if the proxy requires it: | |||
548 | .Xr cat 1 , | 566 | .Xr cat 1 , |
549 | .Xr ssh 1 | 567 | .Xr ssh 1 |
550 | .Sh AUTHORS | 568 | .Sh AUTHORS |
551 | Original implementation by *Hobbit* | 569 | Original implementation by |
552 | .Aq Mt hobbit@avian.org . | 570 | .An *Hobbit* Aq Mt hobbit@avian.org . |
553 | .br | 571 | .br |
554 | Rewritten with IPv6 support by | 572 | Rewritten with IPv6 support by |
555 | .An Eric Jackson Aq Mt ericj@monkey.org . | 573 | .An Eric Jackson Aq Mt ericj@monkey.org . |