title: Configuring SSH Agent Plugin for Jenkins on Windows
body: <p>I am trying to configure the SSH Agent Plugin (v1.15) on a Windows installation of Jenkins (v2.103) to be able to issue commands via ssh to a remote machine.</p>
  
  <p>I have installed the plugin and I have added an entry into Jenkins Credentials (shown below) which contains the private key and passphrase which can login to the remote machine (hostname: corp-wfdemo).  I have confirmed this key works for authenticating the user running Jenkins.</p>
  
  <p><a href="https://i.stack.imgur.com/TJVHI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TJVHI.png" alt="Credentials in Jenkins"></a></p>
  
  <p>I've created a Pipeline project and added this Groovy script to test out ssh:</p>
  
  <pre><code>node ('ssh') {
      stage ('test') {
          sshagent(['corp-wfdemo']) {
              sh 'ls -la'
          }
      }
  }
  </code></pre>
  
  <p>The Jenkins master has the label <code>ssh</code>. This is a Windows Server 2012 machine with Git Bash (MINGW64) installed.  </p>
  
  <p>When I try running this job it fails when trying to find some auto-generated askpass.sh script.  Here's the output:</p>
  
  <p><a href="https://i.stack.imgur.com/eXDfi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eXDfi.png" alt="Jenkins job output"></a></p>
  
  <p>Can anyone help?  Thanks in advance!</p>
  
  <p>Also, each time I try running this job a new instance of <code>ssh-agent</code> is spawned and not terminated, leaving this mess:</p>
  
  <p><a href="https://i.stack.imgur.com/r7efM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r7efM.png" alt="ssh-agent processes"></a></p>