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

Next challenges

Recent achievements


  • Give kudos
  • My kudos


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ssh -T returns logged in as user, but git clone gives Permission denied (publickey

The question title says it all. I added my keys under my bitbucket account and as expected I can do ssh -T to get logged in into the server and received the logged in as Satco message. But then when I try to clone a repo where I am admin, for example git clone I get:

13:05:46.735698 exec-cmd.c:237 trace: resolved executable dir: C:/Users/username/AppData/Local/Programs/Git/mingw64/bin
13:05:46.735698 git.c:440 trace: built-in: git clone
Cloning into 'perception'...
13:05:46.782564 run-command.c:663 trace: run_command: unset GIT_DIR; ssh 'git-upload-pack '\''Satco/perception.git'\''' Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


1 answer

0 votes

Hi @Kaju Bubanja ,

Perhaps the SSH key used to connect to the repository may not be same. Therefore, could you please run the following command reviewing the SSH key used by your clone command:

ssh -v -T

This should provide with:

debug1: Offering public key: ....
debug1: Server accepts key: ...
Enter passphrase for key '....':
debug1: Authentication succeeded (publickey).
Authenticated to ([]:22).

Having this information, could you please attempt on issuing the "git clone" command providing the SSH key mentioned in Offering public key?

GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example -F /dev/null"

The command above will:

  • -i can sometimes be overridden by your config file (e.g ~/.git/config), in which case, you should give SSH an empty config file instead (e.g /dev/null
  • use the SSH key (private) provided, e.g ~/.ssh/id_rsa_example

If you continue on experiencing issues, please enable DEBUG on your Git command to review if the SSH key you are providing is the same one as the one you have on

# on Linux (Terminal / Git Bash)
export GIT_TRACE=1
# on Windows (Command Prompt)

Kind regards,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,897 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you