Fixing "git@github.com: Permission denied (publickey)"
jastuccio

jastuccio @jastuccio

About: Web Developer, Sailor, Stargazer, Hockey Player, and all around fun guy... but my absolute favorite thing is being a dad

Location:
Massachusetts
Joined:
Nov 15, 2019

Fixing "git@github.com: Permission denied (publickey)"

Publish Date: Feb 18 '24
3 0

I run into this error when I haven't used GitHub in a while. There is a simple fix to reconnect your SSH key. The syntax is a bit different than most online answers because I use FISH(Friendly Interactive shell).

in BASH the command should be eval $(ssh-agent -s)
in FISH type eval (ssh-agent -c)

A slight difference but figuring this out almost drove me nuts the first time.

Next type ssh-add path/to/your/ssh-key

Now the error should be resolved.

If you need to generate SSH keys this might help
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Comments 0 total

    Add comment