I recently started using tmux, a terminal multiplexer much similar to GNU screen(which I still use on a lot on RHEL machines). Personally, I find tmux more elegant and less cryptic while configuring. Specially, sharing interactive(or read-only) ssh sessions w/ remote folks for debugging is very trivial.
$ yum install tmux -y
Create a tmux session(let’s say on testbox1) by specifying path to a socket(its name can be anything)to be used:
$ tmux -S /var/tmp/share-ses # Where -S is the absolute path to the server socket.
Now, to share the above created session w/ a remote user, ask the person to ssh into testbox1, and then try the below for sharing a session interactively or read-only mode:
- Read/Write session, so that both users can interactively edit on the shell:
$ tmux -S /var/tmp/share-ses attach
$ tmux -S /var/tmp/share-ses attach -r # Where r is 'read-only' mode for the remote user, # so he/she can just 'watch' the session.
To detach from the session: $ tmux detach (or use the binding — Ctl+b d when in ‘read-only’ mode)