Skip to content

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

Description

@huobazi

When i create a scpclient

varclient=newScpClient("host",22,"username",newPrivateKeyFile("~/.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.(opensshkey type: ssh-rsais not supported)---> Renci.SshNet.Common.SshException: openssh key type: ssh-rsais not supported
at Renci.SshNet.PrivateKeyFile.ParseOpenSshV1Key(Byte[]keyFileData,StringpassPhrase)
at Renci.SshNet.PrivateKeyFile.Open(StreamprivateKey,StringpassPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(StringfileName,StringpassPhrase)

I found the exception source may be came from:

thrownewSshException("openssh key type: "+keyType+" is not supported");

┌[mw82@Marble-MacBook-Pro.local]-(~)
└> ssh -Q key
ssh-ed25519
ssh-ed25519-cert-v01@openssh.com
ssh-rsa
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
ssh-rsa-cert-v01@openssh.com
ssh-dss-cert-v01@openssh.com
ecdsa-sha2-nistp256-cert-v01@openssh.com
ecdsa-sha2-nistp384-cert-v01@openssh.com
ecdsa-sha2-nistp521-cert-v01@openssh.com
┌[mw82@Marble-MacBook-Pro.local]-(~)

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