Ubuntu server: ssh login is very slow

4

I have a server hooked directly up to the internet, no router. But when I go to login to ssh it is VERY slow. It is not the connection as you can see here by the response time on this ping: ping operation average ms=3.769

What settings do I need to tweek in order to speed up the login process.

nkcmr

Posted 2012-05-09T23:57:57.287

Reputation: 227

Answers

3

You need to make sure that the server can resolve the address you're SSHing from to a hostname. That or disable the UseDNS option in the sshd configuration. But preferably the first.

Ignacio Vazquez-Abrams

Posted 2012-05-09T23:57:57.287

Reputation: 100 516

I couldn't find the UseDNS option in the config files, so how do I setup my network to be able to be resolved to a hostname. – nkcmr – 2012-05-10T00:09:07.303

@sightofnick: that's more a job for your ISP. regarding slow-ssh: http://www.openssh.org/faq.html#3.3

– akira – 2012-05-10T09:18:37.050

1

In /etc/nsswitch.conf, make sure the line that begins with host: reads:

host: files dns

Apparently Ubuntu somethimes have problems with avahi-daemon and mdns4_minimal / mdns4.

I had problems with slow ssh connections when my nsswitch.conf read:

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

I didn't try only removing the NOTFOUND clause. Perhaps that would have helped too.

MattBianco

Posted 2012-05-09T23:57:57.287

Reputation: 1 763