Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 10 OpenSSH key invalid format

Tags:

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?

like image 552
AK_ Avatar asked Dec 17 '17 21:12

AK_


People also ask

What is the format of OpenSSH private key?

So, the OpenSSH private key format ultimately contains a private key encrypted with a non-standard version of PBKDF2 that uses bcrypt as its core hash function. The structure that contains the key is not ASN. 1, even though it's base64 encoded and wrapped between header and footer that are similar to the PEM ones.

How do I add a public key to OpenSSH Windows?

The contents of your public key (\. ssh\id_ed25519. pub) needs to be placed on the server into a text file called administrators_authorized_keys in C:\ProgramData\ssh\. You can copy your public key using the OpenSSH scp secure file-transfer utility, or using a PowerShell to write the key to the file.

How do I convert SSH to OpenSSH public key?

To convert a SSH client key to an OpenSSH format: Install the OpenSSH tool set, available under a BSD-style license: http://www.openssh.com/ The ssh-keygen utility is used to covert SSH keys between the different formats required by MessageWay or any other secure file transfer application.


1 Answers

I got this working.. believe it or not by adding a single LF at the end of your private key file. E.G


-----BEGIN OPENSSH PRIVATE KEY----- KEY -----END OPENSSH PRIVATE KEY-----


Without the LF the private key worked fine with putty, secureCRT, WinSCP, GIT etc... but Windows (which is used by VisualCode) Kept giving me "invalid Format"

like image 97
Grev Avatar answered Sep 23 '22 09:09

Grev