Pairing with Separate Accounts and Sockets

Using tmux’s support for sockets, we can create sessions that multiple users can connect to with ease.

First, let’s create two new user accounts for the session: one called “ted” and another named “barney.”

 
tmux@puzzles$ ​sudo adduser ted
 
tmux@puzzles$ ​sudo adduser barney

Next, we create the “tmux” group and the /var/tmux folder we’ll use to hold the shared sessions.

 
tmux@puzzles$ ​sudo addgroup tmux
 
tmux@puzzles$ ​sudo mkdir /var/tmux

We change the group ownership of the /var/tmux folder so that our tmux group has access:

 
tmux@puzzles$ ​sudo chgrp tmux /var/tmux

Then we alter the permissions on the folder so that new files will be accessible for all members of the tmux group:

Get tmux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.