GitHub SSH Configuration (permission denied)

This one is a bit obvious and straightforward but I keep seeing in different posts that people who start using github or the curious ones are struggling at the beginning on how to setup their git environment to get started with and this question comes back often. "I can't clone a repo from Git and I receive permission denied (public key) error!"

Well, the issue is, like the error message states it, ssh certificates not being setup. In summary, you need to create an ssh certificate for your profile and upload your public key to your github account so
that when you run git commands, github is able to authenticate who you're (or your machine). Here are some quick and easy steps to get you started and needs to be done before experimenting with git. These procedure are for Linux environment but the idea is the same for every OS basically.


1 - Install Git 
sudo dnf install git -y
2 - Go to your default ssh folder and run ssh-keygen to create your ssh keys.
cd ~/.ssh && ssh-keygen
3 - Copy the content of your public key.
cat id_rsa.pub | xclip
4 - Go to your github account, under SSH and PGP Keys and add a "New Ssh Key" by pasting the content of your id_rsa.pub file.

5 - From your linux machine run the following commands by replacing the username and email with yours.
git config --global user.name "FirstName LastName"
git config --global user.email "youremailaddress@domain.com"

That's it, you should be able to "git clone" the git repos now!

Comments

Popular posts from this blog

System.Messaging.MessageQueueException (0x80004005): A workgroup installation computer does not support the operation (Public Queue create issue)

Veeam Backup Error : Failed to prepare guest for hot backup. Error: VSSControl

warning: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead - Chef Development Kit Update