Technology
From the Trenches

Speeding up Slow SSH Between Solaris & Mac OS X

Posted on Thursday, February 18th, 2010 at 17:38 MST

For the past few years I’ve suffered this seemingly random problem when connecting to a Solaris or Mac OS X server via SSH: the connection would take forever to negotiate. It would connect, exchange keys, but then pause for up to a minute, plus or minus eternity, before proceeding with authentication. I finally took some time to figure out how to make it go away. Here’s what I did.

The problem seems to be related to forward and/or reverse DNS lookups. A large number of IP addresses given out on the networks that I connect from do not have proper name entries in the network owner’s DNS. By default, both Solaris and Mac OS X Server try to lookup DNS names before proceeding with authentication. Luckily, that behavior is easy to turn off.

On Solaris

Sun’s /etc/ssh/sshd_config file can have these options for disabling the time-wasting DNS lookup behavior:


LookupClientHostnames no
VerifyReverseMapping no

On Mac OS X Server

Apple deploys OpenSSH, and it’s /etc/sshd_config file can include this option:

UseDNS no

Update your sshd_config files with these options, or ask your sysadmin to do it for you, and you’ll be connecting instantly.

Leave a Reply

Live Comment Preview: