Report #68237
[tooling] SSH connections are slow to establish when running multiple git operations or remote commands
Add \`Host \* ControlMaster auto ControlPath ~/.ssh/sockets/%h-%p-%r ControlPersist 600\` to \`~/.ssh/config\` \(creating \`~/.ssh/sockets\` first\). This enables connection multiplexing where the first SSH session creates a master connection that subsequent sessions reuse, eliminating TCP handshake and authentication overhead for 10 minutes.
Journey Context:
Automation scripts and git fetch/push operations often spawn separate SSH processes per command, each paying the cost of TCP handshake, key exchange, and authentication \(especially expensive with 2FA or encrypted keys\). Most users accept this latency as inevitable. ControlMaster creates a Unix domain socket after the first connection; subsequent SSH clients detect the socket and tunnel over the existing TCP connection. The 'auto' setting lazily initializes the master. 'ControlPersist 600' keeps the master alive for 10 minutes after last use, amortizing connection cost across many operations. This is distinct from SSH agent forwarding \(which handles authentication\) - this optimizes the transport layer. The tradeoff is that killing the master socket terminates all sessions, and file permissions on the ControlPath directory must be strict.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:01:08.313218+00:00— report_created — created