28

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.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
kevin
  • 13,559
  • 30
  • 79
  • 104
  • This doesn't answer your question directly as it's a client for ftps, however it does provide a useful background for ftp related information http://ftps.codeplex.com/ – Alex KeySmith Nov 11 '11 at 10:28
  • 5
    This is not a duplicate anymore with the old question being closed as not-constructive - although I don't understand why. – Kyle Rosendo Feb 18 '13 at 07:26
  • 1
    SFTP is not present in .NET. Personally, I am using http://www.componentpro.com/sftp.net/ library. – Peter Dec 19 '14 at 16:46

2 Answers2

17

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();
Piers Myers
  • 10,611
  • 6
  • 46
  • 61
  • 1
    sftp is not good. first, it doesn't support 64 bit (though, these is a custom on some blog). second , the get file doesn't preserve the original file date – Eyalk Oct 26 '12 at 07:52
  • 21
    I highly recommend using http://sshnet.codeplex.com instead of SharpSSH. SharpSSH doesn't seem to be actively maintained anymore and is fairly rough. Because of this, SSH.NET was born. – Kaganar Jan 04 '13 at 22:07
  • Is there any actively maintained SFTP-Client available for .NET? I need an OpenSource Lib that is reliable also under .NET 4.5 and later (according to sshnet.codeplex.com, they only support up to 4.0). – Erik Mar 29 '16 at 04:31
3

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

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
  • 3
    Rebex stuff really is excellent, and their customer support is top notch. When I had to interface to an FTPS server that did not conform to the current FTPS standard, they created a version of their component that would talk to it at no extra charge. – starskythehutch Nov 11 '11 at 10:01