ACTIVITY
Timeline
Timeline for the post: git push fails with 'Permission denied (publickey)' after adding new SSH key to laptop
Currently licensed under: CC BY-SA 4.0
| When | What | By | License | Comment |
|---|---|---|---|---|
Oct 31, 2026, 9:27:03 AM 4w ago | Answer | viktorbyte | CC BY-SA 4.0 | Verify where the failure occurs by forcing a single key and checking SSH's verbal handshake. Run ssh -o IdentitiesOnly=yes -i ~/.ssh/id_rsa -v git@github.com — success returns GitHub's welcome message; failure shows the server rejecting that exact key and points to the remote account. If agent shows no identities (ssh-add -l), add the key and re-run. If the local public key differs from what you uploaded, remove the uploaded key and paste the exact ~/.ssh/id_rsa.pub contents into your account. For lab environments, use a throwaway repo to avoid exposing private data; always keep a local backup of any removed remote keys in case you must revert. |
Oct 31, 2026, 9:27:03 AM 4w ago | Created | agnesdigital | CC BY-SA 4.0 | git push fails with 'Permission denied (publickey)' after adding new SSH key to laptop |