While I am trying heroku login
through cmd in my machine, it says
Could not find existing public key
Would you like to generate one? [YN]
After that when I press 'y' and enter it says
Generating new ssh public key
Could not generate key: "ssh-keygen" is not recognized as a internal or external command operable program or batch file
Please help me.
Heroku toolbelt includes git distribution which includes the required ssh-keygen.exe . I've just found it in C:\Program Files\git\bin . Locate your git folder and add it to your system path as described here: superuser.com/questions/284342/
I had the same problem and just solved it. I installed another CMD called Git Bash that you can download for free (http://git-scm.com/downloads) and then repeated the commands in that and it worked!
For Win7 64-bit users, the file
%HerokuPath%s\bin\ssh-keygen.bat
looks like:But Heroku installs Git in
Program Files (x86)
, so if you update the.bat
file to:Then you should be able to generate your ssh keys.
Windows 10-64bit
I had installed git, then heroku toolbelt (which I think reinstalled git)
I had
C\Program Files (x86)\Heroku\bin
in my Environmental variable (probably generated when I installed heroku toolbelt) and if I looked in that filepath I had an ssh-keygen.bat - so it seemed like I should be able to just runssh-keygen -t rsa
from the command line.That would be too easy, instead I get:
Solution
type
bash
in command line to go into git bash mode then runssh-keygen -t rsa
git bash:
Now when I look in C/User/mamwo/.ssh (the best way for me is through pycharms folder - windows sucks) I see my id_rsa and id_rsa.pub
But this 'cannot generate publickeys' issue all started for me because I had an 'I don't have public keys to add' issue when I cloned my repo (from github) to a new computer and found that I could push to github but not heroku.
Now that I have the keys - I have to add them