The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    1
    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:
    38
    check the permission of /var/log/btmp
    It must be 600
    chmod 600 /var/log/btmp
     
  3. denny.j

    denny.j Member

    Joined:
    Apr 21, 2012
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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:
    1
    Thank you - this fixed the issue for me.
     
Loading...

Share This Page