title: Jenkins ssh remote hosts and keyfile path differences on slaves
body: <p>We have a Jenkins server that uses the <a href="https://wiki.jenkins-ci.org/display/JENKINS/SSH+plugin" rel="nofollow">SSH plugin</a> to configure a SSH remote hosts within the global Jenkins configuration. These ssh connections are using a public/private key for authentication to the remote host.</p>
  
  <p>We then use these configured SSH remote hosts in the build step "Execute shell script on remote host using ssh" (I believe this is also part of the SSH plugin) in a number of jobs.</p>
  
  <p>The problem I'm having is that any job using the execute shell script on remote host using ssh must be running on a Windows slave, since I haven't found a way to put in some sort of relative path to the keyfile.</p>
  
  <p>On windows the file would be located at: <code>C:\Users\&lt;username&gt;\.ssh\</code>
  On linux the file would be located at: <code>/home/&lt;username&gt;/.ssh/</code></p>
  
  <p>I've tried many iterations of using system environment variables, setting environment variables on the node configuration page and using these as part of the keyfile path without any luck.</p>
  
  <p>Am I missing something? Is there a better way to handle it. There must be a way to manage keyfile locations and differences between ssh remote hosts across slaves.</p>