Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

SSH Permission Denied

I set up an SSH key by following the instructions for Mac here:

After setup, I ran "ssh -T" 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? 

2 answers

0 votes

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 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, 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):

PreferredAuthentications publickey
IdentityFile /Users/Username/.ssh/id_rsa

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.

Kind regards,

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

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

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events