user149513
user149513

Reputation: 1732

Linux Terminal: how to capture or watch other terminal session

Let say, I access to a server using ssh. In the same time, there is another person accessing that server.

Is it possible to watch what is going on in that person's terminal. Meaning, Can I just watch what he is typing?

Upvotes: 23

Views: 110015

Answers (10)

William Stein
William Stein

Reputation: 2515

In CoCalc the Linux terminal are all collaborative. You can watch the other person type, you can also type, and there is a chat on the side for discussions. See https://cocalc.com/features/terminal and also you can install https://github.com/sagemathinc/cocalc-docker on your own server (so you don't need to use cocalc.com).

Disclaimer: I mostly wrote these terminals, since I wanted to be able to collaboratively use command line math software.

Upvotes: 0

Roberk20
Roberk20

Reputation: 29

Something nice and easy:

watch -n 1 cat /dev/vcsa1

watch -n 1 refers for the time to refresh.

Upvotes: 2

David Cary
David Cary

Reputation: 5490

To capture what Alice types in a terminal, and then the next day let Bob see what was typed -- without any risk of Bob accidentally typing anything into that terminal -- Alice can type "showterm" ( http://showterm.io ) in her terminal window to start the recording.

To share a terminal so Alice and Bob both see "the same" terminal window and can both type commands into that window, there seems to be three popular methods: Byobu, tmux, or screen.

(tmate is a fork of tmux that works just as well, perhaps better).

Upvotes: 3

Benji York
Benji York

Reputation: 2050

If you want to share a session on a machine behind a firewall or NAT, you can use the open-source terminal sharing program Termbeamer.

Upvotes: 1

estani
estani

Reputation: 26487

I also use an approach similar to what Maze said. This is a unidirectional sharing with read-only for the guest. This is how it works:

1) The host starts the script command writing somewhere where the guest has read access and set the permits as required, for example:

$ script -f /tmp/shared_screen
Script was started....
$ chmod 640 /tmp/shared_screen
$ chgrp shared_group /tmp/shared_screen

The -f flushes the contents permanently so you'll have a very low delay

2) The guest starts dumping the content of the file:

$ tail -f /tmp/shared_screen

In this case -f causes tail to wait on more output from the file. Use ctrl-C to stop displaying the file contents.

Upvotes: 7

Maze
Maze

Reputation: 726

You can use the small tool script for logging the terminal into a file. The observing party can simply tail -f that file to follow.

This is a much simpler approach, but it works very nicely for most cases

Upvotes: 4

Coder of Salvation
Coder of Salvation

Reputation: 11

Well depending on whether its for 'live' or 'ondemand' purposes, you could replay it online with a service like www.playterm.org.

Upvotes: 1

Patrick
Patrick

Reputation: 4377

You can also try "cat /dev/vcsa1"

Upvotes: 1

Ryan C. Thompson
Ryan C. Thompson

Reputation: 42020

If you mean that the other person wants you to see his console, you two can use screen to share a terminal. See http://www.gnu.org/software/screen/manual/html_node/Multiuser-Session.html for a full description of how to do it.

Upvotes: 14

Martin v. Löwis
Martin v. Löwis

Reputation: 127467

If the other person is using the Linux console, you can use conspy.

Upvotes: 16

Related Questions