SharingTerminals

Remote Joint Sessions

or how to share a terminal with several other users

In May 2004 someone asked the following question on the mailing list: "At one of the Saturday Slug meetings each laptop had a view of the speaker's monitor while he worked the app he was talking about (I think it was vi). I guess this was done via something like VNC. Paul configured my computer in a few seconds and I did not see what he did.

If there is a how to somewhere I would be grateful for the URL - or a quick explanation."

Paul Brook replied:

"I ran x0rfbserver on one machine, and xvncviewer on the other. On debian these are in the rfb and xvncviewer packages respectively.

If you just want a terminal you could try screen. "screen" starts a new session, and "screen -x" joins an existing session."

Since then I have been looking around and have two more methods which are both terminal only. I summarise what I have found about all the methods.

screen

The suggestion of using screen lead me to make the unfortunate mistake of reading its man page. It all looked so obscure that I dropped the program immediately. It was some time later that I took another look and just followed Paul's two line instruction. It is that easy.

MarkRound has written some detailed notes on ScreenGuide

x0rfbserver/xvncviewer

To be written - unless anyone else can fill this space?

kibitz

This is installed by default in my Mandrake 10 so I guess it is a fairly standard program. It is dead easy to use. Two users both log into the same host. user1 enters: $kibitz user2

   asking user2  to type:  kibitz -3614

$ The process number will be different every time you run the program. The second host displays:

   Message from user1@example.com on pts/2 at 22:19 ...
   Can we talk? Run: kibitz -3614
   EOF
   Escape sequence is ^]

$ Now you can both type commands (at the same time if you want!) and share a session. The main disadvantage is the danger of conflicting inputs. Maybe this is how the program was named - Bridge players will know that a kibitzer is strictly a silent observer and nothing more. The other problem is that the program only works between two users - no more. As the whole session is run through ssh it should be reasonably secure. I can see no practical differences between kibitz and screen apart from screen's ability to handle at least four users that I tried.

mkfifo and script

This method is described in man script. The mkfifo command will create a pipe (foo) and the script command will send the output to a file (foo or the default name typescript). Adding -f to script will flush the output after every write rather than saving it for a single write at the end of the session. The commands will be: $ cd /tmp $ mkfifo foo; script -f foo

   Script started, file is typescript

$ .........session ............. $exit

   Script done on Wed Jun 30 23:34:36 2004

The other user logs in from the other computer and enters: $ cat /tmp/foo He can now watch whatever is happening on the remote monitor ... or should. This app can be a bit erratic and half the time the session has to be killed. I have not tried it but there is no reason this should not work on several machines at once. Do not forget to delete the files in /tmp before you attempt another session with the same names.

ssh -X

I'm still wondering if this can be done with ssh and a shared DISPLAY number. Can anyone add to this or if it cannot do the job leave a note explaining why?

ssh -Y

Lets you run FireFox on a remote PC via SSH

Tags: