Can't use Ed25519 SSH keys for Azure Linux VMs

Original product version:   Virtual Machine running Linux
Original KB number:   4013792

Symptoms

When you try to create a Linux VM with Ed25519 SSH keys in Microsoft Azure, or when you try to update an Azure Linux VM to use Ed25519 SSH keys, you receive an error message that resembles the following:

The data section of the SSH key starts with an invalid pattern.

This issue occurs in Azure portal, Azure PowerShell, and JSON. The following is a sample of the Ed25519 SSH public key:

---- BEGIN SSH2 PUBLIC KEY ---- 
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJtYkeI+Apm1CjhzwUoV2+1O94ccDsDYKX2ltKcisADy
---- END SSH2 PUBLIC KEY ---- 

Cause

The issue occurs because Ed25519 keys are not supported in Azure.

Workaround

To work around this issue, use other SSH keys for the VM, such as RSA. You can generate SSH keys by using ssh-keygen in Linux and OS X, or by using PuTTYGen in Windows. For more information, see How to Use SSH keys with Windows on Azure.

Contact us for help

If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.