Generate and Setup a new SSH key using PuTTY

Scenario:

Generate and Setup a new SSH key using PuTTY

Solution:

  1. https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html -> download  .msi file from package files section and install
  2. Open PuTTYgen -> Generate [generate some randomness(entropy) by moving the mouse over the blank area]. 
  3. Key is generated and displayed in public key text area. Copy this into your clipboard and add to GITHub account.
  4. Create .ssh folder in your user directory.
  5. Enter a passphrase for your SSH key. [It can be left blank] -> Save private key to a folder [extension .ppk]
  6. Store public key (by copying content) as id_rsa.pub in folder from #4.
  7. Store Private key [Open SSH] by Clicking Conversations -> Export OpenSSH Key (force new file format) as id_rsa file.
  8. By default, git looks at C:\Users\<username>\.ssh for id_rsa key.
  9. To load keys from an SSH client like PuTTY, add an environment variable [GIT_SSH] with value as "C:\Program Files\PuTTY\plink.exe"
  10. Now using command line for GIT it will use SSH agent instead of loading the id_rsa key.
  11. PowerShell -> git clone git@gitlab.com:username/repository-name.git

No comments:

Post a Comment

Move Github Sub Repository back to main repo

 -- delete .gitmodules git rm --cached MyProject/Core git commit -m 'Remove myproject_core submodule' rm -rf MyProject/Core git remo...