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
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
add a comment |
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
One cause of thessh_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 thanchannel 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
add a comment |
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
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
ssh-tunnel
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 thessh_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 thanchannel 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
add a comment |
One cause of thessh_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 thanchannel 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
add a comment |
4 Answers
4
active
oldest
votes
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
add a comment |
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
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
add a comment |
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.
add a comment |
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!
New contributor
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
answered Jan 3 '14 at 21:31
c4f4t0rc4f4t0r
3,84832133
3,84832133
add a comment |
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited Dec 3 '13 at 3:48
slm
5,041124360
5,041124360
answered Dec 3 '13 at 0:30
dr4ck0dr4ck0
1
1
add a comment |
add a comment |
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!
New contributor
add a comment |
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!
New contributor
add a comment |
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!
New contributor
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!
New contributor
New contributor
answered 2 days ago
floatingpurrfloatingpurr
1011
1011
New contributor
New contributor
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 thanchannel 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