title: Jenkins slave using an ssh gateway
body: <p>I have jenkins running on <code>master.com</code>, and want to have a slave running on <code>slave.com</code>. However, to ssh to the slave I need to go through <code>gateway.com</code>. Generally to ssh to this machine from my normal account, I just use ~/.ssh/config to set up a ProxyCommand.</p>
  
  <p>I have replicated this setup in my <code>/var/lib/jenkins/.ssh/config</code> file:</p>
  
  <pre><code>Host slave.com
   User felix
   ProxyCommand ssh felix@gateway.com nc %h %p
  </code></pre>
  
  <p>I have public key authentication set up for both the gateway and the slave, such that from the command line I can ssh directly from <code>jenkins@master.com</code> to <code>felix@slave.com</code> simply by doing <code>ssh slave.com</code>.</p>
  
  <p>Unfortunately Jenkins does not seem to respect my .ssh/config setup, and the connection times out (the slave is not reachable directly). The Jenkins slave log file is:</p>
  
  <pre><code>java.io.IOException: There was a problem while connecting to slave.com:22
  ....
  Caused by: java.net.ConnectException: Connection timed out
  </code></pre>
  
  <p>How can I figure out whether or not jenkins is respecting my .ssh/config file? Am I missing a step in configuring the master jenkins account or the .ssh/config file for jenkins?</p>