Multiplex/shared SSH connections not connecting: "Control socket connect Connection refused. Failed to connect to new control master"

Posted by Matt Bryson on 07-Apr-2016 16:17:56
Find me on:

I was trying to set up SSH Multiplexing on our CI server to speed things up a bit, but for some reason it always failed to use the shared connection.

It turns out that our CI server (CodeShip) has overlayfs as its filesystem, which does not play well with unix sockets.

It's a very simple fix, use shared memory to store the socket.

In the ~/.ssh/config file (or the -S command line flag), change the location of the socket to /dev/shm/.

 Host *
ControlMaster auto
ControlPath /dev/shm/control:%h:%p:%r 
ControlPersist 10

Took a very long time to discover the problem and find a solution, so I hope this helps someone!


Topics: Linux, SSH, Bash, Technology