Home > CentOS > Slow SSH Logins on CentOS 5

Slow SSH Logins on CentOS 5

Following any of the usual how-to’s didn’t leave me with a successfully speedy login.. I eventually tracked down the problem to a particularly monumental bug in RedHat’s OpenSSH server (apparently fixed up stream.. it does us all now no good)..

The fix

  1. edit /etc/ssh/sshd_config
  2. Find and change the lines (or add if missing):
    GSSAPIAuthentication yes
    ...
    #UseDNS yes

    to

    GSSAPIAuthentication no
    ...
    UseDNS no
  3. Enjoy

Side Note

If you use CentOS you’re probably unable to reboot your SSH server and you don’t know it.

I also experienced this problem while attempting to restart the ssh server. Everything seemed to work but when checking the logs it showed serious errors. It complained about being unable to bind to port 22. To see if you have the same problem follow these steps..

/etc/init.d/sshd reload
tail /var/log/secure

If you find something like the following:

sshd[20213]: Server listening on :: port 22.
sshd[20213]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.

then you’ve got problems.. It’s basically saying that the localhost IPv6 address (represented as “::”) is hogging port 22 instead of 0.0.0.0 (means ANY IPv4 address). If that’s what you want, then great! If not..

edit

/etc/ssh/sshd_config

and change it to look as follows from

#ListenAddress 0.0.0.0
#ListenAddress ::

to

ListenAddress 0.0.0.0
#ListenAddress ::

Hope this helps!

References

Categories: CentOS Tags: , ,
  • Mirko
    Thank you! Thank you! Thank you!
blog comments powered by Disqus