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

11

62

I am trying to add ssh keys for usage on github but on my xp on command prompt ssh-keygen does not work. It gives me the following error

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

Is there an alternative for generating keys on xp?

Photima answered 13/4, 2012 at 18:33 Comment(1)
A downvote question that earned me the notable question badge. Weird are the ways of donwvoting.Photima
I
53

Are you running msysgit, or some other form of Windows git installation? msysgit is only one possible way to run git on Windows but it's probably also the simplest one. It's also the way recommended by the git website at http://git-scm.org/ .

If you are using msysgit, then you need to run the command in Git Bash, not in a standard Windows command line prompt. Git Bash is a prompt that is installed for you by msysgit, and is basically the most common Linux command line shell (bash) packaged for Windows to facilitate command line usage of git. msysgit should also install the ssh-keygen program in a place where it is accessible from Git Bash, but not necessarily from your usual Windows command line prompt.

Insanitary answered 14/4, 2012 at 11:25 Comment(0)
H
43

STEP 1 Install Git.

STEP 2 Add the path of your git to the environment variables like this C:\Program Files (x86)\Git\bin.

STEP 3 Open new terminal session and try ssh-keygen. It will work.

NOTE New Terminal Window is must!

Heatherheatherly answered 22/11, 2013 at 14:14 Comment(4)
Very helpful. Nice precise Answer! DO not forget to open the NEW CMD WINDOW!Lots
sometimes git might be installed in C:\Program Files\Git\bin so verify the git existence and add the path.Septic
In my case the "ssh-keygen.exe" was placed under user folder i-e. C:\Program Files\Git\usr\binMajunga
I've add the C:\Program Files\Git\bin to the System Environment Variable\Path imgur.com/xVWwqew , but it still doesn't work. in the C:\Program Files\Git\bin there is no ssh-keygen.exe imgur.com/al12otX . Do you know What's my problem and how can I fix it? Thanks!Skulk
P
23

If you previously installed Git, open a git-bash and try the command from there.

Plainsman answered 7/10, 2016 at 18:22 Comment(0)
K
9

Search your git directory if you already install git

Use git bash should be on your C:\Program Files\Git\bin depend on your installation location

If you already add the path just run sh on your cmd or open sh.exe

type ssh-keygen

Then just insert name and passphrase (You can just type empty string).

Kimes answered 7/2, 2018 at 20:21 Comment(0)
T
3

Running git bash as an admin worked for me!

Trite answered 10/9, 2018 at 7:24 Comment(0)
L
2

for all windows os

cd C:\Program Files (x86)\Git\bin
ssh-keygen
Lives answered 15/12, 2016 at 13:19 Comment(0)
D
1

if you run from cmd on windows check the path System Variable value must have inside C:\Program Files\Git\bin or the path of you git installation on cmd type set to see the variables

Darren answered 13/5, 2013 at 21:3 Comment(0)
F
1
  • Install msysgit
  • Right-click on any file
  • Select "Select Git Bash here" from menu
  • Run ssh-keygen command from a git bash terminal
Flattery answered 28/8, 2019 at 11:17 Comment(0)
F
0
C:\Program Files\Git\usr\bin

Add this to the envvars and reopen cmd. Thats it.

Feudatory answered 7/7, 2023 at 13:49 Comment(0)
A
0

cd C:\Program Files\Git\bin\ssh-keygen

it works fine on my laptop

Attitude answered 9/1 at 8:26 Comment(0)
G
-1

ssh-keygen is a utility usually found on Linux distributions. You can use Cygwin on Windows to have most functionality of the Linux command line available to you.

http://www.cygwin.com/

Grillage answered 13/4, 2012 at 18:34 Comment(4)
But the ssh command works on my command prompt on Windows 7? Also wondering would cygwin in any way conflict with git?Photima
You must have installed openssh client or something like it to be able to use it with the Windows 7 command prompt. Cygwin won't conflict with git, you should be able to use git in Cygwin and the command prompt at any time. You might even find that Cygwin is a lot easier to deal with than the CP.Grillage
Pardon me but it is very complicated to install Cygwin, would there be another alternative?Photima
Eclipse can generate key-pair in pure Java. Window > Preferences > General > Network Connections > SSH2Geomorphology

© 2022 - 2024 — McMap. All rights reserved.