You are here

Slow login into Ubuntu via SSH

Submitted by Druss on Fri, 2014-01-31 20:13

Fresh install of Ubuntu Server 12.04 LTS: After installed SSHD, I found that logging in remotely was a time-consuming process as the password prompt took ages to pop up after the username prompt. Binging about, I found that this was due to SSHD performing a reverse DNS lookup of my IP to potentially check if all is kosher. Turning this check off fixes the issue:

  1. Type sudo vi /etc/ssh/sshd_config to edit the SSHD config file.
  2. Go right to the bottom and add,
    #Turn off DNS look-up to speed up login
    UseDNS no
  3. Save the file and exit the editor.
  4. Restart SSHD using service ssh restart
  5. Try logging in now.

The setting is rather perfunctory in the vast majority of SSH setups. In some cases, the administrator might want to verify that the remote IP belongs to a certain domain and authenticate the session based on it. But this doesn't apply for most scenarios.

Hope this helps :)