Skip to main content
Browse referenceAll guides
Back to Commands
Servertmux 3.3+

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

bash
tmux server-access [-adlrw] [-t target-pane] [user]

Options

FlagDescription
-aAdd the user to the access list
-dRemove the user from the access list
-rGive the user read-only access
-wGive the user read-write access
-lList the current access list

Examples

Allow alice to attach read-write

bash
tmux server-access -aw alice

Allow bob to attach read-only

bash
tmux server-access -ar bob

Revoke bob's access

bash
tmux server-access -d bob

Start 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.

bash
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 alice

List who currently has access to that server.

bash
tmux -S /tmp/pair server-access -l

Default 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