title: How to upload a file to SFTP server using SharpSSH
body: <p>I want to use SharpSSH to upload a file to a SFTP server.</p>
  
  <p>I got <code>SharpSSH.dll</code>, the file to upload, a public key and I sent the private key to the server. They gave me a username and no password is needed.</p>
  
  <p>I tried this:</p>
  
  <pre><code>Sftp sftp = new Sftp(ip, user);
  sftp.Connect();
  sftp.Put(filePath, toPath);
  sftp.Cancel();
  </code></pre>
  
  <p>Do I need a HostKey somewhere here and if yes, where would I have to put it in, and how do I make one out of a <code>.ppk</code> file?</p>