This program was written to provide -L and -R like options in ssh(1) for
It uses a client program and a server program (just same program with different
options) to provide this feature.
Client program (launched from your machine) launch a ssh to your server (you
can change launched program using --shell options).
In your server launch the program with --server options, this launch a shell.
Now you can do whatever you want and use your port redirected !!!
For technical info see note.txt, to sum up server and client detect some
special format in normal flow that are threated like data from sockets or
One of the main use it's to use in a compile farm to test some client program
without installing server one (for example cause you can't install it or it's
too heavy... consider a proprietary database).
This program was originally written in Perl and after a while translated to C
with additional feature (like pseudo terminals). See shtunnel and shserver
perl file (not compatible with C version).
Classifier utility was written to distinguish single output/error streams.
I find it useful for scripting of support multiple stream even when
only a single stream is given.
Currently I use mainly classifier utility, more than original shtunnel.
To use CUSE you have to load cuse module and make classifier suid root (or
launch as root but I prefer the first, permission are lost after
With --no-buffering can be used even to run interactive bash.
Version 0.1.13 - 2012-04-26
add --times option to print time
add note.txt to distribution
Version 0.1.12 - 2012-02-27
pass SIGINT to child in classifier
use CUSE if possible in classifier
Version 0.1.11 - 2008-01-16
don't pass log file to child process
fix mode setting on tty
fix html output with span not closed
Version 0.1.10 - 2007-12-28
use colors in style for additional streams
Version 0.1.9 - 2007-05-27
added automatic test
use controlling tty instead of stdin (which can be redirected)
Version 0.1.8 - 2007-04-22
reset color changing stream
reset color on exit
Version 0.1.7 - 2007-01-01
fix < /dev/null redirection
add --byte-limit option to classifier to stop if data is too long
Version 0.1.6 - 2006-08-13
small fix for HTML output
add --log-file option
support colors for more than 2 streams
Version 0.1.5 - 2006-04-15
support for HTML output in classifier
Version 0.1.4 - 2006-03-25
added classifier utility
Version 0.1.3 - 2006-03-11
better support for SIGCHLD
support multiple parameters
read all data even after SIGCHLD
Version 0.1.2 - 2004-11-03
pass child code exit to allow scripting
fix compatibility for debian and SunOS4
Version 0.1.1 - 2004-10-28
fixes for closed connection
ip specification for -L
more options (magic char, blocking data limits)
more than 255 channels ??
ip v6 ??
port to win ?? Use cygwin
ftp emulation ??
long output should not be truncated for buffer problem, consider
./src/shtunnel -L 12345::23456 localhost cat $PWD/src/shtunnel.c
using this command server seems to not catch all characters
(connect and hit some char like 'qqqq' without enter)
./src/shtunnel -L 12345::23456 localhost -- $PWD/src/shtunnel --server
The problem is that ssh launched by client have tty not in raw mode so
it wait for enter to get line and send to server pipe (it do not create
a pty for server cause it do not use pty to execute commands)
A workaround it to use -t option to ssh (--shell 'ssh -t')