Permission denied publickey Git
This most common annoying error while connecting to Git from remote computer and if you are first timer like me then it will take sometime to understand, it does not matter if you are good Googler. You get exception similar to below:
- Solution: If you want to access Git repository without using the password then you will have to generate SSH key and add public key to your Git hub account. When you generate SSH key it generates private/public pair namely: id_rsa (This is a private key) and id_rsa.pub (This is a public key). You will have to copy content of id_rsa.pub to your git hub account.
- You could check existing and generate new SSH key using this Git tutorial
- Once keys are generated use this documentation to add SSH to your Git account
If you are using Linux you could add SSH key in ~/.profile or ~/.bashrc file below is example of ~/.profile file:
- In above file this is SSH certification part:
That’s it. Still you are not sure what to do, then summary is: Please generate SSH key and add that key to your Git account. If you are using different user other than the Git user as this will be the case if you are using Linux, Mac etc.. where people use super user to take build not using by their own user id but the process is same. Generate SSH key for super user and add that generated public key to your Git account.