Step 1 – First Check if you public and pvt key already generated in your system?
i.e – in USER HOME C:\Users\Rajesh Kumar.ssh, check id_rsa(pvt) and id_rsa.pub(pub)
If id_rsa & id_rsa.pub found, directly move to step 3
Step 2 – Generate id_rsa & id_rsa.pub (exammple done in linux)
---------------- POWERSHELL WINDOWS ------------------------
PS C:\Users\Rajesh Kumar> ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\Rajesh Kumar/.ssh/id_rsa):
---------------- LINUX BASH ------------------------
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:XkUuIn9RzXvZzQ3ihjr5Edyj/h9M3UICWy1mW8YncR8 root@localhost.localdomain
The key's randomart image is:
+---[RSA 2048]----+
| . +=.E.|
| B= X.+|
| . ..+*+*.**|
| o .++*o.oB|
| Soo+ .o.o|
| .+oo o . |
| .+ . o |
| o . |
| .... |
+----[SHA256]-----+
--------------- LINUX & MAC ------------------------
[root@localhost ~]# ls .ssh/
id_rsa id_rsa.pub
--------------- WINDOWS------------------------
PS C:\Users\Rajesh Kumar> ls .\.ssh\
Directory: C:\Users\Rajesh Kumar\.ssh
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 05-03-2022 09:50 old
-a---- 05-03-2022 09:50 2622 id_rsa
-a---- 05-03-2022 09:50 582 id_rsa.pub
-a---- 20-06-2022 19:57 11248 known_hosts
-a---- 20-06-2022 18:42 10588 known_hosts.old
Code language: PHP (php)
Step 3 – Login to github and go to https://github.com/settings/keys

Step 4 – Copy a id_rsa.pub into SSH keys

Step 4 – Clone git repo using ssh and it should work.
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals