1

I am using SharpSSH's Sftp class to upload files. Someone has requested that I enable RSA authentication. I can't find an info how how to do this. What do I need to do in order to support public key authentication in SharpSSH?

All I currently do is this

 ftp = new Sftp(config.SftpServer, config.SftpUsername, config.SftpPassowrd);
 ftp.Connect();
Eric Andres
  • 3,417
  • 2
  • 24
  • 40
madmik3
  • 6,975
  • 3
  • 38
  • 60

1 Answers1

3

In order to connect with an RSA I needed to create an OpenSSH format key and save it to disk. PuttyGen worked well for this. Then I simply needed to call AddIdentityFile with that file like so

 ftp = new Sftp(config.SftpServer, config.SftpUsername, config.SftpPassowrd);
 ftp.AddIdentityFile("file");
 ftp.Connect();
Jon Lin
  • 142,182
  • 29
  • 220
  • 220
madmik3
  • 6,975
  • 3
  • 38
  • 60