Sharing a Single bash Session
Problem
You need to share a single bash session for training or troubleshooting purposes, and there are too many people for “over the shoulder” to work. Or you need to help someone who’s located somewhere else, and you need to share a session across a network.
Solution
Use GNU screen in multiuser mode. The following assumes that you have not changed the default metakey from Ctrl-A as described in Recovering Disconnected Sessions Using screen. If you have, then use your new metakey (e.g., Ctrl-N) instead.
As the host do the following:
screen -Ssession_name(no spaces allowed); e.g.,screen -S training.Ctrl-A :addacl
usernamesof accounts (comma delimited, no spaces!) which may access the display; e.g., Ctrl-A:addacl alice,bob,carol. Note this allows full read/write access.Use the Ctrl-A:
chacl usernames permbits listcommand to refine permissions if needed.Turn on multiuser mode: Ctrl-A:
multiuser on.
As the viewer, do this:
Use
screen -xuser/nameto connect to a shared screen; e.g.,screen -x host/training.Hit Ctrl-A K to kill the window and end the session.
Discussion
See Recovering Disconnected Sessions Using screen, for necessary details.
For multiuser mode, /tmp/screens must exist and be world-readable and executable.
screen versions 3.9.15-8 to 4.0.1-1 from Red Hat (i.e., RHEL3) are broken and should not be used if you want multiuser mode to work. Version 4.0.2-5 or later should work; for example, http://mirror.centos.org/centos/4.2/os/i386/CentOS/RPMS/screen-4.0.2-5.i386.rpm ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access