1. Summarize the problem
I followed Bitbucket's instructions on setting up ssh.
I have a pub/priv key pair, and the pub key pasted into Bitbucket settings (Access Keys) for the project.
I have a build server on a GCE VM. git clone
worked successfully, and git pull origin master
works. I am using a passphrase.
However if I make a small change on a single file, git commit
on the GCE VM, and do git push origin master
, it fails with the following error message.
Enter passphrase for key '/home/proc/.ssh/id_rsa':
Unauthorized
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git remote -v
shows
origin git@bitbucket.org:<my-account>/<my-repo>.git (fetch)
origin git@bitbucket.org:<my-account>/<my-repo>.git (push)
If git pull origin master
works OK, then ssh is setup properly.
I added the following file: $HOME/.ssh/.config
, with the contents below, but it did not help.
Host bitbucket.org
IdentityFile ~/.ssh/id_rsa
my keyfile was generated with the following:
ssh-keygen -t rsa -b 4096 -C "<comment>"
2. Provide background including what you've already tried
I've read every stack overflow article on Bitbucket authentication issues.
3. Show some code
git add <changed file>
git commit -m "made some updates"
git push origin master
4. Describe expected actual results including any error messages
I am trying to git push origin master
to bitbucket.org.