Vscode: git integration - Permission Denied (publickey)

Created on 8 May 2016  路  13Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.0.0
  • OS Version: Win 7

Steps to Reproduce:

  1. Clone a repository
  2. Attempt any git action against the remote from Code (fetch, pull, push)

Works fine from windows cli, git gui, etc

Full detail here
http://stackoverflow.com/questions/37103047

Is this buggy behavior?

git needs more info

Most helpful comment

I have this problem too. It works on cmd, git-bash. My credential files are in ~/.ssh folder. I think I need to input passphrase for my credential files before accessing remote repo but vscode doesn't provide an interface to input passphrase.

My current solution is everytime I want to run vscode, I run it via git-bash. It would be more convenient if there is interface to input passphrase before accessing remote

All 13 comments

What are your credential files names, in ~/.ssh?

I am seeing this issue too. If have id_rsa and GitHub_rsa files in my .ssh folder. I am trying to use the id_rsa key to connect to vsts.

Does it work from the command line for you? Which command line?

Closing due to inactivity.

I have this problem too. It works on cmd, git-bash. My credential files are in ~/.ssh folder. I think I need to input passphrase for my credential files before accessing remote repo but vscode doesn't provide an interface to input passphrase.

My current solution is everytime I want to run vscode, I run it via git-bash. It would be more convenient if there is interface to input passphrase before accessing remote

@saggafarsyad Can you show me a screenshot of how you input the passphrase, when it works?

@joaomoreno Here is the screenshot

screenshot_10

I use ssh from git-bash as my ssh agent. When I open git-bash, it will ask for passphrase. Then I run VS Code by writing code.

@saggafarsyad Created #10064 for this.

PS: Cool ConEmu theme btw.

I am also seeing behavior very similar to this, but I'm using plink.exe and pageant.exe as my ssh client and agent, respectively. Everything works fine in the console, and in Git Kraken - but vscode does not appear to either a) be using plink.exe or b) using pageant.

Update: nevermind. It looks like I can set GIT_SSH_COMMAND. Maybe code should have a setting for this instead of relying on an environment variable, but this works for me.

Also: the value of the command has to be quoted. It seems like Code should be more defensive in how it uses the environment variable; this is what I had to do to get it to work.

Did anyone figure out how to fix this? I'm running into the same issue today (VSCode 1.15.1).

The core issue seems to be this; in my case, I had two SSH keys: one generated by GitHub for Windows and one hand-generated with ssh-keygen.

For some reason, Visual Studio Code picked up the latter one instead of the former. To solve this, I added the latter to GitHub, and everything works now.

I found this on stackoverflow. I've used it and it works like a charm.

still having same issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tekbr picture Tekbr  路  191Comments

jez9999 picture jez9999  路  234Comments

Brakkar picture Brakkar  路  364Comments

ozsay picture ozsay  路  247Comments

lw-schick picture lw-schick  路  229Comments