I am trying to clone a private Bitbucket repository using SSH in GitHub Desktop. Despite being able to connect and clone the repository via Git Bash and Sourcetree, GitHub Desktop fails with an “Authentication failed” error.
SSH Key Setup:
I have generated an SSH key using ssh-keygen -t rsa -C “[email protected]”.
I added the public key to my Bitbucket account under “SSH Keys”.
I added the private key to the SSH agent using ssh-add ~/.ssh/id_rsa.
Verification:
Testing the SSH connection to Bitbucket using ssh -T [email protected] works perfectly in Git Bash.
I can clone the repository using Sourcetree without any issues.
Despite these steps, when attempting to clone the repository in GitHub Desktop, I receive the following error message:
Authentication failed. Some common reasons include:
- You are not logged in to your account: see File > Options.
- You may need to log out and log back in to refresh your token.
- You do not have permission to access this repository.
- The repository is archived on GitHub. Check the repository settings to confirm you are still permitted to push commits.
- If you use SSH authentication, check that your key is added to the ssh-agent and associated with your account.
- If you use SSH authentication, ensure the host key verification passes for your repository hosting service.
- If you used username / password authentication, you might need to use a Personal Access Token instead of your account password. Check the documentation of your repository hosting service.
Current Status:
- SSH key has been added using ssh-add.
- Both GitHub and Bitbucket accounts have the SSH public key added.
- Sourcetree successfully connects and operates with the repository.
- Cloning the repository locally via Sourcetree and attempting to access it through GitHub Desktop results in an infinite loading state.
Question:
Is there a specific configuration or additional step required to enable GitHub Desktop to use SSH for cloning a private Bitbucket repository? Any guidance or suggestions would be greatly appreciated.
PurpleHaze is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.