'ssh-keygen' is not recognized as an internal or external command

Viewed 241198

I run git push -u origin master

It tells me that "Permission denied (public key) fatal: The remote end hung up unexpectedly"

Then I looked up on the internet and found that I had to generate an ssh key for my account on GitHub. However, upon doing so, when I tried to do ssh-keygen -t rsa "email@youremail.com" it simply said ssh-keygen is not recognized. I tried doing mkdir C:\ssh but that didn't work. If it helps I'm using Ruby Rails and I'm on a Windows computer. Could anyone help me?

14 Answers

don't do anything just type in your command prompt

C:\> sh

then you got like this

sh-4.4$ 
# type here 
ssh-4.4$ ssh-keygen -t rsa -b 4096 -C "example@example.com"

this should must work.

For windows you can add this:

SET PATH="C:\Program Files\Git\usr\bin";%PATH%

In my machine, ssh-keygen was available from powershell.

Related