GIT : How to generate SSH key in Windows for GIT
Points to Remember
- Download and install Puttygen to generate the SSH key to be used in GIT.
- Save the Private Key in a safe location and do not miss it.
STEP 1 : Open Puttygen to generate Key
Puttygen is a opensource plugin of Putty and is used to create Public/Private keys for WinSCP.
When you open the puttygen you will see the following screen as shown in image below
Now Select the following
- Select SSH-2 RSA (Type of key to generate tabs)
- 1024 (Number of bits to use to generate key)
- Click Generate button to generate the key.
STEP 2 : Generating Key
After you click the generate button you will see the following screen
Keep clicking on the empty space provided until progress bar reaches the end This is used to create randomness in the key. Once the progress bar reaches the end, it will show the generated key.
STEP 3 : Save Public & Private Keys
Once your key is generated you will see the public key in the text box at the top as shown in the image below.
The screen shows the following things.
- Public key at top.
- Key fingerprint used to create the key.
- Key Phrase. You can add a password to your generated key. If you add password to the key then you have to enter the password/key phrase everytime you do ssh. This is extra security to the key however you can keep it empty, if you are sure nobody can copy the key from your system.
Click on Save private Key & Save public Key to save the keys.
Save the private key in a safe directory or location. If you miss this private key you will not be able to use ssh.
Private key is saved in the .ppk format on windows. Do not change the extension of the file
STEP 4 : Load Private Key to Puttygen
You can load the saved private key in Step 3 to view the public key. You will see the following screen when you click on Load
Just select the saved private key and you will be able to see the public key.
STEP 5 : Use Public Key
Right click on the public key textbox
Click on Select All to select the the public key and then copy the Public Key for the nect step.
Step 6 : Adding Public key in GIT for SSH
Open your Github account and go to profile settings, then click on SSH and GPG keys tab.
Click on the New SSH Key button as shown in the image below
Add the Key title in the title box and public key generated in previous steps in the space with label key and finally save by clicking on Add SSH key button in green.
No comments: