Tuesday, August 17, 2010

Debian/Ubuntu: Delay in getting SSH login prompt

On some of my Debian/Ubuntu machines, I get an annoying 10-20 seconds delay in seeing the prompt while trying to login. My first guess was - something wrong in key exchange and it's must be falling back with standard password authentication, as can be seen with ssh -vv babil@servername

But the solution seems to be in disabling DNS resolution for the SSH server. I found the solution here: http://www.unix.com/linux/96010-delay-getting-ssh-login-prompt.html. /etc/ssh/sshd_conf needs a "UseDNS no" line, followed by a "sudo /etc/init.d/ssh restart".
Cheers.