Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I have 2 servers, A & B, both running CentOS 5.7.

If I ssh using Putty from Windows 7 to server A or B, the password prompt is quick

But if I ssh from Ubuntu 11.10 to server A, the password prompt takes a long time, almost 2 minutes; while server B password prompt is quick, though not as quick as using Putty.

htw@htw-HP-ProBook-4421s:~$ time ssh's password: 
Connection closed by

real    2m33.170s

htw@htw-HP-ProBook-4421s:~$ time ssh's password: 

real    0m1.904s

There shouldn't be anything wrong with both servers since ssh-ing from Win 7 is quick. The puzzling bit is logging onto server B is faster than onto server A using Ubuntu. Both servers sshd.conf are already set to UseDNS=no

How do I debug this?

share|improve this question

marked as duplicate by Eric Carvalho, Elder Geek, waltinator, Mitch Dec 17 '14 at 17:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Run ssh -vvv Post the output (obscure IP addresses for privacy), indicating where there's a delay. – Gilles Feb 15 '12 at 5:59
I agree this is a duplicate question, however the answer here seems to be better than the original. Could they be combined? – Elder Geek Dec 17 '14 at 15:40

The most common cause for this is

GSSAPIAuthentication yes

in /etc/ssh/ssh_config. If you are not using this as an authentication method, setting

GSSAPIAuthentication no

will speed up your ssh client.

You can also change this for just your user by setting up a personal configuration in ~/.ssh/config but if you are the only user on the system, or all users will benefit, then setting it in /etc/ssh/ssh_config is fine.

See man ssh_config for more information on setting up your ssh client.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.