1

I am new to git and when I try to upload my newly created repository to github I get the message:

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

: Any idea what this means?

yazz.com
  • 57,320
  • 66
  • 234
  • 385

2 Answers2

5

Did you forget to add your public key to the github project settings? Also check to make sure your private key is in your .ssh directory.

Goto https://github.com/[username here]/[project name here]/edit and make sure your public key is set.

Read this too: http://help.github.com/mac-key-setup/

Felix Khazin
  • 1,479
  • 2
  • 10
  • 16
0

I have faced the same problem but i solved using the following steps

  1. First of all i add ssh key to my github account which is not added before. use following command in git bash $ssh-keygen -t rsa -C "your_email@youremail.com"

    it generates the new file new_key.pub file whatever you put the file name during the key generation process.

  2. paste your new_key.pub into GitHub. go to GitHub Account -> setting -> ssh key -> add ssh key

  3. now rename the new_key.pub into id_rsa.pub.

and it solved my problem

Ajay
  • 4,850
  • 2
  • 32
  • 44