Heroku error: "Permission denied (public key)" Heroku error: "Permission denied (public key)" git git

Heroku error: "Permission denied (public key)"


Try heroku keys:add <path-to-your-public-key>.

For example, heroku keys:add ~/.ssh/id_rsa.pub


the solution above did not work for me as I did not have any keys generated in my ~/.ssh folder.

My solution was to simply type heroku keys:add

The output in terminal was:

Could not find an existing public key.Would you like to generate one? [Yn] yGenerating new SSH public key.Uploading SSH public key /home/funkdified/.ssh/id_rsa.pub... done

See: https://devcenter.heroku.com/articles/keys


i faced the same issue . Writing my experience so it helps someone else .

I tried to follow the instructions that were detialed on the official website -Getting Started with Your Facebook App on Heroku

Even though it is quite detialed especially the video it is quite annoying to note that they do not mention having to set up SSH keys . Either it is set by default ( i dont know ) or you get the error mentioned by the question poster .

So i did the following :

1 . opened up the git shell

2 . typed the following in

C:\Users\blue\Documents\GitHub> heroku keys:addFound the following SSH public keys:1) github_rsa.pub2) id_rsa.pubWhich would you like to use with your Heroku account? 2

3 . Subsequent to this i was able to getcheckout my repository

C:\Users\blue\Documents\GitHub> heroku loginEnter your Heroku credentials.Email: sxxxxt.xxxx@gmail.comPassword (typing will be hidden):Authentication successful.C:\Users\blue\Documents\GitHub> git clone git@heroku.com:sxxxd-plains-8530.gitCloning into 'sxxxd-plains-8530'...Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of knownhosts.remote: Counting objects: 180, done.remote: Compressing objects: 100% (112/112), done.remote: Total 180 (delta 82), reused 132 (delta 62)Receiving objects:  81% (146/180), 76.00 KiB | 62 KiB/sReceiving objects: 100% (180/180), 137.91 KiB | 62 KiB/s, done.Resolving deltas: 100% (82/82), done.C:\Users\blue\Documents\GitHub>

Please dont downvote my answer . Even though i dont add any new value to what is already posted but i hope my experiences will help someone who is new to using git & heruko . Hence i added screen shots .

  • My 2 cents