Reese Knowledgebase

How to share ssh command line with someone via screen

View Kristian Reese's profile on LinkedIn

If you like this article, please +1 or Recommend via FB with the provided buttons above:

Article ID: 155
by: Reese K.
Posted: 17 Nov, 2014
Last updated: 17 Nov, 2014
Views: 1600

Use screen to share an ssh session

It's quite easy to share an ssh session with someone remote so that they can view the ssh session.  This process works well if everyone involved has root access.  Read further below if this is not the case.  To begin, screen must be installed to create the screen.  Once installed, create the screen as follows:

screen -L -S <session name>

Provide the session name to the person you wish to view the ssh session, and they can join this screen as follows:

screen -x <session name>

After the session is over, a .screenlog log is written, containing all the commands that were issued during the session.

For those limited to non-root, multiuser screen may be a solution.  It is well documented here:

Other tips I've found include using the script command.  I personally have not tried this one myself, but it looks like it should work depending on your use case:

$ script -t 1 /tmp/screencast

For those who wish to look on:

$ tail -f /tmp/screencast

This article was:   Helpful | Not Helpful
External links

Prev   Next
Resizing an Online Multipath Device     How to force NFSv3 via config files instead of mount options