Skip to content

Instantly share code, notes, and snippets.

@morosmo
Created February 21, 2025 06:32
Show Gist options
  • Save morosmo/67b84e573e9cace1251ec9044f391fd8 to your computer and use it in GitHub Desktop.
Save morosmo/67b84e573e9cace1251ec9044f391fd8 to your computer and use it in GitHub Desktop.
Connecting Github To Local Computer

Setting Up SSH Key for GitHub

To create an SSH key for GitHub, use the following commands:

ssh-keygen -t rsa -b 4096 (After running commang jsut press enter continously to get they keys)

The above command will genrrate ssh key at your user main folder.

cat ~/.ssh/id_rsa.pub (To get public key run this command on terminal - |id_rsa.pub| is the filename in folder)

cat ~/.ssh/id_rsa (To get private key run this command)

##To add that in github account:

  • Got to you profile setting
  • Click on (SSH and GPG Keys)
  • Click add new
  • Paste key and click save

To check if its added or not run this command

ssh -T [email protected]

Thsi will show output like (You've successfully authenticated, but GitHub does not provide shell access.)

###Trouble shouting If above key give some error mesaging then use the belwo steps. Make sure to switch terminal to git bash in vs-code; #Run command

eval ssh-agent -s ssh-add ~/.ssh/id_rsa

Run this below command again to check if its added or not

ssh -T [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment