Search code examples
.netsshsftpopenssh

.NET SSH with certificate authentication


I am looking for a way to authenticate to an OpenSSH SFTP server using an SSH certificate in .NET.

I can do this on the command line on linux or a newer version of Windows:

sftp -o CertificateFile=~/.ssh/sftpuser-cert.pub -i ~/.ssh/sftpuser [email protected]

but I can't seem to find a way to do the equivalent or I am misreading/misunderstanding docs from multiple vendors. Can anyone post an example of how to do this? Just to be specific I am NOT asking about authenticating with an SSH key in .NET, but with a certificate in "OpenSSH" format.


Solution

  • The "certificates" is a proprietary feature of OpenSSH. It's not a standard SSH thing. The standard SSH uses plain key files.

    Support for OpenSSH certificates in other clients/libraries is rare.