title: SSH remote port forwarding through bastion server
body: <p>I'm trying to establish a remote port forwarding to my Mac (target 4004) via a bastion host and Server-A to a Port (1555) on Server B.</p>
  
  <p>So the whole connection is:</p>
  
  <blockquote>
    <p>Mac:4004 => Bastion:22 => A:22 => B:1555</p>
  </blockquote>
  
  <p>And the target is my Mac should have a Port 4004 forwarded from B:1555.</p>
  
  <p><strong>What is working so far?</strong></p>
  
  <ol>
  <li>I can connect to Server A with the command <code>ssh user-bastion@user-A@server-A@server-bastion</code></li>
  <li>On Server A I can establish a connection e.g. telnet to B:1555</li>
  <li>On my windows client I can remote forward the port B:1555 to my local machine via Putty.</li>
  </ol>
  
  <p>I'm now looking for the ssh command to establish this connection on my Mac.</p>
  
  <p><strong>Commands I tried:</strong></p>
  
  <p>Of course I have already searched for it and I've already tried different versions.
  e.g.</p>
  
  <ul>
  <li>ssh -fNT -R 1555:localhost:4004 -J user-bastion@user-A@server-A@server-bastion server-B</li>
  <li>ssh -N user-bastion@user-A@server-A@server-bastion -R server-B:1555:localhost:4004</li>
  </ul>
  
  <p>I always receive message like "Warning: remote port forwarding failed for listen port 1555"</p>