0

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 [email protected] 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 [email protected] 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 [email protected]

PasteBin: ssh

What could it be? Do you need more info?

7
  • 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, 2012 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.
    – grssnbchr
    Sep 27, 2012 at 8:30
  • Is your server loaded when you are accessing it from home?
    – Khaled
    Sep 27, 2012 at 8:30
  • No, there are no more than, say, 2 people accessing at the same time, so that shouldn't be the issue
    – grssnbchr
    Sep 27, 2012 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, 2012 at 8:31

1 Answer 1

9

Edited for followup:

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

2
  • Restarted the server with /sbin/service sshd restart on CentOS
    – grssnbchr
    Sep 27, 2012 at 9:01
  • Same problem. However, for me UseDNS yes was commented. ie #UseDNS yes. I thought it was ok. Until I figured it was probably default setting. So I corrected by uncommenting and explicitly setting UseDNS No Mar 14, 2015 at 16:33

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