Blob


1 # lstun -- lazy ssh tunnel
3 lstun is a simple utility to lazily (on demand) spawn a ssh tunnel to
4 a remote machine and optionally kill it after some time of inactivity.
6 The only dependency is libevent. It expects ssh to be `/usr/bin/ssh`,
7 compile with `-DSSH_PATH=...` to alter the path eventually.
9 To compile it just run
11 $ ./configure
12 $ make
13 # make install # eventually
15 The build can be customized by passing arguments to the configure
16 script or by using a `configure.local` file; see `./configure -h` and
17 [`configure.local.example`](configure.local.example) for more
18 information.
20 The `configure` script can use pkg-config if available to find the
21 flags for libevent. To disable the usage of it, pass
22 `PKG_CONFIG=false` to the configure script.
24 For Linux users with libbsd installed, the configure script can be
25 instructed to use libbsd instead of the bundled compats as follows:
27 CFLAGS="$(pkg-config --cflags libbsd-overlay)" \
28 ./configure LDFLAGS="$(pkg-config --libs libbsd-overlay)"
31 ### Usage
33 ```
34 usage: lstun [-dv] -B sshaddr -b addr [-t timeout] destination
35 ```
37 Check out the [manpage](lstun.1) for the usage.
40 ### Motivation
42 It was written to forward lazily all the traffic on the local port
43 2525 to a remote port 25, thus using ssh as some sort of
44 authentication.
46 The need for the "lazy" opening and closing of the tunnel is to avoid
47 wasting resources when not needed.