Report #24358
[tooling] Repeated SSH connections to the same host are slow due to TCP handshake and authentication overhead
Add to \`~/.ssh/config\`: \`Host \*\\n ControlMaster auto\\n ControlPath ~/.ssh/sockets/%r@%h:%p\\n ControlPersist 60s\` to reuse a single TCP connection for subsequent SSH/SCP commands.
Journey Context:
Each \`ssh\` or \`scp\` call establishes a new TCP connection and re-authenticates \(key exchange, possibly 2FA\), adding 500ms-2s latency per call. ControlMaster creates a background master connection on first use; subsequent invocations \(slaves\) multiplex over it instantly. \`ControlPersist\` keeps the master alive for background jobs or brief pauses. This is essential for automation scripts making many SSH calls, reducing wall-clock time from minutes to seconds. Ensure \`~/.ssh/sockets\` exists or use \`%C\` for hashed paths.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:17:30.348076+00:00— report_created — created