tmux Remote Sessions, SSH, and Pairing

tmux patterns for remote servers, resilient SSH sessions, multi-client visibility, and collaboration workflows.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Remote persistence

Patterns for SSH, reconnecting, and long-running jobs.

Start or attach after SSH login

Create-or-attach workflow for remote boxes.

bashANYtmuxsshremote
bash
tmux new-session -A -s remote
Notes

`-A` attaches if the session exists and creates it otherwise.

Detach another client

Detach a specific attached client.

bashANYtmuxdetach-client
bash
tmux detach-client -t /dev/pts/1
Notes

Helpful when a stale client is still attached.

List connected clients

See who is attached and where from.

bashANYtmuxclients
bash
tmux list-clients -F "#{client_tty} #{client_session} #{client_activity}"
Notes

Useful for support, pair sessions, and debugging.

Lock a session

Require unlocking before use.

bashANYtmuxlock-session
bash
tmux lock-session -t remote
Notes

A simple security step on shared machines.

Pairing and collaboration

Shared work and safe broadcasting patterns.

Attach a read-only client

Observe a session without sending input.

bashANYtmuxpairingread-only
bash
tmux attach-session -r -t remote
Notes

Great for demos or passive observation.

Enable broadcast for paired commands

Send the same input to multiple panes in a window.

bashANYtmuxpairingbroadcast
bash
tmux setw synchronize-panes on
Notes

Useful for multi-host orchestration demos.

Disable broadcast again

Turn off synchronized typing.

bashANYtmuxpairingbroadcast
bash
tmux setw synchronize-panes off
Notes

Important to avoid accidental fan-out commands.

Recommended next

No recommendations yet.