Linux Terminal: how to capture or watch other terminal session

前端 未结 9 931
伪装坚强ぢ
伪装坚强ぢ 2020-12-30 01:25

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

相关标签:
9条回答
  • 2020-12-30 01:47

    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

    0 讨论(0)
  • 2020-12-30 01:48

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

    0 讨论(0)
  • 2020-12-30 01:49

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

    0 讨论(0)
  • 2020-12-30 02:00

    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.

    0 讨论(0)
  • 2020-12-30 02:02

    Something nice and easy:

    watch -n 1 cat /dev/vcsa1
    

    watch -n 1 refers for the time to refresh.

    0 讨论(0)
  • 2020-12-30 02:03

    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.

    0 讨论(0)
提交回复
热议问题