Skip to content

Instantly share code, notes, and snippets.

View nathansnow1981's full-sized avatar
🟢
Awake

Nathan Snow nathansnow1981

🟢
Awake
View GitHub Profile
@nathansnow1981
nathansnow1981 / PermissionDeniedPublicKey.md
Last active November 23, 2021 03:28
[SOLVED] GitHub 'Permission Denied (publickey)' error when pushing local changes to a repository!

"GitHub 'Permission Denied (publickey)' error when I try to push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash or your choice of CLI (e.g. windows command prompt (CMD), powershell or the Mac Terminal).
  2. Type cd ~/.ssh(cd %USERPROFILE%/.ssh in command prompt). This will take you to the root directory for your SSH keys (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows).
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that authenticate your computer so it can communicate with GitHub, BitBucket, or any other Git based service. Type ls(dir in command prompt) to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To cre