Always receiving "Git: git@bucket.org: Permission denied (publickey)" in Visual Studio Code

Issue #313 resolved
RamoramaInteractive created an issue

Although I authenicated with my Bitbucket Repository, I always receive the error "Git: git@bucket.org: Permission denied (publickey)" when I start to pull my repository.

What did I wrong and how to provide my SSH key to Visual Studio Code if needed?

Comments (14)

  1. Kamil Maráz

    I have WSL on Windows 10 set up. My default terminal is bash on windows. Everything works there. But when I am using “Git pull” command in VSCode, It throws error mentioned above.

    I have ssh-agent running for WSL and Putty for Windows. I know this setup work because I am using applications purely for windows and purely for linux on the same system with SSH access.

    Switching Remote-WSL fixes the issue for me.

  2. Pramod Busam Account Deactivated

    Closing the issue.

    @RamoramaInteractive @Ody Light Please re-open if the suggestions in the ticket do not fix the issue.

  3. Liber Design

    I’m facing same error! This bug is not fixed, why this is maked as RESOLVED?

    Iìm using VS Code on Linux! I have added id_rsa.pub to Bitbucket SSH Key, and added to my machine too.

    Done all commandds like:

    eval $(ssh-agent)
    
    ssh-add ~/.ssh/id_rsa
    

    From command-line, git working fine, all command like PUSH, PULL, FETCH!

    But not from VS Code Menu, or Source Control!

  4. Shuhari

    Still the same problem here. No clue why this was marked “resolved”. Terminal works fine (ssh + password), but VS Code throws “persmission denied” without asking for a password:

    [2022-04-05T21:49:58.439Z] > git clone git@bitbucket.org:xxx/xxx.git /Users/xxx/dev/xxx/xxx --progress [685ms]
    [2022-04-05T21:49:58.439Z] Cloning into '/Users/xxx/dev/xxx/xxx'...
    git@bitbucket.org: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

  5. urbanware.tech

    also had the error then used the above to fix it.
    re ran the adding of the key

    ssh-add ~/.ssh/nameofyourkey
    
    ssh -T git@bitbucket.org
    
    authenticated via ssh key.
    

    if you get this then you’re ok

    if that didn’t work run it as ssh -Tv git@bitbucket.org to get all the error output. Check to make sure you’re using the right public key

    If passed then can run git normally

  6. Log in to comment