You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I set up an SSH key by following the instructions for Mac here: https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/#Set-up-SSH-on-macOS-Linux
After setup, I ran "ssh -T firstname.lastname@example.org" to test the connection and got the classic "Permission denied (publickey)". So I looked at the troubleshooting section here:
and none of the scenarios described for my particular error seem to match. As an experiment, I set the same ssh key up with GitHub (which is basically the same process) and the ssh test worked just fine. In addition, I was able to clone a repo on Bitbucket using ssh, even though the connection test never works. What in the world is going on?
Hi Brian and welcome to the community.
One possible reason I can think of is that the private key offered when you run ssh -T email@example.com may be different than the key offered when you clone.
You can see what key is being offered in the first case if you run ssh -Tvvv firstname.lastname@example.org, the key offered should be shown in the output.
You can create a file named config in your ~/.ssh directory and add the following (if the file exists, just add the following lines):
where /Users/Username/.ssh/id_rsa replace with the path to the private SSH key whose public key is uploaded to Bitbucket, to ensure that this key will be offered.
Hi Brant, thanks for your swift reply! Yes, I have seen this page and checked out all of the scenarios, but none seem to apply:
1) I have verified that my ssh-agent is up and running and my key is loaded
2) I have verified that my key is uploaded to Bitbucket, and can screenshot if necessary.
3) Git clearly has permission to write to my filesystem, since I've been able to use it to download repos, even with ssh. It's the test command that mysteriously fails.
Like before, issuing the
ssh -T email@example.com
results in the same Permission denied (publickey). Real head scratcher here!
By the way, I am using a MacBook Pro 2019, Monterey 12.2.1