Workflows remote - uhop/dotfiles GitHub Wiki
Day-to-day remote access. For one-time SSH and machine setup see Setting Up a New Machine. For tmux configuration see Application Notes. For running GUI programs on a remote host and displaying them locally, see Remote GUI.
All remote-access helpers attach to (or create) a tmux session on the remote host, so disconnections do not kill running commands.
| Command | Transport | Notes |
|---|---|---|
ssht host [session] |
SSH | Primary choice. Works everywhere. |
mosht host [session] |
Mosh | Better on high-latency or unreliable links. |
ett host [session] |
Eternal Terminal | Survives IP changes and sleep/wake. |
kssht host [session] |
Kitty SSH + tmux | Uses Kitty's built-in SSH (kitten ssh). |
The default session name is ssh_tmux. Using the same name from multiple connections shares the session. Detach with Ctrl+b d without closing it.
When running tmux both locally and on a remote host, Ctrl+b is captured by the local session. Press Ctrl+b twice to send the prefix to the inner (remote) session. For example, to detach the remote session without affecting the local one: Ctrl+b Ctrl+b d.
For managing multiple remote hosts โ maintenance playbooks, script deployment, file transfers โ see Playbash Server Management.
Prerequisite: every host in the playbash inventory must be reachable via passwordless SSH with connection multiplexing. Both are configured by this project โ see Setting Up a New Machine ยง SSH.
Quick reference:
| Command | What it does |
|---|---|
playbash run all daily |
Run the daily maintenance playbook on all hosts. |
playbash run all weekly |
Run the weekly maintenance playbook on all hosts. |
playbash exec all -- "command" |
Run an ad-hoc command on all hosts. |
playbash push all ./script.sh |
Upload and run a local script on all hosts. |
playbash put all local remote |
Transfer a file to all hosts. |
playbash log |
View the latest run log. |
Playbash relies on two SSH features configured by this project:
-
Passwordless key-based access. Every host in the inventory must accept key authentication without a password prompt. By default, playbash detects interactive
sudo/doas/password prompts and kills the connection to avoid hanging playbooks. For hosts that need a sudo password, pass--sudoโ playbash prompts once and injects the password when sudo asks (see Playbash ยง Sudo support). -
Connection multiplexing. The
ControlMaster auto/ControlPersist 5msettings in~/.ssh/configallow playbash to reuse a single connection per host across multiple operations (pre-flight check, playbook run, sidecar fetch, file transfers). Without multiplexing, each SSH invocation performs a full handshake, which slows fan-out significantly and can trigger rate limits on hosts withMaxStartupsset.
Other considerations:
-
Vanilla hosts (in the inventory, without chezmoi) get playbooks auto-pushed to
~/.cache/playbash-staging/, and their status line says(pushed). They still need passwordless SSH access, andpython3forrun,push, andexec. A host the inventory does not list is refused. -
Passwordless privilege escalation on remotes. Remote hosts need passwordless sudo (or doas) for maintenance commands (
upd,cln, etc.).chezmoi init --applyconfigures this automatically by writing/etc/sudoers.d/chezmoiwith NOPASSWD rules tailored to the platform (apt on Debian/Ubuntu, dnf on RHEL/Fedora, softwareupdate on macOS). Ifdoasis installed and/etc/doas.confexists, both sudoers and doas rules coexist โ the doas alias handles interactive shells while sudoers covers cron and non-interactive contexts. Hosts where neither is in place will trigger playbash's sudo-detection kill.