Can a putty terminal window be made viewable in a web browser

browserputtyssh

I often remotely connect via putty to client computers over ssh.

I would like to share my putty session so the client can see the commands I'm running from a web browser.

Is this possible to do?

Note I know it's possible to share a window using the Linux screen command.

Best Answer

One way you can do this is saving the terminal session into a file and then accessing that file with a browser. Since your question gives very little information about your setup, I will assume that i) you are connecting to *nix clients, ii) the client can serve a webpage.

The main tool here is a program called script :

 script makes a typescript of everything printed on your termiā€
 nal.  It is useful for students who need a hardcopy record of an
 interactive session as proof of an assignment, as the typescript
 file can be printed out later with lpr(1).

You can install on Debian based distros using

sudo apt-get install script

Then create a simple HTML file on the remote machine with the following contents and save it as output.htm (make sure it is accessible from the internet):

<html>
<head>
 <meta http-equiv="refresh" content="2"> 
</head>

<body>
<pre>

The <meta> tag makes the page refresh every 2 seconds and the <pre> tag ensures that new lines and spaces are displayed correctly.

Now, once you log on to the remote machine run script -af output.htm. That will append (-a) a transcript of your terminal session to the file output.htm. Your client can then access http://remote.server.com/output.txt and watch the commands as they appear.

CAVEATS:

If you use colored output in your terminal, the ANSI escape sequences that make the colors will be visible in your html output.