Why does Visual Studio Code wants to access my private SSH key?

I started using SSH based authentication to push/pull to/from my github remotes.

For any git related work, I used the default terminal present in Ubuntu.

  • Git - How to auto push changes in a directory to another branch
  • including the .git folder when running git archive
  • Git pull without arguments?
  • Git update-server-info nothing do
  • Is there an equivalent of git-walk next / git-walk prev in hg?
  • NPM install from Github, ambiguous argument
  • The problem started when I switched to Visual Studio Code a few weeks ago. VSCode has some git features, and this results in a prompt every few minutes.

    Unlock Private SSH Key

    This prompt is displayed/drawn over any window. The keyboard cursor changes focus from the current working window to this prompt window. The problem further exacerbates if you are using multiple monitors.

    My main questions are –

    1. Why does this happen?
    2. What kind of access am i providing to Visual Studio Code?
    3. Will the key be decrypted and VSCode will have access to my private SSH key forever?

    My efforts

    I hadn’t set up the ssh-agent till now. So, i followed these steps here to add my private key to the ssh-agent. I thought that once I set ssh-agent up and VSCode needed access to my private key, the ssh-agent would handle it instead.

    But that didn’t stop the prompts either, which makes me think that VSCode needs direct access to my decrypted private SSH keys.

    At this point, the prompts were coming up every few minutes and disturbing my workflow and I found [this answer][3] which showed me the way to make VSCode stop fetching any git realted changes automatically.

    And this is where things stand as of now.

    I really think that VSCode is a good editor. Much better than Atom. And I really want to use its inbuilt git functions but I won’t allow it access to my private SSH keys.

    I went have visited almost all the community resources of VSCode listed on https://code.visualstudio.com/community but I couldn’t get a good answer on this.

    I am running Ubuntu 16.04.2 with git version 2.7.4

  • Git-flow for the system that others have heavy dependency on
  • What's the difference between git clone --mirror and git clone --bare
  • Fatal Error when updating submodule using GIT
  • X session in Git Bash on Windows?
  • .pack file from git repo can't be deleted using File delete() method
  • Can you determine the git version of a file copied from a repo?
  • One Solution collect form web for “Why does Visual Studio Code wants to access my private SSH key?”

    Why does this happen?

    It is a gnome-keyring, not the ssh-agent.

    What kind of access am i providing to Visual Studio Code?

    It is only allowed to access the remote server (github) using your credentials (probably you configured it to do so).

    Will the key be decrypted and VSCode will have access to my private SSH key forever?

    No. The key is decrypted but NEVER available to calling application (in this case VSCode). The code is decrypted inside of gnome-keyring and the application has only access to request signatures using this key.

    Git Baby is a git and github fan, let's start git clone.