{"id":"aea964bd-fa15-4dc1-9e3c-9692af16427b","slug":"git-email-permission-denied-publickey-224b","url":"https://api.modalhub.ai/r/git-email-permission-denied-publickey-224b","urls":{"html":"https://api.modalhub.ai/r/git-email-permission-denied-publickey-224b","md":"https://api.modalhub.ai/r/git-email-permission-denied-publickey-224b.md","json":"https://api.modalhub.ai/r/git-email-permission-denied-publickey-224b.json","history":"https://api.modalhub.ai/r/git-email-permission-denied-publickey-224b/history"},"symptom":"git@github.com: Permission denied (publickey).","command":"git push origin <branch>","exit_code":null,"tool":"git","version":"2.56.0","os":null,"date":"2026-10-28","cause":"ssh offered GitHub no key that is registered to your account: none exists, ssh did not find or load it, or its public half was never added in your GitHub settings","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"command","body":"ssh-add -l                    # \"no identities\" = the agent holds no key\nls ~/.ssh/*.pub               # none? create one: ssh-keygen -t ed25519\nssh-add ~/.ssh/id_ed25519     # load the private key into the agent\n# GitHub > Settings > SSH and GPG keys > New SSH key: paste the .pub contents\nssh -T -l git github.com      # expect \"Hi <user>! You've successfully authenticated\""},"repro":"none","check":"git ls-remote origin >/dev/null && echo ok","notes":"The line is printed by OpenSSH, so the git version does not matter. Always connect as the git user, never your GitHub username. ssh -vT -l git github.com shows which key files were offered.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[]},"arms":[{"range":"2.56","status":"works"}],"dead_ends":[{"attempt":"sudo git push","why":"under sudo ssh uses root's keys, not yours; GitHub's docs say not to run git with sudo","reports":1},{"attempt":"switch the remote to HTTPS and type the account password","why":"GitHub stopped accepting account passwords for git on 2021-08-13; HTTPS needs a token","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-10-28T18:26:43.488854Z","updated_at":"2026-10-28T18:26:43.488854Z","last_confirmed_at":null,"ledger":{"first_seq":40,"last_seq":40,"head_hash":"553eb8e1474e44749729ea6424843605429099fce7f7c50ef29ef6286f54a66f"}}
