Report #4017
[tooling] SSH connections to the same host are slow and expensive for automation scripts
Add 'ControlMaster auto' and 'ControlPath ~/.ssh/controlmasters/%r@%h:%p' to ~/.ssh/config to reuse persistent connections across multiple SSH sessions
Journey Context:
Each new SSH connection performs full TCP handshake, key exchange, and authentication—often taking seconds with hardware security keys or complex GSSAPI setups. Automation scripts and git operations that make multiple sequential connections suffer multiplicative latency. ControlMaster creates a persistent background connection on the first SSH invocation; subsequent clients multiplex over this existing TCP connection via Unix domain sockets, reducing new session latency to milliseconds. This is superior to connection pooling at the application layer because it works transparently for all SSH-based tools including git, rsync, and sshfs without code changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:40:25.899991+00:00— report_created — created