Steps to Generate Another ssh key:

by
  1. from cmd prompt go to c:/users/xyz/mkdir .ssh
  2. open gitbash from c:/program files/git/bin/bash.exe
  3. typessh-keygen -t rsa -C "your-email-address"
  4. Enter full path when asked for the file name (this is important)C:/Users/xyz/.ssh/id_rsa_ge
  5. Enter pass phrase..and your key shall be generated.
  6. Login to your Github account “SSH and GPG keys” click New SSH Key button
  7. Open your id_rsa_ge.pub file in a text file eg notepad and copy everything and paste into the key dialog..give any title of your choice.
  8. In git bash Typessh-add ~/.ssh/id_rsa_ge
  9. If it says “Could not open a connection to your authentication agent.”, do the following commands a. ssh-agent b. $ eval $(ssh-agent)

it should return a agent pid Now again repeat step 8.

Create config file in .ssh folder and type

#Default GitHub
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa

Host github-ge
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_ge

Now use git

git add .
git commit ...
git push origin master

Note: before reinstalling your OS always take a backup of keys

Data Scientist & Solution Architect || IBM Recognised Speaker, Mentor, and Teacher || Debater || Blogger || Guinness World Record Holder || Watson Solution Developer || IBM Community Activist || Aspiring to Inspire.

Leave a Reply

Your email address will not be published.

*