Skip to content

GitHub Authentication with SSH Keys

Richard Davies edited this page Jan 21, 2022 · 1 revision

The very first time you try to clone a project on a new computer you'll likely get this error:

$ git clone git@github.com:eGovPDX/portlandor.git

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

This is because that git clone commands uses SSH and it needs to know how to authenticate with our GitHub repository.

Here's how to solve it!

  1. Generate a SSH key on your computer as described here: Generating SSH keys
  2. Login to your GitHub account and add the newly generated SSH: My account SSH keys (pasting in the contents of the new key file)
  3. Try again to git clone the project