Configure SSH with GitHub (4096bit Key)

Most of the times, we tend to search this up when a new laptop is being given to you from your workplace. After facing the requirement for several times and have to go through several documentations, thought of drafting this in one sheet for the reference of anyone who needs it to resolve in one-go.

Step 1: Get the GitBash installed in your PC/Laptop

Step 2: Open the command line/terminal

Step 3: Set your username

Step 4 : Set your email address

Step 5: Check for the updated username and email-address.

Username and Email should display as above in your terminal/cmd

Step 6: Open GitBash

Step 7: Check if there's an SSH key which has been generated (to take a backup of it)

If available, the files should display as above.

Step 8: Take a backup of the existing SSH key pair (id_rsa/ before regenerating a new key-pair

Step 9: Create/Generate a new 4096-bit key pair (private key and public key)

Step 10: Enter a file in which you want to save your keys.
(You can press enter and the default ~/.ssh/id_rsa will be used.)

Step 11: Enter a passphrase or your can keep it empty
(but it is not recommended to keep it empty)

Note: Just press enter-key without typing any key, if you need to keep the passphrase empty.

Step 12: Two new SSH key pair will be generated for the .ssh folder. (C:/Users/you/.ssh/id_rsa)

Step 13: Open the file from NPP ofr VSCode and copy the content of it.

Step 14: Navigate to the GitHub account > Settings > SSH and GPG Keys

Add New SSH Key page on GitHub (as of 2021-April)

Step 15: Click on ‘New SSH Key’

Step 16: Add a custom name for title (Tip : Better to add the clue/hint to your passphrase in your title, because this passphrase is easy to forget as not being used frequently)

Step 17: Paste the copied content on the Key section

Step 18: Click on ‘Add SSH Key’

Tadaaa!! Its Done!! Commit some files and push to the GitHub and verify if the data is being pushed. ;)

Writer | Vlogger | Techie | Technical Tester (Snr-QAE)