Always receiving "Git: git@bucket.org: Permission denied (publickey)" in Visual Studio Code
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)
-
-
- changed status to open
-
i got the same error! is there a solution?
-
@Ody Light , does it work if you pull the repository from the command line?
-
I have the same error, pulling from command line works.
-
@Kamil Maráz , which OS are you using?
-
Account Deactivated @Kamil Maráz Can you let us know if setting up ssh-agent fixes the issue? https://dev.to/cdennig/vs-code-git-integration-with-ssh-stops-working-1mj0
-
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.
-
Account Deactivated - changed status to resolved
Closing the issue.
@RamoramaInteractive @Ody Light Please re-open if the suggestions in the ticket do not fix the issue.
-
How was this resolved? There is no solution here.
-
Yes, I am facing the same problem. Where can I find the solution?
-
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!
-
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.
-
also had the error then used the above to fix it.
re ran the adding of the keyssh-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
- Log in to comment
@RamoramaInteractive , does it work if you pull your repository using git from the command line?
It sounds like you might not have an SSH key configured for Bitbucket on your computer. If that’s the case there are instructions for setting up an SSH key at https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html