Why SSH takes a long time to Connect

I had this same problem just this morning...

Edit your /etc/ssh/sshd_config to set GSSAPIAuthentication no


Often this happened to me when DNS was not correctly configured, but SSH is trying to do a reverse lookup on every connect, so it might be waiting for some high timeouts. Try doing this in /etc/ssh/sshd_config:

UseDNS no

And then restart the SSH daemon. This will make it not use reverse lookups anymore.


If you do not want to change any server configurations

Go to $HOME/.ssh/config and add

Host *
  GSSAPIAuthentication no

Tags:

Ssh

Rhel