Resources and References

Week 1

Week 2: The Shell

Week 3: The Filesystem

On Ubuntu you will need to install cifs-utils and devfs2 for cifs and WebDAV support, respectively.

Week 9 

Tmux session pairing

Remember, sharing your tmux session is by definition insecure: you are giving others shell access to your machine.  Never share a session from your primary user account (among other things you will give others easy access to your private SSH keys stored in ~/.ssh/), at the very least set up an unprivledged user with shared group access to a limited directory structure, but better yet use virtualization software such as Vagrant and VirtualBox to create a virtual environment.

There are two ways to share a tmux session with another user, using a shared account and using multiple accounts and a shared socket. I am going to give quick-reference for the shared account method here, google “tmux paired sessions” for more detailed explanations and other helpful resources, in particular the wemux project looks very promising. Though not directly related to pairing, another tool I have found useful is tmuxinator.

shared account

First, you will need to create a user account that will be shared, as previously mentioned, do not use your regular user account to share tmux sessions:

root@bobshost$ useradd -m tmux
root@bobshost$ passwd tmux
Enter new UNIX password:
Retype new UNIX password:

Remember, if you aren’t working as root you will have to preface system administration commands with ‘sudo’.

$ tmux new-session -s pairing

This created a new tmux session named ‘pairing’ and attached to it.

alice@wonderland $ ssh tmux@bobshost
tmux@bobshost's password:
tmux@host $

Alice has now connected to host as the tmux user, she now attaches to the existing tmux session

tmux@bobshost $ tmux attach -t pairing

You will notice that Alice and Bob share the cursor focus: If Bob creates a new window in the session and switches to it, Alice will notice that her cursor switches to the same window Bob is looking at. At any given time both Bob and Alice will be writing to the same pane and viewing the same window. It is often useful to share a session but allow other users to have a different view and focus. If Alice detaches from the session [prefix] d she can create a new grouped session:

tmux@bobshost $ tmux new-session -t pairing -s aliceview

Alice now created a new tmux session named ‘aliceview’ that is grouped with the original session ‘pairing’

tmux@bobshost $ tmux list-sessions
pairing: 2 windows (created Wed Oct 24 20:58:14 2012) [165x47] (group 0) (attached)
aliceview: 2 windows (created Wed Oct 24 20:59:17 2012) [125x23] (group 0) (attached)

At this point a third user could attach to one of the existing sessions, or create a new grouped session as above.

Leave a Reply