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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

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
4,457,346
Community Members
 
Community Events
176
Community Groups

Cannot push using git on linux

Steps I've taken:

Follow this guide exactly https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/

This is my test connection message:

ssh -T git@bitbucket.org
authenticated via ssh key.

You can use git to connect to Bitbucket. Shell access is disabled

 This is message I get when I try to push my files into my repo

root@jirau-virtual-machine:/var/atlassian/application-data/jira/scripts# git push bitbucket2
root@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.

 This repo does exist in my Bitbucket Cloud and was created by me

My remote settings:

root@jirau-virtual-machine:/var/atlassian/application-data/jira/scripts# git remote -v
bitbucket2 ssh://bitbucket.org/inforcekz_jira/scripts/src/master/ (fetch)
bitbucket2 ssh://bitbucket.org/inforcekz_jira/scripts/src/master/ (push)

SSH settings under Personal settings in Bitbucket:

image.png

SSH port is open on my VM as I can only connect to it via SSH

2 answers

I've got the same issue, but I found better solution, I just changed remote from git@bitbucket.org into user@bitbucket.org

0 votes
Ben Atlassian Team Jul 20, 2022

Hey Gleb,

Welcome to the Bitbucket Cloud Community!

A common issue I see is that the SSH will authenticate, but it will not use the correct key and therefore will fail to grant access.
Please try to update your remote URL as follows to specify the username to authenticate with in GIT, provided your ~/.ssh/config file has been mapped correctly this should authenticate without issues:

git remote set-url origin username@bitbucket.org:workspaceID/reposlug.git
If this does not work, try to edit your config file directly to, again, specify the username that you would be using to authenticate with - replacing "username" in the text below:
#username account
Host bitbucket.org-username
HostName bitbucket.org
User git
IdentityFile ~/.ssh/privatekeyname
IdentitiesOnly yes
Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events