title: Reverse SSH connection refused
body: <p>I'm running a raspberry pi in a remote location, so I setup a reverse ssh tunnel to one of my servers (CentOS 7) using autossh. All works fine, I can use this reverse ssh to login to the Raspberry from the server, but I can't get the server to forward the ssh, so I can not connect to the Raspberry via the server from the laptop, I always get Connection Refused.
  Firewall on the server has been shut down the GatewayPorts yes has been added to the sshd_config and sshd restarted.</p>
  
  <p>Details:</p>
  
  <ol>
  <li>On the Raspberry I'm opening the reverse SSh tunnel:</li>
  </ol>
  
  <blockquote>
    <p>autossh -fNC -g -M 0 -R 2223:localhost:22 [serveruser]@[server] -p2002</p>
  </blockquote>
  
  <ol start="2">
  <li>From the server I can ssh into the Raspberry with no problem:</li>
  </ol>
  
  <blockquote>
    <p>ssh [raspberryuser]@localhost -p2223</p>
  </blockquote>
  
  <ol start="3">
  <li>I have added the next to /etc/ssh/sshd_config and restarted sshd service after:</li>
  </ol>
  
  <blockquote>
    <p>GatewayPorts yes</p>
  </blockquote>
  
  <ol start="4">
  <li>I can successfully ssh into the Raspberry from the server:</li>
  </ol>
  
  <blockquote>
    <p>ssh [raspberryuser]@localhost -p2223</p>
  </blockquote>
  
  <ol start="5">
  <li>But when I'm trying to connect from my laptop to the Raspberry through this server:</li>
  </ol>
  
  <blockquote>
  <pre><code>ssh [raspberryuser]@[server] -p2223
  ssh: connect to host [server] port 2223: Connection refused
  </code></pre>
  </blockquote>
  
  <ol start="6">
  <li><p>The firewall on the server has been stopped</p></li>
  <li><p>SELinux is disabled on the server</p></li>
  </ol>
  
  <p>I ran out of ideas, so I'm open to suggestions</p>