tags:

views:

6431

answers:

7

Looking for an SFTP client in c# SSH File Transfer Protocol (SFTP). I've come across these two suitable projects - one two.

While trying to understand the basics, I came across this confusing Wikipedia article.

What is difference between SFTP and FTP over SSH?

No library seems to give support for "FTP over SSH", if it is different.

A: 

FTP over SSH is plain FTP protocol tunneled through SSH. SFTP is the file transfer mechanism offered by SSH and it's a completely different protocol. I haven't seen anybody using FTP over SSH.

Mehrdad Afshari
A: 

SFTP is it's own protocol. FTP over SSH is using FTP once you're connected via SSH.

jacobangel
+13  A: 

Here is the difference:

  • SFTP (SSH file transfer protocol) is a protocol that provides file transfer and manipulation capabilities. It can work over any reliable data stream, but is typically used with SSH
  • "FTP over SSH" uses the regular old FTP protocol, but an SSH tunnel is placed between client and server.

You probably won't find libraries for "FTP over SSH" because typically the tunnel is set up by running an SSH command, and once it is set up, clients and servers don't need to know about the tunnel; they just open ports and transfer data they way they would without a tunnel.

BTW, yet another option for you might be FTP over SSL (FTPS), which is supported by .NET. (See http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.enablessl.aspx.)

Kristopher Johnson
"You probably won't find libraries for 'FTP over SSH'" - there is at least one :-). Rebex File Transfer Pack (http://www.rebex.net/file-transfer-pack/default.aspx) is capable of running the FTP over SSH channel. It's possible because our SshSession class can be used as (kind-of) proxy for Ftp class (technically it can be used as class factory for creating the communication sockets for the FTP component). It's even capable of running such weirdness as the SFTP protocol over the SSL channel (instead of over SSH), however we have not found any server which support it.
Martin Vobr
+1  A: 

SFTP is actually another protocol that runs over SSH - an extension of SSH if you like. People tend to use SFTP rather than tunnelling FTP over SSH.

For comprehensive SFTP support in .NET try edtFTPnet/PRO. It's been around a long time with support for many different SFTP servers.

Bruce Blackshaw
+5  A: 

Basically, there are the following file transfer protocols around:

  • FTP – the plain old FTP protocol that has been around since 1970s. The acronym stands for "File Transfer Protocol". It usually runs over TCP port 21.

  • SFTP – another, completely different file transfer protocol that has nothing to do with FTP. SFTP runs over an SSH session, usually on TCP port 22. It has been around since late 1990s. The acronym actually stands for "SSH File Transfer Protocol".

  • FTP over SSH - 1) possible, but extremely rare example of FTP protocol tunneled through a SSH channel 2) incorrectly named SFTP

(for details see "Secure FTP, FTP/SSL, SFTP, FTPS, FTP, SCP... What's the difference?" page at Rebex)

Disclaimer: I work for Rebex

Martin Vobr
A: 

I just created a .NET SFTP Library. One of the things I learned in the process is how different FTP is to SFTP. You are actually communicating with an SSH server instead of an FTP server. It's not just the protocol, the commands are totally different that you are sending to the SSH server.

Here is a link to my library.

Greg Finzer
A: 

I've used SharpSSH for years and it works great. Though it hasn't seen any development in awhile, the source code is easy to understand and work with. I've made tweaks and re-compiled it for my own projects with no trouble, though it works just fine as-is without the need for any of that.

If you don't need to do anything fancy, you could also write your own .NET wrapper for PuTTY's PSFTP.EXE client with very minimal code.

Though I've never used Greg Finzer's SFTP library, I know him personally and strongly believe that he has a quality product if you need something actively developed and robust. But for the simple stuff, I've had great success with the free options I mentioned.

mattmc3