Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOpsSchool!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

How to generate & upload your public key to github for SSH access on github

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.

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x