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:
sudo vi /etc/ssh/sshd_configto edit the SSHD config file.
- Go right to the bottom and add,
#Turn off DNS look-up to speed up login
- Save the file and exit the editor.
- Restart SSHD using
service ssh restart
- 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 :)