两者都移动文件。 One of them broadcasts your password to anyone listening on the path.如果您今天要选择一种方案,本页将以事实而非流行方式结束辩论。
FTP is older than the web, and it was designed for a friendlier internet where nobody on the wire was assumed hostile.这个假设已经死了。下面是每种协议中实际在网络上传输的内容、为什么防火墙团队讨厌 FTP,以及您仍然会遇到它的地方 - 不知道其他任何内容的旧设备。
这不是理论上的弱点。 In FTP the username, the password and every byte of every file cross the network exactly as typed, as the panel above shows.位于该路径上的任何人(办公室 LAN 上的恶意设备、受感染的路由器、共享 Wi-Fi 上的邻居)都可以读取所有内容,而不会攻击任何内容。
SFTP encrypts the entire session before any credential is sent, and it also checks the data for tampering on the way.同一个监听器没有得到任何可用的东西。
FTP uses port 21 for commands and then opens separate, shifting connections for the data itself.防火墙和 NAT 路由器必须猜测并戳出额外的漏洞,这就是 FTP 经常半途而废的原因:登录成功,文件夹列表或传输挂起。
SFTP 通过端口 22 上的单个 SSH 连接运行所有内容。防火墙中的一条规则,无需配置被动端口范围,并且它在几乎所有网络中的行为都是相同的。
不要让相似的名称混淆在一起:
When a client says their software supports "secure FTP", check which of the last two it means. They are not interchangeable and the wrong choice fails silently at connection time.
There is also a speed myth worth retiring: the encryption in SFTP costs almost nothing on any modern machine. People repeat benchmarks from twenty year old hardware as if they were laws of nature.在当今使用的 PC 和服务器上,您的网络和磁盘在加密之前就会变慢,因此速度从来都不是保留普通 FTP 的诚实理由。
Honesty matters here: you will still meet FTP in the wild. Some old network printers, CCTV recorders and legacy machines offer nothing newer.规则是遏制,而不是恐慌:
See the whole Ubuntu SFTP setup done live, with the exact clicks and commands, in the Technical Anshu video.
Watch Full Video不会。SFTP 是内置于 SSH 中的自己的协议。 FTPS is the original FTP protocol with TLS added. The names look alike but the software, ports and behaviour are different.
是的。 A free packet capture tool on the same network shows FTP credentials in plain text within seconds. This is the main reason plain FTP disappeared from serious use.
不是立即。让它远离互联网,给它一个唯一的密码,并将其限制在一个文件夹中。按正常升级周期更换,不要惊慌。