GithubHelp home page GithubHelp logo

permission-denied-publickey-error's Introduction

Permission-denied-publickey-error

How to fix [email protected]: Permission denied (publickey) error

When trying git push or git pull command, the following error may occur.

[email protected]: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

The reason this error occurs is that the ssh key connected to the [email protected] is not set

The solution to this is simple. You can create an ssh key and register this key to your account on github.

First create an ssh key. ** ssh-keygen -t rsa -C “your GitHub account email”**

When you run ssh-keygen, a terminal window asks you to specify where to create a key. If you just press Enter, it will be created in the default location ** (~/.ssh/id_rsa.pub)** .

Next, you will be asked to specify a password. If you want to specify a password, you can enter it or just press Enter. Then it will say that the key has been created in ** ~/.ssh/id_rsa.pub** . Never disclose this key to anyone else. (If you make it public, it's like saying, just use my github to your heart's content)

Since the generated key needs to be registered on Github, copy the contents after ** cat ~/.ssh/id_rsa.pub**.

Set the created key to your Github account and you're done. ** First, log in to GitHub and go to Settings -> SSH and GPG Keys** .

** Click the New SSH key button, enter the title as desired, and insert the copied ssh key (~/.ssh/id_rsa.pub)** key we created in the key input section below.

Now, if you do git pull or git push, you can see that the error is resolved.

permission-denied-publickey-error's People

Contributors

imdsafi09 avatar

Stargazers

Saulo Soares Da Silva avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.