Git

git error : Permission denied (publickey)

Naranjito 2022. 4. 6. 10:28
  • Cause

If I am using ssh, public key between server<->git probably does not match or not connected.

$ git push origin main
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

...

 

  • Solution

Create new ssh key on github.

#Get the public key from server.

$ vi ~/.ssh/id_rsa.pub

>>>

ssh-rsa AAAAB3NzaC1yc2EAA 

...

And then issue the key in github.