Skip to main content

Command Palette

Search for a command to run...

Create SSH keys to access GitHub via SSH

Works in most Operating Systems (Linux/MacOS/Windows)

Updated
•1 min read•View as Markdown
A

I am a computer science undergraduate from India with a deep passion for entrepreneurship and technology. Beyond programming, you'll often find me engrossed in chess, maths and diving into algorithmic puzzles. — Ooh and I use Arch, btw.

Dont need if you use github desktop ~

I do this all the time whenever I break my Arch install (ye I have my backups in timeshift, dont teach me now) or I do another distro hop, so thought why not I just put these in my easy website to easy access these commands, instead of typing them always :p

  1. Open terminal and cd into ssh folder (mkdir ~/.ssh if it doesnt exist there )
cd ~/.ssh
  1. Update with your GitHub Email Address
ssh-keygen -t rsa -b 4096 -C "arnvgh@gmail.com"

Ignore passphrase (by press Enter key without input any characters) if you want to create a non-passphrase ssh key

Screenshot from 2022-11-11 11-47-34.png

3. Run ssh agent

eval $(ssh-agent -s)
  1. Add the key has been just generated to ssh agent you can simply run (if you are folllowing my guide)
ssh-add

else

ssh-add "/home/username/.ssh/ssh_file_name"
  1. Copy the SSH Key by
ls
cat id_rsa.pub

(Dont copy mine, I have changed it alr :p)

image.png

Finally,

Add the publickey to github account (go to "Setting" then select "SSH and GPG keys")

here ~ https://github.com/settings/keys

Happy Coding 🐼