1. Screen Notes
screen is a screen multi-plexing program; it allows you to have several terminals within a single terminal and to detach and attach a session, all while keeping the multiple terminals running.
1.1. Multi-User Mode
One of the least-used features of screen is the ability for multiple users to be attached to a single session, which is very useful to teaching or pair programming. The problem, however, is that screen must be SUID root, which for a complex package like this can be dangerous. If you've got root on the system anyway, I would recommend toggling the SUID bit on only when you need it.
In the examples, we'll call the session name test. We'll also refer to user1 and user2--the former will be the person who first starts screen and under whose UID all the processes will run. user2 will be the person who attaches to the session started by user1.
-
After setting the binary SUID root, user1 starts up a screen session. You probably want to give it a name to make it easier to connect to.
user1$ screen -S test
-
Enable multi-user mode by first typing Ctrl-A : to enter command-mode (like ex-mode in vi) and typing
: multiuser on
-
Add user2 to the list of allowed users to connect, again prefixing with Ctrl-A ::
: acladd user2
-
user2 now connects to the session with:
user2$ screen -r user1/test
1.2. Multi-Display Mode
Multi-display mode is kinda neat. It may be useful in remotely walking another admin through a particular setup or monitoring the work of a junior admin. To use it, simple connect to an existing session with the -x option. For example,screen -x test
Note that if you are using su or sudo to become root without a full login (i.e., su -), screen will look in the wrong place for the session FIFO; you'll have to use other options to point it to the right place.
