When I used Ruby on Rails to create sample project on my virtual machine using Ubuntu, I created an SSH key and saved in the folder ~/.ssh/id_rsa.pub
I have also saved this SSH key on Bit Bucket.
But error of invalid key comes when try to push this.
When I use cloud environment for ROR projects, I could push the information of the project to Bit Bucket without any error.
Also in Ubuntu 2 separate SSH keys were created probably when I was in 2 different directories like ~/workspace or ~/workspace/hello_app
I however uploaded both the SSH keys on Bitbucket.
So how to resolve the error when trying to push the info to Bitbucket repository from my virtual machine using Ubuntu.
I am getting the following error:
~/workspace/hello_app$ git push -u origin --all
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I created the key as follows and copied the public key to the directory ~/.ssh/ :
$ ssh-keygen -t rsa (this command was made while in home directory)
Generating public/private rsa key pair.
Enter file in which to save the key (/home/venkata/.ssh/id_rsa): id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
and then using cat command, displayed and then copied to Bitbucket. The repository hello_app was created in BitBucket. Presently this repository is empty.
Can you let us know what happens when you run the following command?
$ ssh -T email@example.com
This might not be your case, but as a quick test, what happens if you run the push command using sudo in front of?
Also, this can happen due to a variety of reasons such as 1) your public key not loaded in your Bitbucket account 2) your key not loaded onto your ssh-agent etc.
This document does a good job of walking you through the process of troubleshooting your problems. There is a specific section for the Permission denied (publickkey) error as well that you might find useful.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs