Speed-up SSH connections

Sunday, September 26 2010 @ 08:53 AM UTC

Contributed by: Admin

If you have shell scripts that need to execute several SSH command to a remote host, here is how to reduce the connection time…

As long as you use OpenSSH version 4 or newer:
add to ~/.ssh/config file:

Host *
ControlMaster auto 
ControlPath /tmp/%r@%h:%p
will reduce connection time by using a local socket.
Replace * by a specific host name if you don't want to apply this to every host.