1

I'm encountering some trouble to connect via ssh to a specific host (running on ubuntu server 14.04), The process takes up to 9s to happen. When running ssh with debug option (-v), I get the following output:

    OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug1: Connecting to host_ip [host_ip] port 22.
    debug1: Connection established.
    debug1: identity file /host_home/.ssh/id_rsa type -1
    debug1: identity file /host_home/.ssh/id_rsa-cert type -1
    debug1: identity file /host_home/.ssh/id_dsa type -1
    debug1: identity file /host_home/.ssh/id_dsa-cert type -1
    debug1: identity file /host_home/.ssh/id_ecdsa type -1
    debug1: identity file /host_home/.ssh/id_ecdsa-cert type -1
    debug1: identity file /host_home/.ssh/id_ed25519 type -1
    debug1: identity file /host_home/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.11
    debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.11
    debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.11 pat OpenSSH_6.6.1* compat 0x04000000
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
    debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
    debug1: sending SSH2_MSG_KEX_ECDH_INIT
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: ECDSA 2a:cb:66:69:ce:14:94:83:59:d5:4b:ea:87:15:be:23
    debug1: Host 'host_ip' is known and matches the ECDSA host key.
    debug1: Found key in /host_home/.ssh/known_hosts:4
    debug1: ssh_ecdsa_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug1: SSH2_MSG_SERVICE_ACCEPT received
**_____the abnormal delay starts here_____**
    debug1: Authentications that can continue: publickey,password
    debug1: Next authentication method: publickey
    debug1: Trying private key: /host_home/.ssh/id_rsa
    debug1: Trying private key: /host_home/.ssh/id_dsa
    debug1: Trying private key: /host_home/.ssh/id_ecdsa
    debug1: Trying private key: /host_home/.ssh/id_ed25519
    debug1: Next authentication method: password

No specific errors or exceptions are detected but I have noticed that the Authentication step is the one that is taking too long.

I don't know if there are some hardware specifications that may have something to do with this. Or maybe a more advanced debugging mode.

3
  • Can you try skipping the public key authentication with ssh -v -o 'PubkeyAuthentication no' user@server?
    – Haxiel
    Jan 10 '19 at 10:30
  • Hi @Haxiel , Thank you so much for your comment. We fixed the issue. It was basically a problem with the network configuration of my host having dns in it but working in a local network. After removing the dns-nameservers in the network/interfaces file, everything was back to normal :).
    – JasBot
    Jan 10 '19 at 10:53
  • You might have UseDNS enabled in the ssh server configuration. That can cause this sort of delay when DNS isn't working. Consider turning that off.
    – Kenster
    Jan 10 '19 at 14:03
0

Problem solved!

In my case, It was basically a problem with the network configuration of my host having dns in it but working in a local network. After removing the dns-nameservers in the network/interfaces file, everything was back to normal.

I'll be happy if someone would be able to explain in details the dns verification process and why no issues where reported when running in debug mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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