Windows 10 OpenSSH key invalid format

AK_ picture AK_ · Dec 17, 2017 · Viewed 19.6k times · Source

The recent beta version of OpenSSH on Windows 10 does not accept my openssh formatted private key:

enter image description here

The same key works on ssh shipped with git shell from github.

Is there a format option for openssh on Windows that I'm missing or is this a bug?

Answer

simon picture simon · Jan 2, 2018

Windows 10 currently (as of January 2018) only supports ed25519 keys (reference: https://github.com/PowerShell/Win32-OpenSSH/issues/973). I see that you are trying to connect to Amazon Web Services. If you manage your key using the AWS console, you can only use an RSA key.

However, if you are trying to connect to an existing EC2 instance, you can do the following:

  1. Create the private/public key in Windows cmd using the command "ssh-keygen", if you have not already done this. The key pair is saved in files id_ed25519.pub and id_ed25519 in your .ssh directory
  2. Connect to your AWS EC2 instance. Add the contents of the id_ed25519.pub to your authorized_keys file within the .ssh directory
  3. Now you can connect to your EC2 instance using the Windows 10 SSH client.