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

We have a CentOS server that we use for internal testing purposes, which has sshd enabled. When I (as a developer) am at the company, I use ssh root@192.168.55.131 to connect to it - and it works flawlessly.

Now, in order to work from home, accessing the server via the company's static IP, we set up another port for ssh, 2020. So I execute ssh -p 2020 root@xx.xxx.xxx.xx and am immediately granted for a password. After entering the password, it takes up to 30 seconds until I can access the server. Same is with SFTP (i.e. uploading files takes about 30 seconds until it begins to transfer). As you can imagine, if you have to regularly upload files to a webserver via SFTP, this is very tedious.

So I looked at similar questions and thus edited the sshd_config file on the server, setting UseDNS to "no" and GSSAPIAuthentication to "no" (this one also in ssh_config on the client) - it did not work..

Please have a look at the -vvv output when externally accessing the server: ssh -p 2020 -vvv root@xx.xxx.xxx.xx

PasteBin: ssh

What could it be? Do you need more info?

share|improve this question

marked as duplicate by Iain Sep 27 '12 at 8:57

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.

1  
Usually usedns is the reason for the delay, but moduli (openssh.com/faq.html#3.3) can also contribute to the delay. did you restart the sshd server after making changes to ssh_config? –  Hex Sep 27 '12 at 8:28
    
Nope, how can I actually restart it? Looked for it in the man pages, but couldn't find it. I will look into moduli, thanks. –  wnstnsmth Sep 27 '12 at 8:30
    
Is your server loaded when you are accessing it from home? –  Khaled Sep 27 '12 at 8:30
    
No, there are no more than, say, 2 people accessing at the same time, so that shouldn't be the issue –  wnstnsmth Sep 27 '12 at 8:30
    
So at what line of the debugging output does it pause, exactly? Have you also tried specifying -u0 to the OpenSSHd command line to disable DNS lookups? –  the-wabbit Sep 27 '12 at 8:31
show 3 more comments

1 Answer 1

up vote 2 down vote accepted

Edited for followup:

Setting UseDNS to NO in sshd_config and restarting the sshd server fixes this issue.

share|improve this answer
    
Restarted the server with /sbin/service sshd restart on CentOS –  wnstnsmth Sep 27 '12 at 9:01
add comment

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