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