title: VS Code / Bitbucket / SSH - Permission denied (publickey)
body: <p>I'm trying to access bitbucket via ssh from vscode but always get <em>permission denied (publickey)</em>. </p>
  
  <p>SSH key(s) are located under <code>~\.ssh\</code>, public key(s) are correctly setup in <code>bitbucket/settings/security/sshkeys</code>. The keys are tested and do work! </p>
  
  <p>After booting, I can access my repository without problems from the windows command prompt and powershell but NOT from git bash or from vscode. Manually setting up ssh in git bash and starting vscode works though:</p>
  
  <pre><code>eval $(ssh-agent)
  ssh-add /c/Users/username/.ssh/privatekey
  code
  </code></pre>
  
  <p><strong>My environment:</strong></p>
  
  <ul>
  <li>Windows 10 Enterprise (1803/17134.765)</li>
  <li>Visual Studio Code (1.35.0)</li>
  <li>git for windows (2.20.1.windows.1)</li>
  <li>bitbucket via ssh</li>
  <li><em>I think</em> I'm using the ssh-agent that was introduced in one of the later Windows10 updates (not sure how to check, the windows ssh-agent service is running though).</li>
  <li>my user folder (containing /.ssh) and the working copy of the repo are located on network drives</li>
  </ul>
  
  <p><em>For me the problem boils down to one question:
  Why is vscode not using windows native, correctly setup ssh service and instead relying on git bash ssh agent?</em></p>
  
  <p>Disclaimer: I spent hours reading threads about this topic and fiddling with settings. I suspect the problem to be related to the delayed deployment of network drives under Windows10 (a known issue). My windows group policy is set to wait for the network on boot/login.</p>