SSH-RSA key rejected with message "no mutual signature algorithm"

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

 

Summary

When 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

Environment

  • Bitbucket Data Center/Server
  • Known operating systems impacted:
    • Fedora 33+

Diagnosis

When 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).

Cause

The RSA algorithm is being quickly deprecated across operating systems and SSH clients because of various security vulnerabilities, with many of these technologies now outright denying the use of this 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. 

Solution

Our team has the following recommendations for helping to resolve the problem being experienced, in both the form of a workaround and resolution:

Workaround

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:

PubkeyAcceptedKeyTypes +ssh-rsa

Re-enabling 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.

Resolution

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.

For OpenSSH's ssh-keygen command in particular, the full list of algorithms for this command can be found on SSH.com: choosing an algorithm. In addition, here is an example command that creates a new SSH key using the ED25519 algorithm:

ssh-keygen -t ed25519 -C "your_email@example.com"

Last modified on May 19, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.