Remote "command prompt" (pseudo-telnet) over HTTP

HTTP is capable of far more than merely serving web pages. It is indeed 9P for the rest of us. For example, HTTP can trivially support a "remote shell" connection, even between alien platforms (e.g, Mac, UNIX, WinNT). It is fascinating how simple the implementation is, especially considering the power it offers.

A "frameset" below is a snapshot of a remote shell session: a browser running on a Mac displaying a web form fetched from a Linux box; the form's ACTION is a do-sh.pl CGI script on a WinNT server being executed by IIS.

Like the ordinary rsh, this facility does not maintain a true remote session, with persistent current directory and other environment. Still do-sh.pl does keep a session log, of all executed commands and their results. The script runs under UNIX as well as WinNT. To an extent, the script lets you manage a remote (e.g., WinNT computer) through a web interface: you can enter 'net view', 'net users', 'net share', 'dir \\enterprise\temp', 'del', etc. WinNT commands on a target computer from any Web browser. Provided that the target box grants necessary privileges to do-sh.pl. Fortunately, we do not have to carry the burden of authorization, authentication, etc. ourselves -- we simply rely on the extensive facilities already built into every HTTP server.
 

Your session file

Display lines of your session file
Clear the log before running the command



>>>> net view
Server Name            Remark
----------------------------------------------------------------
\\DOUG
\\ENTERPRISE
\\NT-NITES
\\PCGINT
The command completed successfully.


>>>> dir \\enterprise\temp
 Volume in drive \\enterprise\temp is MICRON
 Volume Serial Number is 4109-1B07
 Directory of \\enterprise\temp

09/02/97  01:08a        <DIR>          .
09/02/97  01:08a        <DIR>           ..
04/28/98  04:49p                10,752 ~DFD6F2.tmp
04/27/98  04:22p                10,752 ~DF6E4A.tmp
04/28/98  06:34a                     0 ~DFD760.tmp
03/09/98  11:45a                 1,099 mso254.csv
12/23/97  08:05a        <DIR>           VBE
04/29/98  06:36a                10,752 ~DF8987.tmp
04/29/98  06:36a                     0 ~DF89C3.tmp


 
 
Version
 The current version is 1.3, May 1998.
References
 

do-sh.pl script itself [.pl, 5K]

The source of this present page includes a web form to call the above CGI script from.
 

Other references
 
"Announce: HTTP VFS: Midnight Commanding remote *WinNT* files",
A USENET article posted on comp.os.linux.development.system, comp.infosystems.www.misc, comp.os.linux.misc, comp.client-server, comp.os.misc, comp.os.ms-windows.networking.misc newsgroups on Sun, 17 May 1998 19:55:18 GMT.

 


Last updated July 4, 1999

This site's top page is http://okmij.org/ftp/

oleg-at-okmij.org
Your comments, problem reports, questions are very welcome!