Report #8167
[tooling] SSH connections in automation scripts are slow due to repeated TCP handshakes and authentication
Configure \`ControlMaster auto\` and \`ControlPath ~/.ssh/sockets/%r@%h:%p\` in \`~/.ssh/config\`. The first connection creates a master socket; subsequent connections reuse the TCP session \(multiplexing\), eliminating handshake latency.
Journey Context:
Each \`ssh\` invocation opens a new TCP connection and re-authenticates \(key exchange, userauth\). For automation \(Ansible, rsync, git\), this latency compounds. ControlMaster enables multiplexing: the first client becomes the master, subsequent clients attach to a Unix domain socket. The ControlPath must include \`%r\` \(remote user\), \`%h\` \(host\), \`%p\` \(port\) to prevent collisions between different destinations. This reduces subsequent connections to microseconds. Note: the socket directory must exist and have restrictive permissions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:46:22.953022+00:00— report_created — created