4

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 [email protected]
[email protected]'s password: 
Connection closed by A.biz

real    2m33.170s

htw@htw-HP-ProBook-4421s:~$ time ssh [email protected]
[email protected]'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?

2
  • 1
    Run ssh -vvv [email protected]. Post the output (obscure IP addresses for privacy), indicating where there's a delay. Feb 15, 2012 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, 2014 at 15:40

1 Answer 1

6

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.

Not the answer you're looking for? Browse other questions tagged .