ssh tunnel error “ssh_exchange_identification: Connection closed by remote host”SSH hosts.deny and hosts.allowSSH + svnserve -t command, while still allowing shell accessallow ssh connection from remote hostTunnel to MySql via workbench not working when regular ssh tunnel worksssh_exchange_identification: Connection closed by remote host remote desktopTunneling cassandra via ssh gives me a connection closed errorSSH Connection through a Reverse (Remote) SSH TunnelSSH Tunnel connection issuesCan't get SSH ProxyCommand to work (ssh_exchange_identification: Connection closed by remote host)“connection refused” on ssh reverse tunnelssl connection to aws serverless aurora

Do UK voters know if their MP will be the Speaker of the House?

Is it acceptable for a professor to tell male students to not think that they are smarter than female students?

What exploit Are these user agents trying to use?

What is the most common color to indicate the input-field is disabled?

Why was the shrinking from 8″ made only to 5.25″ and not smaller (4″ or less)?

Extract rows of a table, that include less than x NULLs

Intersection Puzzle

How do I deal with an unproductive colleague in a small company?

Would Slavery Reparations be considered Bills of Attainder and hence Illegal?

Mathematica command that allows it to read my intentions

How seriously should I take size and weight limits of hand luggage?

One verb to replace 'be a member of' a club

Avoiding the "not like other girls" trope?

What mechanic is there to disable a threat instead of killing it?

ssTTsSTtRrriinInnnnNNNIiinngg

Can I run a new neutral wire to repair a broken circuit?

Do scales need to be in alphabetical order?

How do I gain back my faith in my PhD degree?

Arrow those variables!

Bullying boss launched a smear campaign and made me unemployable

How did the Super Star Destroyer Executor get destroyed exactly?

How to show a landlord what we have in savings?

Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?

How dangerous is XSS?



ssh tunnel error “ssh_exchange_identification: Connection closed by remote host”


SSH hosts.deny and hosts.allowSSH + svnserve -t command, while still allowing shell accessallow ssh connection from remote hostTunnel to MySql via workbench not working when regular ssh tunnel worksssh_exchange_identification: Connection closed by remote host remote desktopTunneling cassandra via ssh gives me a connection closed errorSSH Connection through a Reverse (Remote) SSH TunnelSSH Tunnel connection issuesCan't get SSH ProxyCommand to work (ssh_exchange_identification: Connection closed by remote host)“connection refused” on ssh reverse tunnelssl connection to aws serverless aurora













10















I'm trying to use an ssh tunnel from my office machine to my home machine, and get an error when I try to use it.



What I'm doing is starting one shell like so:



ssh -gL 12345:my.home.domain:22 my.home.domain


This is giving me a proper shell, no problem. What I normally do then is ssh to my home machine through this office machine, like so:



ssh -p 12345 127.0.0.1


This has always worked for me, until last week, when I set up a new system on my home machine (switching from Ubuntu to Debian). Now I get an error. I can still open up my initial ssh connection, but when I try to use that tunnel, I get (on the office machine) this error:



ssh_exchange_identification: Connection closed by remote host


Also, when that happens, the open shell that I have the tunnelling set up through gets this line spat out at it:



channel 3: open failed: connect failed: Connection timed out


At which point, I'm at a loss. If any more info is needed, I'll be happy to post it.



============= further to that ==============



After fiddling around further, I've found that I'm getting a different response from the server (my home machine that is) when I try to telnet in on the various ports. If I try:



telnet my.home.domain 22


I get this back:



Trying <my ip address>...
Connected to <my domain>.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.5p1 Debian-6+squeeze2


Which is what I would expect. After setting up the tunnel though, and then telnetting to that, I see this response:



Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.


============== and further still ==================



As per kbulgrien's suggestion, here is the output from the client machine with the -v option:




ssh -vp 24600 127.0.0.1
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 24600.
debug1: Connection established.
debug1: identity file /home/jacob/.ssh/id_rsa type -1
debug1: identity file /home/jacob/.ssh/id_rsa-cert type -1
debug1: identity file /home/jacob/.ssh/id_dsa type -1
debug1: identity file /home/jacob/.ssh/id_dsa-cert type -1
debug1: identity file /home/jacob/.ssh/id_ecdsa type -1
debug1: identity file /home/jacob/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host










share|improve this question
























  • One cause of the ssh_exchange_identification: Connection closed by remote host error relates to the connecting host being listed in the /etc/hosts.deny.

    – Zoredache
    Jan 10 '13 at 17:23











  • Hm - if I cat /ets/hosts.deny on that machine, every line is remarked.

    – Jacob Ewing
    Jan 10 '13 at 17:26











  • May I suggest adding -v to the ssh command that fails? Does the ensuing output give any other indication of failure (i.e. channel 1: open failed: administratively prohibited: open failed).

    – kbulgrien
    Jan 10 '13 at 19:41






  • 2





    Sorry, it just occured to me that it is helpful to have -v on both the tunnel and failing ssh commands (looking for something more than channel 3: open failed: connect failed: Connection timed out). It might be noteworthy to mention that one can add multiple -v (up to three) to increase verbosity. I wouldn't necessarily post the whole spew, but it might be worth perusing for words that seem to indicate a problem.

    – kbulgrien
    Jan 10 '13 at 20:14















10















I'm trying to use an ssh tunnel from my office machine to my home machine, and get an error when I try to use it.



What I'm doing is starting one shell like so:



ssh -gL 12345:my.home.domain:22 my.home.domain


This is giving me a proper shell, no problem. What I normally do then is ssh to my home machine through this office machine, like so:



ssh -p 12345 127.0.0.1


This has always worked for me, until last week, when I set up a new system on my home machine (switching from Ubuntu to Debian). Now I get an error. I can still open up my initial ssh connection, but when I try to use that tunnel, I get (on the office machine) this error:



ssh_exchange_identification: Connection closed by remote host


Also, when that happens, the open shell that I have the tunnelling set up through gets this line spat out at it:



channel 3: open failed: connect failed: Connection timed out


At which point, I'm at a loss. If any more info is needed, I'll be happy to post it.



============= further to that ==============



After fiddling around further, I've found that I'm getting a different response from the server (my home machine that is) when I try to telnet in on the various ports. If I try:



telnet my.home.domain 22


I get this back:



Trying <my ip address>...
Connected to <my domain>.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.5p1 Debian-6+squeeze2


Which is what I would expect. After setting up the tunnel though, and then telnetting to that, I see this response:



Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.


============== and further still ==================



As per kbulgrien's suggestion, here is the output from the client machine with the -v option:




ssh -vp 24600 127.0.0.1
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 24600.
debug1: Connection established.
debug1: identity file /home/jacob/.ssh/id_rsa type -1
debug1: identity file /home/jacob/.ssh/id_rsa-cert type -1
debug1: identity file /home/jacob/.ssh/id_dsa type -1
debug1: identity file /home/jacob/.ssh/id_dsa-cert type -1
debug1: identity file /home/jacob/.ssh/id_ecdsa type -1
debug1: identity file /home/jacob/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host










share|improve this question
























  • One cause of the ssh_exchange_identification: Connection closed by remote host error relates to the connecting host being listed in the /etc/hosts.deny.

    – Zoredache
    Jan 10 '13 at 17:23











  • Hm - if I cat /ets/hosts.deny on that machine, every line is remarked.

    – Jacob Ewing
    Jan 10 '13 at 17:26











  • May I suggest adding -v to the ssh command that fails? Does the ensuing output give any other indication of failure (i.e. channel 1: open failed: administratively prohibited: open failed).

    – kbulgrien
    Jan 10 '13 at 19:41






  • 2





    Sorry, it just occured to me that it is helpful to have -v on both the tunnel and failing ssh commands (looking for something more than channel 3: open failed: connect failed: Connection timed out). It might be noteworthy to mention that one can add multiple -v (up to three) to increase verbosity. I wouldn't necessarily post the whole spew, but it might be worth perusing for words that seem to indicate a problem.

    – kbulgrien
    Jan 10 '13 at 20:14













10












10








10


4






I'm trying to use an ssh tunnel from my office machine to my home machine, and get an error when I try to use it.



What I'm doing is starting one shell like so:



ssh -gL 12345:my.home.domain:22 my.home.domain


This is giving me a proper shell, no problem. What I normally do then is ssh to my home machine through this office machine, like so:



ssh -p 12345 127.0.0.1


This has always worked for me, until last week, when I set up a new system on my home machine (switching from Ubuntu to Debian). Now I get an error. I can still open up my initial ssh connection, but when I try to use that tunnel, I get (on the office machine) this error:



ssh_exchange_identification: Connection closed by remote host


Also, when that happens, the open shell that I have the tunnelling set up through gets this line spat out at it:



channel 3: open failed: connect failed: Connection timed out


At which point, I'm at a loss. If any more info is needed, I'll be happy to post it.



============= further to that ==============



After fiddling around further, I've found that I'm getting a different response from the server (my home machine that is) when I try to telnet in on the various ports. If I try:



telnet my.home.domain 22


I get this back:



Trying <my ip address>...
Connected to <my domain>.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.5p1 Debian-6+squeeze2


Which is what I would expect. After setting up the tunnel though, and then telnetting to that, I see this response:



Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.


============== and further still ==================



As per kbulgrien's suggestion, here is the output from the client machine with the -v option:




ssh -vp 24600 127.0.0.1
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 24600.
debug1: Connection established.
debug1: identity file /home/jacob/.ssh/id_rsa type -1
debug1: identity file /home/jacob/.ssh/id_rsa-cert type -1
debug1: identity file /home/jacob/.ssh/id_dsa type -1
debug1: identity file /home/jacob/.ssh/id_dsa-cert type -1
debug1: identity file /home/jacob/.ssh/id_ecdsa type -1
debug1: identity file /home/jacob/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host










share|improve this question
















I'm trying to use an ssh tunnel from my office machine to my home machine, and get an error when I try to use it.



What I'm doing is starting one shell like so:



ssh -gL 12345:my.home.domain:22 my.home.domain


This is giving me a proper shell, no problem. What I normally do then is ssh to my home machine through this office machine, like so:



ssh -p 12345 127.0.0.1


This has always worked for me, until last week, when I set up a new system on my home machine (switching from Ubuntu to Debian). Now I get an error. I can still open up my initial ssh connection, but when I try to use that tunnel, I get (on the office machine) this error:



ssh_exchange_identification: Connection closed by remote host


Also, when that happens, the open shell that I have the tunnelling set up through gets this line spat out at it:



channel 3: open failed: connect failed: Connection timed out


At which point, I'm at a loss. If any more info is needed, I'll be happy to post it.



============= further to that ==============



After fiddling around further, I've found that I'm getting a different response from the server (my home machine that is) when I try to telnet in on the various ports. If I try:



telnet my.home.domain 22


I get this back:



Trying <my ip address>...
Connected to <my domain>.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.5p1 Debian-6+squeeze2


Which is what I would expect. After setting up the tunnel though, and then telnetting to that, I see this response:



Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.


============== and further still ==================



As per kbulgrien's suggestion, here is the output from the client machine with the -v option:




ssh -vp 24600 127.0.0.1
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 24600.
debug1: Connection established.
debug1: identity file /home/jacob/.ssh/id_rsa type -1
debug1: identity file /home/jacob/.ssh/id_rsa-cert type -1
debug1: identity file /home/jacob/.ssh/id_dsa type -1
debug1: identity file /home/jacob/.ssh/id_dsa-cert type -1
debug1: identity file /home/jacob/.ssh/id_ecdsa type -1
debug1: identity file /home/jacob/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host







ssh-tunnel






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:14









Community

1




1










asked Jan 10 '13 at 17:11









Jacob EwingJacob Ewing

151126




151126












  • One cause of the ssh_exchange_identification: Connection closed by remote host error relates to the connecting host being listed in the /etc/hosts.deny.

    – Zoredache
    Jan 10 '13 at 17:23











  • Hm - if I cat /ets/hosts.deny on that machine, every line is remarked.

    – Jacob Ewing
    Jan 10 '13 at 17:26











  • May I suggest adding -v to the ssh command that fails? Does the ensuing output give any other indication of failure (i.e. channel 1: open failed: administratively prohibited: open failed).

    – kbulgrien
    Jan 10 '13 at 19:41






  • 2





    Sorry, it just occured to me that it is helpful to have -v on both the tunnel and failing ssh commands (looking for something more than channel 3: open failed: connect failed: Connection timed out). It might be noteworthy to mention that one can add multiple -v (up to three) to increase verbosity. I wouldn't necessarily post the whole spew, but it might be worth perusing for words that seem to indicate a problem.

    – kbulgrien
    Jan 10 '13 at 20:14

















  • One cause of the ssh_exchange_identification: Connection closed by remote host error relates to the connecting host being listed in the /etc/hosts.deny.

    – Zoredache
    Jan 10 '13 at 17:23











  • Hm - if I cat /ets/hosts.deny on that machine, every line is remarked.

    – Jacob Ewing
    Jan 10 '13 at 17:26











  • May I suggest adding -v to the ssh command that fails? Does the ensuing output give any other indication of failure (i.e. channel 1: open failed: administratively prohibited: open failed).

    – kbulgrien
    Jan 10 '13 at 19:41






  • 2





    Sorry, it just occured to me that it is helpful to have -v on both the tunnel and failing ssh commands (looking for something more than channel 3: open failed: connect failed: Connection timed out). It might be noteworthy to mention that one can add multiple -v (up to three) to increase verbosity. I wouldn't necessarily post the whole spew, but it might be worth perusing for words that seem to indicate a problem.

    – kbulgrien
    Jan 10 '13 at 20:14
















One cause of the ssh_exchange_identification: Connection closed by remote host error relates to the connecting host being listed in the /etc/hosts.deny.

– Zoredache
Jan 10 '13 at 17:23





One cause of the ssh_exchange_identification: Connection closed by remote host error relates to the connecting host being listed in the /etc/hosts.deny.

– Zoredache
Jan 10 '13 at 17:23













Hm - if I cat /ets/hosts.deny on that machine, every line is remarked.

– Jacob Ewing
Jan 10 '13 at 17:26





Hm - if I cat /ets/hosts.deny on that machine, every line is remarked.

– Jacob Ewing
Jan 10 '13 at 17:26













May I suggest adding -v to the ssh command that fails? Does the ensuing output give any other indication of failure (i.e. channel 1: open failed: administratively prohibited: open failed).

– kbulgrien
Jan 10 '13 at 19:41





May I suggest adding -v to the ssh command that fails? Does the ensuing output give any other indication of failure (i.e. channel 1: open failed: administratively prohibited: open failed).

– kbulgrien
Jan 10 '13 at 19:41




2




2





Sorry, it just occured to me that it is helpful to have -v on both the tunnel and failing ssh commands (looking for something more than channel 3: open failed: connect failed: Connection timed out). It might be noteworthy to mention that one can add multiple -v (up to three) to increase verbosity. I wouldn't necessarily post the whole spew, but it might be worth perusing for words that seem to indicate a problem.

– kbulgrien
Jan 10 '13 at 20:14





Sorry, it just occured to me that it is helpful to have -v on both the tunnel and failing ssh commands (looking for something more than channel 3: open failed: connect failed: Connection timed out). It might be noteworthy to mention that one can add multiple -v (up to three) to increase verbosity. I wouldn't necessarily post the whole spew, but it might be worth perusing for words that seem to indicate a problem.

– kbulgrien
Jan 10 '13 at 20:14










4 Answers
4






active

oldest

votes


















1














Maybe if you have more then ssh 10 sessions waiting for insert the password, you have that kind of error, i remember that was recent ssh bug, if you would verify this, use the command below



for i in 1..15;do ssh -fNt pippo@remote.server.com & >/dev/null ;done





share|improve this answer






























    0














    Something like this happened on a recent install. In this situation /etc/hosts.deny existed and had no settings that explicity denied access, so the circumstances seem similar. It was necessary to alter /etc/hosts.allow to add something like:



    sshd: 192.168.127.0/255.255.255.128


    The IP details need to be adjusted to your needs, or are replaced with ALL if there is no concern with allowing ssh from everywhere.



    After making the changes, stop and restart sshd.



    Upvoted answers to following question provide more examples.



    SSH hosts.deny and hosts.allow



    Here is someone else's testimony that links the error message with the solution.



    How To Fix : ssh_exchange_identification: Connection closed by remote host problem when logging in with SSH






    share|improve this answer

























    • Hmm - sadly that didn't fix it for me. I think my situation differs from the ones in the example. I am able to ssh in on port 22 with no trouble. It's only when I try to tunnel through another port that I get the errors mentioned.

      – Jacob Ewing
      Jan 10 '13 at 18:27











    • Granted that the tunnel is a distinctive difference. Given that, does this help: discussion.dreamhost.com/thread-97951.html ? I have also found references to an indication that uninstalling and re-installing the sshd package on debian-like systems corrects an issue with keys that causes the behavior you describe ( discussion.dreamhost.com/thread-97951.html et. al. ).

      – kbulgrien
      Jan 10 '13 at 18:59












    • You do have sshd (openssh-server) installed on both systems, right?

      – kbulgrien
      Jan 10 '13 at 19:06











    • Yupyup. I've been doing this for quite a long time, and only ran into trouble last week after switching to Debian on my home machine (the server). I'll try your suggestion of un/re-installing sshd when I get home tonight.

      – Jacob Ewing
      Jan 10 '13 at 19:53


















    0














    I had the same problem and in the end solved the problem by correcting the /etc/network/interfaces:



    auto eth0
    iface eth0 inet static


    or



    auto eth0
    iface eth0 inet dhcp


    without that config I never get reverse connection to my ssh tunnel.






    share|improve this answer
































      0














      In my case, I had to insert to /etc/ssh/sshd_config of the gateway machine the following lines:



      Match User <username>
      GatewayPorts yes


      See more details here



      Hope this helps!






      share|improve this answer








      New contributor




      floatingpurr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "2"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f465881%2fssh-tunnel-error-ssh-exchange-identification-connection-closed-by-remote-host%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        1














        Maybe if you have more then ssh 10 sessions waiting for insert the password, you have that kind of error, i remember that was recent ssh bug, if you would verify this, use the command below



        for i in 1..15;do ssh -fNt pippo@remote.server.com & >/dev/null ;done





        share|improve this answer



























          1














          Maybe if you have more then ssh 10 sessions waiting for insert the password, you have that kind of error, i remember that was recent ssh bug, if you would verify this, use the command below



          for i in 1..15;do ssh -fNt pippo@remote.server.com & >/dev/null ;done





          share|improve this answer

























            1












            1








            1







            Maybe if you have more then ssh 10 sessions waiting for insert the password, you have that kind of error, i remember that was recent ssh bug, if you would verify this, use the command below



            for i in 1..15;do ssh -fNt pippo@remote.server.com & >/dev/null ;done





            share|improve this answer













            Maybe if you have more then ssh 10 sessions waiting for insert the password, you have that kind of error, i remember that was recent ssh bug, if you would verify this, use the command below



            for i in 1..15;do ssh -fNt pippo@remote.server.com & >/dev/null ;done






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 3 '14 at 21:31









            c4f4t0rc4f4t0r

            3,84832133




            3,84832133























                0














                Something like this happened on a recent install. In this situation /etc/hosts.deny existed and had no settings that explicity denied access, so the circumstances seem similar. It was necessary to alter /etc/hosts.allow to add something like:



                sshd: 192.168.127.0/255.255.255.128


                The IP details need to be adjusted to your needs, or are replaced with ALL if there is no concern with allowing ssh from everywhere.



                After making the changes, stop and restart sshd.



                Upvoted answers to following question provide more examples.



                SSH hosts.deny and hosts.allow



                Here is someone else's testimony that links the error message with the solution.



                How To Fix : ssh_exchange_identification: Connection closed by remote host problem when logging in with SSH






                share|improve this answer

























                • Hmm - sadly that didn't fix it for me. I think my situation differs from the ones in the example. I am able to ssh in on port 22 with no trouble. It's only when I try to tunnel through another port that I get the errors mentioned.

                  – Jacob Ewing
                  Jan 10 '13 at 18:27











                • Granted that the tunnel is a distinctive difference. Given that, does this help: discussion.dreamhost.com/thread-97951.html ? I have also found references to an indication that uninstalling and re-installing the sshd package on debian-like systems corrects an issue with keys that causes the behavior you describe ( discussion.dreamhost.com/thread-97951.html et. al. ).

                  – kbulgrien
                  Jan 10 '13 at 18:59












                • You do have sshd (openssh-server) installed on both systems, right?

                  – kbulgrien
                  Jan 10 '13 at 19:06











                • Yupyup. I've been doing this for quite a long time, and only ran into trouble last week after switching to Debian on my home machine (the server). I'll try your suggestion of un/re-installing sshd when I get home tonight.

                  – Jacob Ewing
                  Jan 10 '13 at 19:53















                0














                Something like this happened on a recent install. In this situation /etc/hosts.deny existed and had no settings that explicity denied access, so the circumstances seem similar. It was necessary to alter /etc/hosts.allow to add something like:



                sshd: 192.168.127.0/255.255.255.128


                The IP details need to be adjusted to your needs, or are replaced with ALL if there is no concern with allowing ssh from everywhere.



                After making the changes, stop and restart sshd.



                Upvoted answers to following question provide more examples.



                SSH hosts.deny and hosts.allow



                Here is someone else's testimony that links the error message with the solution.



                How To Fix : ssh_exchange_identification: Connection closed by remote host problem when logging in with SSH






                share|improve this answer

























                • Hmm - sadly that didn't fix it for me. I think my situation differs from the ones in the example. I am able to ssh in on port 22 with no trouble. It's only when I try to tunnel through another port that I get the errors mentioned.

                  – Jacob Ewing
                  Jan 10 '13 at 18:27











                • Granted that the tunnel is a distinctive difference. Given that, does this help: discussion.dreamhost.com/thread-97951.html ? I have also found references to an indication that uninstalling and re-installing the sshd package on debian-like systems corrects an issue with keys that causes the behavior you describe ( discussion.dreamhost.com/thread-97951.html et. al. ).

                  – kbulgrien
                  Jan 10 '13 at 18:59












                • You do have sshd (openssh-server) installed on both systems, right?

                  – kbulgrien
                  Jan 10 '13 at 19:06











                • Yupyup. I've been doing this for quite a long time, and only ran into trouble last week after switching to Debian on my home machine (the server). I'll try your suggestion of un/re-installing sshd when I get home tonight.

                  – Jacob Ewing
                  Jan 10 '13 at 19:53













                0












                0








                0







                Something like this happened on a recent install. In this situation /etc/hosts.deny existed and had no settings that explicity denied access, so the circumstances seem similar. It was necessary to alter /etc/hosts.allow to add something like:



                sshd: 192.168.127.0/255.255.255.128


                The IP details need to be adjusted to your needs, or are replaced with ALL if there is no concern with allowing ssh from everywhere.



                After making the changes, stop and restart sshd.



                Upvoted answers to following question provide more examples.



                SSH hosts.deny and hosts.allow



                Here is someone else's testimony that links the error message with the solution.



                How To Fix : ssh_exchange_identification: Connection closed by remote host problem when logging in with SSH






                share|improve this answer















                Something like this happened on a recent install. In this situation /etc/hosts.deny existed and had no settings that explicity denied access, so the circumstances seem similar. It was necessary to alter /etc/hosts.allow to add something like:



                sshd: 192.168.127.0/255.255.255.128


                The IP details need to be adjusted to your needs, or are replaced with ALL if there is no concern with allowing ssh from everywhere.



                After making the changes, stop and restart sshd.



                Upvoted answers to following question provide more examples.



                SSH hosts.deny and hosts.allow



                Here is someone else's testimony that links the error message with the solution.



                How To Fix : ssh_exchange_identification: Connection closed by remote host problem when logging in with SSH







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Apr 13 '17 at 12:14









                Community

                1




                1










                answered Jan 10 '13 at 18:16









                kbulgrienkbulgrien

                285413




                285413












                • Hmm - sadly that didn't fix it for me. I think my situation differs from the ones in the example. I am able to ssh in on port 22 with no trouble. It's only when I try to tunnel through another port that I get the errors mentioned.

                  – Jacob Ewing
                  Jan 10 '13 at 18:27











                • Granted that the tunnel is a distinctive difference. Given that, does this help: discussion.dreamhost.com/thread-97951.html ? I have also found references to an indication that uninstalling and re-installing the sshd package on debian-like systems corrects an issue with keys that causes the behavior you describe ( discussion.dreamhost.com/thread-97951.html et. al. ).

                  – kbulgrien
                  Jan 10 '13 at 18:59












                • You do have sshd (openssh-server) installed on both systems, right?

                  – kbulgrien
                  Jan 10 '13 at 19:06











                • Yupyup. I've been doing this for quite a long time, and only ran into trouble last week after switching to Debian on my home machine (the server). I'll try your suggestion of un/re-installing sshd when I get home tonight.

                  – Jacob Ewing
                  Jan 10 '13 at 19:53

















                • Hmm - sadly that didn't fix it for me. I think my situation differs from the ones in the example. I am able to ssh in on port 22 with no trouble. It's only when I try to tunnel through another port that I get the errors mentioned.

                  – Jacob Ewing
                  Jan 10 '13 at 18:27











                • Granted that the tunnel is a distinctive difference. Given that, does this help: discussion.dreamhost.com/thread-97951.html ? I have also found references to an indication that uninstalling and re-installing the sshd package on debian-like systems corrects an issue with keys that causes the behavior you describe ( discussion.dreamhost.com/thread-97951.html et. al. ).

                  – kbulgrien
                  Jan 10 '13 at 18:59












                • You do have sshd (openssh-server) installed on both systems, right?

                  – kbulgrien
                  Jan 10 '13 at 19:06











                • Yupyup. I've been doing this for quite a long time, and only ran into trouble last week after switching to Debian on my home machine (the server). I'll try your suggestion of un/re-installing sshd when I get home tonight.

                  – Jacob Ewing
                  Jan 10 '13 at 19:53
















                Hmm - sadly that didn't fix it for me. I think my situation differs from the ones in the example. I am able to ssh in on port 22 with no trouble. It's only when I try to tunnel through another port that I get the errors mentioned.

                – Jacob Ewing
                Jan 10 '13 at 18:27





                Hmm - sadly that didn't fix it for me. I think my situation differs from the ones in the example. I am able to ssh in on port 22 with no trouble. It's only when I try to tunnel through another port that I get the errors mentioned.

                – Jacob Ewing
                Jan 10 '13 at 18:27













                Granted that the tunnel is a distinctive difference. Given that, does this help: discussion.dreamhost.com/thread-97951.html ? I have also found references to an indication that uninstalling and re-installing the sshd package on debian-like systems corrects an issue with keys that causes the behavior you describe ( discussion.dreamhost.com/thread-97951.html et. al. ).

                – kbulgrien
                Jan 10 '13 at 18:59






                Granted that the tunnel is a distinctive difference. Given that, does this help: discussion.dreamhost.com/thread-97951.html ? I have also found references to an indication that uninstalling and re-installing the sshd package on debian-like systems corrects an issue with keys that causes the behavior you describe ( discussion.dreamhost.com/thread-97951.html et. al. ).

                – kbulgrien
                Jan 10 '13 at 18:59














                You do have sshd (openssh-server) installed on both systems, right?

                – kbulgrien
                Jan 10 '13 at 19:06





                You do have sshd (openssh-server) installed on both systems, right?

                – kbulgrien
                Jan 10 '13 at 19:06













                Yupyup. I've been doing this for quite a long time, and only ran into trouble last week after switching to Debian on my home machine (the server). I'll try your suggestion of un/re-installing sshd when I get home tonight.

                – Jacob Ewing
                Jan 10 '13 at 19:53





                Yupyup. I've been doing this for quite a long time, and only ran into trouble last week after switching to Debian on my home machine (the server). I'll try your suggestion of un/re-installing sshd when I get home tonight.

                – Jacob Ewing
                Jan 10 '13 at 19:53











                0














                I had the same problem and in the end solved the problem by correcting the /etc/network/interfaces:



                auto eth0
                iface eth0 inet static


                or



                auto eth0
                iface eth0 inet dhcp


                without that config I never get reverse connection to my ssh tunnel.






                share|improve this answer





























                  0














                  I had the same problem and in the end solved the problem by correcting the /etc/network/interfaces:



                  auto eth0
                  iface eth0 inet static


                  or



                  auto eth0
                  iface eth0 inet dhcp


                  without that config I never get reverse connection to my ssh tunnel.






                  share|improve this answer



























                    0












                    0








                    0







                    I had the same problem and in the end solved the problem by correcting the /etc/network/interfaces:



                    auto eth0
                    iface eth0 inet static


                    or



                    auto eth0
                    iface eth0 inet dhcp


                    without that config I never get reverse connection to my ssh tunnel.






                    share|improve this answer















                    I had the same problem and in the end solved the problem by correcting the /etc/network/interfaces:



                    auto eth0
                    iface eth0 inet static


                    or



                    auto eth0
                    iface eth0 inet dhcp


                    without that config I never get reverse connection to my ssh tunnel.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Dec 3 '13 at 3:48









                    slm

                    5,041124360




                    5,041124360










                    answered Dec 3 '13 at 0:30









                    dr4ck0dr4ck0

                    1




                    1





















                        0














                        In my case, I had to insert to /etc/ssh/sshd_config of the gateway machine the following lines:



                        Match User <username>
                        GatewayPorts yes


                        See more details here



                        Hope this helps!






                        share|improve this answer








                        New contributor




                        floatingpurr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.
























                          0














                          In my case, I had to insert to /etc/ssh/sshd_config of the gateway machine the following lines:



                          Match User <username>
                          GatewayPorts yes


                          See more details here



                          Hope this helps!






                          share|improve this answer








                          New contributor




                          floatingpurr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






















                            0












                            0








                            0







                            In my case, I had to insert to /etc/ssh/sshd_config of the gateway machine the following lines:



                            Match User <username>
                            GatewayPorts yes


                            See more details here



                            Hope this helps!






                            share|improve this answer








                            New contributor




                            floatingpurr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.










                            In my case, I had to insert to /etc/ssh/sshd_config of the gateway machine the following lines:



                            Match User <username>
                            GatewayPorts yes


                            See more details here



                            Hope this helps!







                            share|improve this answer








                            New contributor




                            floatingpurr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            share|improve this answer



                            share|improve this answer






                            New contributor




                            floatingpurr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            answered 2 days ago









                            floatingpurrfloatingpurr

                            1011




                            1011




                            New contributor




                            floatingpurr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.





                            New contributor





                            floatingpurr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.






                            floatingpurr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Server Fault!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f465881%2fssh-tunnel-error-ssh-exchange-identification-connection-closed-by-remote-host%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                                Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                                Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070