Permission denied publickey Git

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 (This is a public key). You will have to copy content of 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.

Leave a Reply

Your email address will not be published. Required fields are marked *