talktalk
talktalk

Reputation: 26

Bitbucket Permission denied (publickey) Git on OS X

I'm attempting to use a three location Git repo setup

  1. local
  2. remote (Bitbucket)
  3. web server

I've successfully created my SSH key, my Git repo on local and pushed it to my remote. I'm attempting to do the same from my web server to my remote but receive the error:

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

I'm relatively new to Git/Terminal/SSH and might be missing something obvious that's necessary to push from web server to remote. I've been through the entire Bitbucket SSH FAQ to no avail. I'm not sure why I can push, via SSH, from my local to remote but am unable from my web server to remote.

Upvotes: 1

Views: 2244

Answers (1)

Sonia Hamilton
Sonia Hamilton

Reputation: 4419

A couple of things you can do on your webserver (which I presume is running Linux):

  • try ssh-ing from webserver to bitbucket - is that successful? Also try ssh -vvv (very verbose) - see what sort of errors you're getting
  • check the permissions of your ~/.ssh directory on your webserver. They should be 0600
  • also try ssh-ing from webserver to other hosts you know you have ssh access to

Upvotes: 2

Related Questions