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:
will reduce connection time by using a local socket.
Host * ControlMaster auto ControlPath /tmp/%r@%h:%p