Skip to content

Exception occurred, " openssh key type: ssh-rsa is not supported" #704

Closed
@huobazi

Description

@huobazi

When i create a scpclient

var client = new ScpClient("host", 22, "username", new PrivateKeyFile("~/.ssh/id_rsa", "123123"));

I got a exception:

openssh key type: ssh-rsa is not supported

The stack trace:

System.AggregateException: One or more errors occurred. (openssh key type: ssh-rsa is not supported)
 ---> Renci.SshNet.Common.SshException: openssh key type: ssh-rsa is not supported
   at Renci.SshNet.PrivateKeyFile.ParseOpenSshV1Key(Byte[] keyFileData, String passPhrase)
   at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase)
   at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase)

I found the exception source may be came from:

throw new SshException("openssh key type: " + keyType + " is not supported");

┌[[email protected]]-(~)
└> ssh -Q key
ssh-ed25519
[email protected]
ssh-rsa
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
┌[[email protected]]-(~)

Any response was appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions