Possible Duplicate:
ssh delay when connecting

Whenever I try to SSH into my CentOS server from my desktop, after entering "ssh user@address", it hangs with a flashing cursor for about 30 seconds before asking for a password. Once connected it's fine, and it's instant on other devices.

Any idea what could cause this? I have already cleared out ~/.ssh.

marked as duplicate by mattdm, Iain Dec 1 '12 at 19:51

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.


I will bet dollars to donuts that the problem here is with your DNS configuration on your server. SSH tries to reverse-look up your hostname, and if that's slow, you'll get a delay. (Often, the problem is with the first server in your /etc/resolv.conf, but it could also be something wrong with your client system's DNS configuration.

  • I'm going to look at what ewwhite said, if it helps both my server and my desktop use Google's DNS, – Torvero Dec 1 '12 at 17:08
  • Had exactly this on with SSL connections to our ejabberd server. Added the reverse entry to the /etc/hosts file on the server and the problem went away. – Colin 't Hart Jan 15 at 13:03

This is probably a DNS issue. Can you check that the DNS on your CentOS server is configured properly?

If you don't have full access to your DNS setup, you can add an entry in /etc/hosts for the IP you're connecting from. That will most-likely shorten the delay.

Also see: 10 second SSH delay prior to successful login and ssh delay when connecting

  • Thanks, I'll check now and get back to you. Not sure though if that could be it as it is instant on other devices on the same network. Edit: could it be anything to do with my server and desktop using Google's DNS ( I'm quite new to this I guess. – Torvero Dec 1 '12 at 17:04

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