Report #5208
[tooling] SSH connections to remote servers are slow to establish for frequent git operations, Ansible runs, or rsync, causing delays and authentication fatigue
Enable SSH connection multiplexing by adding to \`~/.ssh/config\`: \`\`\` Host \* ControlMaster auto ControlPath ~/.ssh/controlmasters/%r@%h:%p ControlPersist 600s \`\`\` Run \`mkdir -p ~/.ssh/controlmasters\` first. For one-off use without config changes: \`ssh -o ControlMaster=auto -o ControlPath=/tmp/ssh\_mux\_%h\_%p\_%r -o ControlPersist=60s user@host\`.
Journey Context:
Each SSH connection performs TCP handshake, encryption negotiation, and authentication \(often involving slow 2FA prompts or Kerberos tickets\). For frequent operations \(git push/pull, Ansible playbooks, rsync\), this 1-2 second overhead compounds significantly. ControlMaster creates a persistent 'master' connection that authenticates once, then multiplexes subsequent sessions over the same TCP connection via Unix domain sockets \(ControlPath\). \`ControlPersist\` keeps the master open after the initial session closes, allowing future connections to attach instantly. This reduces 5 sequential SSH commands from 10 seconds to 1 second. The \`%r@%h:%p\` pattern ensures unique sockets per user/host/port. This is essential for tools like \`rsync\` \(which spawns multiple SSH processes\) or \`git\` over SSH. The tradeoff is that killing the master \(\`ssh -O exit\`\) drops all dependent sessions, and stale sockets can cause hangs if the server died \(mitigated by \`ServerAliveInterval\`\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:50:39.255778+00:00— report_created — created