How to fix Github Error: Permission denied (publickey) [Best Solution 2024]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome to my youtube channel in today's tutorial you're going to be learning how to solve permission deny problem before uh to to get started i will be showing you the exact problem so let's take for instance you have a repository you would like to clone so i'm going to click on the code then copy the https then go to the folder i would like to clone it so i'm going to um use the git batch here to do that then i'm going to use command git clone space the url so paste enter now as you can see it says was permission denied it's denied what the permission now let me zoom in my screen so that you can see uh what i'm trying to um show you now let's see it says what permission denied so to solve this problem you are going to follow the this simple process i'm going to be showing you now it's very very simple and amazing so it's very simple so for those who don't have github or or you are just installing your github account this is also applied for you and for those who already have their github account it's still the same process okay so the first thing we have to do is to unset your current email your current username you need to unset it and i'll say some exclude files then um you cannot add to your ssh directory and delete it so now let's take it one after the other the first thing is to um on set is to and on set our global uh exclude files so i'm going to set this now so this um commands i'm using i'm going to provide it um below the description so don't bother don't worry yourself okay so i'm trying to unset my what's exclusive now my own exclusive file has been unsearched so the next thing i need to unset is my email or my username so we need to do it those as i'm explaining to you okay so do the same yeah okay my username is on set my email is also onset so the next thing we need to do is to use the git global global iphone iphone list to check our global list so i'm going to say git i'm going to use this git command git config dash global dash dash list now as you can see my username and email is not part of it so now let's not try to what to add it again so i'm going to add my username so to add your username we're going to take out this onset and at the end of it pass your what's your email so i'm going to pass my email in this place so be able to i so don't bother all these um commands i'm going to provide it down um below the description so be at gmail.com okay that's my email now my username the same applies to the username okay so i'm going to change this to um name name is equals towards a delay higher dj so add a layer i dj enter okay so once you are done setting your email set your name you can also confirm again if it's part of it now as you can see my username is now part of the list my email is part of the list so the next thing we need to do now is to um head down to our local digs where you install your windows click on your users under your users click on your username under your username click on the ssh inside your ssh folder you might find any file in the ssh folder so just uh you can delete it but for me this is my new and updated um file that we just added as i was updating my name and other credentials so if you find any other files in this place you can try as much as possible to take it out um let me let me actually take this out so you understand deeply okay now my ssh is empty as you can see we don't have anything in my ssh so the next thing we have to do is to go back to the um to our command line area now in this place now we're going to generate a new key we're going to generate a new key that are going to pass down to our github accounts so to do the key generation we're going to use ssh iphone keygen okay so enter so you're going to wait for the p for the key to be generated so it's going to ask you and it's it's going to ask you to enter the file in which you want to save the key let me zoom in my screen so that you can see very well let me zoom in my screen okay so i think this is better so it says what enter the file in which you want to save this key so you can enter any file name that you would like this um this key to be called so for me i can decide to use this id underscore rsa as default so let me use the default id underscore rse as my um as a title of my file so i'll leave it the way it is i would now click on enter so once you click on enter it's going to activate a password of sorry for your passphrase so i'm going to enter um something for my passphrase and if i like i might not enter anything for my password so your accounts will do the same for yours okay so i've done that now so the same thing you have to enter your password again okay so now our um our key has been generated and it has been saved to user under my username at the layer and inside the folder about ssh now let's go to this folder and check if it's actually there so i'll go back to this folder click on this folder as you can see we have the file generated in this folder good and that is awesome so the next thing to do is to go back to our command line area and close this command line area but don't forget the directory that you save your uh your your generated key mine is in ssh folder under my username so don't forget this um directory so we're going to be using this directory after we uh good after we set up our security level on our github account so i'm going to close this now okay then i will head down to my settings on my github account go to my settings under my settings i'm going to head down to ssh and gpg keys now under my ssh key i'm going to add the what a new ssh okay on the new add new ssh i'm going to add in title to this as windows uh my key is not copied yet now to copy up to copy my key i'm going to be using a powershell because if i try to use the git command you might not copy um the other code the the content of the of the of the pop you know we have dot probe as the key as you can see this is the dot probe as the extension so my uh my git command might not be able to copy that but if you have an application that can open the contents it's fine but i'll be using git um i'll be using powershell to do the copy so to use powershell to do the copy i'm going to be um using this command that will be pasting into this powershell now so for those who don't see my second screen i'm going to provide this command in my description so don't get confused this command will be verb will be provided in my description so just go to my description copy it and use it okay so this is the command and the file name that you um you you placed into saving your fi to save your key now my is what id on that's called rsa.pub okay now let me enter on the content has been copied if i check my clipboard now sorry if i check my clipboard now you are going to find it in my clipboard uh to open your clipboard is very simple just use the windows v to bring it up okay now after i'm after i copy that i'm going to close powershell then paste in my um copied content into this place now this is my copied key so before i add this key if i try to see um get this done it's not going to work let me try to show you if i try to get this done it's not going to work okay click on um sorry so i'm going to um go to overview okay ajax image uploader progress okay now let me click on add um click on the code copy what's it called copy the https then i'm going to add down to the folder again to the folder that i want to add this uh my content okay this is the folder let me try to get bash this guy again and let's see if it's going to work without um saving our key because we're just trying to add a key we haven't saved it yet okay so let's try to get clone the url so git clone gate clone then the url we paste okay enter now as you can see uh it asked me for some generated key so let me say yes actually i haven't saved it yet so i save yes it's going to still reject it because the key doesn't match the one on the live server okay now let me save this now add ssh key now my key has been added to my github uh ssh ssh directory so the next thing i need to do now is to do this again run this command again so get clone run again okay now let's see what we are going to get now as you can see it's clone it directly this is amazing you know this this solve a lot of problem it stress less your time without wasting much time on researching on the internet how to solve these sort of subjects so uh if you have any issue relating to this tutorial comment below and don't forget please like subscribe to this channel so that others who are in the same problem can find this solution so thank you for this um time thank you for your time thank you for watching my videos see you some other time bye
Info
Channel: BiggiDroid
Views: 71,142
Rating: undefined out of 5
Keywords: error permission denied (publickey), github error message - permission denied (publickey), how to solve permission denied (publickey) error when using git
Id: dxvnbKaszBw
Channel Id: undefined
Length: 10min 49sec (649 seconds)
Published: Fri Jan 28 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.