Linux and PHP web application support and development (Bromsgrove, UK)

tel: 0845 0046746

Speeding up subsequent SSH connections to a host

Somehow we’d not come across this little “hack” before, so perhaps others haven’t….

Anyway, rather than recreating a new TCP connection to a host, SSH can multiplex the traffic down an existing connection to that host.

This results in subsequent ssh connections opening quicker.

The magic stuff is –

* Edit ~/.ssh/config
* Add in something like :

Host *
ControlMaster auto
ControlPersist 1
ControlPath ~/.ssh/cm_socket/%r@%h:%p

Leave a Reply

Your email address will not be published. Required fields are marked *