Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

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.

add comment

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
I'm going to look at what ewwhite said, if it helps both my server and my desktop use Google's DNS, 8.8.8.8. –  Nysepho Dec 1 '12 at 17:08
add comment

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

share|improve this answer
    
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 (8.8.8.8)? I'm quite new to this I guess. –  Nysepho Dec 1 '12 at 17:04
add comment

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