git
auth_error
ai_generated
true
Permission denied (publickey). fatal: Could not read from remote repository.
ID: git/permission-denied-publickey
88%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 2 | active | — | — | — |
Root Cause
SSH key not configured or not added to SSH agent.
genericWorkarounds
-
92% success Add SSH key to agent and verify: ssh-add, then ssh -T [email protected]
eval $(ssh-agent) && ssh-add ~/.ssh/id_ed25519 && ssh -T [email protected]
Sources: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection
-
88% success Use HTTPS with personal access token or gh auth login
Use HTTPS with personal access token or gh auth login
Dead Ends
Common approaches that don't work:
-
Switch to HTTPS and enter password every time
70% fail
Tedious, and GitHub disabled password auth in 2021
-
Generate new key pair every time
60% fail
Doesn't help if the key isn't added to GitHub/agent
Error Chain
Frequently confused with: