[HOME(Mark Whitis)]
[Contact]
[Resume]
[Browser Friendly]
[No Spam]
[FEL]
[DBD]
Official Home page for the manyterm software package
Manyterm is a program which runs on a linux (or other un*x) system
and allows multiple telnet connections to the same processes. It's
function is roughly opposite to the popular program "screen" which allows a
single terminal to control multiple processes.
Features
- Allows multiple telnet sessions, plus optionally the standard input
and output of the manyterm program itself, to share the standard input
and output/error of any unix program.
- Works for command line programs and some full screen text mode programs.
- Anything typed on any of the keyboards appears as standard input
to the program being executed by manyterm.
- Anything output to standard output or standard error by the program being
executed will be sent to all of the terminals.
Limitations
- A slow or erratic connection from one of the remote "terminals" will
cause problems. It will probably slow down all of the "terminals".
- No terminal translation is performed. So all of the terminals
must be reasonably compatible. However, vt100 is a pretty reasonable
common denominator to use.
- Applications which poll the terminal may be confused by the
results. For example, if the application asks the terminals what
type they are or how many lines they have, it will get multiple
answers (perhaps different) where it expected only one. Surprisingly,
this has not seemed to be much of a problem so far (I guess curses
is fairly smart).
Applications
Manyterm has many uses. Here are some example applications:
Running manyterm
Running the program with the option "help" will give the following response:
Invalid command line syntax
Usage:
manyterm [var=value ...]
Where var is one of
command="bash" Command to execute
use_parent_stdin= 0 Enable input from parent process stdin
use_parent_stdout= 0 Enable output to parent process stdout
debug= 0 Debug level, 0=none
use_pty= 1 1=Use pty, 0=use pipe
wait_conn= 0 1=Wait for first connection
port= 1234 TCP/IP Port # to use
show_settings= 0 1=show these settings
Explanations of each of these variables follows.
- command
- This is the command to be executed. The command is executed using
system() so it can include shell commands. Note that the command
is supplied by a user at the same level of trust as the program
will be executing so the use of system() should not be a problem
here.
- use_parent_stdin
- If this is set ("1" or other non-zero value), then the standard
input to the manyterm program will be forwarded to the command being
executed. Used in conjuctin with use_parent_stdout, this allows you
to use the terminal from which manyterm was invoked as one of the
many connected terminals. When used with redirection, you can
provide initial input (such as a sequence of initial commands).
- use_parent_stdout
- If this is set("1" or other non-zero value), then the output of
the command being executed will also be copied to standard output.
This can be used with redirection (or piped through "tee") to
produce a log opf all activity.
- debug
- If this is set to a value greater than 0, the program will print
various debugging messages. Larger values will print more detail.
- use_pty
- If this is set, the program will use a pty (psuedoterminal); otherwise,
it will use a pipe for the standard input, standard output/standard error
of the program being controlled. This is necessary because some programs,
including shells, mail programs, and ls, behave differently if their
standard input/output is not a terminal. One of the common modes of
misbehavior is not displaying a prompt.
- wait_conn
- If set, the program will wait for the first incoming connection
before running the program specified by the "command" variable. If
neither this nor "use_parent_stdout" is set, the initial output of
the program will be lost.
- port
- This sets the TCP/IP port number the program will listen on.
Typically, you must be root to specify a port <1024.
- show_settings
- If this value is set (to 1 or other non-zero value), the program
will show the settings.
Downloading manyterm
manyterm-0.51.tar.gz
Unincorporated changes
There are some changes made to other versions of this program that
I have not yet incorporated. These include password checking and telnet
options processing.
Documentation
You are reading it.
Security Implications
There are a number of security implications.
- This program was originally written many years ago when the internet
was a friendly place, under severe time pressure, and was intended to
be used only by trusted users.
- Passwords sent in clear text over an unsecure network are a really
bad idea. Use an SSL proxy daemon, SSH port forwarding, a secure IP
tunnel, or a network topology which does not permit snooping to
protect your connection from prying eyes and hijacking.
- This program can be configured to allow remote shell access on ports
which may not be blocked by a firewall. Use this program,
or any other program which allows remote shell access, only with
the approval of your system and network administrators.
- This program allows you to enable remote access to a program
which was not designed for remote access; it is very likely that that
program will have security holes.
- In many applications, it will make sense to run this program
as an untrusted user in a chroot() environment.
- There is at least one security hole. :-)
- Seriously, this version is vulnerable to buffer overflows from
bogus reverse DNS data.
- Yadda, Yadda, Yadda.
An exmaple
This program illustrates many advanced programming features
on Linux and similar un*x flavored operating systems
- pipes
- psuedo-ttys
- select()
- fork()
- Setting controlling tty
- Signal handling
- non-blocking I/O
- socket(), bind(), listen(), accept(), gethostbyname(),htons()
- dup(),dup2().
- setjmp()/longjmp()
Not too bad a list considering that this one of the first, probably the first,
un*x specific programs I ever wrote.
It also illustrates some more mundane features:
- Command line argument parsing using a primative symbol table.
(This was a very early version of my symbol table library).
- system()
- telnet option processing
Copyright/License terms
This software is copyrighted and distributed under these
license terms. For the purpose of the license, "primary author(s)" and "maintainer(s)" are defined to be Mark Whitis.
History
Manyterm was originally written to allow another program to splice
in to a "terminal" session and inject commands as if they were typed by
the user. This allowed the software I wrote to control one astronomical
instrument (a type of spectrometer) to take over control of the software
which controlled another astronomical instrument (an infrared camera) and
the software which controlled the telescope.
Manyterm was originally written around 1993. It sat around gathering
dust (although I used the program and stole code from it)
until I got around to cleaning up a bit for public release in 1999.
Other peoples misguided GPL fanaticism, absurd US cryptographic
export policy, and criminal actions by the Internal Revenue Service
all contributed to the delay in the release of this software.
This software was originally developed on SPARCstation hardware (running
SunOS) donated by Sun Microsystems and provided for my use by the
National Air and Space Museum.
Linux Programming Unleashed
This program will be used as an example program for a book I am coauthoring
on for Macmillian Computer Publishing (Sams) entitled Linux Programming Unleashed.
This file is maintained by
Mark Whitis
(whitis@freelabs.com).
Senior Engineer for hire
Software Development
- Electronic Design
- Embedded Systems
- Device Drivers
- System/Network Administration and Security
- Motor Control, RobotCNC
- Linux/Un*x
- 25+ years experience
The author of these pages is looking for a new gig.
[RESUME]
|
|
Engineers and electronic hobbyists: The new
Open Symbol Project
is creating open schematic symbols and PCB footprints
for a variety of different CAD packages.
|
All email messages received must pass the
turing test or they will be considered SPAM. If it could have been written
by a machine, it was.
Under no circumstances are you to email me with questions regarding windoze,
any other microsoft operating system or application, or any software which
runs under any form of windoze.
*