Report #83019
[tooling] Running multiple SSH commands \(Ansible, rsync, git\) to the same host is slow due to repeated connection overhead and authentication round-trips
Configure \`ControlMaster auto\` and \`ControlPath ~/.ssh/sockets/%r@%h:%p\` in \`~/.ssh/config\` \(or use \`-o ControlMaster=auto -o ControlPath=...\` flags\) to reuse the first connection for subsequent commands, eliminating TCP\+auth overhead.
Journey Context:
Establishing a new SSH connection involves TCP handshake, key exchange, and authentication \(often 2FA or expensive cryptographic signatures\). For automation running 100s of commands, this dominates runtime. ControlMaster opens a single 'master' connection that stays open \(backgrounded\), and subsequent clients connect via a Unix domain socket at \`ControlPath\`. This shares the encrypted tunnel and authenticated session. The tradeoff is file descriptor usage and slightly complex socket permissions, but for CI/CD and local development iterating on remote hosts, the speedup is 10-100x.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:56:20.743464+00:00— report_created — created