Page 1 of 1

SFTP invalid key

Posted: 21 Nov 2022, 16:13
by Land
Hello!

OS: Windows 11 22H2

I have a backup that moves everything from a folder to a local NAS and the SSH keys on it and my local computer are both OpenSSH RSA keys. I can successfully SSH to it and use FileZilla to make sure the sftp is working; however, when I try to connect using Cobain reflector it says invalid key format. Why do you think this is happening?
Thanks.

P.S. I have also tried to regenerate the SSH keys and it still says invalid.

Re: SFTP invalid key

Posted: 22 Nov 2022, 02:01
by cobian
OpenSSH has fairly recently created a new private key format called RFC4716 (it isn’t a standard but is derived from this public key standard). That’s their default format now, and you can recognise it by the file header:

—–BEGIN OPENSSH PRIVATE KEY—–

There is no support yet for this format. You can convert from the new format to the old format PEM keys using ssh-keygen. The command below will do the conversion (overwriting the original file!):

ssh-keygen -e -f openSshKeyNew -m PEM -p

You can also convert to the old PEM format using PuTTYgen.