How to: Snoop / View Other Linux Shell User Typescript of Terminal Session

Get real time updates directly on you device, subscribe now.

Q. How do I make typescript of terminal session for training purpose or just to monitor other user terminal under Linux?

A. Use script command. It makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment or use this tool to demonstrate some concepts.

Login as student and type the following two commands:
$ mkfifo hardcopy
$ script hardcopy

Login as instructor and type the following command to view typescript of terminal session for student user:
$ cat /home/student/hardcopy

Now anything typed by user student, including all commands and other sessions, will be displayed to the instructor user screen. Use this trick to demonstrate Linux configurations and command usage to student or just to monitor their activity in a classroom.

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Get real time updates directly on you device, subscribe now.