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.
Get it:
$ 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)
You can do the same thing with screen. If you run:
screen bash
And then have the second (or third, or fourth) user run screen -x they will share your bash session.
Scott:
Right. Been using ‘screen’ since a couple of years. This is just a preference, that’s all. Just to note, window/layout splitting/session management is a little more convenient in tmux.
Pingback: Links 20/8/2011: Linux Graphics Survey, Firefox 7 Beta | Techrights