Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

ssh_exchange_identification: Connection closed by remote host

Discussion in 'Security' started by farooq, Apr 20, 2012.

  1. farooq

    farooq Member

    Joined:
    Dec 22, 2011
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Root Administrator
    Hello,

    I am getting this error :

    ssh_exchange_identification: Connection closed by remote host

    I have searched google and tried several things, but i cannot even log into the server, how do i edit hosts.allow
     
  2. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    68
    check the permission of /var/log/btmp
    It must be 600
    chmod 600 /var/log/btmp
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. denny.j

    denny.j Member

    Joined:
    Apr 21, 2012
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Root Administrator
    Hi,

    If you are still unable to SSH to the server, I would suggest contacting your DC or your hosting provider immediately.

    This issue may have arisen due any one of the issues below.

    Check /etc/hosts.allow

    and make sure that your local machine IP address is white listed in it. If you are not sure about the IP address, please access the URL "whatismyip.com" in the browser. It will show your current IP address.

    Also check whether ssh is allowed in the server

    root@host # grep sshd /etc/hosts.allow
    sshd: ALL

    Missing Dependencies

    This one typically happens after a glibc or openssl upgrade. Many distros can install updates to glibc or openssl libs and not require a restart to sshd.

    On any distro you can recognize it when after an update, then use lsof to see where sshd has open files. Some will be pointed to DEL, because those libs were deleted on update.

    ~ # lsof -n | grep ssh | grep DEL

    When an SSH connection comes in the sshd daemon forks and attempts to attach (ld) these lib files, and fails resulting in this error.
    Corrupted Fingerprint / Keys

    Some how one or the other of the fingerprints or keys has become corrupted (did you manually edit one of these files?). Remove the server-side fingerprint in the clients ~/.ssh/known_hosts and try again. When you re-connect you will be prompted to accept the host identity again.

    Login via console

    Then check the permission of /var/log/btmp
    it must be 600
    chmod 600 /var/log/btmp
     
  4. bashconsole

    bashconsole Registered

    Joined:
    Mar 13, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Go to "Security Center >> SSH Password Authorization Tweak" and then Disable Password Auth and Enable it again.
     
  5. bcwebinc

    bcwebinc Registered

    Joined:
    Feb 4, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    151
    Thank you - this fixed the issue for me.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice