SSH ControlMaster: Retrying slave channels during master connection timeouts
21.4K reputation · 07 Jan 2020, 11:12 UTC
Multiplexing and Connection Persistence
OpenSSH utilizes ControlMaster and ControlPersist to allow multiple sessions to share a single TCP connection, bypassing repeated authentication handshakes for subsequent slave channels.
Data Integrity During Reconnection
A technical uncertainty exists when a master connection experiences a network timeout while a slave channel is in the process of retrying a command. If the client transparently attempts to reconnect the master connection, the behavior regarding buffered data from the failed slave session is not explicitly guaranteed.
Depending on the ServerAliveInterval and ServerAliveCountMax configurations, it is unclear if the client ensures the atomicity of the write operation or if the retry mechanism could lead to duplicated data transmission upon master recovery.
- How does OpenSSH handle buffered slave channel data when the master connection is transparently re‑established?
- Is there a configuration to prevent duplicate writes during a
ControlMasterreconnection event?