summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2018-08-17 14:03:10 +0000
committerschwarze <>2018-08-17 14:03:10 +0000
commitff0a5d520ad32e0f9a6191ef9a200e5cb93be13d (patch)
tree6c9633f0162d212cce77b023692f5c6ba38a2f69 /src
parent9c8ed9fc37dd34af232404d0945d2667da72cef3 (diff)
downloadopenbsd-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.1234
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
96The options are as follows: 96The options are as follows:
97.Bl -tag -width Ds 97.Bl -tag -width Ds
98.It Fl 4 98.It Fl 4
99Forces 99Use IPv4 addresses only.
100.Nm
101to use IPv4 addresses only.
102.It Fl 6 100.It Fl 6
103Forces 101Use IPv6 addresses only.
104.Nm
105to use IPv6 addresses only.
106.It Fl C Ar certfile 102.It Fl C Ar certfile
107Specifies the filename from which the public key part of the TLS 103Load the public key part of the TLS peer certificate from
108certificate is loaded, in PEM format. 104.Ar certfile ,
109May only be used with TLS. 105in PEM format.
106Requires
107.Fl c .
110.It Fl c 108.It Fl c
111If using a TCP socket to connect or listen, use TLS. 109Use TLS to connect or listen.
112Illegal if not using TCP sockets. 110Cannot be used together with any of the options
111.Fl FuU .
113.It Fl D 112.It Fl D
114Enable debugging on the socket. 113Enable debugging on the socket.
115.It Fl d 114.It Fl d
116Do not attempt to read from stdin. 115Do not attempt to read from stdin.
117.It Fl e Ar name 116.It Fl e Ar name
118Specify the name that must be present in the peer certificate when using TLS. 117Only accept the TLS peer certificate if it contains the
119Illegal if not using TLS. 118.Ar name .
119Requires
120.Fl c .
121If not specified,
122.Ar destination
123is used.
120.It Fl F 124.It Fl F
121Pass the first connected socket using 125Pass 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
134option). 138option).
139Cannot be used with
140.Fl c
141or
142.Fl U .
135.It Fl H Ar hash 143.It Fl H Ar hash
136Specifies the required hash string of the peer certificate when using TLS. 144Only accept the TLS peer certificate if its hash returned from
137The string format required is that used by 145.Xr tls_peer_cert_hash 3
138.Xr tls_peer_cert_hash 3 . 146matches
139Illegal if not using TLS, and may not be used with -T noverify. 147.Ar hash .
148Requires
149.Fl c
150and cannot be used with
151.Fl T Cm noverify .
140.It Fl h 152.It Fl h
141Prints out 153Print out the
142.Nm 154.Nm
143help. 155help text and exit.
144.It Fl I Ar length 156.It Fl I Ar length
145Specifies the size of the TCP receive buffer. 157Specify the size of the TCP receive buffer.
146.It Fl i Ar interval 158.It Fl i Ar interval
147Specifies a delay time interval between lines of text sent and received. 159Sleep for
160.Ar interval
161seconds between lines of text sent and received.
148Also causes a delay time between connections to multiple ports. 162Also causes a delay time between connections to multiple ports.
149.It Fl K Ar keyfile 163.It Fl K Ar keyfile
150Specifies the filename from which the private key 164Load the TLS private key from
151is loaded in PEM format. 165.Ar keyfile ,
152May only be used with TLS. 166in PEM format.
167Requires
168.Fl c .
153.It Fl k 169.It Fl k
154Forces 170When a connection is completed, listen for another one.
155.Nm 171Requires
156to stay listening for another connection after its current connection 172.Fl l .
157is completed.
158It is an error to use this option without the
159.Fl l
160option.
161When used together with the 173When used together with the
162.Fl u 174.Fl u
163option, the server socket is not connected and it can receive UDP datagrams from 175option, the server socket is not connected and it can receive UDP datagrams from
164multiple hosts. 176multiple hosts.
165.It Fl l 177.It Fl l
166Used to specify that 178Listen for an incoming connection rather than initiating a
167.Nm
168should listen for an incoming connection rather than initiate a
169connection to a remote host. 179connection to a remote host.
170It is an error to use this option in conjunction with the 180Cannot be used together with any of the options
171.Fl p , 181.Fl psxz .
172.Fl s ,
173or
174.Fl z
175options.
176Additionally, any timeouts specified with the 182Additionally, any timeouts specified with the
177.Fl w 183.Fl w
178option are ignored. 184option are ignored.
@@ -189,97 +195,111 @@ Some servers require this to finish their work.
189Do not do any DNS or service lookups on any specified addresses, 195Do not do any DNS or service lookups on any specified addresses,
190hostnames or ports. 196hostnames or ports.
191.It Fl O Ar length 197.It Fl O Ar length
192Specifies the size of the TCP send buffer. 198Specify the size of the TCP send buffer.
193.It Fl o Ar staplefile 199.It Fl o Ar staplefile
194Specifies the filename from which to load data to be stapled 200During the TLS handshake, load data to be stapled from
195during the TLS handshake. 201.Ar staplefile ,
196The file is expected to contain an OCSP response from an OCSP server in 202which is expected to contain an OCSP response from an OCSP server in
197DER format. 203DER format.
198May only be used with TLS and when a certificate is being used. 204Requires
205.Fl c
206and
207.Fl C .
199.It Fl P Ar proxy_username 208.It Fl P Ar proxy_username
200Specifies a username to present to a proxy server that requires authentication. 209Specifies a username to present to a proxy server that requires authentication.
201If no username is specified then authentication will not be attempted. 210If no username is specified then authentication will not be attempted.
202Proxy authentication is only supported for HTTP CONNECT proxies at present. 211Proxy authentication is only supported for HTTP CONNECT proxies at present.
203.It Fl p Ar source_port 212.It Fl p Ar source_port
204Specifies the source port 213Specify the source port
205.Nm 214.Nm
206should use, subject to privilege restrictions and availability. 215should use, subject to privilege restrictions and availability.
207It is an error to use this option in conjunction with the 216Cannot be used together with
208.Fl l 217.Fl l .
209option.
210.It Fl R Ar CAfile 218.It Fl R Ar CAfile
211Specifies the filename from which the root CA bundle for certificate 219Load the root CA bundle for TLS certificate verification from
212verification is loaded, in PEM format. 220.Ar CAfile ,
213Illegal if not using TLS. 221in PEM format, instead of
214The default is
215.Pa /etc/ssl/cert.pem . 222.Pa /etc/ssl/cert.pem .
223Requires
224.Fl c .
216.It Fl r 225.It Fl r
217Specifies that source and/or destination ports should be chosen randomly 226Choose source and/or destination ports randomly
218instead of sequentially within a range or in the order that the system 227instead of sequentially within a range or in the order that the system
219assigns them. 228assigns them.
220.It Fl S 229.It Fl S
221Enables the RFC 2385 TCP MD5 signature option. 230Enable the RFC 2385 TCP MD5 signature option.
222.It Fl s Ar source 231.It Fl s Ar source
223Specifies the IP of the interface which is used to send the packets. 232Send packets from the interface with the
233.Ar source
234IP address.
224For 235For
225.Ux Ns -domain 236.Ux Ns -domain
226datagram sockets, specifies the local temporary socket file 237datagram sockets, specifies the local temporary socket file
227to create and use so that datagrams can be received. 238to create and use so that datagrams can be received.
228It is an error to use this option in conjunction with the 239Cannot be used together with
229.Fl l 240.Fl l
230option. 241or
242.Fl x .
231.It Fl T Ar keyword 243.It Fl T Ar keyword
232Change IPv4 TOS value or TLS options. 244Change the IPv4 TOS value or the TLS options.
233For TLS options 245.Pp
246For TLS options,
234.Ar keyword 247.Ar keyword
235may be one of: 248may be one of:
236.Ar noverify , 249.Cm noverify ,
237which disables certificate verification; 250which disables certificate verification;
238.Ar noname , 251.Cm noname ,
239which disables certificate name checking; 252which disables certificate name checking;
240.Ar clientcert , 253.Cm clientcert ,
241which requires a client certificate on incoming connections; or 254which requires a client certificate on incoming connections; or
242.Ar muststaple , 255.Cm muststaple ,
243which requires the peer to provide a valid stapled OCSP response 256which requires the peer to provide a valid stapled OCSP response
244with the handshake. 257with the handshake.
245The following TLS options specify a value in the form of a key=value pair: 258The following TLS options specify a value in the form of a
246.Ar ciphers , 259.Ar key Ns = Ns Ar value
260pair:
261.Cm ciphers ,
247which allows the supported TLS ciphers to be specified (see 262which allows the supported TLS ciphers to be specified (see
248.Xr tls_config_set_ciphers 3 263.Xr tls_config_set_ciphers 3
249for further details); 264for further details);
250.Ar protocols , 265.Cm protocols ,
251which allows the supported TLS protocols to be specified (see 266which allows the supported TLS protocols to be specified (see
252.Xr tls_config_parse_protocols 3 267.Xr tls_config_parse_protocols 3
253for further details). 268for further details).
254It is illegal to specify TLS options if not using TLS. 269Specifiying TLS options requires
270.Fl c .
255.Pp 271.Pp
256For IPv4 TOS value 272For the IPv4 TOS value,
257.Ar keyword 273.Ar keyword
258may be one of 274may 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 ,
265or one of the DiffServ Code Points: 281or 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 ;
269or a number in either hex or decimal. 285or a number in either hex or decimal.
270.It Fl t 286.It Fl t
271Causes 287Send RFC 854 DON'T and WON'T responses to RFC 854 DO and WILL requests.
272.Nm
273to send RFC 854 DON'T and WON'T responses to RFC 854 DO and WILL requests.
274This makes it possible to use 288This makes it possible to use
275.Nm 289.Nm
276to script telnet sessions. 290to script telnet sessions.
277.It Fl U 291.It Fl U
278Specifies to use 292Use
279.Ux Ns -domain 293.Ux Ns -domain
280sockets. 294sockets.
295Cannot be used together with any of the options
296.Fl cFx .
281.It Fl u 297.It Fl u
282Use UDP instead of the default option of TCP. 298Use UDP instead of TCP.
299Cannot be used together with
300.Fl c
301or
302.Fl x .
283For 303For
284.Ux Ns -domain 304.Ux Ns -domain
285sockets, use a datagram socket instead of a stream socket. 305sockets, 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
294Set the routing table to be used. 314Set the routing table to be used.
295.It Fl v 315.It Fl v
296Have 316Produce more verbose output.
297.Nm
298give more verbose output.
299.It Fl W Ar recvlimit 317.It Fl W Ar recvlimit
300Terminate after receiving 318Terminate after receiving
301.Ar recvlimit 319.Ar recvlimit
@@ -315,22 +333,20 @@ will listen forever for a connection, with or without the
315flag. 333flag.
316The default is no timeout. 334The default is no timeout.
317.It Fl X Ar proxy_protocol 335.It Fl X Ar proxy_protocol
318Requests that 336Use
319.Nm 337.Ar proxy_protocol
320should use the specified protocol when talking to the proxy server. 338when talking to the proxy server.
321Supported protocols are 339Supported 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)
326and 344and
327.Dq connect 345.Cm connect
328(HTTPS proxy). 346(HTTPS proxy).
329If the protocol is not specified, SOCKS version 5 is used. 347If 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
331Requests that 349Connect to
332.Nm
333should connect to
334.Ar destination 350.Ar destination
335using a proxy at 351using a proxy at
336.Ar proxy_address 352.Ar proxy_address
@@ -343,17 +359,18 @@ for SOCKS, 3128 for HTTPS).
343An IPv6 address can be specified unambiguously by enclosing 359An IPv6 address can be specified unambiguously by enclosing
344.Ar proxy_address 360.Ar proxy_address
345in square brackets. 361in square brackets.
362A proxy cannot be used with any of the options
363.Fl lsuU .
346.It Fl Z Ar peercertfile 364.It Fl Z Ar peercertfile
347Specifies the filename in which the peer supplied certificates will be saved 365Save the peer certificates to
366.Ar peercertfile ,
348in PEM format. 367in PEM format.
349May only be used with TLS. 368Requires
369.Fl c .
350.It Fl z 370.It Fl z
351Specifies that 371Only scan for listening daemons, without sending any data to them.
352.Nm 372Cannot be used together with
353should just scan for listening daemons, without sending any data to them. 373.Fl l .
354It is an error to use this option in conjunction with the
355.Fl l
356option.
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
377can be a specified as a numeric port number, or as a service name. 394can be a specified as a numeric port number, or as a service name.
378Ports may be specified in a range of the form nn-mm. 395Ports may be specified in a range of the form
396.Ar nn Ns - Ns Ar mm .
379In general, 397In general,
380a destination port must be specified, 398a destination port must be specified,
381unless the 399unless 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
551Original implementation by *Hobbit* 569Original implementation by
552.Aq Mt hobbit@avian.org . 570.An *Hobbit* Aq Mt hobbit@avian.org .
553.br 571.br
554Rewritten with IPv6 support by 572Rewritten with IPv6 support by
555.An Eric Jackson Aq Mt ericj@monkey.org . 573.An Eric Jackson Aq Mt ericj@monkey.org .