Skip to content

Exhausted authentication methods (RSA key)

If you’re encountering the “Exhausted available authentication methods” error when using an RSA key on an Ubuntu 22.04 or newer server, it’s a sign that your RSA key is outdated and potentially insecure. This guide will help you resolve the issue by upgrading to a modern and secure ed25519 keypair.

Error: Exhausted available authentication methods

Section titled “Error: Exhausted available authentication methods”

When attempting to SSH into your server with the RSA key, you might see the following error message:

Exhausted available authentication methods

To resolve this issue and enhance your server’s security, follow these steps:

On your server, open a terminal and generate a new ed25519 keypair using the ssh-keygen command:

ssh-keygen -t ed25519
You can accept the default location for the key files or specify a custom location.

2. Add the New Public Key to Authorized Keys:

Section titled “2. Add the New Public Key to Authorized Keys:”

Copy the newly generated public key to your server’s ~/.ssh/authorized_keys file using the ssh-copy-id command:

ssh-copy-id -i ~/.ssh/id_ed25519.pub username@your_server_ip

Try connecting to your server using the ed25519 key to ensure it’s working correctly:

ssh -i ~/.ssh/id_ed25519 username@your_server_ip
If you can log in without any issues, your new key is set up correctly.

Upgrading to a modern ed25519 keypair resolves the “Exhausted available authentication methods” error associated with RSA keys. It’s a crucial step in improving your server’s security, as RSA keys with SHA-1 hash algorithms are no longer considered safe. Keep your private key secure, and consider adding a passphrase for an extra layer of protection.