Skip to content


Multiplex several ssh sessions over a single TCP connection

Simon (gotta love that photo) informs us:

There’s a nifty feature in openssh that lets you multiplex several ssh sessions over a single TCP connection. The first time you connect to a host it sets up a regular ssh connection, and creates a unix socket on a local filesystem; subsequence sessions get tunneled over that connection, without having to do all the heavy duty key exchange, etc.

To enable, add the following to your ssh config file (typically ~/.ssh/config )

ControlMaster auto
ControlPath ~/.ssh/control-master/%r@%h:%p

Create a directory to hold the local sockets

mkdir ~/.ssh/control-master

Test by connecting to a host from one window, then, without logging out, start another window and connection to the same host. The second one should start up a lot faster.

Posted in general.

Tagged with .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.



Close