List pages History

How To Termcast

This document describes some ways to share your terminal session using

Using ssh and script

Tested with OpenSSH, but should work with any ssh client. script is usually available in Linux (as a part of util-linux) and OS X.

Choose a temporary username starting with =. I'll use "=jason" for this example. Run 'check':

$ ssh check
The authenticity of host ' (' can't be established.
RSA key fingerprint is SHA256:JvWo1jqg5jYBkHuiKsBjlI26r/eOw3uFhaNOTgfWImQ.
Are you sure you want to continue connecting (yes/no)? yes
Everything looks good.

Create a FIFO and connect it to using ssh:

$ mkfifo termcast.pipe
$ ssh broadcast --script < termcast.pipe > termcast.log &

You can use broadcast --script --record instead to create a recording of your session.

Run script to start the shell in a shared terminal session:

$ script -q -f a.pipe -c 'sh -ic "PS1=tc\ \$PS1 exec bash --norc"'
tc $

When done, exit the shell to quit the shared session:

tc $ exit
[1]+  Exit 255                ssh broadcast --script < termcast.pipe > termcast.log

Using tmux

Choose a username and maybe run check as described above. Then, in tmux session:

$ tmux pipe-pane 'ssh broadcast > termcast.log'

... to start sharing your session, and tmux pipe-pane (without paramters) to stop sharing. You can bind that to a couple of hotkeys in tmux, or just use the commands.

Deprecated Legacy Protocol

Finally, if you don't care about security at all, you can use old broadcasting protocol. It's still supported for legacy clients. You need to choose a temporary username (we'll use jason for this example), and a temporary password (we'll use fredfred here). Then, make a FIFO as described above, and use nc (netcat of some sort) to start sharing:

$ (echo hello jason fredfred; cat) < termcast.pipe | nc 31337 > termcast.log &
$ script -q -f termcast.pipe -c 'sh -ic "PS1=tc\ \$PS1 exec bash --norc"'
tc $
Revised on June 13, 2019 19:51 by admin