Speed up ssh logins

In this article we are going to explore two ways to speed up ssh logins. Reusing existing connections and disabling GSSAPI authentication.

The changes can be made on the ssh client side by adding the relevant config to the ssh config file at $HOME/.ssh/config .

Reusing existing connections

If you login to the same host using the same credentials multiple times (ie: different windows), one way to speed up connections is to share the same ssh connection. This means only the first connection actually needs to login. This also speeds things up if you open an ssh session, and later use scp/rsync to copy files across. Instead of opening a new connection, scp/rsync will reuse the existing ssh connection.

Host *
    ControlMaster auto
    ControlPath /tmp/ssh_mux_%h_%p_%r

Disabling GSSAPI Authentication

The GSSAPI is a IETF standard that provides an alternative to public/private keys as a means of authentication, suitable for doing strong encrypted authentication1. Sometimes ssh takes a long time figuring out if it needs to use GSSAPIAuthentication or not. If you don’t use it, disabling it can speed things up.

Host *
    GSSAPIAuthentication no


1. Using GSSAPI authentication at SLAC

Speed up ssh logins