When I freshly installed UBUNTU , and tried to login to Ubuntu via ssh , it always took up-to 5-10 seconds to ask for password. The quick fix was
Solution # 1
The quick fix was to inform ssh to stop using DNS during the connection.
Issue the following command in terminal and restart SSH.
sudo echo “UseDNS no” >> /etc/ssh/sshd_config
OR
You can do it manually on the config file.
Add the following to your sshd_config file and restart SSH.
Edit the /etc/ssh/sshd_config file using the following command
nano /etc/ssh/sshd_config
& Add the following line at top.
UseDNS no
Save the File and Exit and Re-Try Login. It ill work fast now without delays.
***************************************************************
Solution # 2
Edit the /etc/ssh/ssh_config file using the following command
nano /etc/ssh/ssh_config
Commen the following lines by adddin # at start of the line
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
TO
# GSSAPIAuthentication yes
# GSSAPIDelegateCredentials no
save the file and exit and restart SSH service by
service ssh restart
***************************************************************
Howto install SSH Server in Ubuntu
apt-get install openssh-server