SSH-RSA key rejected with message "no mutual signature algorithm"
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
On attempting to use an SSH key generated using the ssh-rsa algorithm, the SSH key isn't accepted (the user receives a 'Permission denied' message) and the following message is displayed when the verbose SSH output is reviewed:
debug1: send_pubkey_test: no mutual signature algorithm
- Bitbucket Data Center/Server
- Known operating systems impacted:
- Fedora 33+
On running the command
ssh -vvvv the following output can be seen:
debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering public key: /home/user/.ssh/id_rsa RSA ... agent debug1: send_pubkey_test: no mutual signature algorithm <-- ssh-rsa is not enabled debug1: No more authentication methods to try. user@hostname: Permission denied (publickey).
The RSA algorithm is being quickly deprecated across operating systems and SSH clients due to various security vulnerabilities, with many of these technologies now outright denying the use of this algorithm.
- For example - here is the announcement from OpenSSH regarding their upcoming deprecation of the ssh-rsa algorithm.
In the event that you are using an operating system or SSH client whose version has this algorithm disabled - it's possible that any SSH keys previously generated using this algorithm will no longer be accepted by these technologies.
Our team has the following recommendations for helping to resolve the problem being experienced, in both the form of a workaround and resolution:
In order to re-enable ssh-rsa support, inserting the following line into the affected SSH client's config file can re-enable this algorithm:
ssh-rsa support is a security risk, and should only be done as a temporary measure/workaround while affected users switch to a key generated using a more secure algorithm.
To fully resolve this issue, our team recommends that these deprecated keys be re-generated using a supported and more secure algorithm such as ECDSA and ED25519:
debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering public key: /home/user/.ssh/id_rsa RSA ... agent debug1: send_pubkey_test: no mutual signature algorithm <-- ssh-rsa is not enabled debug1: Offering public key: /home/user/.ssh/id_ed25519 ED25519 ... agent debug3: send packet: type 50 debug2: we sent a publickey packet, wait for reply debug3: receive packet: type 60 debug1: Server accepts key: /home/user/.ssh/id_ed25519 ED25519 ... agent <- The Ed25519 key is accepted without issue
To generate a key using this updated algorithm, it's recommended that you consult the documentation for the usual software that your team uses for SSH key generation.
ssh-keygen command in particular, the full list of algorithms for this command can be found here. In addition, here is an example command that creates a new SSH key using the ED25519 algorithm:
ssh-keygen -t ed25519 -C "firstname.lastname@example.org"