I was using Bitbucket successfully with SmartGit, but after they changed their licensing requirements I tried to change to git for windows. I installed git for windows and then checked that OpenSSH was successfully installed by running
ssh -V
getting
OpenSSH_9.2p1, OpenSSL 1.1.1t 7 Feb 2023
Then I started the ssh-agent with
eval $(ssh-agent)
and got
Agent pid 629
Then I tried adding my existing SSH key to the agent with
ssh-add ~/my_key_name
but that didn’t work, so I generated a new key with
ssh-keygen -t ed25519 -b 4096 -C "{username@emaildomain.com}" -f {ssh-key-name}
and then added the public key to my Bitbucket account. I added the key to the agent with
ssh-add ~/my_new_key_name
which resulted in
Identity added: /c/Users/me/my_new_key_name (myaddress@email.com)
I ran
ssh -T git@bitbucket.org
to confirm that the SSH key was successfully added, getting
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
But when I then run git pull or git fetch I get
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.
If I run
ssh -T git@bitbucket.org
again I’m refused, getting
git@bitbucket.org: Permission denied (publickey).
I’ve run out of ideas, please help.