Gnu Screen Pairing Notes
GNU screen allows 2 or more users to control a terminal screen.
Screen only needs to be installed on the host machine. The client machines only need a terminal emulator, such as xterm, Apple Terminal.app, or GNOME Terminal, and an ssh client such as openssh (unix) or putty (Windows.)
Since the guests need to ssh into the host machine, this is simplest to set up when the host machine is not behind a NAT router. NAT routers are in the broadband modems used by many homes and small businesses. For example, you could use a virtual machine cloud server.
This 2011 guide from Siyelo covers a couple of options to set up and partially automate multiuser GNU screen for pairing.
This kuro5hin blog introduces some of screen’s useful features and keystrokes.
There is a handy reference page for the multiuser feature at aperiodic.
Here is how one Agile Ventures engineer configured a Debian 7.1 cloud machine to host a Rails pairing session.
- Copy a public ssh key from the guest’s computer. We copied the text from the
~/.ssh/id_rsa.pubfile in the guest’s Ubuntu VM.
- Now on the host machine, the Debian 7.1 Linux machine in the cloud, create a new user, as superuser with this command:
- Now become the new user,
su - marian
cat >> .ssh/authorized_keys2
- Paste the public key you copied from the guest’s own machine into the terminal. Then press control-D
cat ssh/authorized_keys2to check that the key pasted in ok. It is important to check that you did not introduce any line breaks during the copy-paste operation. Exit back to the superuser (root) account.
- As root, install GNU screen
apt-get install screen
- Add the set-uid bit to screen
chmod 4755 /usr/bin/screen
- Return to your own user account (in our case
david2) on the host machine.
- Adjust the terminal window to a reasonable size, as this will be the layout that all the guests will see.
- Start or resume a screen session (the
-Llogs the session)
screen -R -D -L
- Set up multiuser and add permission for the guest user with the next two key sequences. Don’t forget the colon after control-A.
- The following steps are on the guest’s client PC.
- Log in to the guest account on the cloud machine, for example
- Join the host’s screen session by including the host’s username in the following command. The slash at the end is important:
screen -x david2/
- With a bit of luck, you should be sharing control of a terminal from which you can run console programs and full screen editors like
emacs. You could even install
linkswhich is a terminal web browser.