Blob


1 .\" Copyright (c) 2021 Omar Polo <op@omarpolo.com>
2 .\"
3 .\" Permission to use, copy, modify, and distribute this software for any
4 .\" purpose with or without fee is hereby granted, provided that the above
5 .\" copyright notice and this permission notice appear in all copies.
6 .\"
7 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 .Dd $Mdocdate: November 23 2021$
15 .Dt LSTUN 1
16 .Os
17 .Sh NAME
18 .Nm lstun
19 .Nd lazy ssh tunnel
20 .Sh SYNOPSIS
21 .Nm
22 .Bk -words
23 .Fl B Ar sshaddr
24 .Fl b Ar addr
25 .Op Fl t Ar timeout
26 .Ar destination
27 .Ek
28 .Sh DESCRIPTION
29 .Nm
30 binds the local
31 .Ar addr
32 and lazily spawns an
33 .Xr ssh 1
34 instance to forward the traffic to a remote end.
35 After
36 .Ar timeout
37 seconds
38 from the last client activity, the ssh tunnel is closed.
39 .Pp
40 The
41 .Xr ssh 1
42 tunnel is established by running
43 .Bk
44 .Pa /usr/bin/ssh
45 .Fl L Ar sshaddr
46 .Fl NTq
47 .Ar destination .
48 .Ek
49 .Pp
50 The arguments are as follows:
51 .Bl -tag -width Ds
52 .It Fl B Xo
53 .Sm off
54 .Oo Ar bind_address : Oc
55 .Ar port : host : hostport
56 .Sm on
57 .Xc
58 Fed to
59 .Xr ssh 1
60 .Fl L
61 flag.
62 .It Fl b Ar addr
63 Where to bind the local socket.
64 A port number or the tuple host:port.
65 .It Fl t Ar timeout
66 Number of seconds after after the last client shutdown to kill the ssh
67 process.
68 Defaults to 120.
69 .El
70 .Sh AUTHORS
71 .An -nosplit
72 The
73 .Nm
74 utility was written by
75 .An Omar Polo Aq Mt op@omarpolo.com .
76 .Sh CAVEATS
77 Currently it's impossible to pass flags to the
78 .Xr ssh 1
79 subcommand.
80 This is especially painful when you need to use, say, a jump host.