Skip to main content

Command Palette

Search for a command to run...

how to add rsa key to github

Updated
2 min read
how to add rsa key to github
D

I love creating digital solutions

How to set up SSH Key so that you don't have to type your username and password when you want to push to GitHub.

Open up your gitbash, if you don't have it installed on your PC, you can download it by clicking on this link https://git-scm.com/downloads

type this command to generate the ssh key

  $ ssh-keygen -t rsa -b 4096 -C "youremailaddress@host.com"

it'll show you this

Generating public/private rsa key pair.
Enter file in which to save the key (/c/user/yourname/.ssh/id_rsa):

then press your enter button to save it. It'll ask to enter your passphrase

Note: When you're typing your passphrase it won't show you the keys or words you type in. just know/remember what you typed

Enter passphrase (empty for no phrase):
Enter same passphrase again:

passphrase is like your password whenever you want to pull or push to github you'll be asked to enter it.

Now Your Keys have been generated. it's time you let your computer know that you want to use this key

First you need to start the ssh agent by typing

$ eval $(ssh-agent -s)

it's time to add the ssh key. Remember you must be on this part

*C:\Users\Owner\

$ ssh add ~/.ssh/id_rsa
Enter the passphrase for /c/users/owner/.ssh/id_rsa:

Now it has been added.

Now you need to copy the public key to your clipboard and add it your github account

$ clip < ~/.ssh/id_rsa.pub

Now you've copied the public key

  1. Go to your github account and click on your profile picture

  2. Go to settings

  3. Click on SSH and GPG Keys

  4. Then give it a title. e.g first ssh key

  5. Paste the public key you copied

  6. and click on add ssh key or save button

Congratulations. You've added your first ssh key to github

184 views
S

Developer Joseph I have written a similar article. Check this! Introduction to Git-Adding SSH key

1
D

Waw. yours is more detail. i love it

2
S

Useful stuff Joseph !! It would be of great help to any beginner starting struggling with Git and generating RSA key and registering it.

1
D

Yeah. And thanks 😊 for going through my article

More from this blog

devjoseph🔥

16 posts

I'm a software engineer