Feb 9, 2015

Set up SSH for Git in Windows

Do the following to verify your installation:

Double-click the Git Bash icon to start a terminal session. Enter the following command to verify the SSH client is available:

$ ssh -v

If you have ssh installed, go to the next step. List the contents of your ~/.ssh directory.

$ ls -a ~/.ssh

If you have not used SSH on Bash you might see something like this:

rishi@rishi-PC ~
$ ls -a ~/.ssh
ls: /c/Users/rishi/.ssh: No such file or directory

If you have a default identity already, you'll see two id_* files:

rishi@rishi-PC ~
$ ls -a ~/.ssh
.    ..    id_rsa    id_rsa.pub

Enter ssh-keygen at the command line. The command prompts you for a file to save the key in:

ssh-agent /bin/bash
ssh-add ~/.ssh/id_rsa
ssh-add -l

In your terminal window, cat the contents of the public key file.

Image Source

No comments :

Post a Comment