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.
Community moderators have prevented the ability to post new answers.
I found out the error. When I generated key while in ~/.ssh/ instead of generating it while in another directory, the key started working and I could push the info to repository. Thank you.
Hi Venkata,
Can you let us know what happens when you run the following command?
$ ssh -T git@bitbucket.org |
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.
Regards,
Renato Rudnicki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the actual error you are getting?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.