5

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 followingfile: $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 have every stack overflow article on Bitbucket auth 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.

user10664542
  • 873
  • 13
  • 32
  • Your private SSH key (`/home/proc/.ssh/id_rsa`) requires an extra password - see https://stackoverflow.com/a/25721662/3474146 – alex Sep 16 '19 at 13:57
  • that solution does not work. it's called a pass phrase. I have a pass phrase set on my pub/priv key pair. The problem has nothing to do with a pass phrase. The response did not help. You yourself are not able to push to Bitbucket having your public key entered into Bitbucket settings (Access Keys), for the individual project. No one can. – user10664542 Sep 17 '19 at 14:50
  • Sorry - figured *Enter passphrase for key '/home/proc/.ssh/id_rsa': Unauthorized* is probably a passphrase issue. – alex Sep 17 '19 at 15:10
  • When I enter my passphrase (correctly each time) - it gives an error: ```fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.``` It does not say incorrect passphrase, but accepts my passphrase. It's not a passphrase issue, my passphrase is 5 lowercase characters that I am entering correctly each and every time, I am able to pull with this 5 lower character passphrase, but not pull. If you have any ideas for a solution, please post. You could go try this first yourself, see the problem before responding. – user10664542 Sep 17 '19 at 15:21
  • That is a different error - I would check the local/global git configs to see what user you are pushing as, and I would check permissions on the remote Bitbucket repository to see if that user indeed has write permissions. I would also verify that the public key uploaded to Bitbucket is the same as your local public key. – alex Sep 17 '19 at 15:26

0 Answers0