SHTunnel
This program was written to provide -L and -R like options in ssh(1) for
normal shell.
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
control informations.
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
initialization).
With --no-buffering can be used even to run interactive bash.
NEWS
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
- support redirection
- 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
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
- SIGCHLD handled
- fix compatibility for debian and SunOS4
Version 0.1.1 - 2004-10-28
- fixes for closed connection
- Solaris portability
TODO
- no-blocking connect
- ip specification for -L
- man page
- more options (magic char, blocking data limits)
- more than 255 channels ??
- ip v6 ??
- port to win ?? Use cygwin
- ftp emulation ??
- tests
-
- 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')
- strace -s 200 -f -o xxx.log ./shtunnel --shell "./shtunnel --server --shell cat" "./shtunnel.c" | md5sum
- "shtunnel --shell ssh localhost " not duplicate new lines and reset correctly line
DOWNLOAD
shtunnel-0.1.13.tar.gz (155kb) [md5=47445824f329e214543c8820ad6704e2 clicks=94].
shtunnel-0.1.12.tar.gz (152kb) [md5=c5d646a39972a1232ca4c7d47e85ab4a clicks=84].
shtunnel-0.1.11.tar.gz (130kb) [md5=137c31cccd53b30f6b186b214532f703 clicks=380].
shtunnel-0.1.10.tar.gz (131kb) [md5=0d77cd98477cb2fbc1e474c5bc22b868 clicks=318].
shtunnel-0.1.9.tar.gz (127kb) [md5=deedbad86ee729ba9275c23750a94fd9 clicks=356].
shtunnel-0.1.8.tar.gz (126kb) [md5=62b2c928b0e244d4bc56a5f156791cee clicks=380].
shtunnel-0.1.7.tar.gz (123kb) [md5=96c2168c842f0f30da02bf46c1b2c9e5 clicks=353].
shtunnel-0.1.6.tar.gz (122kb) [md5=2183e8fb749992ebbc715d6b5c21b70e clicks=344].