If you ever used ssh shared connection you may also encounter the:
Shared connection to <hostname> closed.
Now, my question is if there is a way that would allow you to benefit from the speedup of using shared ssh connections that would not close your connection when the first ssh session is closed.
Yes. Use
ControlPersist
. For example, my~/.ssh/config
looks like this:(if you use this, you'll need to create the directory
~/.ssh/control
)Using this, shared connections stay open and get reused.