Slow SSH Login Resolved

Published by Torry Crass on

Every once in a while I've run into a problem where SSH takes a very long time to prompt for a password and log into a system.  In almost all cases this has been related to DNS.  First, you should know that this could indicate a DNS problem, but that is beyond the scope of this article so we won't address it, but please keep it in mind as you may have to troubleshoot your DNS if you are also having other problems.

The fix for the slow SSH problem is actually quite simple.  Take either of the steps below and it should resolve the situation.

  • add "UseDNS no" to /etc/ssh/sshd_config (and restart SSH)
  • add the client's net address to the server's /etc/hosts

 


Leave a Comment

%d bloggers like this: