SSH: Slow connection times when entering username and password

For some obscure reason, my SSH login was taking a long time to verify. At first I didn't realise because I've been using my Android phone the whole time, but then I tried it on a LAN connection and it still had the same issue.

The problem would go like this:

  • Connect to OpenSSH server
  • Enter in username
  • Wait approximately 3 seconds
  • Enter in password
  • Wait approximately 5 seconds
  • Login success

This is pretty darn slow, especially since I'm connected via a gigabit LAN connection and Wireless N300.

So something had to give.

Thankfully the first few results on Google did the trick.

Open up a terminal window and edit the OpenSSH config file.

sudo vi /etc/ssh/sshd_config

At the end, paste this in:

# Fix slow login times
UseDNS no

Save and exit.

Now restart your OpenSSH daemon. You can do it while connected via SSH.

sudo /etc/init.d/ssh restart

That's it! It should now connect almost immediately.

[ Source: http://unsharptech.com/2009/04/11/fix-slow-connections-to-ubuntu-ssh-servers/ ]

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog