server-access
Manage the access-control list for the tmux socket, so other users can attach read-only or read-write. The server's owner and root always have access. File-system permissions on the socket must still be set manually.
How server-access works
server-access controls which other users on the same machine may connect to your tmux server. It exists for pair programming and teaching: you can let a colleague attach and watch read-only, or let them type too.
-a gives a user access and -d takes it away, detaching them if they are attached. -r makes their clients read-only and -w makes them writable. -l lists who has access. The user who owns the server and root always have access and can't be changed.
The access list is only half of it. By default tmux creates its socket so only you can reach it, so you also need a socket in a shared place with suitable file permissions.
Synopsis
tmux server-access [-adlrw] [-t target-pane] [user]Options
| Flag | Description |
|---|---|
| -a | Add the user to the access list |
| -d | Remove the user from the access list |
| -r | Give the user read-only access |
| -w | Give the user read-write access |
| -l | List the current access list |
Examples
Allow alice to attach read-write
tmux server-access -aw aliceAllow bob to attach read-only
tmux server-access -ar bobRevoke bob's access
tmux server-access -d bobStart a server on a shared socket, let the devs group reach it, and give alice read-only access. She joins with tmux -S /tmp/pair attach -t pair.
tmux -S /tmp/pair new -d -s pair
chgrp devs /tmp/pair && chmod g+rw /tmp/pair
tmux -S /tmp/pair server-access -a -r aliceList who currently has access to that server.
tmux -S /tmp/pair server-access -lDefault Keybinding
server-access has no default key. Run it from a shell as tmux server-access, type it at the command prompt (Ctrl+b then :), or give it a key with bind-key.
Common Mistakes
- Adding a user does nothing until they can reach the socket. Start a server on a shared path with -S and give their group access to that file.
- Read-only users can still see everything on screen, including passwords you type or secrets you print. Only share with people you trust.
- It needs tmux 3.3 or later on the machine running the server.
Pro Tips
- •Pair-program safely by granting read-only access to a shared socket
- •Still set socket file permissions (e.g. via -S) so others can reach it