Report #14113
[tooling] SSH connections to the same host are slow due to repeated authentication or connection overhead in automation scripts
Enable connection multiplexing by adding \`ControlMaster auto\` and \`ControlPath ~/.ssh/sockets/%r@%h-%p\` to \`~/.ssh/config\`. Use \`ssh -O check host\` to verify the master socket is active, and \`ssh -O exit host\` to gracefully close the persistent connection when finished.
Journey Context:
Without multiplexing, every \`ssh\`, \`scp\`, \`git fetch\`, or \`rsync\` opens a new TCP connection and re-authenticates \(especially painful with 2FA, FIDO keys, or passphrase-protected keys requiring agent interaction\). ControlMaster keeps one persistent connection open and shares it via a Unix socket, reducing subsequent connection latency to near-zero. The \`-O\` flag is specifically for control commands \(check/exit\) and is often overlooked in favor of killing processes manually or leaving connections dangling. This is essential for CI/CD pipelines making multiple SSH calls to the same host.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T20:43:12.985113+00:00— report_created — created