Remote SSH problem - connection closed by remote host

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi everyone,
I have been reading every post that I could find about this particular
error message:

ssh_exchange_identification: Connection closed by remote host

I'm working with an external client who wants to grab some files from
us via SFTP.  I set up a Solaris 9 server with "ChrootSSH" from here:

I compiled it locally with the following options:

./configure --with-pam --disable-suid-ssh --without-rsh --with-
lastlog=/var/adm/lastlog --sysconfdir=/usr/local/etc/openssh --prefix=/
usr/local --without-privsep-user--without-privsep-path --without-prngd
--without-rand-helper --with-tcp-wrappers=/usr/sfw

OpenSSH has been configured with the following options:
                     User binaries: /usr/local/bin
                   System binaries: /usr/local/sbin
               Configuration files: /usr/local/etc/openssh
                   Askpass program: /usr/local/libexec/ssh-askpass
                      Manual pages: /usr/local/share/man/manX
                          PID file: /var/run
  Privilege separation chroot path: /var/empty
            sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/
   (If PATH is set in /etc/default/login it will be used instead. If
   used, ensure the path to scp is present, otherwise scp will not
                    Manpage format: man
                       PAM support: yes
                   OSF SIA support: no
                 KerberosV support: no
                   SELinux support: no
                 Smartcard support: no
                     S/KEY support: no
              TCP Wrappers support: yes
              MD5 password support: no
                   libedit support: no
  Solaris process contract support: no
       IP address in $DISPLAY hack: no
           Translate v4 in v6 hack: no
                  BSD Auth support: no
              Random number source: OpenSSL internal ONLY

              Host: sparc-sun-solaris2.9
          Compiler: gcc
    Compiler flags: -g -O2 -Wall -Wpointer-arith -Wuninitialized -
Preprocessor flags: -I/usr/local/ssl/include -I/usr/sfw/include
      Linker flags: -L/usr/local/ssl/lib -R/usr/local/ssl/lib -L/usr/
sfw/lib -R/usr/sfw/lib
         Libraries: -lwrap -lpam -ldl -lresolv -lcrypto -lrt -lz -
lsocket -lnsl

I setup the chroot jail and it works fine from the local network and
from another external server running Debian 3.0.

However, from the client's test machine, they continually get the
following error:

$ ssh -vvv user@IP
Sun_SSH_1.1, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be
debug1: ssh_connect: needpriv 0
debug1: Connecting to IP [IP] port 22.
debug1: Connection established.
debug1: identity file /home/.ssh/identity type -1
debug1: identity file /home/.ssh/id_rsa type -1
debug1: identity file /home/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
debug1: Calling cleanup 0x34214(0x0)

Quoted text here. Click to load it
is due to missing entries in hosts.deny / hosts.allow.  I put in a
hosts.allow file (no hosts.deny) with the following yet still no
connection.  In sshd_config I also changed the "UseDNS" option to "NO"

sshd sshd1 sshd2 : ALL : ALLOW
ssh: ALL : ALLOW

They tried telnetting to port 22 and received the same error.  I'm
still thinking that this might be a client side issue, but is there
anything else that you guys can think of that would be causing this?

Is there such a thing as SSH version mismatch since they're running
Sun SSH 1.1 and I'm running SSH-1.99-OpenSSH_4.5 ?

Any help would be greatly appreciated.

Re: Remote SSH problem - connection closed by remote host

I suggest you run sshd in debug mode and/or under truss, to see what it's
doing.  It's not a client side issue: the server is immediately closing
its connection.

  Richard Silverman

Site Timeline