Add the following to your .ssh config file:
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
Then, when you open up a second terminal to the same remote server, it will automatically reuse the existing connection and the new prompt will appear almost instantaneously. It doesn’t have to re-authenticate for every new window. Amazing.
If you also add
ControlPersist 4h
then the connection will stay open in the background. Super useful for things like git that re-establishes a connection on every operation. Dropped my `git pull` from 10 seconds on the first run to 2 seconds on the second.
via @malmckay