Why my reverse ssh is closing when I try to connect to it?

0

I'm using a reverse SSH tunnel on Debian with openssh-server and autossh: something like -R 1234:localhost:22 with a monitoring port also set.

Generally, it works well, but I'm having the following problem: the tunnel opens and I see my remote server listening on 127.0.0.1:1234. But as soon as I try to establish a connection to this address:port, I get a "Connection refused" message and the port closes until autossh reopens it.

I have another tunnel, a -L. It sends its logs to this remote server. This tunnel seems to work as I'm receiving logs.

Anyone would have an idea of what's happening?

user305368

Posted 2014-03-05T20:05:20.057

Reputation: 1

do you have anything like a misconfigured snort or failban or iptables rules that could get in the way? Do you have a service already listening on 1234? Your -R command is definitely good so there's something else getting in the way. – zmo – 2014-03-05T20:41:44.210

Looking at the informations I have now, it looks very strange. This machine opens a few tunnels: -D (socks), -L (local) and -R (remote). All the -R tunnels won't work. I already ran some tests with fail2ban off or iptables ... – user305368 – 2014-03-05T20:47:56.430

Answers

0

After a while, I thought it was a bad network cable: the tunnel opens but as soon as there is more trafic on it, it falls.

Actually, I wasn't so far: the device initiating the tunnel had the same IP than another device. The connection was not stable.

user305368

Posted 2014-03-05T20:05:20.057

Reputation: 1