title: SSH Tunnel Timing out on client side
body: <p>So I'm on my local machine, and I'm sshing into a google compute server.</p>
  
  <p>From this google compute server, I'm trying to establish an ssh tunnel to a third party server ($host) using the following command:</p>
  
  <pre><code>ssh username@$host -L 3306:127.0.0.1:3306 -N
  </code></pre>
  
  <p>And after hanging for 20-30 seconds, I get:</p>
  
  <pre><code>ssh: connect to host $host port 22: Connection timed out
  </code></pre>
  
  <p>I can use the exact same command on my local machinet to the third party server and it works fine.</p>
  
  <p>I've killed anything using the 3306 port on the google compute server.</p>
  
  <p>I've opened port 22 and 3306 on the google server through the interface (through I can't tell if this applies to outbound connections also).</p>
  
  <p>Not sure where to go from here, any help would be appreciated.</p>
  
  <p>Edit1: The google server can successfully ping the third party server.</p>
  
  <p>Edit2: Just tried it from the company server, it doesn't work there either. Both he google-compute and the company server are linux (Deb Wee and Ubuntu respectively) and the local machine is windows. The fact that I'm sshing into them shouldn't make a difference should it?</p>
  
  <p>Edit3: Changed the default SSH port on the google server to 22222 and connected to it using that instead. Trying to connect to third party now with:</p>
  
  <pre><code>sudo ssh -p 22 username@$host -L 3306:127.0.0.1:3306 -N -v -v -v
  </code></pre>
  
  <p>Debug output is:</p>
  
  <pre><code>OpenSSH_6.6.1, OpenSSL 1.0.1e 11 Feb 2013
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: /etc/ssh/ssh_config line 19: Applying options for *
  debug2: ssh_connect: needpriv 0
  debug1: Connecting to $host [$host] port 22.
  </code></pre>
  
  <p>And after that it just hangs.</p>
  
  <p>Debug output on local machine using same command is is:</p>
  
  <pre><code>OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
  debug2: ssh_connect: needpriv 0
  debug1: Connecting to $host [$host] port 22.
  debug1: Connection established.
  *other junk*
  </code></pre>