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 am using ssh keys for authentification. on my old repos i can pull, push, everything works. that should also means, that my ssh-key which i added to my personal settings is working.
but on the same ubuntu machine, i cant push anything to a new created repository.
it fails with:
The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated.
when i try:
ssh -i -T email@example.com
Warning: Identity file -T not accessible: No such file or directory.
PTY allocation request failed on channel 0
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
Connection to bitbucket.org closed.
it shows that authentification works.
Hello @keulemaster ,
Thank you for reaching out to Atlassian Community!
The error you are receiving is most likely because the ssh key being used does not have the required permissions in the repository you are trying to push to.
The test with the ssh command you have used confirms the SSH key used is recognized by bitbucket for authentication, but when pushing to a repository, bitbucket also checks for authorization to confirm if that key has access to the content you are trying to read/write.
When you add an ssh key to your personal settings, this key will have the same access as your account, so your account needs to have write permissions to the repository you are pushing to.
Another thing that might be happening if you have multiple SSH keys in your local machine, is that the wrong key is being presented to git. In order to check what the key ssh is trying to use you can run the following command to include verbose logs :
GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git push
That will include ssh logs of the keys that were found and the order of precedence that ssh will attempt to use them.
By default in SSH, the first key that passes authentication will be used, but that does not necessarily mean that key has access to the repository in question. So make sure to identify if the key being used is the one you have added to the bitbucket account that has access to the repository.
Hope that helps! Let me know in case you have any questions.
Thank you, @keulemaster .
@Patrik SHello Patrik, thanks for the informativ answer!
The repository into i cant push, was made by me, with the user that i used also for the authentification test with SSH. I also tried two different PCs, from both i cant push anything to my new project. I also cant add my user for authorization to the new project, because as the owner of the workspace, i am implicitly added. Maybe i miss some configuration stuff? i allready mad more then 10 repos at bitbucket, all of them worked for me. but the last one didnt...
i double checked..i have only on ssh key in my ubuntu account...on both of my PCs.
Thanks for your help
Hello @keulemaster ,