Fix "Permission denied (publickey)" in SSH & GitHub
Developer guide and instant terminal command to diagnose and solve this error.
Why Does This Error Happen?
Your SSH client did not offer a public key recognized by the remote server, or file permissions on ~/.ssh/id_rsa are too permissive.
Instant Terminal One-Liner Fixes
Comprehensive Step-by-Step Resolution
- 1Fix SSH key file permissions: "chmod 600 ~/.ssh/id_ed25519" and "chmod 700 ~/.ssh".
- 2Add key to SSH agent: "ssh-add ~/.ssh/id_ed25519".
- 3Test GitHub connectivity: "ssh -T git@github.com".
Troubleshoot using the chmod 600 SSH Key Security Guide
Use our client-side utility with zero server upload for instant debugging.
Frequently Asked Questions
Frequently Asked Questions
Everything you need to know regarding specifications, syntax, and security best practices.
Your SSH client did not offer a public key recognized by the remote server, or file permissions on ~/.ssh/id_rsa are too permissive.
Related Developer Errors
Fix "error: failed to push some refs to [remote]" in Git
Fix "JsonWebTokenError: jwt malformed / invalid signature"
Fix "Host key verification failed / REMOTE HOST IDENTIFICATION HAS CHANGED"
Fix "Error: certificate has expired / CERT_HAS_EXPIRED" in Node.js & cURL