UNIX FAQ Version 2.1 92/12/04 -- Question 4.11

UNIX FAQ Version 2.1 92/12/04 -- Question 4.11

Is it possible to "spy" on a terminal, displaying the output that's appearing on it on another terminal?

There are a few different ways you can do this, although none of them is perfect: * kibitz allows two (or more) people to interact with a shell (or any arbitary program). Uses include: - watching or aiding another person's terminal session; - recording a conversation while retaining the ability to scroll backwards, save the conversation, or even edit it while in progress; - teaming up on games, document editing, or other cooperative tasks where each person has strengths and weakness that complement one another. kibitz comes as part of the expect distribution. See question 3.9. kibitz requires permission from the person to be spyed upon. To spy without permission requires less pleasant approaches: * You can write a program that grovels through Kernel structures and watches the output buffer for the terminal in question, displaying characters as they are output. This, obviously, is not something that should be attempted by anyone who does not have experience working with the Unix kernel. Furthermore, whatever method you come up with will probably be quite non-portable. * If you want to do this to a particular hard-wired terminal all the time (e.g. if you want operators to be able to check the console terminal of a machine from other machines), you can actually splice a monitor into the cable for the terminal. For example, plug the monitor output into another machine's serial port, and run a program on that port that stores its input somewhere and then transmits it out *another* port, this one really going to the physical terminal. If you do this, you have to make sure that any output from the terminal is transmitted back over the wire, although if you splice only into the computer->terminal wires, this isn't much of a problem. This is not something that should be attempted by anyone who is not very familiar with terminal wiring and such.