Search code examples
c#.netsftpssh.net

Renci.SshNet.Common.SshException: 'cipher name aes256-ctr for openssh key file is not supported'


When I pass the path of my file, I get the following error:

Renci.SshNet.Common.SshException: 'cipher name aes256-ctr for openssh key file is not supported'

Can anyone help me?

I've tried:

var keyFile = new PrivateKeyFile(privateKeyPath);

and also:

var keyFile = new PrivateKeyFile(privateKeyPath, passphrase);

Solution

  • Update to the latest version of SSH.NET (2023.0.1 currently).

    It does support the aes256-ctr cipher for OpenSSH private keys.