C# SFTP 和“FTP over SSH”的区别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/440463/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 03:28:20  来源:igfitidea点击:

Differences between SFTP and "FTP over SSH"

c#ftpsshsftp

提问by sundar venugopal

While looking for an SFTP client in C# SSH File Transfer Protocol (SFTP), I've come across these two suitable projects - oneand two.

在 C# SSH 文件传输协议 (SFTP) 中寻找 SFTP 客户端时,我遇到了这两个合适的项目 -一个两个.

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.

在尝试了解基础知识时,我遇到了这篇令人困惑的维基百科文章。SFTP 和 FTP over SSH 有什么区别?如果不同的话,似乎没有图书馆支持“FTP over SSH”。

采纳答案by Kristopher Johnson

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 tunnelis placed between client and server.
  • SFTP(SSH 文件传输协议)是一种提供文件传输和操作功能的协议。它可以处理任何可靠的数据流,但通常与 SSH 一起使用
  • “FTP over SSH”使用常规的旧 FTP 协议,但在客户端和服务器之间放置了一个SSH 隧道

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.

您可能找不到“FTP over SSH”库,因为通常隧道是通过运行 SSH 命令设置的,一旦设置,客户端和服务器就不需要知道隧道;他们只是打开端口并以他们没有隧道的方式传输数据。

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.)

顺便说一句,您的另一个选择可能是FTP over SSL (FTPS),它受 .NET 支持。(请参阅http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.enablessl.aspx。)

回答by Mehrdad Afshari

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.

SSH 上的 FTP 是通过 SSH 建立隧道的普通 FTP 协议。SFTP 是 SSH 提供的文件传输机制,它是一种完全不同的协议。我还没有看到任何人通过 SSH 使用 FTP。

回答by jacobangel

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

SFTP 是它自己的协议。一旦您通过 SSH 连接,通过 SSH 的 FTP 就是使用 FTP。

回答by Bruce Blackshaw

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.

SFTP 实际上是另一种在 SSH 上运行的协议——如果您愿意,可以作为 SSH 的扩展。人们倾向于使用 SFTP,而不是通过 SSH 隧道传输 FTP。

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

要在 .NET 中获得全面的 SFTP 支持,请尝试edtFTPnet/PRO。支持许多不同的 SFTP 服务器已经有很长时间了。

回答by Martin Vobr

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

  • FTP – 自 1970 年代以来一直存在的普通旧 FTP 协议。该首字母缩写词代表“文件传输协议”。它通常在 TCP 端口 21 上运行。

  • SFTP – 另一种完全不同的文件传输协议,与 FTP 无关。SFTP 在 SSH 会话上运行,通常在 TCP 端口 22 上运行。它自 1990 年代后期以来一直存在。该首字母缩略词实际上代表“SSH 文件传输协议”。

  • SSH 上的 FTP - 1) 可能,但极少见的通过 SSH 通道隧道传输的 FTP 协议示例 2) 错误命名的 SFTP

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

(有关详细信息,请参阅Rebex 上的安全 FTP、FTP/SSL、SFTP、FTPS、FTP、SCP...有什么区别?”页面)

Disclaimer: I work for Rebex

免责声明:我为 Rebex 工作

回答by Greg Finzer

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.

我刚刚创建了一个.NET SFTP 库。我在这个过程中学到的一件事是 FTP 与 SFTP 有何不同。您实际上是在与 SSH 服务器而不是 FTP 服务器进行通信。这不仅仅是协议,您发送到 SSH 服务器的命令也完全不同。

Here is a linkto my library.

这是我的图书馆的链接

回答by Greg Finzer

  • SFTP stands for SSH File Transfer Protocol. It's not FTP over SSL and not FTP over SSH. SFTP is standardized in RFC 4253.
  • FTP stands for File Transfer Protocol which is defined by RFC 959 and latter additions. FTP is very popular but not secured. Therefore FTP over SSL was introduced and it's called FTPS or FTP/SSL.
  • SFTP 代表 SSH 文件传输协议。它不是基于 SSL 的 FTP,也不是基于 SSH 的 FTP。SFTP 在 RFC 4253 中标准化。
  • FTP 代表文件传输协议,由 RFC 959 和后面的补充定义。FTP 非常流行,但并不安全。因此引入了基于 SSL 的 FTP,它被称为 FTPS 或 FTP/SSL。

For authentication SFTP use SSH keys, while FTPS use X.509 certificates.

对于身份验证,SFTP 使用 SSH 密钥,而 FTPS 使用 X.509 证书。

回答by Tony Herman

Here's a simple explanation:

这是一个简单的解释:

  • FTPS = FTP + SSL
  • SFTP = SSH using an FTP program
  • FTPS = FTP + SSL
  • SFTP = 使用 FTP 程序的 SSH

https://www.webstix.com/knowledgebase/general/how-to-connect-using-sftp/

https://www.webstix.com/knowledgebase/general/how-to-connect-using-sftp/