Harish Kumar

Fix access denied error while interacting with git or bitbucket due to ssh

Published on 22 May 2022 · git

Sometimes you will face issue while pushing or pulling code to git or bitbucket via your code editor or might be from terminal intself, and if the error says "access denied" then it could be due to ssh service is disabled or ssh is removed from agent. In that case you can try the following command to resolve that issue

Get-Service -Name ssh-agent | Set-Service -StartupType Manual
ssh-agent
ssh-add
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe

If you dont have ssh key setup already for git then you can follow this article for adding ssh key in github.

For bitbucket follow this article to add ssh key