Repository navigation
System.NotSupportedException: Key 'OPENSSH' is not supported. #485
Description
Activity
Please see #496, which adds OPENSSH-Format for ed25519 Keys.
What kind of key you used? Can't find on a quick search what MacOS ssh-keygen generates by default.The usual default is:
If invoked without any arguments, ssh-keygen will generate an RSA key.
(https://man.openbsd.org/ssh-keygen)Ah! I see now. Yeah, the default format was changed. Will see if my PR can be updated to support more than just ed25519 Keys.
@darinkes Please submit a separate PR for this.
Reacted by Stefan Rinkes@drieseng sure! first finish the big one.
@mauroa If you want to give it a shot: https://github.com/darinkes/SSH.NET-1/tree/openssh_format_rsa
@darinkes - cool you are working on openssh; wondering about the status of your changes? will it include Message Authentication Code (HMAC)? perhaps I can help?
@gojimmypi I'm waiting for upstream to catch up with current PRs, before creating new ones.
Is there any advancement on this one ?
I really need to be able to connect through SFTP via OpenSSH key :-)Same here, failed to support generated ssh via
ssh-keygen -t rsaEdit: Using puttygen and exporting under different format fixed my issue, here is a neat article:
https://lluisfranco.com/2017/11/29/how-to-connect-via-sftp-using-ssh-net/Reacted by Álvaro Molina Espejo and ryan-carbonThe same problem. Is there any plan to support OPENSSH keyname?
Reacted by Ali AsadiThe same problem. Is there any plan to support OPENSSH keyname?
Yes, the diff is ready for an PR. But @drieseng is currently busy with other projects.
You can check out and test the diff from here: #485 (comment)@darinkes Please submit a PR for this. If you make sure there's sufficient test coverage, I'll do my best to review it :p
@darinkes ... and thx!
@drieseng The diff is based on the Elliptic Curves Branch, cause OPENSSH format was needed there already partially.
Having the same problem. Could you tell the current status of this issue?
for me, this lib works in mac but no in windows 2012R2
This is now supported in 2020.0.0-beta1.
I added 2020.0.0-beta1 but now the error is
openssh key type: ssh-rsa is not supportedthe same for me
Renci.SshNet.Common.SshException: openssh key type: ssh-rsa is not supported- The new OpenSSH RSA key format is not supported by the library…On Nov 20, 2020, at 5:16 PM, Arhisan ***@***.***> wrote: the same for me Renci.SshNet.Common.SshException: openssh key type: ssh-rsa is not supported — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#485 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAD7IHSZNM5GT52XVBXWR5DSQ3MD5ANCNFSM4GB2MY7A>.Reacted by Brian
Same here... The new-style OpenSSH key format is not supported. This issue is closed, but it should be open.
@darinkes I saw your fork from 31-1-2021. Does it support the new key format and will you create a PR for this library?
@ramondeklein already there #614
@ramondeklein Have you tried checking out develop, building it locally, and adding the netstandard2.0 dll as reference to your project? This works for me. I am getting the same error "Renci.SshNet.Common.SshException: 'openssh key type: ssh-rsa is not supported'" when using the latest nuget package 2020.0.1.
Reacted by Damianhi @h0wXD , @jkmyklebust ,
I've got the same error, but found the quick solution.
Just need to convert the key's format from --OPENSSH to --RSA:
ssh-keygen -p -P "" -N "" -m pem -f \path\to\key\file
This will convert your current key.
Reacted by Himanshu Patel, JianpingCAI, ArchieGu, marcogruhl and DamianHey, I am getting the same issue : Renci.SshNet.Common.SshException: openssh key type: ssh-rsa is not supported.
Here's how key was generated : ssh-keygen -t rsa -b 4096
Did anybody resolve it?
Please see my reply above, use ssh-keygen to convert your key.
Reacted by Mansimar KaurHi all, I hit this issue when using POSH-SSH. Documented in issue: darkoperator/Posh-SSH#388
I worked around this issue by creating my SSH key with the
-m PEMoption.Example:
ssh-keygen -f ~/.ssh/id_rsa -m PEM -t rsaReacted by Valhallans
A NotSupportedException is thrown when generating SSH keys with the "ssh-keygen" command on a Mac with macOS Mojave 10.14.1. With lower versions it's working fine.
Exception:
System.NotSupportedException: Key 'OPENSSH' is not supported.
at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase)
Inspecting the generated private key I can see that the header starts with:
"-----BEGIN OPENSSH PRIVATE KEY-----"
Also, If I inspect a private key generated in a Mac with a lower macOS version, I can see something like:
"-----BEGIN RSA PRIVATE KEY-----"
The following code in this repo tries to match a Regex to detect they key name and act based on it. For this reason, It doesn't recognize "OPENSSH" as a valid private key name and it fails:
SSH.NET/src/Renci.SshNet/PrivateKeyFile.cs
Lines 190 to 273 in bd01d97
Thanks.