Speed-up SSH connections

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

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.
As long as you use OpenSSH version 4 or newer:
add to ~/.ssh/config file: