SSH Slow to respond for password input (timeout problems) Ubuntu Linux

by on Mar.14, 2009, under linux/ubuntu

If you find your SSH client is taking too long to connect (and ask you for the password), or you’re trying to SFTP and it’s timing out before the password prompt. It’s probably trying to do a DNS lookup!

It’s a quick and easy fix! Just edit the following file:


And add or change the following:

UseDNS no

Restart SSH

sudo /etc/init.d/ssh restart

:, , , ,
6 comments for this entry:
  1. Jay

    Perfect thanks!

  2. Pete Soper

    This doesn’t work for me with Ubuntu 8.10. However this solution did work (but be careful, the config file lines that have to be commented out may appear multiple times):


  3. Jeremy

    Worked for me! Thanks.

  4. NitriX

    Saved, thanks!

  5. Tikaram

    After change in configuration file, it working fine, and ssh very fast working

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...