Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
yes its possible... there is a package in Mint's software repo that does this. If I come across it, ill post it. –  Keltari May 14 '13 at 3:24
    
possible duplicate of How can I share a single application window with TightVNC? –  Kyle Jones May 14 '13 at 4:20
    
Can we assume that you are connecting from a windows machine to a Linux server? And that you have root access to the Linux machine? Is there a webserver running on the client Linux machines? –  terdon May 14 '13 at 10:07
    
Yes I'm connecting to Linux from Windows via putty. Yes I have root. And yes a webserver is running. –  anongeek May 14 '13 at 19:15
add comment

1 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> tage 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.

share|improve this answer
    
Thank you terdon. I was hoping to be able to show terminal window activity in real time inside the browser. But this may be an alternative. –  anongeek May 14 '13 at 19:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.