"Permission denied" error occurs when performing git operations via SSH
This Knowledge Base article was written specifically for the Atlassian Server platform. Due to the Functional differences in Atlassian Cloud, the contents of this article cannot be applied to Atlassian Cloud applications.
When using SSH to perform git operations on a repository hosted on Bitbucket Server, seemingly randomly the operation may fail with the following error:
Permission denied (publickey)
A similar error is written to the log at the same time.
- Any version of Bitbucket Server
- A DSA public key is used for authentication (rather than an RSA key)
While Bitbucket Server supports DSA public keys, this issue is known to occur when using keys of this type. The root cause is not known at this time.
To resolve this problem, use an RSA public key instead of a DSA public key.