SSH Login Takes a Long Time
Has it ever happened to you that logging in to an SSH server takes a long time? More than, say 20, 30 seconds? Well, there are many solutions out there to fix it, some may even make your system less secure. So let’s go to the source of SSH, so to speak, for a resolution. If you head over to ssh(1) takes a long time to connect or log in, you will see that it’s an issue with DNS resolution. To resolve this issue, try the following steps:
You need to change the sshd config file …
sudo vim /etc/ssh/sshd_config
… and make sure you have this line uncommented
UseDNS no
Save the file and restart SSH daemon (service) like so
sudo service sshd restart (Fedora, Red Hat, CentOS)
or
sudo /etc/init.d/sshd restart (Debian, Ubuntu)
Hat tip: Slow SSH login;
Or, you could just, um, fix your broken dns?
You do this on the ssh server, or on the client machine that you use to login?
Thanks!