Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use sftp in C# [duplicate]

Tags:

c#

.net

sftp

Possible Duplicate:
How do I upload a file to an SFTP server in C# / .NET?

Does .net support sftp?

I can't find any sample online.

like image 996
kevin Avatar asked Nov 11 '11 09:11

kevin


People also ask

How do I pass a private key using SFTP?

Select Open Connection Select SFTP (SSH File Transfer Protocol) for the connection type. Enter server, port (22), username. You can skip password - it will use the SSH key. For SSH Private Key, select Choose... and find the save location of your file.


2 Answers

We have used SharpSSH for sftp, it works well and is open source.

Code example:

sftp = new Tamir.SharpSsh.Sftp(ipAddress, username, password); sftp.Connect(); sftp.Get(sourcePath, destinationPath); sftp.Close(); 
like image 139
Piers Myers Avatar answered Sep 30 '22 21:09

Piers Myers


We use successfully the Rebex components (FTP, S-FTP, FTP-S) for that in our projects. They are commercially, though.

like image 34
Uwe Keim Avatar answered Sep 30 '22 22:09

Uwe Keim