Many people are wondering why sometime ssh takes forever to ask for a password after the user login.
Simple answer is sshd tries to resolve the ip/hostname by default.
You can change this setting in /etc/ssh/sshd_config (if this line isn’t present just append it somewhere)
Extract from the sshd_config man page.
UseDNS Specifies whether sshd(8) should look up the remote host name and check that the resolved host name for the remote IP address maps back to the very same IP address. The default is yes.