Quick-gun Morgan
Quick-gun Morgan

Reputation: 338

SSH key generation for GIT on Windows 8

I am trying to generate a new SSH key on my windows computer using command prompt. I have installed Cygwin and added its path to use linux commands through command prompt.

Now ls is listing me the inner folders. But ssh is still nor working.

On trying to generate SSH key using the command ssh-keygen -t rsa -C "email_id"

its giving me a following error. ssh-keygen is not recognized as an internal or external command, operable program or batch file.

Upvotes: 4

Views: 4411

Answers (2)

PieterB22
PieterB22

Reputation: 11

I am probably one of the only few people still left who might be using Windows 8 for development purposes. However my solution is quite simple if anyone comes looking for this answer like me.

All you need to do is the following:

  1. Download Git: https://git-scm.com/downloads
  2. Install Git
  3. Run Git Bash
  4. In the Git Bash terminal type: ssh-keygen
  5. Enter the location you want the keys to be stored:

/c/Users/(my_user)/.ssh/(key_file_name)

  1. Enter your password and press enter

Your new ssh key pair has been generated.

Upvotes: 1

VonC
VonC

Reputation: 1323115

No need for cygwin: a regular msysgit is enough (unzip PortableGit-1.9.5-preview20141217.7z anywhere you want, add its bin/ folder to your path and you have git and ssh including ssh-keygen)

Once you have launched its git-cmd.bat, you can generate your ssh keys.

ssh-keygen -t rsa -C "email_id" -q -P ""

(here I don't use a passphrase, for testing purposes, avoiding the ssh-agent management)

id_rsa and id_rsa.pub will be generated in %HOME%/.ssh.
HOME is set by the git-cmd.bat, usually in %USERPROFILE%.

Upvotes: 1

Related Questions