Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not generate ssh public key for heroku in Windows 7

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.

like image 425
Suman Sapkota Avatar asked Feb 22 '13 06:02

Suman Sapkota


3 Answers

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/

like image 190
stys Avatar answered Nov 08 '22 06:11

stys


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!

like image 16
GER Avatar answered Nov 08 '22 06:11

GER


For Win7 64-bit users, the file %HerokuPath%s\bin\ssh-keygen.bat looks like:

@SETLOCAL
@SET HOME=%USERPROFILE%
@"%HerokuPath%\..\Git\bin\ssh-keygen.exe" %*

But Heroku installs Git in Program Files (x86), so if you update the .bat file to:

@SETLOCAL
@SET HOME=%USERPROFILE%
@"C:\Program Files (x86)\Git\bin\ssh-keygen.exe" %*

Then you should be able to generate your ssh keys.

like image 1
Steve Eynon Avatar answered Nov 08 '22 08:11

Steve Eynon